diff options
Diffstat (limited to 'server.h')
-rw-r--r-- | server.h | 61 |
1 files changed, 15 insertions, 46 deletions
@@ -1,51 +1,33 @@ #ifndef fooflxserverhfoo #define fooflxserverhfoo -struct _flxEntry; 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; gboolean unique; - flxEntry *next, *prev; - flxEntry *next_by_name, *prev_by_name; - 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 _flxQueryJob { - gint ref; - GTimeVal time; - flxQuery query; -} flxQueryJob; - -typedef struct _flxQueryJobInstance { - flxPrioQueueNode *node; - flxQueryJob *job; - gint interface; - guchar protocol; -} flxQueryJobInstance; - -typedef struct _flxResponseJob { - gint ref; - GTimeVal time; - flxRecord response; -} flxResponseJob; - -typedef struct _flxResponseJobInstance { - flxPrioQueueNode *node; - flxResponseJob *job; - gint interface; - guchar protocol; -} flxResponseJobInstance; +struct _flxResponseJob { + flxTimeEvent *time_event; + flxRecord *record; + FLX_LLIST_FIELDS(flxResponseJob, response); +}; struct _flxServer { GMainContext *context; @@ -56,25 +38,12 @@ struct _flxServer { GHashTable *rrset_by_id; GHashTable *rrset_by_name; - flxEntry *entries; - - flxPrioQueue *query_job_queue; - flxPrioQueue *response_job_queue; - - gint hinfo_rr_id; + FLX_LLIST_HEAD(flxEntry, entries); + flxTimeEventQueue *time_event_queue; + gchar *hostname; }; -flxQueryJob* flx_query_job_new(void); -flxQueryJob* flx_query_job_ref(flxQueryJob *job); -void flx_query_job_unref(flxQueryJob *job); - -void flx_server_post_query_job(flxServer *s, gint interface, guchar protocol, const GTimeVal *tv, const flxQuery *q); -void flx_server_drop_query_job(flxServer *s, gint interface, guchar protocol, const flxQuery *q); - -void flx_server_remove_query_job_instance(flxServer *s, flxQueryJobInstance *i); - -gboolean flx_query_equal(const flxQuery *a, const flxQuery *b); #endif |