]> git.meshlink.io Git - catta/blob - server.h
add code for recieving packets
[catta] / server.h
1 #ifndef fooflxserverhfoo
2 #define fooflxserverhfoo
3
4 typedef struct _flxEntry flxEntry;
5 typedef struct _flxResponseJob flxResponseJob;
6
7 #include "flx.h"
8 #include "iface.h"
9 #include "prioq.h"
10 #include "llist.h"
11 #include "timeeventq.h"
12
13 struct _flxEntry {
14     flxRecord *record;
15     gint id;
16     gint interface;
17     guchar protocol;
18
19     gboolean unique;
20
21     FLX_LLIST_FIELDS(flxEntry, entry);
22     FLX_LLIST_FIELDS(flxEntry, by_name);
23     FLX_LLIST_FIELDS(flxEntry, by_id);
24 };
25
26 struct _flxResponseJob {
27     flxTimeEvent *time_event;
28     flxRecord *record;
29     FLX_LLIST_FIELDS(flxResponseJob, response);
30 };
31
32 struct _flxServer {
33     GMainContext *context;
34     flxInterfaceMonitor *monitor;
35
36     gint current_id;
37     
38     GHashTable *rrset_by_id;
39     GHashTable *rrset_by_name;
40
41     FLX_LLIST_HEAD(flxEntry, entries);
42
43     flxTimeEventQueue *time_event_queue;
44     
45     gchar *hostname;
46
47     gint fd_ipv4, fd_ipv6;
48
49     GPollFD pollfd_ipv4, pollfd_ipv6;
50     GSource *source;
51 };
52
53
54 #endif