<arg name="txt" type="aay" direction="in"/>
</method>
+ <method name="AddServiceSubtype">
+ <arg name="interface" type="i" direction="in"/>
+ <arg name="protocol" type="i" direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ <arg name="name" type="s" direction="in"/>
+ <arg name="type" type="s" direction="in"/>
+ <arg name="domain" type="s" direction="in"/>
+ <arg name="subtype" type="s" direction="in"/>
+ </method>
+
<method name="AddAddress">
<arg name="interface" type="i" direction="in"/>
<arg name="protocol" type="i" direction="in"/>
if (avahi_server_add_service_strlst(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, type, domain, host, port, strlst) < 0) {
avahi_string_list_free(strlst);
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
- } else
- i->n_entries ++;
-
+ }
+
+ i->n_entries ++;
avahi_string_list_free(strlst);
return respond_ok(c, m);
+ } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddServiceSubtype")) {
+
+ int32_t interface, protocol;
+ uint32_t flags;
+ char *type, *name, *domain, *subtype;
+
+ if (!dbus_message_get_args(
+ m, &error,
+ DBUS_TYPE_INT32, &interface,
+ DBUS_TYPE_INT32, &protocol,
+ DBUS_TYPE_UINT32, &flags,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_STRING, &type,
+ DBUS_TYPE_STRING, &domain,
+ DBUS_TYPE_STRING, &subtype,
+ DBUS_TYPE_INVALID) || !type || !name || !subtype) {
+ avahi_log_warn("Error parsing EntryGroup::AddServiceSubtype message");
+ goto fail;
+ }
+
+ if (i->n_entries >= MAX_ENTRIES_PER_ENTRY_GROUP) {
+ avahi_log_warn("Too many entries per entry group, client request failed.");
+ return respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
+ }
+
+ if (domain && !*domain)
+ domain = NULL;
+
+ if (avahi_server_add_service_subtype(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, type, domain, subtype) < 0)
+ return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
+
+ i->n_entries ++;
+
+ return respond_ok(c, m);
+
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddAddress")) {
int32_t interface, protocol;
uint32_t flags;
if (avahi_server_add_address(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, &a) < 0)
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
- else
- i->n_entries ++;
+
+ i->n_entries ++;
return respond_ok(c, m);
- }
+ }
avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));