summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-10-11 01:24:53 +0000
committerLennart Poettering <lennart@poettering.net>2005-10-11 01:24:53 +0000
commit6daf938592d243f52281a6933f2ed04af937fc1f (patch)
treeea1efccc776fb4659285e867e47d8e28a08ddc0f /examples
parentb49d175f13f77dfb4de0367cae9ac4b12dbec32e (diff)
add an example for subtype usage
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@722 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'examples')
-rw-r--r--examples/client-publish-service.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/client-publish-service.c b/examples/client-publish-service.c
index c3f11ad..efc1f2b 100644
--- a/examples/client-publish-service.c
+++ b/examples/client-publish-service.c
@@ -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));