- if ((ret = avahi_server_add_service(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
- fprintf(stderr, "Failed to add _printer._tcp service: %s\n", avahi_strerror(ret));
+ if ((ret = catta_server_add_service(s, group, CATTA_IF_UNSPEC, CATTA_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
+ fprintf(stderr, "Failed to add _printer._tcp service: %s\n", catta_strerror(ret));
+ goto fail;
+ }
+
+ /* Add an additional (hypothetic) subtype */
+ if ((ret = catta_server_add_service_subtype(s, group, CATTA_IF_UNSPEC, CATTA_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, "_magic._sub._printer._tcp") < 0)) {
+ fprintf(stderr, "Failed to add subtype _magic._sub._printer._tcp: %s\n", catta_strerror(ret));