summaryrefslogtreecommitdiffstats
path: root/server.h
blob: 982143b038bf48d56222b76aa3a38efd5fb49c2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef fooflxserverhfoo
#define fooflxserverhfoo

typedef struct _flxEntry flxEntry;
typedef struct _flxResponseJob flxResponseJob;

#include "flx.h"
#include "iface.h"
#include "prioq.h"
#include "llist.h"
#include "timeeventq.h"

struct _flxEntry {
    flxRecord *record;
    gint id;
    gint interface;
    guchar protocol;

    gboolean unique;

    FLX_LLIST_FIELDS(flxEntry, entry);
    FLX_LLIST_FIELDS(flxEntry, by_name);
    FLX_LLIST_FIELDS(flxEntry, by_id);
};

struct _flxResponseJob {
    flxTimeEvent *time_event;
    flxRecord *record;
    FLX_LLIST_FIELDS(flxResponseJob, response);
};

struct _flxServer {
    GMainContext *context;
    flxInterfaceMonitor *monitor;

    gint current_id;
    
    GHashTable *rrset_by_id;
    GHashTable *rrset_by_name;

    FLX_LLIST_HEAD(flxEntry, entries);

    flxTimeEventQueue *time_event_queue;
    
    gchar *hostname;
};


#endif