]> git.meshlink.io Git - catta/commitdiff
add an example for subtype usage
authorLennart Poettering <lennart@poettering.net>
Tue, 11 Oct 2005 01:24:53 +0000 (01:24 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 11 Oct 2005 01:24:53 +0000 (01:24 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@722 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

examples/client-publish-service.c

index c3f11added056dba099252a141b9055ad93fa3e2..efc1f2b90ecbfec3c9d50adac6b7845617e82876 100644 (file)
@@ -94,6 +94,12 @@ static void create_services(AvahiClient *c) {
         goto fail;
     }
 
+    /* Add an additional (hypothetic) subtype */
+    if ((ret = avahi_entry_group_add_service_subtype(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, "_magic._sub._printer._tcp") < 0)) {
+        fprintf(stderr, "Failed to add subtype _magic._sub._printer._tcp: %s\n", avahi_strerror(ret));
+        goto fail;
+    }
+    
     /* Tell the server to register the service */
     if ((ret = avahi_entry_group_commit(group)) < 0) {
         fprintf(stderr, "Failed to commit entry_group: %s\n", avahi_strerror(ret));