X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=server.h;h=45669260d97f75b84d91ad8d1bdf16a7d752de8f;hb=7bb43bd370e70385a4ccde06f3f4554f488aa6b3;hp=7c96e780152c07005b1784d704fe1d37b4ac93ea;hpb=33ccd714ea9469b5b7d3b36bbe468ba1b0f31dfc;p=catta diff --git a/server.h b/server.h index 7c96e78..4566926 100644 --- a/server.h +++ b/server.h @@ -1,22 +1,33 @@ #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 rr; + flxRecord *record; gint id; gint interface; + guchar protocol; - int unique; + gboolean unique; - struct _flxEntry *next, *prev; - struct _flxEntry *next_by_name, *prev_by_name; - struct _flxEntry *next_by_id, *prev_by_id; + FLX_LLIST_FIELDS(flxEntry, entry); + FLX_LLIST_FIELDS(flxEntry, by_name); + FLX_LLIST_FIELDS(flxEntry, by_id); }; -typedef struct _flxEntry flxEntry; +struct _flxResponseJob { + flxTimeEvent *time_event; + flxRecord *record; + FLX_LLIST_FIELDS(flxResponseJob, response); +}; struct _flxServer { GMainContext *context; @@ -27,7 +38,17 @@ struct _flxServer { GHashTable *rrset_by_id; GHashTable *rrset_by_name; - flxEntry *entries; + FLX_LLIST_HEAD(flxEntry, entries); + + flxTimeEventQueue *time_event_queue; + + gchar *hostname; + + gint fd_ipv4, fd_ipv6; + + GPollFD pollfd_ipv4, pollfd_ipv6; + GSource *source; }; + #endif