X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=examples%2Fcore-publish-service.c;h=f826a5f4e7a43e88d6e6f0057a3c0036b6964800;hb=feae35a24a8d234ae5a4eb629cd09c905f74dc04;hp=62badf39091437b09aecbbb6610afe70e02655a1;hpb=424aefe8a431b79496672799dc4f4430fa935252;p=catta diff --git a/examples/core-publish-service.c b/examples/core-publish-service.c index 62badf3..f826a5f 100644 --- a/examples/core-publish-service.c +++ b/examples/core-publish-service.c @@ -96,6 +96,12 @@ static void create_services(AvahiServer *s) { goto fail; } + /* Add an additional (hypothetic) subtype */ + if ((ret = avahi_server_add_service_subtype(s, 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_s_entry_group_commit(group)) < 0) { fprintf(stderr, "Failed to commit entry_group: %s\n", avahi_strerror(ret));