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