]> git.meshlink.io Git - catta/blob - server.h
add known answer suppresion server part
[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 #include "subscribe.h"
13
14 struct _flxServerEntry {
15     flxRecord *record;
16     gint id;
17     gint interface;
18     guchar protocol;
19
20     gboolean unique;
21
22     FLX_LLIST_FIELDS(flxServerEntry, entry);
23     FLX_LLIST_FIELDS(flxServerEntry, by_key);
24     FLX_LLIST_FIELDS(flxServerEntry, by_id);
25     
26     FLX_LLIST_HEAD(flxAnnouncement, announcements);
27 };
28
29 struct _flxServer {
30     GMainContext *context;
31     flxInterfaceMonitor *monitor;
32
33     gint current_id;
34     
35     FLX_LLIST_HEAD(flxServerEntry, entries);
36     GHashTable *rrset_by_id;
37     GHashTable *rrset_by_key;
38
39     FLX_LLIST_HEAD(flxSubscription, subscriptions);
40     GHashTable *subscription_hashtable;
41
42     flxTimeEventQueue *time_event_queue;
43     
44     gchar *hostname;
45
46     gint fd_ipv4, fd_ipv6;
47
48     GPollFD pollfd_ipv4, pollfd_ipv6;
49     GSource *source;
50     
51 };
52
53 gboolean flx_server_entry_match_interface(flxServerEntry *e, flxInterface *i);
54
55 #endif