]> git.meshlink.io Git - catta/commitdiff
* make all flags parameters UINT32 when marshalling for DBUS
authorLennart Poettering <lennart@poettering.net>
Thu, 29 Sep 2005 01:51:53 +0000 (01:51 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 29 Sep 2005 01:51:53 +0000 (01:51 +0000)
* rename AvahiEntryFlags to AvahiPublishFlags
* add flags parameter to add_service() and friends
* validity checking of flags, interface and protocol parameters of add_service() and friends
* make AVAHI_VALID_FLAGS a global macro
* add new flag AVAHI_PUBLISH_NO_REVERSE, if set address records will no be created with matching reverse lookup PTR RRs
* add new flag AVAHI_PUBLISH_NO_COOKIE, for not implicitly adding the service cookie to TXT records
* minor cleanups

Yes, this will break the mono bindings. More breakages to come.

NO_REVERSE and NO_COOKIE needs testing.

Lathiat, I guess the new flag NO_REVERSE makes the immediate need to add a client side API to add arbitrary RRs obsolete for now. You might consider moving it in the TODO list to "later".

git-svn-id: file:///home/lennart/svn/public/avahi/trunk@648 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

36 files changed:
avahi-client/browser.c
avahi-client/client-test.c
avahi-client/client.h
avahi-client/entrygroup.c
avahi-client/resolver.c
avahi-common/defs.h
avahi-core/announce.c
avahi-core/avahi-test.c
avahi-core/browse-dns-server.c
avahi-core/browse-domain.c
avahi-core/browse-service-type.c
avahi-core/browse-service.c
avahi-core/browse.c
avahi-core/browse.h
avahi-core/conformance-test.c
avahi-core/core.h
avahi-core/iface.c
avahi-core/publish.h
avahi-core/resolve-address.c
avahi-core/resolve-host-name.c
avahi-core/resolve-service.c
avahi-core/server.c
avahi-core/server.h
avahi-daemon/AddressResolver.introspect
avahi-daemon/DomainBrowser.introspect
avahi-daemon/EntryGroup.introspect
avahi-daemon/HostNameResolver.introspect
avahi-daemon/Server.introspect
avahi-daemon/ServiceBrowser.introspect
avahi-daemon/ServiceResolver.introspect
avahi-daemon/ServiceTypeBrowser.introspect
avahi-daemon/dbus-protocol.c
avahi-daemon/main.c
avahi-daemon/static-services.c
examples/client-publish-service.c
examples/core-publish-service.c

index 1aaae8c48c4aa44373ef3bab3554648c29de06e2..a83aa697da597c4d0ecfb813b817758b1a9d4c15 100644 (file)
@@ -52,7 +52,8 @@ AvahiDomainBrowser* avahi_domain_browser_new(
     DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
     char *path;
-    int32_t i_interface, i_protocol, i_flags, bt;
+    int32_t i_interface, i_protocol, bt;
+    uint32_t u_flags;
 
     assert(client);
     assert(callback);
@@ -86,7 +87,7 @@ AvahiDomainBrowser* avahi_domain_browser_new(
 
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
     bt = btype;
 
     if (!(dbus_message_append_args(
@@ -95,7 +96,7 @@ AvahiDomainBrowser* avahi_domain_browser_new(
               DBUS_TYPE_INT32, &i_protocol,
               DBUS_TYPE_STRING, &domain,
               DBUS_TYPE_INT32, &bt,
-              DBUS_TYPE_INT32, &flags,
+              DBUS_TYPE_UINT32, &flags,
               DBUS_TYPE_INVALID))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -175,7 +176,8 @@ DBusHandlerResult avahi_domain_browser_event (AvahiClient *client, AvahiBrowserE
     DBusError error;
     const char *path;
     char *domain = NULL;
-    int32_t interface = AVAHI_IF_UNSPEC, protocol = AVAHI_PROTO_UNSPEC, flags = 0;
+    int32_t interface = AVAHI_IF_UNSPEC, protocol = AVAHI_PROTO_UNSPEC;
+    uint32_t flags = 0;
 
     assert(client);
     assert(message);
@@ -198,7 +200,7 @@ DBusHandlerResult avahi_domain_browser_event (AvahiClient *client, AvahiBrowserE
                 DBUS_TYPE_INT32, &interface,
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &domain,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) ||
             dbus_error_is_set (&error)) {
             fprintf(stderr, "Failed to parse browser event.\n");
@@ -229,7 +231,8 @@ AvahiServiceTypeBrowser* avahi_service_type_browser_new(
     DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
     char *path;
-    int32_t i_interface, i_protocol, i_flags;
+    int32_t i_interface, i_protocol;
+    uint32_t u_flags;
 
     assert(client);
     assert(callback);
@@ -263,14 +266,14 @@ AvahiServiceTypeBrowser* avahi_service_type_browser_new(
     
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
 
     if (!dbus_message_append_args(
             message,
             DBUS_TYPE_INT32, &i_interface,
             DBUS_TYPE_INT32, &i_protocol,
             DBUS_TYPE_STRING, &domain,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID)) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -349,7 +352,8 @@ DBusHandlerResult avahi_service_type_browser_event (AvahiClient *client, AvahiBr
     DBusError error;
     const char *path;
     char *domain = NULL, *type = NULL;
-    int32_t interface = AVAHI_IF_UNSPEC, protocol = AVAHI_PROTO_UNSPEC, flags = 0;
+    int32_t interface = AVAHI_IF_UNSPEC, protocol = AVAHI_PROTO_UNSPEC;
+    uint32_t flags = 0;
 
     assert(client);
     assert(message);
@@ -373,7 +377,7 @@ DBusHandlerResult avahi_service_type_browser_event (AvahiClient *client, AvahiBr
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &type,
                 DBUS_TYPE_STRING, &domain,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) ||
             dbus_error_is_set(&error)) {
             fprintf(stderr, "Failed to parse browser event.\n");
@@ -406,7 +410,8 @@ AvahiServiceBrowser* avahi_service_browser_new(
     DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
     char *path;
-    int32_t i_protocol, i_interface, i_flags;
+    int32_t i_protocol, i_interface;
+    uint32_t u_flags;
 
     assert(client);
     assert(type);
@@ -441,7 +446,7 @@ AvahiServiceBrowser* avahi_service_browser_new(
 
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
 
     if (!dbus_message_append_args(
             message,
@@ -449,7 +454,7 @@ AvahiServiceBrowser* avahi_service_browser_new(
             DBUS_TYPE_INT32, &i_protocol,
             DBUS_TYPE_STRING, &type,
             DBUS_TYPE_STRING, &domain,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID)) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -528,7 +533,8 @@ DBusHandlerResult avahi_service_browser_event (AvahiClient *client, AvahiBrowser
     DBusError error;
     const char *path;
     char *name = NULL, *type = NULL, *domain = NULL;
-    int32_t interface = AVAHI_IF_UNSPEC, protocol = AVAHI_PROTO_UNSPEC, flags = 0;
+    int32_t interface = AVAHI_IF_UNSPEC, protocol = AVAHI_PROTO_UNSPEC;
+    uint32_t flags = 0;
 
     dbus_error_init (&error);
 
@@ -550,7 +556,7 @@ DBusHandlerResult avahi_service_browser_event (AvahiClient *client, AvahiBrowser
                 DBUS_TYPE_STRING, &name,
                 DBUS_TYPE_STRING, &type,
                 DBUS_TYPE_STRING, &domain,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) ||
             dbus_error_is_set(&error)) {
             fprintf(stderr, "Failed to parse browser event.\n");
index 24576dde0c13bd8fad63902cd8cdd28c8ffd8d31..15af93f45722706618e5cfad363375ec8c580e8e 100644 (file)
@@ -189,7 +189,7 @@ static void test_entry_group_reset (AvahiTimeout *timeout, void* userdata)
     printf ("Resetting entry group\n");
     avahi_entry_group_reset (g);
 
-    avahi_entry_group_add_service (g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar2", NULL);
+    avahi_entry_group_add_service (g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar2", NULL);
 
     avahi_entry_group_commit (g);
 }
@@ -243,7 +243,7 @@ int main (int argc, char *argv[]) {
     
     printf("Sucessfully created entry group %p\n", (void*) group);
 
-    avahi_entry_group_add_service (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar", NULL);
+    avahi_entry_group_add_service (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar", NULL);
 
     avahi_entry_group_commit (group);
 
index 4a915ac4946d04949d7279cefde0cca7b359f11f..31997cfe9895af887bacc80eda829cf2ccc8aa68 100644 (file)
@@ -185,6 +185,7 @@ int avahi_entry_group_add_service(
     AvahiEntryGroup *group,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -197,6 +198,7 @@ int avahi_entry_group_add_service_strlst(
     AvahiEntryGroup *group,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -209,6 +211,7 @@ int avahi_entry_group_add_service_va(
     AvahiEntryGroup *group,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
index dc0994a231cef8780e9cead0110c4a54dbd20b7b..2dffcf631a49994577aa03a1333301a1b101635b 100644 (file)
@@ -334,6 +334,7 @@ int avahi_entry_group_add_service_strlst(
     AvahiEntryGroup *group,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -348,6 +349,7 @@ int avahi_entry_group_add_service_strlst(
     DBusError error;
     AvahiClient *client;
     int32_t i_interface, i_protocol;
+    uint32_t u_flags;
 
     assert(group);
     assert(name);
@@ -373,11 +375,13 @@ int avahi_entry_group_add_service_strlst(
 
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
+    u_flags = (uint32_t) flags;
 
     if (!dbus_message_append_args(
             message,
             DBUS_TYPE_INT32, &i_interface,
             DBUS_TYPE_INT32, &i_protocol,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_STRING, &name,
             DBUS_TYPE_STRING, &type,
             DBUS_TYPE_STRING, &domain,
@@ -460,6 +464,7 @@ int avahi_entry_group_add_service(
     AvahiEntryGroup *group,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -473,7 +478,7 @@ int avahi_entry_group_add_service(
     assert(group);
 
     va_start(va, port);
-    r = avahi_entry_group_add_service_va(group, interface, protocol, name, type, domain, host, port, va);
+    r = avahi_entry_group_add_service_va(group, interface, protocol, flags, name, type, domain, host, port, va);
     va_end(va);
     return r;
 }
@@ -482,6 +487,7 @@ int avahi_entry_group_add_service_va(
     AvahiEntryGroup *group,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -495,7 +501,7 @@ int avahi_entry_group_add_service_va(
     assert(group);
 
     txt = avahi_string_list_new_va(va);
-    r = avahi_entry_group_add_service_strlst(group, interface, protocol, name, type, domain, host, port, txt);
+    r = avahi_entry_group_add_service_strlst(group, interface, protocol, flags, name, type, domain, host, port, txt);
     avahi_string_list_free(txt);
 
     return r;
index f08ce77b455ff6e63c952ac0d835e941919aa4e0..d054ae773a70c244b356f224658d697b1fe56c5c 100644 (file)
@@ -63,7 +63,8 @@ DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolv
 
     if (event == AVAHI_RESOLVER_FOUND) {
         int j;
-        int32_t interface, flags, protocol, aprotocol;
+        int32_t interface, protocol, aprotocol;
+        uint32_t flags;
         char *name, *type, *domain, *host, *address;
         uint16_t port;
         DBusMessageIter iter, sub;
@@ -130,8 +131,8 @@ DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolv
 
         dbus_message_iter_next(&iter);
 
-        if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_INT32) {
-            fprintf(stderr, "Failed to parse resolver event. XXX %i\n", dbus_message_iter_get_arg_type(&iter));
+        if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32) {
+            fprintf(stderr, "Failed to parse resolver event.\n");
             goto fail;
         }
 
@@ -175,7 +176,8 @@ AvahiServiceResolver * avahi_service_resolver_new(
     DBusError error;
     AvahiServiceResolver *r;
     DBusMessage *message = NULL, *reply = NULL;
-    int32_t i_interface, i_protocol, i_aprotocol, i_flags;
+    int32_t i_interface, i_protocol, i_aprotocol;
+    uint32_t u_flags;
     char *path;
     
     assert(client);
@@ -214,7 +216,7 @@ AvahiServiceResolver * avahi_service_resolver_new(
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
     i_aprotocol = (int32_t) aprotocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
 
     if (!(dbus_message_append_args(
               message,
@@ -224,7 +226,7 @@ AvahiServiceResolver * avahi_service_resolver_new(
               DBUS_TYPE_STRING, &type,
               DBUS_TYPE_STRING, &domain,
               DBUS_TYPE_INT32, &i_aprotocol,
-              DBUS_TYPE_INT32, &i_flags,
+              DBUS_TYPE_UINT32, &u_flags,
               DBUS_TYPE_INVALID))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -324,7 +326,8 @@ DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiReso
         goto fail;
 
     if (event == AVAHI_RESOLVER_FOUND) {
-        int32_t interface, protocol, aprotocol, flags;
+        int32_t interface, protocol, aprotocol;
+        uint32_t flags;
         char *name, *address;
         AvahiAddress a;
         
@@ -335,7 +338,7 @@ DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiReso
                 DBUS_TYPE_STRING, &name,
                 DBUS_TYPE_INT32, &aprotocol,
                 DBUS_TYPE_STRING, &address,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) ||
             dbus_error_is_set (&error)) {
             fprintf(stderr, "Failed to parse resolver event.\n");
@@ -348,7 +351,7 @@ DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiReso
             goto fail;
         }
     
-        r->callback(r, (AvahiIfIndex) interface, (AvahiProtocol) protocol, AVAHI_RESOLVER_FOUND, name, &a, flags, r->userdata);
+        r->callback(r, (AvahiIfIndex) interface, (AvahiProtocol) protocol, AVAHI_RESOLVER_FOUND, name, &a, (AvahiLookupResultFlags) flags, r->userdata);
 
     } else
         r->callback(r, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, event, NULL, NULL, 0, r->userdata);
@@ -374,7 +377,8 @@ AvahiHostNameResolver * avahi_host_name_resolver_new(
     DBusError error;
     AvahiHostNameResolver *r;
     DBusMessage *message = NULL, *reply = NULL;
-    int32_t i_interface, i_protocol, i_aprotocol, i_flags;
+    int32_t i_interface, i_protocol, i_aprotocol;
+    uint32_t u_flags;
     char *path;
     
     assert(client);
@@ -407,7 +411,7 @@ AvahiHostNameResolver * avahi_host_name_resolver_new(
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
     i_aprotocol = (int32_t) aprotocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
 
     if (!(dbus_message_append_args(
               message,
@@ -415,7 +419,7 @@ AvahiHostNameResolver * avahi_host_name_resolver_new(
               DBUS_TYPE_INT32, &i_protocol,
               DBUS_TYPE_STRING, &name,
               DBUS_TYPE_INT32, &i_aprotocol,
-              DBUS_TYPE_INT32, &i_flags,
+              DBUS_TYPE_UINT32, &u_flags,
               DBUS_TYPE_INVALID))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -514,7 +518,8 @@ DBusHandlerResult avahi_address_resolver_event (AvahiClient *client, AvahiResolv
         goto fail;
 
     if (event == AVAHI_RESOLVER_FOUND) {
-        int32_t interface, protocol, aprotocol, flags;
+        int32_t interface, protocol, aprotocol;
+        uint32_t flags;
         char *name, *address;
         AvahiAddress a;
         
@@ -525,7 +530,7 @@ DBusHandlerResult avahi_address_resolver_event (AvahiClient *client, AvahiResolv
                 DBUS_TYPE_INT32, &aprotocol,
                 DBUS_TYPE_STRING, &address,
                 DBUS_TYPE_STRING, &name,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) ||
             dbus_error_is_set (&error)) {
             fprintf(stderr, "Failed to parse resolver event.\n");
@@ -585,7 +590,8 @@ AvahiAddressResolver * avahi_address_resolver_new(
     DBusError error;
     AvahiAddressResolver *r;
     DBusMessage *message = NULL, *reply = NULL;
-    int32_t i_interface, i_protocol, i_flags;
+    int32_t i_interface, i_protocol;
+    uint32_t u_flags;
     char *path;
     
     assert(client);
@@ -616,14 +622,14 @@ AvahiAddressResolver * avahi_address_resolver_new(
 
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
 
     if (!(dbus_message_append_args(
               message,
               DBUS_TYPE_INT32, &i_interface,
               DBUS_TYPE_INT32, &i_protocol,
               DBUS_TYPE_STRING, &address,
-              DBUS_TYPE_INT32, &i_flags,
+              DBUS_TYPE_UINT32, &u_flags,
               DBUS_TYPE_INVALID))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
index a0fb034eca9b0b69b16ea3342d6c0509831c7eda..06b48a6acee1673be5538eb2e92adb96c40f5c93 100644 (file)
@@ -152,6 +152,17 @@ typedef enum {
     AVAHI_DOMAIN_BROWSER_MAX
 } AvahiDomainBrowserType;
 
+/** Some flags for publishing functions */
+typedef enum {
+    AVAHI_PUBLISH_NULL = 0,          
+    AVAHI_PUBLISH_UNIQUE = 1,           /**< For raw records: The RRset is intended to be unique */
+    AVAHI_PUBLISH_NO_PROBE = 2,          /**< For raw records: Though the RRset is intended to be unique no probes shall be sent */
+    AVAHI_PUBLISH_NO_ANNOUNCE = 4,       /**< For raw records: Do not announce this RR to other hosts */
+    AVAHI_PUBLISH_ALLOW_MULTIPLE = 8,     /**< For raw records: Allow multiple local records of this type, even if they are intended to be unique */
+    AVAHI_PUBLISH_NO_REVERSE = 16,      /**< For address records: don't create a reverse (PTR) entry */
+    AVAHI_PUBLISH_NO_COOKIE = 32        /**< For service records: do not implicitly add the local service cookie to TXT data */
+} AvahiPublishFlags;
+
 /** Some flags for lookup functions */
 typedef enum {
     AVAHI_LOOKUP_NULL = 0,
index c21b147a5577ed3961b87e03ebbc6cdeb7b8c4c4..025331d0b43249eb054b26112a8d95c623f69728 100644 (file)
@@ -155,7 +155,7 @@ static void next_state(AvahiAnnouncement *a) {
 
     } else if (a->state == AVAHI_ANNOUNCING) {
 
-        if (a->entry->flags & AVAHI_ENTRY_UNIQUE)
+        if (a->entry->flags & AVAHI_PUBLISH_UNIQUE)
             /* Send the whole rrset at once */
             avahi_server_prepare_matching_responses(a->server, a->interface, a->entry->record->key, 0);
         else
@@ -212,9 +212,9 @@ static void go_to_initial_state(AvahiAnnouncement *a, int immediately) {
     assert(a);
     e = a->entry;
 
-    if ((e->flags & AVAHI_ENTRY_UNIQUE) && !(e->flags & AVAHI_ENTRY_NOPROBE))
+    if ((e->flags & AVAHI_PUBLISH_UNIQUE) && !(e->flags & AVAHI_PUBLISH_NO_PROBE))
         a->state = AVAHI_PROBING;
-    else if (!(e->flags & AVAHI_ENTRY_NOANNOUNCE)) {
+    else if (!(e->flags & AVAHI_PUBLISH_NO_ANNOUNCE)) {
 
         if (!e->group || e->group->state == AVAHI_ENTRY_GROUP_ESTABLISHED)
             a->state = AVAHI_ANNOUNCING;
@@ -336,7 +336,7 @@ int avahi_entry_is_registered(AvahiServer *s, AvahiEntry *e, AvahiInterface *i)
     return
         a->state == AVAHI_ANNOUNCING ||
         a->state == AVAHI_ESTABLISHED ||
-        (a->state == AVAHI_WAITING && !(e->flags & AVAHI_ENTRY_UNIQUE));
+        (a->state == AVAHI_WAITING && !(e->flags & AVAHI_PUBLISH_UNIQUE));
 }
 
 int avahi_entry_is_probing(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
@@ -354,7 +354,7 @@ int avahi_entry_is_probing(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
     
     return
         a->state == AVAHI_PROBING ||
-        (a->state == AVAHI_WAITING && (e->flags & AVAHI_ENTRY_UNIQUE));
+        (a->state == AVAHI_WAITING && (e->flags & AVAHI_PUBLISH_UNIQUE));
 }
 
 void avahi_entry_return_to_initial_state(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
@@ -403,7 +403,7 @@ static void send_goodbye_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, v
     if (!avahi_interface_match(i, e->interface, e->protocol))
         return;
 
-    if (e->flags & AVAHI_ENTRY_NOANNOUNCE)
+    if (e->flags & AVAHI_PUBLISH_NO_ANNOUNCE)
         return;
 
     if (!avahi_entry_is_registered(m->server, e, i))
@@ -412,7 +412,7 @@ static void send_goodbye_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, v
     if (!(g = make_goodbye_record(e->record)))
         return; /* OOM */
     
-    avahi_interface_post_response(i, g, e->flags & AVAHI_ENTRY_UNIQUE, NULL, 1);
+    avahi_interface_post_response(i, g, e->flags & AVAHI_PUBLISH_UNIQUE, NULL, 1);
     avahi_record_unref(g);
 }
     
index 0490c84972256e88466ddbfb9d964581499f2b05..7ed59919f4af981168f7c6314556de807a96b634 100644 (file)
@@ -164,22 +164,22 @@ static void create_entries(int new_name) {
         service_name = n;
     }
     
-    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_http._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
+    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, service_name, "_http._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
         avahi_log_error("Failed to add HTTP service");
         goto fail;
     }
 
-    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_ftp._tcp", NULL, NULL, 21, "foo", NULL) < 0) {
+    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, service_name, "_ftp._tcp", NULL, NULL, 21, "foo", NULL) < 0) {
         avahi_log_error("Failed to add FTP service");
         goto fail;
     }
 
-    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_webdav._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
+    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0,service_name, "_webdav._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
         avahi_log_error("Failed to add WEBDAV service");
         goto fail;
     }
 
-    if (avahi_server_add_dns_server_address(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, avahi_address_parse("192.168.50.1", AVAHI_PROTO_UNSPEC, &a), 53) < 0) {
+    if (avahi_server_add_dns_server_address(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, NULL, AVAHI_DNS_SERVER_RESOLVE, avahi_address_parse("192.168.50.1", AVAHI_PROTO_UNSPEC, &a), 53) < 0) {
         avahi_log_error("Failed to add new DNS Server address");
         goto fail;
     }
index 675000bd7169d11af4c9b04907706fd6a5976fbf..31da536ace66a4a005f3377845bca6f4068e69a6 100644 (file)
@@ -262,7 +262,7 @@ AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
     if (!domain)
         domain = server->domain_name;
 
-    if (!AVAHI_VALID_FLAGS(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
         avahi_server_set_errno(server, AVAHI_ERR_INVALID_FLAGS);
         return NULL;
     }
index c5d2ba87c3074f99ea8ff5f57e8dc33652cc3eac..6cbc93a53d31e2645d2a60b34e25d318f89e0370 100644 (file)
@@ -97,7 +97,7 @@ AvahiSDomainBrowser *avahi_s_domain_browser_new(
     if (!domain)
         domain = server->domain_name;
     
-    if (!AVAHI_VALID_FLAGS(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
         avahi_server_set_errno(server, AVAHI_ERR_INVALID_FLAGS);
         return NULL;
     }
index 3ea28c0a1c21c384588060b214d6da0aff8738fa..25673faec99af4a44f5aa510bbe1865fd8647b3f 100644 (file)
@@ -120,7 +120,7 @@ AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
     if (!domain)
         domain = server->domain_name;
 
-    if (!AVAHI_VALID_FLAGS(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
         avahi_server_set_errno(server, AVAHI_ERR_INVALID_FLAGS);
         return NULL;
     }
index 55fba6aa0c6bd3bc81b41ebb73fc7cc36474321b..dfa6050c9bf2f42b3cc05cb6d4c305f5d7a80fdf 100644 (file)
@@ -128,7 +128,7 @@ AvahiSServiceBrowser *avahi_s_service_browser_new(
     if (!domain)
         domain = server->domain_name;
     
-    if (!AVAHI_VALID_FLAGS(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
         avahi_server_set_errno(server, AVAHI_ERR_INVALID_FLAGS);
         return NULL;
     }
index 64680b7630116a92cf36082b081af1a553360c42..f47418af2d76631c2e2a471f3f474a65aefc5676 100644 (file)
@@ -527,7 +527,7 @@ AvahiSRecordBrowser *avahi_s_record_browser_new(
     CHECK_VALIDITY_RETURN_NULL(server, AVAHI_IF_VALID(interface), AVAHI_ERR_INVALID_INTERFACE);
     CHECK_VALIDITY_RETURN_NULL(server, !avahi_key_is_pattern(key), AVAHI_ERR_IS_PATTERN);
     CHECK_VALIDITY_RETURN_NULL(server, avahi_key_is_valid(key), AVAHI_ERR_INVALID_KEY);
-    CHECK_VALIDITY_RETURN_NULL(server, AVAHI_VALID_FLAGS(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS);
+    CHECK_VALIDITY_RETURN_NULL(server, AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS);
     CHECK_VALIDITY_RETURN_NULL(server, !(flags & AVAHI_LOOKUP_USE_WIDE_AREA) || !(flags & AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS); 
     
     if (!(b = avahi_new(AvahiSRecordBrowser, 1))) {
index 70e724fddcc7654668a026d32b97f7570fe4834f..a340c7f35bcd917cfcf4680ce1a7f5cb906ad083 100644 (file)
@@ -60,6 +60,4 @@ void avahi_s_record_browser_destroy(AvahiSRecordBrowser *b);
 void avahi_s_record_browser_restart(AvahiSRecordBrowser *b);
 void avahi_s_record_browser_cancel(AvahiSRecordBrowser *b);
 
-#define AVAHI_VALID_FLAGS(flags, max) (!((flags) & ~(max)))
-
 #endif
index 392dddccdff6abcdba38a21c5cc4cec0405317d5..1856fc56d8f48ca2b4022bb19341d52495b04da7 100644 (file)
@@ -74,7 +74,7 @@ static void create_service(const char *t) {
     else
         group = avahi_s_entry_group_new(avahi, entry_group_callback, NULL);
     
-    avahi_server_add_service(avahi, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, name, "_http._tcp", NULL, NULL, 80, "foo", NULL);   
+    avahi_server_add_service(avahi, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_http._tcp", NULL, NULL, 80, "foo", NULL);   
     avahi_s_entry_group_commit(group);
 
     try++;
index 4883c6b1f78d0890e9faaa827a672c5f8ee594d0..e3bf8a3af8e705272f2f47e9c92101c3856189df 100644 (file)
@@ -50,15 +50,6 @@ AVAHI_C_DECL_BEGIN
 /** Maximum number of defined DNS servers for wide area DNS */
 #define AVAHI_MAX_WIDE_AREA_SERVERS 4
 
-/** Flags for server entries */
-typedef enum {
-    AVAHI_ENTRY_NULL = 0,          /**< No special flags */
-    AVAHI_ENTRY_UNIQUE = 1,        /**< The RRset is intended to be unique */
-    AVAHI_ENTRY_NOPROBE = 2,       /**< Though the RRset is intended to be unique no probes shall be sent */
-    AVAHI_ENTRY_NOANNOUNCE = 4,    /**< Do not announce this RR to other hosts */
-    AVAHI_ENTRY_ALLOWMUTIPLE = 8   /**< Allow multiple local records of this type, even if they are intended to be unique */
-} AvahiEntryFlags;
-
 /** Prototype for callback functions which are called whenever the state of an AvahiServer object changes */
 typedef void (*AvahiServerCallback) (AvahiServer *s, AvahiServerState state, void* userdata);
 
index f882988cfb55bf79f0074445750a1bf4460fcb29..e3e2cd79c82dc240e072254e99ac329a5ebd82de 100644 (file)
@@ -142,8 +142,8 @@ static void update_hw_interface_rr(AvahiInterfaceMonitor *m, AvahiHwInterface *h
             if (!name)
                 return; /* OOM */
             
-            if (avahi_server_add_service(m->server, hw->entry_group, hw->index, AVAHI_PROTO_UNSPEC, name, "_workstation._tcp", NULL, NULL, 9, NULL) < 0) { 
-                avahi_log_warn(__FILE__": avahi_server_add_service() failed.");
+            if (avahi_server_add_service(m->server, hw->entry_group, hw->index, AVAHI_PROTO_UNSPEC, 0, name, "_workstation._tcp", NULL, NULL, 9, NULL) < 0) { 
+                avahi_log_warn(__FILE__": avahi_server_add_service() failed: %s", avahi_strerror(m->server->error));
                 avahi_s_entry_group_free(hw->entry_group);
                 hw->entry_group = NULL;
             } else
index 4e632f8e333614b114a0e21679127276557fb75f..c75c0678628be1cdbdbfc1ebe2a964e8e62aa310 100644 (file)
@@ -93,8 +93,9 @@ int avahi_server_add(
     AvahiSEntryGroup *g,       /**< An entry group object if this new record shall be attached to one, or NULL. If you plan to remove the record sometime later you a required to pass an entry group object here. */
     AvahiIfIndex interface,   /**< A numeric index of a network interface to attach this record to, or AVAHI_IF_UNSPEC to attach this record to all interfaces */
     AvahiProtocol protocol,   /**< A protocol family to attach this record to. One of the AVAHI_PROTO_xxx constants. Use AVAHI_PROTO_UNSPEC to make this record available on all protocols (wich means on both IPv4 and IPv6). */
-    AvahiEntryFlags flags,    /**< Special flags for this record */
-    AvahiRecord *r            /**< The record to add. This function increases the reference counter of this object. */   );
+    AvahiPublishFlags flags,    /**< Special flags for this record */
+    AvahiRecord *r            /**< The record to add. This function increases the reference counter of this object. */);
+    
 
 /** Add a PTR RR to the server. See avahi_server_add() for more information. */
 int avahi_server_add_ptr(
@@ -102,7 +103,7 @@ int avahi_server_add_ptr(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,             /**< DNS TTL for this record */
     const char *name,       /**< PTR record name */
     const char *dest        /**< pointer destination */  );
@@ -113,7 +114,7 @@ int avahi_server_add_txt(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,             /**< DNS TTL for this record */
     const char *name,       /**< TXT record name */
     ... /**< Text record data, terminated by NULL */) AVAHI_GCC_SENTINEL;
@@ -126,7 +127,7 @@ int avahi_server_add_txt_va(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,
     const char *name,
     va_list va);
@@ -139,7 +140,7 @@ int avahi_server_add_txt_strlst(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,
     const char *name,
     AvahiStringList *strlst  /**< TXT decord data as a AvahiString. This routine makes a deep copy of this object. */ );
@@ -156,7 +157,7 @@ int avahi_server_add_address(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     const char *name,
     AvahiAddress *a);
 
@@ -171,6 +172,7 @@ int avahi_server_add_service(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,         /**< Service name, e.g. "Lennart's Files" */
     const char *type,         /**< DNS-SD type, e.g. "_http._tcp" */
     const char *domain,       
@@ -184,6 +186,7 @@ int avahi_server_add_service_va(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -197,6 +200,7 @@ int avahi_server_add_service_strlst(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -218,6 +222,7 @@ int avahi_server_add_dns_server_address(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *domain,
     AvahiDNSServerType type,
     const AvahiAddress *address,
@@ -231,6 +236,7 @@ int avahi_server_add_dns_server_name(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *domain,
     AvahiDNSServerType type,
     const char *name,
index 4fb588e9fe6cf82124c18d6d7e64bdf5af0c7534..704dab48bfadd7a3b574b0e1eff9fdd3218b4c00 100644 (file)
@@ -202,7 +202,7 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
         return NULL;
     }
 
-    if (!AVAHI_VALID_FLAGS(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
         avahi_server_set_errno(server, AVAHI_ERR_INVALID_FLAGS);
         return NULL;
     }
index 622ece10d1419dd025b7d72309ef373eb881534a..940febf403feeb23034ad5df016da4ddc326f244 100644 (file)
@@ -234,7 +234,7 @@ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
         return NULL;
     }
 
-    if (!AVAHI_VALID_FLAGS(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST)) {
         avahi_server_set_errno(server, AVAHI_ERR_INVALID_FLAGS);
         return NULL;
     }
index 31b00815798ee7baac1f8b1d8d75e1aa79c730f2..1d79c5a0fe2a4dbacfed9075e875f084f988b651 100644 (file)
@@ -410,7 +410,7 @@ AvahiSServiceResolver *avahi_s_service_resolver_new(
     if (!domain)
         domain = server->domain_name;
     
-    if (!AVAHI_VALID_FLAGS(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST|AVAHI_LOOKUP_NO_TXT|AVAHI_LOOKUP_NO_ADDRESS)) {
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST|AVAHI_LOOKUP_NO_TXT|AVAHI_LOOKUP_NO_ADDRESS)) {
         avahi_server_set_errno(server, AVAHI_ERR_INVALID_FLAGS);
         return NULL;
     }
index 6b7571e7f547ce5b83a724d30c976726db1aee23..49821d8b65e8bfbf175b97791e3eba4eaea84dde 100644 (file)
@@ -139,7 +139,7 @@ static void enum_aux_records(AvahiServer *s, AvahiInterface *i, const char *name
 
     for (e = avahi_hashmap_lookup(s->entries_by_key, k); e; e = e->by_key_next)
         if (!e->dead && avahi_entry_is_registered(s, e, i)) 
-            callback(s, e->record, e->flags & AVAHI_ENTRY_UNIQUE, userdata);
+            callback(s, e->record, e->flags & AVAHI_PUBLISH_UNIQUE, userdata);
 
     avahi_key_unref(k);
 }
@@ -166,7 +166,7 @@ void avahi_server_prepare_response(AvahiServer *s, AvahiInterface *i, AvahiEntry
     assert(i);
     assert(e);
 
-    avahi_record_list_push(s->record_list, e->record, e->flags & AVAHI_ENTRY_UNIQUE, unicast_response, auxiliary);
+    avahi_record_list_push(s->record_list, e->record, e->flags & AVAHI_PUBLISH_UNIQUE, unicast_response, auxiliary);
 }
 
 void avahi_server_prepare_matching_responses(AvahiServer *s, AvahiInterface *i, AvahiKey *k, int unicast_response) {
@@ -319,7 +319,7 @@ static int handle_conflict(AvahiServer *s, AvahiInterface *i, AvahiRecord *recor
             continue;
         }
         
-        if (!(e->flags & AVAHI_ENTRY_UNIQUE) && !unique)
+        if (!(e->flags & AVAHI_PUBLISH_UNIQUE) && !unique)
             continue;
 
         /* Either our entry or the other is intended to be unique, so let's check */
@@ -1195,7 +1195,7 @@ static void register_hinfo(AvahiServer *s) {
         r->data.hinfo.cpu = avahi_strdup(avahi_strup(utsname.machine));
         r->data.hinfo.os = avahi_strdup(avahi_strup(utsname.sysname));
 
-        if (avahi_server_add(s, s->hinfo_entry_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_ENTRY_UNIQUE, r) < 0) {
+        if (avahi_server_add(s, s->hinfo_entry_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_PUBLISH_UNIQUE, r) < 0) {
             avahi_log_warn("Failed to add HINFO RR: %s", avahi_strerror(s->error));
             return;
         }
@@ -1214,10 +1214,10 @@ static void register_localhost(AvahiServer *s) {
     
     /* Add localhost entries */
     avahi_address_parse("127.0.0.1", AVAHI_PROTO_INET, &a);
-    avahi_server_add_address(s, NULL, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_ENTRY_NOPROBE|AVAHI_ENTRY_NOANNOUNCE, "localhost", &a);
+    avahi_server_add_address(s, NULL, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_PUBLISH_NO_PROBE|AVAHI_PUBLISH_NO_ANNOUNCE, "localhost", &a);
 
     avahi_address_parse("::1", AVAHI_PROTO_INET6, &a);
-    avahi_server_add_address(s, NULL, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_ENTRY_NOPROBE|AVAHI_ENTRY_NOANNOUNCE, "ip6-localhost", &a);
+    avahi_server_add_address(s, NULL, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_PUBLISH_NO_PROBE|AVAHI_PUBLISH_NO_ANNOUNCE, "ip6-localhost", &a);
 }
 
 static void register_browse_domain(AvahiServer *s) {
@@ -1418,7 +1418,6 @@ AvahiServer *avahi_server_new(const AvahiPoll *poll_api, const AvahiServerConfig
     s->legacy_unicast_reflect_slots = NULL;
     s->legacy_unicast_reflect_id = 0;
 
-
     if (s->config.enable_wide_area) {
         s->wide_area_lookup_engine = avahi_wide_area_engine_new(s);
         avahi_wide_area_set_servers(s->wide_area_lookup_engine, s->config.wide_area_servers, s->config.n_wide_area_servers);
@@ -1535,7 +1534,7 @@ void avahi_server_free(AvahiServer* s) {
     avahi_free(s);
 }
 
-static int check_record_conflict(AvahiServer *s, AvahiIfIndex interface, AvahiProtocol protocol, AvahiRecord *r, AvahiEntryFlags flags) {
+static int check_record_conflict(AvahiServer *s, AvahiIfIndex interface, AvahiProtocol protocol, AvahiRecord *r, AvahiPublishFlags flags) {
     AvahiEntry *e;
     
     assert(s);
@@ -1545,10 +1544,10 @@ static int check_record_conflict(AvahiServer *s, AvahiIfIndex interface, AvahiPr
         if (e->dead)
             continue;
 
-        if (!(flags & AVAHI_ENTRY_UNIQUE) && !(e->flags & AVAHI_ENTRY_UNIQUE))
+        if (!(flags & AVAHI_PUBLISH_UNIQUE) && !(e->flags & AVAHI_PUBLISH_UNIQUE))
             continue;
         
-        if ((flags & AVAHI_ENTRY_ALLOWMUTIPLE) && (e->flags & AVAHI_ENTRY_ALLOWMUTIPLE) )
+        if ((flags & AVAHI_PUBLISH_ALLOW_MULTIPLE) && (e->flags & AVAHI_PUBLISH_ALLOW_MULTIPLE) )
             continue;
 
         if ((interface <= 0 ||
@@ -1569,7 +1568,7 @@ int avahi_server_add(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     AvahiRecord *r) {
     
     AvahiEntry *e, *t;
@@ -1577,6 +1576,18 @@ int avahi_server_add(
     assert(s);
     assert(r);
 
+    if (!AVAHI_IF_VALID(interface))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_INTERFACE);
+
+    if (!AVAHI_PROTO_VALID(protocol))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PROTOCOL);
+    
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_PUBLISH_NO_ANNOUNCE|AVAHI_PUBLISH_NO_PROBE|AVAHI_PUBLISH_UNIQUE|AVAHI_PUBLISH_ALLOW_MULTIPLE))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_FLAGS);
+    
+    if (!avahi_is_valid_domain_name(r->key->name))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME);
+    
     if (r->ttl == 0)
         return avahi_server_set_errno(s, AVAHI_ERR_INVALID_TTL);
 
@@ -1590,7 +1601,7 @@ int avahi_server_add(
         return avahi_server_set_errno(s, AVAHI_ERR_LOCAL_COLLISION);
 
     if (!(e = avahi_new(AvahiEntry, 1)))
-        return avahi_server_set_errno(s, AVAHI_ERR_NO_NETWORK);
+        return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         
     e->server = s;
     e->record = avahi_record_ref(r);
@@ -1671,7 +1682,7 @@ int avahi_server_add_ptr(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,
     const char *name,
     const char *dest) {
@@ -1682,7 +1693,13 @@ int avahi_server_add_ptr(
     assert(s);
     assert(dest);
 
-    if (!(r = avahi_record_new_full(name ? name : s->host_name_fqdn, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR, ttl)))
+    if ((name && !avahi_is_valid_domain_name(name)) || !avahi_is_valid_domain_name(dest))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME);
+
+    if (!name)
+        name = s->host_name_fqdn;
+    
+    if (!(r = avahi_record_new_full(name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR, ttl)))
         return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         
     r->data.ptr.name = avahi_normalize_name(dest);
@@ -1696,30 +1713,38 @@ int avahi_server_add_address(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     const char *name,
     AvahiAddress *a) {
 
     char *n = NULL;
     int ret = AVAHI_OK;
+    
     assert(s);
     assert(a);
 
-    if (name) {
+    if (!AVAHI_IF_VALID(interface))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_INTERFACE);
+
+    if (!AVAHI_PROTO_VALID(protocol) || !AVAHI_PROTO_VALID(a->proto))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PROTOCOL);
+    
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_PUBLISH_NO_REVERSE|AVAHI_PUBLISH_NO_ANNOUNCE|AVAHI_PUBLISH_NO_PROBE))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_FLAGS);
+    
+    if (name && !avahi_is_valid_domain_name(name))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME);
+
+    if (!name)
+        name = s->host_name_fqdn;
+    else {
         if (!(n = avahi_normalize_name(name)))
             return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
 
         name = n;
-    } else
-        name = s->host_name_fqdn;
-
-    if (!avahi_is_valid_domain_name(name)) {
-        ret = avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME);
-        goto fail;
     }
     
     if (a->proto == AVAHI_PROTO_INET) {
-        char *reverse;
         AvahiRecord  *r;
 
         if (!(r = avahi_record_new_full(name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A, AVAHI_DEFAULT_TTL_HOST_NAME))) {
@@ -1728,22 +1753,25 @@ int avahi_server_add_address(
         }
         
         r->data.a.address = a->data.ipv4;
-        ret = avahi_server_add(s, g, interface, protocol, flags | AVAHI_ENTRY_UNIQUE | AVAHI_ENTRY_ALLOWMUTIPLE, r);
+        ret = avahi_server_add(s, g, interface, protocol, (flags & ~ AVAHI_PUBLISH_NO_REVERSE) | AVAHI_PUBLISH_UNIQUE | AVAHI_PUBLISH_ALLOW_MULTIPLE, r);
         avahi_record_unref(r);
 
         if (ret < 0)
             goto fail;
-        
-        if (!(reverse = avahi_reverse_lookup_name_ipv4(&a->data.ipv4))) {
-            ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
-            goto fail;
-        }
-
-        ret = avahi_server_add_ptr(s, g, interface, protocol, flags | AVAHI_ENTRY_UNIQUE, AVAHI_DEFAULT_TTL_HOST_NAME, reverse, name);
-        avahi_free(reverse);
 
+        if (!(flags & AVAHI_PUBLISH_NO_REVERSE)) {
+            char *reverse;
+            
+            if (!(reverse = avahi_reverse_lookup_name_ipv4(&a->data.ipv4))) {
+                ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
+                goto fail;
+            }
+            
+            ret = avahi_server_add_ptr(s, g, interface, protocol, flags | AVAHI_PUBLISH_UNIQUE, AVAHI_DEFAULT_TTL_HOST_NAME, reverse, name);
+            avahi_free(reverse);
+        }
+        
     } else {
-        char *reverse;
         AvahiRecord *r;
 
         assert(a->proto == AVAHI_PROTO_INET6);
@@ -1754,30 +1782,34 @@ int avahi_server_add_address(
         }
         
         r->data.aaaa.address = a->data.ipv6;
-        ret = avahi_server_add(s, g, interface, protocol, flags | AVAHI_ENTRY_UNIQUE | AVAHI_ENTRY_ALLOWMUTIPLE, r);
+        ret = avahi_server_add(s, g, interface, protocol, (flags & ~ AVAHI_PUBLISH_NO_REVERSE) | AVAHI_PUBLISH_UNIQUE | AVAHI_PUBLISH_ALLOW_MULTIPLE, r);
         avahi_record_unref(r);
 
         if (ret < 0)
             goto fail;
 
-        if (!(reverse = avahi_reverse_lookup_name_ipv6_arpa(&a->data.ipv6))) {
-            ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
-            goto fail;
-        }
-            
-        ret = avahi_server_add_ptr(s, g, interface, protocol, flags | AVAHI_ENTRY_UNIQUE, AVAHI_DEFAULT_TTL_HOST_NAME, reverse, name);
-        avahi_free(reverse);
+        if (!(flags & AVAHI_PUBLISH_NO_REVERSE)) {
+            char *reverse;
 
-        if (ret < 0)
-            goto fail;
-    
-        if (!(reverse = avahi_reverse_lookup_name_ipv6_int(&a->data.ipv6))) {
-            ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
-            goto fail;
+            if (!(reverse = avahi_reverse_lookup_name_ipv6_arpa(&a->data.ipv6))) {
+                ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
+                goto fail;
+            }
+            
+            ret = avahi_server_add_ptr(s, g, interface, protocol, flags | AVAHI_PUBLISH_UNIQUE, AVAHI_DEFAULT_TTL_HOST_NAME, reverse, name);
+            avahi_free(reverse);
+            
+            if (ret < 0)
+                goto fail;
+            
+            if (!(reverse = avahi_reverse_lookup_name_ipv6_int(&a->data.ipv6))) {
+                ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
+                goto fail;
+            }
+            
+            ret = avahi_server_add_ptr(s, g, interface, protocol, flags | AVAHI_PUBLISH_UNIQUE, AVAHI_DEFAULT_TTL_HOST_NAME, reverse, name);
+            avahi_free(reverse);
         }
-
-        ret = avahi_server_add_ptr(s, g, interface, protocol, flags | AVAHI_ENTRY_UNIQUE, AVAHI_DEFAULT_TTL_HOST_NAME, reverse, name);
-        avahi_free(reverse);
     }
 
 fail:
@@ -1792,7 +1824,7 @@ static int server_add_txt_strlst_nocopy(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,
     const char *name,
     AvahiStringList *strlst) {
@@ -1801,7 +1833,7 @@ static int server_add_txt_strlst_nocopy(
     int ret;
     
     assert(s);
-    
+
     if (!(r = avahi_record_new_full(name ? name : s->host_name_fqdn, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_TXT, ttl)))
         return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
     
@@ -1817,7 +1849,7 @@ int avahi_server_add_txt_strlst(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,
     const char *name,
     AvahiStringList *strlst) {
@@ -1832,7 +1864,7 @@ int avahi_server_add_txt_va(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,
     const char *name,
     va_list va) {
@@ -1847,7 +1879,7 @@ int avahi_server_add_txt(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
-    AvahiEntryFlags flags,
+    AvahiPublishFlags flags,
     uint32_t ttl,
     const char *name,
     ...) {
@@ -1907,6 +1939,7 @@ static int server_add_service_strlst_nocopy(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -1923,6 +1956,15 @@ static int server_add_service_strlst_nocopy(
     assert(type);
     assert(name);
 
+    if (!AVAHI_IF_VALID(interface))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_INTERFACE);
+
+    if (!AVAHI_PROTO_VALID(protocol))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PROTOCOL);
+    
+    if (!AVAHI_FLAGS_VALID(flags, AVAHI_PUBLISH_NO_COOKIE))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_FLAGS);
+
     if (!avahi_is_valid_service_name(name))
         return avahi_server_set_errno(s, AVAHI_ERR_INVALID_SERVICE_NAME);
 
@@ -1953,7 +1995,7 @@ static int server_add_service_strlst_nocopy(
     snprintf(ptr_name, sizeof(ptr_name), "%s.%s", t, d);
     snprintf(svc_name, sizeof(svc_name), "%s.%s.%s", ename, t, d);
 
-    if ((ret = avahi_server_add_ptr(s, g, interface, protocol, AVAHI_ENTRY_NULL, AVAHI_DEFAULT_TTL, ptr_name, svc_name)) < 0)
+    if ((ret = avahi_server_add_ptr(s, g, interface, protocol, 0, AVAHI_DEFAULT_TTL, ptr_name, svc_name)) < 0)
         goto fail;
 
     if (!(r = avahi_record_new_full(svc_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_SRV, AVAHI_DEFAULT_TTL_HOST_NAME))) {
@@ -1966,22 +2008,23 @@ static int server_add_service_strlst_nocopy(
     r->data.srv.port = port;
     r->data.srv.name = h;
     h = NULL;
-    ret = avahi_server_add(s, g, interface, protocol, AVAHI_ENTRY_UNIQUE, r);
+    ret = avahi_server_add(s, g, interface, protocol, AVAHI_PUBLISH_UNIQUE, r);
     avahi_record_unref(r);
 
     if (ret < 0)
         goto fail;
 
-    strlst = add_magic_cookie(s, strlst);
+    if (!(flags & AVAHI_PUBLISH_NO_COOKIE))
+        strlst = add_magic_cookie(s, strlst);
     
-    ret = server_add_txt_strlst_nocopy(s, g, interface, protocol, AVAHI_ENTRY_UNIQUE, AVAHI_DEFAULT_TTL, svc_name, strlst);
+    ret = server_add_txt_strlst_nocopy(s, g, interface, protocol, AVAHI_PUBLISH_UNIQUE, AVAHI_DEFAULT_TTL, svc_name, strlst);
     strlst = NULL;
 
     if (ret < 0)
         goto fail;
 
     snprintf(enum_ptr, sizeof(enum_ptr), "_services._dns-sd._udp.%s", d);
-    ret = avahi_server_add_ptr(s, g, interface, protocol, AVAHI_ENTRY_NULL, AVAHI_DEFAULT_TTL, enum_ptr, ptr_name);
+    ret = avahi_server_add_ptr(s, g, interface, protocol, 0, AVAHI_DEFAULT_TTL, enum_ptr, ptr_name);
 
 fail:
     
@@ -1999,6 +2042,7 @@ int avahi_server_add_service_strlst(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -2010,7 +2054,7 @@ int avahi_server_add_service_strlst(
     assert(type);
     assert(name);
 
-    return server_add_service_strlst_nocopy(s, g, interface, protocol, name, type, domain, host, port, avahi_string_list_copy(strlst));
+    return server_add_service_strlst_nocopy(s, g, interface, protocol, flags, name, type, domain, host, port, avahi_string_list_copy(strlst));
 }
 
 int avahi_server_add_service_va(
@@ -2018,6 +2062,7 @@ int avahi_server_add_service_va(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -2029,7 +2074,7 @@ int avahi_server_add_service_va(
     assert(type);
     assert(name);
 
-    return server_add_service_strlst_nocopy(s, g, interface, protocol, name, type, domain, host, port, avahi_string_list_new_va(va));
+    return server_add_service_strlst_nocopy(s, g, interface, protocol, flags, name, type, domain, host, port, avahi_string_list_new_va(va));
 }
 
 int avahi_server_add_service(
@@ -2037,6 +2082,7 @@ int avahi_server_add_service(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *name,
     const char *type,
     const char *domain,
@@ -2052,7 +2098,7 @@ int avahi_server_add_service(
     assert(name);
 
     va_start(va, port);
-    ret = avahi_server_add_service_va(s, g, interface, protocol, name, type, domain, host, port, va);
+    ret = avahi_server_add_service_va(s, g, interface, protocol, flags, name, type, domain, host, port, va);
     va_end(va);
     return ret;
 }
@@ -2084,6 +2130,7 @@ int avahi_server_add_dns_server_address(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *domain,
     AvahiDNSServerType type,
     const AvahiAddress *address,
@@ -2095,23 +2142,33 @@ int avahi_server_add_dns_server_address(
 
     assert(s);
     assert(address);
-    assert(type == AVAHI_DNS_SERVER_UPDATE || type == AVAHI_DNS_SERVER_RESOLVE);
-    assert(address->proto == AVAHI_PROTO_INET || address->proto == AVAHI_PROTO_INET6);
 
+    if (!AVAHI_IF_VALID(interface))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_INTERFACE);
+
+    if (!AVAHI_PROTO_VALID(protocol) || !AVAHI_PROTO_VALID(address->proto))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PROTOCOL);
+    
+    if (!AVAHI_FLAGS_VALID(flags, 0) || (type != AVAHI_DNS_SERVER_UPDATE && type != AVAHI_DNS_SERVER_RESOLVE))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_FLAGS);
+    
     if (port == 0)
         return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PORT);
     
     if (domain && !avahi_is_valid_domain_name(domain))
         return avahi_server_set_errno(s, AVAHI_ERR_INVALID_DOMAIN_NAME);
 
+    if (!domain)
+        domain = s->domain_name;
+
     if (address->proto == AVAHI_PROTO_INET) {
         hexstring(h, sizeof(h), &address->data, sizeof(AvahiIPv4Address));
-        snprintf(n, sizeof(n), "ip-%s.%s", h, s->domain_name);
+        snprintf(n, sizeof(n), "ip-%s.%s", h, domain);
         r = avahi_record_new_full(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A, AVAHI_DEFAULT_TTL_HOST_NAME);
         r->data.a.address = address->data.ipv4;
     } else {
         hexstring(h, sizeof(h), &address->data, sizeof(AvahiIPv6Address));
-        snprintf(n, sizeof(n), "ip6-%s.%s", h, s->domain_name);
+        snprintf(n, sizeof(n), "ip6-%s.%s", h, domain);
         r = avahi_record_new_full(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_AAAA, AVAHI_DEFAULT_TTL_HOST_NAME);
         r->data.aaaa.address = address->data.ipv6;
     }
@@ -2119,13 +2176,13 @@ int avahi_server_add_dns_server_address(
     if (!r)
         return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
     
-    ret = avahi_server_add(s, g, interface, protocol, AVAHI_ENTRY_UNIQUE | AVAHI_ENTRY_ALLOWMUTIPLE, r);
+    ret = avahi_server_add(s, g, interface, protocol, AVAHI_PUBLISH_UNIQUE | AVAHI_PUBLISH_ALLOW_MULTIPLE, r);
     avahi_record_unref(r);
 
     if (ret < 0)
         return ret;
     
-    return avahi_server_add_dns_server_name(s, g, interface, protocol, domain, type, n, port);
+    return avahi_server_add_dns_server_name(s, g, interface, protocol, flags, domain, type, n, port);
 }
 
 int avahi_server_add_dns_server_name(
@@ -2133,6 +2190,7 @@ int avahi_server_add_dns_server_name(
     AvahiSEntryGroup *g,
     AvahiIfIndex interface,
     AvahiProtocol protocol,
+    AvahiPublishFlags flags,
     const char *domain,
     AvahiDNSServerType type,
     const char *name,
@@ -2144,8 +2202,16 @@ int avahi_server_add_dns_server_name(
     
     assert(s);
     assert(name);
-    assert(type == AVAHI_DNS_SERVER_UPDATE || type == AVAHI_DNS_SERVER_RESOLVE);
 
+    if (!AVAHI_IF_VALID(interface))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_INTERFACE);
+
+    if (!AVAHI_PROTO_VALID(protocol))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PROTOCOL);
+
+    if (!AVAHI_FLAGS_VALID(flags, 0) || (type != AVAHI_DNS_SERVER_UPDATE && type != AVAHI_DNS_SERVER_RESOLVE))
+        return avahi_server_set_errno(s, AVAHI_ERR_INVALID_FLAGS);
+    
     if (port == 0)
         return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PORT);
 
@@ -2154,7 +2220,6 @@ int avahi_server_add_dns_server_name(
 
     if (domain && !avahi_is_valid_domain_name(domain))
         return avahi_server_set_errno(s, AVAHI_ERR_INVALID_DOMAIN_NAME);
-
     
     if (!domain)
         domain = s->domain_name;
@@ -2178,7 +2243,7 @@ int avahi_server_add_dns_server_name(
     r->data.srv.weight = 0;
     r->data.srv.port = port;
     r->data.srv.name = n;
-    ret = avahi_server_add(s, g, interface, protocol, AVAHI_ENTRY_NULL, r);
+    ret = avahi_server_add(s, g, interface, protocol, AVAHI_PUBLISH_NULL, r);
     avahi_record_unref(r);
 
     return ret;
index 600e4422972ab0c03ed3b85e4f0b81809bf9a51e..3e439f97f178796764199a1a6e31bc921c421671 100644 (file)
@@ -42,6 +42,8 @@ typedef struct AvahiEntry AvahiEntry;
 
 #define AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS 100
 
+#define AVAHI_FLAGS_VALID(flags, max) (!((flags) & ~(max)))
+
 typedef struct AvahiLegacyUnicastReflectSlot AvahiLegacyUnicastReflectSlot;
 
 struct AvahiLegacyUnicastReflectSlot {
@@ -61,7 +63,7 @@ struct AvahiEntry {
 
     int dead;
     
-    AvahiEntryFlags flags;
+    AvahiPublishFlags flags;
     AvahiRecord *record;
     AvahiIfIndex interface;
     AvahiProtocol protocol;
index 5d6afa7808884188dffe02095f801230a90ed518..61a6e9ce453a690589f5fca3a819d922b9e92b71 100644 (file)
@@ -21,7 +21,7 @@
       <arg name="aprotocol" type="i" direction="out"/>
       <arg name="address" type="s" direction="out"/>
       <arg name="name" type="s" direction="out"/>
-      <arg name="flags" type="i" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
     </signal>
 
     <signal name="Timeout"/>
index 3da9e00a08f2e0b72612661ac12712d106c17b54..85e7e73eaf2522354af938cba4935ae7f840ba45 100644 (file)
       <arg name="interface" type="i"/>
       <arg name="protocol" type="i"/>
       <arg name="domain" type="s"/>
-      <arg name="flags" type="i"/>
+      <arg name="flags" type="u"/>
     </signal>
 
     <signal name="ItemRemove">
       <arg name="interface" type="i"/>
       <arg name="protocol" type="i"/>
       <arg name="domain" type="s"/>
-      <arg name="flags" type="i"/>
+      <arg name="flags" type="u"/>
     </signal>
 
     <signal name="Failure"/>
index 40ddf3a380ea1328bb20c295ff6a2c4179b8252e..51cddf675f5531c497ee00b2553115118ac564eb 100644 (file)
@@ -30,6 +30,7 @@
     <method name="AddService">
       <arg name="interface" type="i" direction="in"/>
       <arg name="protocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
       <arg name="name" type="s" direction="in"/>
       <arg name="type" type="s" direction="in"/>
       <arg name="domain" type="s" direction="in"/>
@@ -41,6 +42,7 @@
     <method name="AddAddress">
       <arg name="interface" type="i" direction="in"/>
       <arg name="protocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
       <arg name="name" type="s" direction="in"/>
       <arg name="address" type="s" direction="in"/>
     </method>
index 2484100c441bb6240c51c0bb3a8f89850fd21738..d3337f9fbeafd7dccc9ef68dbd287cfcdcc7b6d7 100644 (file)
@@ -21,7 +21,7 @@
       <arg name="name" type="s" direction="out"/>
       <arg name="aprotocol" type="i" direction="out"/>
       <arg name="address" type="s" direction="out"/>
-      <arg name="flags" type="i" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
     </signal>
 
     <signal name="Timeout"/>
index cb4616cb3b5f9f8f6596ec0961aecb0510ab3ee8..5d5e8623ba1b78ce0f03f65134717f0898a43409 100644 (file)
       <arg name="protocol" type="i" direction="in"/>
       <arg name="name" type="s" direction="in"/>
       <arg name="aprotocol" type="i" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="interface" type="i" direction="out"/>
       <arg name="protocol" type="i" direction="out"/>
       <arg name="name" type="s" direction="out"/>
       <arg name="aprotocol" type="i" direction="out"/>
       <arg name="address" type="s" direction="out"/>
-      <arg name="flags" type="i" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
     </method>
 
     <method name="ResolveAddress">
       <arg name="interface" type="i" direction="in"/>
       <arg name="protocol" type="i" direction="in"/>
       <arg name="address" type="s" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="interface" type="i" direction="out"/>
       <arg name="protocol" type="i" direction="out"/>
       <arg name="aprotocol" type="i" direction="out"/>
       <arg name="address" type="s" direction="out"/>
       <arg name="name" type="s" direction="out"/>
-      <arg name="flags" type="i" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
     </method>
 
     <method name="ResolveService">
@@ -92,7 +92,7 @@
       <arg name="type" type="s" direction="in"/>
       <arg name="domain" type="s" direction="in"/>
       <arg name="aprotocol" type="i" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="interface" type="i" direction="out"/>
       <arg name="protocol" type="i" direction="out"/>
       <arg name="address" type="s" direction="out"/>
       <arg name="port" type="q" direction="out"/>
       <arg name="txt" type="aay" direction="out"/>
-      <arg name="flags" type="i" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
     </method>
 
     <method name="IsServiceLocal">
       <arg name="protocol" type="i" direction="in"/>
       <arg name="domain" type="s" direction="in"/>
       <arg name="btype" type="i" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="path" type="o" direction="out"/>
     </method>
       <arg name="interface" type="i" direction="in"/>
       <arg name="protocol" type="i" direction="in"/>
       <arg name="domain" type="s" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="path" type="o" direction="out"/>
     </method>
       <arg name="protocol" type="i" direction="in"/>
       <arg name="type" type="s" direction="in"/>
       <arg name="domain" type="s" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="path" type="o" direction="out"/>
     </method>
       <arg name="type" type="s" direction="in"/>
       <arg name="domain" type="s" direction="in"/>
       <arg name="aprotocol" type="i" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="path" type="o" direction="out"/>
     </method>
       <arg name="protocol" type="i" direction="in"/>
       <arg name="name" type="s" direction="in"/>
       <arg name="aprotocol" type="i" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="path" type="o" direction="out"/>
     </method>
       <arg name="interface" type="i" direction="in"/>
       <arg name="protocol" type="i" direction="in"/>
       <arg name="address" type="s" direction="in"/>
-      <arg name="flags" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
 
       <arg name="path" type="o" direction="out"/>
     </method>
index abb065d8577f7f9de020edd3cdab3cffe95822fc..350026d06f234960d7df97c236571195e2038c81 100644 (file)
@@ -21,7 +21,7 @@
       <arg name="name" type="s"/>
       <arg name="type" type="s"/>
       <arg name="domain" type="s"/>
-      <arg name="flags" type="i"/>
+      <arg name="flags" type="u"/>
     </signal>
 
     <signal name="ItemRemove">
@@ -30,7 +30,7 @@
       <arg name="name" type="s"/>
       <arg name="type" type="s"/>
       <arg name="domain" type="s"/>
-      <arg name="flags" type="i"/>
+      <arg name="flags" type="u"/>
     </signal>
 
     <signal name="Failure"/>
index 8d00983f5d8974394a67e432ec14d793a0dd7210..7b752e3b8aa594fdece790f16a2e7da0e8bf252f 100644 (file)
@@ -26,7 +26,7 @@
       <arg name="address" type="s" direction="out"/>
       <arg name="port" type="q" direction="out"/>
       <arg name="txt" type="aay" direction="out"/>
-      <arg name="flags" type="i" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
     </signal>
 
     <signal name="Timeout"/>
index 7e080d611f99edf56326e44088db950e63da2f32..1540a8f36378eec24b2fddf3acf071b05bcc0f3d 100644 (file)
@@ -20,7 +20,7 @@
       <arg name="protocol" type="i"/>
       <arg name="type" type="s"/>
       <arg name="domain" type="s"/>
-      <arg name="flags" type="i"/>
+      <arg name="flags" type="u"/>
     </signal>
 
     <signal name="ItemRemove">
@@ -28,7 +28,7 @@
       <arg name="protocol" type="i"/>
       <arg name="type" type="s"/>
       <arg name="domain" type="s"/>
-      <arg name="flags" type="i"/>
+      <arg name="flags" type="u"/>
     </signal>
 
     <signal name="Failure"/>
index e5b099883474bac19573ccab28f7d86ba7cbc22a..9270168a448e4125793a21654bb87dace657e340 100644 (file)
@@ -786,6 +786,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
         
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddService")) {
         int32_t interface, protocol;
+        uint32_t flags;
         char *type, *name, *domain, *host;
         uint16_t port;
         AvahiStringList *strlst;
@@ -796,6 +797,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
                 DBUS_TYPE_INT32, &protocol,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_STRING, &name,
                 DBUS_TYPE_STRING, &type,
                 DBUS_TYPE_STRING, &domain,
@@ -808,7 +810,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
 
         dbus_message_iter_init(m, &iter);
 
-        for (j = 0; j < 7; j++)
+        for (j = 0; j < 8; j++)
             dbus_message_iter_next(&iter);
         
         if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
@@ -854,7 +856,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
         if (host && !*host)
             host = NULL;
 
-        if (avahi_server_add_service_strlst(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, name, type, domain, host, port, strlst) < 0) {
+        if (avahi_server_add_service_strlst(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, type, domain, host, port, strlst) < 0) {
             avahi_string_list_free(strlst);
             return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
         } else
@@ -866,6 +868,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
         
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddAddress")) {
         int32_t interface, protocol;
+        uint32_t flags;
         char *name, *address;
         AvahiAddress a;
         
@@ -873,6 +876,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
                 DBUS_TYPE_INT32, &protocol,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_STRING, &name,
                 DBUS_TYPE_STRING, &address,
                 DBUS_TYPE_INVALID) || !name || !address) {
@@ -889,7 +893,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
             return respond_error(c, m, AVAHI_ERR_INVALID_ADDRESS, NULL);
         }
 
-        if (avahi_server_add_address(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, 0, name, &a) < 0)
+        if (avahi_server_add_address(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, &a) < 0)
             return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
         else
             i->n_entries ++;
@@ -915,7 +919,8 @@ static void sync_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfI
 
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[256], *pt = t;
-        int32_t i_interface, i_protocol, i_aprotocol, i_flags;
+        int32_t i_interface, i_protocol, i_aprotocol;
+        uint32_t u_flags;
         DBusMessage *reply;
 
         assert(a);
@@ -924,7 +929,7 @@ static void sync_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfI
         i_interface = (int32_t) interface;
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) a->proto;
-        i_flags = (int32_t) flags;
+        u_flags = (uint32_t) flags;
         
         reply = dbus_message_new_method_return(i->message);
         dbus_message_append_args(
@@ -934,7 +939,7 @@ static void sync_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfI
             DBUS_TYPE_STRING, &host_name,
             DBUS_TYPE_INT32, &i_aprotocol,
             DBUS_TYPE_STRING, &pt,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
 
         dbus_connection_send(server->bus, reply, NULL);
@@ -954,7 +959,8 @@ static void sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInde
 
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[256], *pt = t;
-        int32_t i_interface, i_protocol, i_aprotocol, i_flags;
+        int32_t i_interface, i_protocol, i_aprotocol;
+        uint32_t u_flags;
         DBusMessage *reply;
 
         assert(host_name);
@@ -963,7 +969,7 @@ static void sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInde
         i_interface = (int32_t) interface;
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) address->proto;
-        i_flags = (int32_t) flags;
+        u_flags = (uint32_t) flags;
         
         reply = dbus_message_new_method_return(i->message);
         dbus_message_append_args(
@@ -973,7 +979,7 @@ static void sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInde
             DBUS_TYPE_INT32, &i_aprotocol,
             DBUS_TYPE_STRING, &pt,
             DBUS_TYPE_STRING, &host_name,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
 
         dbus_connection_send(server->bus, reply, NULL);
@@ -1031,14 +1037,15 @@ fail:
 static void domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, AvahiLookupResultFlags flags,  void* userdata) {
     DomainBrowserInfo *i = userdata;
     DBusMessage *m;
-    int32_t i_interface, i_protocol, i_flags;
+    int32_t i_interface, i_protocol;
+    uint32_t u_flags;
     
     assert(b);
     assert(i);
 
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_DOMAIN_BROWSER, map_browse_signal_name(event));
 
@@ -1049,7 +1056,7 @@ static void domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex interfa
             DBUS_TYPE_INT32, &i_interface,
             DBUS_TYPE_INT32, &i_protocol,
             DBUS_TYPE_STRING, &domain,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
     }
     
@@ -1105,14 +1112,15 @@ fail:
 static void service_type_browser_callback(AvahiSServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *type, const char *domain, AvahiLookupResultFlags flags, void* userdata) {
     ServiceTypeBrowserInfo *i = userdata;
     DBusMessage *m;
-    int32_t i_interface, i_protocol, i_flags;
+    int32_t i_interface, i_protocol;
+    uint32_t u_flags;
     
     assert(b);
     assert(i);
 
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER, map_browse_signal_name(event));
 
@@ -1125,7 +1133,7 @@ static void service_type_browser_callback(AvahiSServiceTypeBrowser *b, AvahiIfIn
             DBUS_TYPE_INT32, &i_protocol,
             DBUS_TYPE_STRING, &type,
             DBUS_TYPE_STRING, &domain,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
     }
         
@@ -1181,14 +1189,15 @@ fail:
 static void service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void* userdata) {
     ServiceBrowserInfo *i = userdata;
     DBusMessage *m;
-    int32_t i_interface, i_protocol, i_flags;
+    int32_t i_interface, i_protocol;
+    uint32_t u_flags;
     
     assert(b);
     assert(i);
 
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
-    i_flags = (int32_t) flags;
+    u_flags = (uint32_t) flags;
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_BROWSER, map_browse_signal_name(event));
 
@@ -1204,7 +1213,7 @@ static void service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex inter
             DBUS_TYPE_STRING, &name,
             DBUS_TYPE_STRING, &type,
             DBUS_TYPE_STRING, &domain,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
     }
     
@@ -1256,7 +1265,8 @@ static void sync_service_resolver_callback(
 
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[256], *pt = t;
-        int32_t i_interface, i_protocol, i_aprotocol, i_flags;
+        int32_t i_interface, i_protocol, i_aprotocol;
+        uint32_t u_flags;
         DBusMessage *reply;
     
         assert(host_name);
@@ -1270,7 +1280,7 @@ static void sync_service_resolver_callback(
         i_interface = (int32_t) interface;
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) a->proto;
-        i_flags = (int32_t) flags;
+        u_flags = (uint32_t) flags;
 
         reply = dbus_message_new_method_return(i->message);
         dbus_message_append_args(
@@ -1290,7 +1300,7 @@ static void sync_service_resolver_callback(
                 
         dbus_message_append_args(
             reply,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
 
         dbus_connection_send(server->bus, reply, NULL);
@@ -1312,7 +1322,8 @@ static void async_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInd
     
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[256], *pt = t;
-        int32_t i_interface, i_protocol, i_aprotocol, i_flags;
+        int32_t i_interface, i_protocol, i_aprotocol;
+        uint32_t u_flags;
 
         assert(address);
         assert(host_name);
@@ -1321,7 +1332,7 @@ static void async_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInd
         i_interface = (int32_t) interface;
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) address->proto;
-        i_flags = (int32_t) flags;
+        u_flags = (uint32_t) flags;
         
         dbus_message_append_args(
             reply,
@@ -1330,7 +1341,7 @@ static void async_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfInd
             DBUS_TYPE_INT32, &i_aprotocol,
             DBUS_TYPE_STRING, &pt,
             DBUS_TYPE_STRING, &host_name,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
 
     }
@@ -1395,7 +1406,8 @@ static void async_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIf
     
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[256], *pt = t;
-        int32_t i_interface, i_protocol, i_aprotocol, i_flags;
+        int32_t i_interface, i_protocol, i_aprotocol;
+        uint32_t u_flags;
 
         assert(a);
         assert(host_name);
@@ -1404,7 +1416,7 @@ static void async_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIf
         i_interface = (int32_t) interface;
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) a->proto;
-        i_flags = (int32_t) flags;
+        u_flags = (uint32_t) flags;
         
         dbus_message_append_args(
             reply,
@@ -1413,7 +1425,7 @@ static void async_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIf
             DBUS_TYPE_STRING, &host_name,
             DBUS_TYPE_INT32, &i_aprotocol,
             DBUS_TYPE_STRING, &pt,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
     }
 
@@ -1490,7 +1502,8 @@ static void async_service_resolver_callback(
     
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[256], *pt = t;
-        int32_t i_interface, i_protocol, i_aprotocol, i_flags;
+        int32_t i_interface, i_protocol, i_aprotocol;
+        uint32_t u_flags;
     
         assert(host_name);
 
@@ -1505,7 +1518,7 @@ static void async_service_resolver_callback(
         i_interface = (int32_t) interface;
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) a->proto;
-        i_flags = (int32_t) flags;
+        u_flags = (uint32_t) flags;
 
         dbus_message_append_args(
             reply,
@@ -1524,7 +1537,7 @@ static void async_service_resolver_callback(
 
         dbus_message_append_args(
             reply,
-            DBUS_TYPE_INT32, &i_flags,
+            DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
     }
 
@@ -1811,7 +1824,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
         
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveHostName")) {
         Client *client;
-        int32_t interface, protocol, aprotocol, flags;
+        int32_t interface, protocol, aprotocol;
+        uint32_t flags;
         char *name;
         SyncHostNameResolverInfo *i;
             
@@ -1821,7 +1835,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &name,
                 DBUS_TYPE_INT32, &aprotocol,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) || !name) {
             avahi_log_warn("Error parsing Server::ResolveHostName message");
             goto fail;
@@ -1852,7 +1866,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
         
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveAddress")) {
         Client *client;
-        int32_t interface, protocol, flags;
+        int32_t interface, protocol;
+        uint32_t flags;
         char *address;
         SyncAddressResolverInfo *i;
         AvahiAddress a;
@@ -1862,7 +1877,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_INT32, &interface,
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &address,
-                DBUS_TYPE_INT32, &flags, 
+                DBUS_TYPE_UINT32, &flags, 
                 DBUS_TYPE_INVALID) || !address) {
             avahi_log_warn("Error parsing Server::ResolveAddress message");
             goto fail;
@@ -1905,7 +1920,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
             NULL,
             NULL
         };
-        int32_t interface, protocol, type, flags;
+        int32_t interface, protocol, type;
+        uint32_t flags;
         char *domain;
         
         if (!dbus_message_get_args(
@@ -1914,7 +1930,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &domain,
                 DBUS_TYPE_INT32, &type,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) || type < 0 || type >= AVAHI_DOMAIN_BROWSER_MAX) {
             avahi_log_warn("Error parsing Server::DomainBrowserNew message");
             goto fail;
@@ -1959,7 +1975,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
             NULL,
             NULL
         };
-        int32_t interface, protocol, flags;
+        int32_t interface, protocol;
+        uint32_t flags;
         char *domain;
         
         if (!dbus_message_get_args(
@@ -1967,7 +1984,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_INT32, &interface,
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &domain,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID)) {
             avahi_log_warn("Error parsing Server::ServiceTypeBrowserNew message");
             goto fail;
@@ -2013,7 +2030,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
             NULL,
             NULL
         };
-        int32_t interface, protocol, flags;
+        int32_t interface, protocol;
+        uint32_t flags;
         char *domain, *type;
         
         if (!dbus_message_get_args(
@@ -2022,7 +2040,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &type,
                 DBUS_TYPE_STRING, &domain,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) || !type) {
             avahi_log_warn("Error parsing Server::ServiceBrowserNew message");
             goto fail;
@@ -2059,7 +2077,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
         
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveService")) {
         Client *client;
-        int32_t interface, protocol, aprotocol, flags;
+        int32_t interface, protocol, aprotocol;
+        uint32_t flags;
         char *name, *type, *domain;
         SyncServiceResolverInfo *i;
             
@@ -2071,7 +2090,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_STRING, &type,
                 DBUS_TYPE_STRING, &domain,
                 DBUS_TYPE_INT32, &aprotocol,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) || !type) {
             avahi_log_warn("Error parsing Server::ResolveService message");
             goto fail;
@@ -2108,7 +2127,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
         
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ServiceResolverNew")) {
         Client *client;
-        int32_t interface, protocol, aprotocol, flags;
+        int32_t interface, protocol, aprotocol;
+        uint32_t flags;
         char *name, *type, *domain;
         AsyncServiceResolverInfo *i;
         static const DBusObjectPathVTable vtable = {
@@ -2128,7 +2148,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_STRING, &type,
                 DBUS_TYPE_STRING, &domain,
                 DBUS_TYPE_INT32, &aprotocol,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) || !type) {
             avahi_log_warn("Error parsing Server::ServiceResolverNew message");
             goto fail;
@@ -2169,7 +2189,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
 
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "HostNameResolverNew")) {
         Client *client;
-        int32_t interface, protocol, aprotocol, flags;
+        int32_t interface, protocol, aprotocol;
+        uint32_t flags;
         char *name;
         AsyncHostNameResolverInfo *i;
         static const DBusObjectPathVTable vtable = {
@@ -2187,7 +2208,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &name,
                 DBUS_TYPE_INT32, &aprotocol,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) || !name) {
             avahi_log_warn("Error parsing Server::HostNameResolverNew message");
             goto fail;
@@ -2220,7 +2241,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
 
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "AddressResolverNew")) {
         Client *client;
-        int32_t interface, protocol, flags;
+        int32_t interface, protocol;
+        uint32_t flags;
         char *address;
         AsyncAddressResolverInfo *i;
         AvahiAddress a;
@@ -2238,7 +2260,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
                 DBUS_TYPE_INT32, &interface,
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &address,
-                DBUS_TYPE_INT32, &flags,
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) || !address) {
             avahi_log_warn("Error parsing Server::AddressResolverNew message");
             goto fail;
index 07d71272868560f57e2cce9b42c01c2418ee09a8..de74178d7079b55ad71fe6aa026fa01ccdf52a17 100644 (file)
@@ -178,7 +178,7 @@ static AvahiSEntryGroup* add_dns_servers(AvahiServer *s, AvahiSEntryGroup* g, ch
         if (!avahi_address_parse(*p, AVAHI_PROTO_UNSPEC, &a))
             avahi_log_warn("Failed to parse address '%s', ignoring.", *p);
         else
-            if (avahi_server_add_dns_server_address(s, g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, &a, 53) < 0) {
+            if (avahi_server_add_dns_server_address(s, g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, NULL, AVAHI_DNS_SERVER_RESOLVE, &a, 53) < 0) {
                 avahi_s_entry_group_free(g);
                 avahi_log_error("Failed to add DNS server address: %s", avahi_strerror(avahi_server_errno(s)));
                 return NULL;
index e459bbca051467616c2775cc9855f9f4cf4a6baf..09777cca847224808f06e21f021a7a8f6161a5d0 100644 (file)
@@ -221,7 +221,8 @@ static void add_static_service_group_to_server(StaticServiceGroup *g) {
         if (avahi_server_add_service_strlst(
                 avahi_server,
                 g->entry_group,
-                -1, s->protocol,
+                AVAHI_IF_UNSPEC, s->protocol,
+                0, 
                 g->chosen_name, s->type, 
                 s->domain_name, s->host_name, s->port,
                 s->txt_records) < 0) {
index 9b12f5c73636b3055654807804a5b03d622069c0..c3f11added056dba099252a141b9055ad93fa3e2 100644 (file)
@@ -83,13 +83,13 @@ static void create_services(AvahiClient *c) {
     snprintf(r, sizeof(r), "random=%i", rand());
 
     /* Add the service for IPP */
-    if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, name, "_ipp._tcp", NULL, NULL, 651, "test=blah", r, NULL)) < 0) {
+    if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_ipp._tcp", NULL, NULL, 651, "test=blah", r, NULL)) < 0) {
         fprintf(stderr, "Failed to add _ipp._tcp service: %s\n", avahi_strerror(ret));
         goto fail;
     }
 
     /* Add the same service for BSD LPR */
-    if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
+    if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
         fprintf(stderr, "Failed to add _printer._tcp service: %s\n", avahi_strerror(ret));
         goto fail;
     }
index 67f88dbac144580717b39b2e3596e5b4032dd540..62badf39091437b09aecbbb6610afe70e02655a1 100644 (file)
@@ -85,13 +85,13 @@ static void create_services(AvahiServer *s) {
     snprintf(r, sizeof(r), "random=%i", rand());
 
     /* Add the service for IPP */
-    if ((ret = avahi_server_add_service(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, name, "_ipp._tcp", NULL, NULL, 651, "test=blah", r, NULL)) < 0) {
+    if ((ret = avahi_server_add_service(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_ipp._tcp", NULL, NULL, 651, "test=blah", r, NULL)) < 0) {
         fprintf(stderr, "Failed to add _ipp._tcp service: %s\n", avahi_strerror(ret));
         goto fail;
     }
 
     /* Add the same service for BSD LPR */
-    if ((ret = avahi_server_add_service(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
+    if ((ret = avahi_server_add_service(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
         fprintf(stderr, "Failed to add _printer._tcp service: %s\n", avahi_strerror(ret));
         goto fail;
     }