summaryrefslogtreecommitdiffstats
path: root/avahi-compat-libdns_sd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-10-11 01:30:57 +0000
committerLennart Poettering <lennart@poettering.net>2005-10-11 01:30:57 +0000
commit1adbc218354388dd59c68267c363d2fbcc75eaad (patch)
tree610c24773c2d251645a2cc1861f4ac3e279246f7 /avahi-compat-libdns_sd
parent6daf938592d243f52281a6933f2ed04af937fc1f (diff)
add subtype support to compat-libdns_sd
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@723 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-compat-libdns_sd')
-rw-r--r--avahi-compat-libdns_sd/compat.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c
index e09099d..02c04ee 100644
--- a/avahi-compat-libdns_sd/compat.c
+++ b/avahi-compat-libdns_sd/compat.c
@@ -805,22 +805,43 @@ static void reg_report_error(DNSServiceRef sdref, DNSServiceErrorType error) {
static int reg_create_service(DNSServiceRef sdref) {
int ret;
+ const char *real_type;
+
assert(sdref);
assert(sdref->n_ref >= 1);
+ real_type = avahi_get_type_from_subtype(sdref->service_regtype);
+
if ((ret = avahi_entry_group_add_service_strlst(
sdref->entry_group,
sdref->service_interface,
AVAHI_PROTO_UNSPEC,
0,
sdref->service_name_chosen,
- sdref->service_regtype,
+ real_type ? real_type : sdref->service_regtype,
sdref->service_domain,
sdref->service_host,
sdref->service_port,
sdref->service_txt)) < 0)
return ret;
+
+ if (real_type) {
+ /* Create a subtype entry */
+
+ if (avahi_entry_group_add_service_subtype(
+ sdref->entry_group,
+ sdref->service_interface,
+ AVAHI_PROTO_UNSPEC,
+ 0,
+ sdref->service_name_chosen,
+ real_type,
+ sdref->service_domain,
+ sdref->service_regtype) < 0)
+ return ret;
+
+ }
+
if ((ret = avahi_entry_group_commit(sdref->entry_group)) < 0)
return ret;