]> git.meshlink.io Git - catta/blobdiff - server.h
* add subscription feature - with reissuing
[catta] / server.h
index 7c96e780152c07005b1784d704fe1d37b4ac93ea..d050bcc1574682171244de69484dd712019eaf89 100644 (file)
--- a/server.h
+++ b/server.h
@@ -1,33 +1,55 @@
 #ifndef fooflxserverhfoo
 #define fooflxserverhfoo
 
+typedef struct _flxServerEntry flxServerEntry;
+
 #include "flx.h"
 #include "iface.h"
-
-struct _flxEntry {
-    flxRecord rr;
+#include "prioq.h"
+#include "llist.h"
+#include "timeeventq.h"
+#include "announce.h"
+#include "subscribe.h"
+
+struct _flxServerEntry {
+    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(flxServerEntry, entry);
+    FLX_LLIST_FIELDS(flxServerEntry, by_key);
+    FLX_LLIST_FIELDS(flxServerEntry, by_id);
+    
+    FLX_LLIST_HEAD(flxAnnouncement, announcements);
 };
 
-typedef struct _flxEntry flxEntry;
-
 struct _flxServer {
     GMainContext *context;
     flxInterfaceMonitor *monitor;
 
     gint current_id;
     
+    FLX_LLIST_HEAD(flxServerEntry, entries);
     GHashTable *rrset_by_id;
-    GHashTable *rrset_by_name;
+    GHashTable *rrset_by_key;
+
+    FLX_LLIST_HEAD(flxSubscription, subscriptions);
+    GHashTable *subscription_hashtable;
 
-    flxEntry *entries;
+    flxTimeEventQueue *time_event_queue;
+    
+    gchar *hostname;
+
+    gint fd_ipv4, fd_ipv6;
+
+    GPollFD pollfd_ipv4, pollfd_ipv6;
+    GSource *source;
+    
 };
 
+gboolean flx_server_entry_match_interface(flxServerEntry *e, flxInterface *i);
+
 #endif