]> git.meshlink.io Git - catta/blobdiff - avahi-core/server.h
* add address resolver
[catta] / avahi-core / server.h
index 226672f79f7ef16988150a3702b310fb2848f5d0..41a691e4c52040f6d604926f26eb0e51520beaaf 100644 (file)
@@ -28,8 +28,9 @@
 #include "llist.h"
 #include "timeeventq.h"
 #include "announce.h"
-#include "subscribe.h"
+#include "resolve.h"
 #include "dns.h"
+#include "rrlist.h"
 
 struct AvahiEntry {
     AvahiServer *server;
@@ -67,37 +68,60 @@ struct AvahiServer {
     GMainContext *context;
     AvahiInterfaceMonitor *monitor;
 
+    AvahiServerConfig config;
+
     AVAHI_LLIST_HEAD(AvahiEntry, entries);
     GHashTable *entries_by_key;
 
     AVAHI_LLIST_HEAD(AvahiEntryGroup, groups);
     
-    AVAHI_LLIST_HEAD(AvahiSubscription, subscriptions);
-    GHashTable *subscription_hashtable;
+    AVAHI_LLIST_HEAD(AvahiRecordResolver, record_resolvers);
+    GHashTable *record_resolver_hashtable;
+    AVAHI_LLIST_HEAD(AvahiHostNameResolver, host_name_resolvers);
+    AVAHI_LLIST_HEAD(AvahiAddressResolver, address_resolvers);
 
     gboolean need_entry_cleanup, need_group_cleanup;
     
     AvahiTimeEventQueue *time_event_queue;
     
-    gchar *hostname;
+    gchar *host_name, *host_name_fqdn, *domain_name;
 
     gint fd_ipv4, fd_ipv6;
 
     GPollFD pollfd_ipv4, pollfd_ipv6;
     GSource *source;
 
-    gboolean ignore_bad_ttl;
+    AvahiServerState state;
+    AvahiServerCallback callback;
+    gpointer userdata;
+
+    AvahiEntryGroup *hinfo_entry_group;
+    AvahiEntryGroup *browse_domain_entry_group;
+    guint n_host_rr_pending;
 
-    AvahiDnsPacket *unicast_packet;
+    AvahiTimeEvent *register_time_event;
+    
+    /* Used for assembling responses */
+    AvahiRecordList *record_list;
 };
 
 gboolean avahi_server_entry_match_interface(AvahiEntry *e, AvahiInterface *i);
 
 void avahi_server_post_query(AvahiServer *s, gint interface, guchar protocol, AvahiKey *key);
-void avahi_server_post_response(AvahiServer *s, gint interface, guchar protocol, AvahiRecord *record, gboolean flush_cache);
+
+void avahi_server_prepare_response(AvahiServer *s, AvahiInterface *i, AvahiEntry *e, gboolean unicast_response, gboolean auxiliary);
+void avahi_server_prepare_matching_responses(AvahiServer *s, AvahiInterface *i, AvahiKey *k, gboolean unicast_response);
+void avahi_server_generate_response(AvahiServer *s, AvahiInterface *i, AvahiDnsPacket *p, const AvahiAddress *a, guint16 port, gboolean legacy_unicast);
 
 void avahi_entry_group_change_state(AvahiEntryGroup *g, AvahiEntryGroupState state);
 
 gboolean avahi_entry_commited(AvahiEntry *e);
 
+void avahi_server_enumerate_aux_records(AvahiServer *s, AvahiInterface *i, AvahiRecord *r, void (*callback)(AvahiServer *s, AvahiRecord *r, gboolean flush_cache, gpointer userdata), gpointer userdata);
+
+void avahi_host_rr_entry_group_callback(AvahiServer *s, AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata);
+
+void avahi_server_decrease_host_rr_pending(AvahiServer *s);
+void avahi_server_increase_host_rr_pending(AvahiServer *s);
+
 #endif