]> git.meshlink.io Git - catta/blobdiff - avahi-core/server.h
add support for service subtypes: avahi_server_add_service_subtype()
[catta] / avahi-core / server.h
index 7384e9879f18b05b0368715e4473096a7bf8de3f..e7e77a2392d9b2008708bc43cf41dcf65a5b76ec 100644 (file)
@@ -37,9 +37,13 @@ typedef struct AvahiEntry AvahiEntry;
 #include "dns.h"
 #include "rrlist.h"
 #include "hashmap.h"
+#include "wide-area.h"
+#include "multicast-lookup.h"
 
 #define AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS 100
 
+#define AVAHI_FLAGS_VALID(flags, max) (!((flags) & ~(max)))
+
 typedef struct AvahiLegacyUnicastReflectSlot AvahiLegacyUnicastReflectSlot;
 
 struct AvahiLegacyUnicastReflectSlot {
@@ -59,7 +63,7 @@ struct AvahiEntry {
 
     int dead;
     
-    AvahiEntryFlags flags;
+    AvahiPublishFlags flags;
     AvahiRecord *record;
     AvahiIfIndex interface;
     AvahiProtocol protocol;
@@ -84,6 +88,8 @@ struct AvahiSEntryGroup {
     unsigned n_register_try;
     struct timeval register_time;
     AvahiTimeEvent *register_time_event;
+
+    struct timeval established_at;
     
     AVAHI_LLIST_FIELDS(AvahiSEntryGroup, groups);
     AVAHI_LLIST_HEAD(AvahiEntry, entries);
@@ -138,9 +144,14 @@ struct AvahiServer {
     AvahiLegacyUnicastReflectSlot **legacy_unicast_reflect_slots;
     uint16_t legacy_unicast_reflect_id;
 
+    /* The last error code */
     int error;
 
+    /* The local service cookie */
     uint32_t local_service_cookie;
+
+    AvahiMulticastLookupEngine *multicast_lookup_engine;
+    AvahiWideAreaLookupEngine *wide_area_lookup_engine;
 };
 
 int avahi_server_entry_match_interface(AvahiEntry *e, AvahiInterface *i);
@@ -164,4 +175,18 @@ void avahi_server_increase_host_rr_pending(AvahiServer *s);
 
 int avahi_server_set_errno(AvahiServer *s, int error);
 
+#define AVAHI_CHECK_VALIDITY_RETURN_NULL(server, expression, error) { \
+        if (!(expression)) { \
+            avahi_server_set_errno((server), (error)); \
+            return NULL; \
+        } \
+}
+
+#define AVAHI_CHECK_VALIDITY_SET_RET_GOTO_FAIL(server, expression, error) {\
+    if (!(expression)) { \
+        ret = avahi_server_set_errno((server), (error)); \
+        goto fail; \
+    } \
+}
+
 #endif