avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
AVAHI_LLIST_REMOVE(EntryGroupInfo, entry_groups, i->client->entry_groups, i);
AVAHI_LLIST_REMOVE(EntryGroupInfo, entry_groups, i->client->entry_groups, i);
dbus_error_init(&error);
avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
dbus_error_init(&error);
avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Free")) {
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Free")) {
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
avahi_dbus_entry_group_free(i);
return avahi_dbus_respond_ok(c, m);
avahi_dbus_entry_group_free(i);
return avahi_dbus_respond_ok(c, m);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Commit")) {
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Commit")) {
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
- avahi_s_entry_group_commit(i->entry_group);
+ if (avahi_s_entry_group_commit(i->entry_group) < 0)
+ return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
+
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
avahi_log_warn("Error parsing EntryGroup::Reset message");
goto fail;
}
avahi_s_entry_group_reset(i->entry_group);
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
avahi_log_warn("Error parsing EntryGroup::Reset message");
goto fail;
}
avahi_s_entry_group_reset(i->entry_group);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "IsEmpty")) {
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "IsEmpty")) {
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "GetState")) {
AvahiEntryGroupState state;
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "GetState")) {
AvahiEntryGroupState state;
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
avahi_log_warn("Error parsing EntryGroup::GetState message");
goto fail;
if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
avahi_log_warn("Error parsing EntryGroup::GetState message");
goto fail;
state = avahi_s_entry_group_get_state(i->entry_group);
return avahi_dbus_respond_int32(c, m, (int32_t) state);
state = avahi_s_entry_group_get_state(i->entry_group);
return avahi_dbus_respond_int32(c, m, (int32_t) state);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddService")) {
int32_t interface, protocol;
uint32_t flags;
char *type, *name, *domain, *host;
uint16_t port;
AvahiStringList *strlst = NULL;
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddService")) {
int32_t interface, protocol;
uint32_t flags;
char *type, *name, *domain, *host;
uint16_t port;
AvahiStringList *strlst = NULL;
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
avahi_string_list_free(strlst);
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
}
avahi_string_list_free(strlst);
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
}
} 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;
} 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,
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
if (domain && !*domain)
domain = NULL;
return avahi_dbus_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)
+ if (avahi_server_add_service_subtype(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, type, domain, subtype) < 0)
return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
if (!(flags & AVAHI_PUBLISH_UPDATE))
i->n_entries ++;
return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
if (!(flags & AVAHI_PUBLISH_UPDATE))
i->n_entries ++;
return avahi_dbus_respond_ok(c, m);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "UpdateServiceTxt")) {
return avahi_dbus_respond_ok(c, m);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "UpdateServiceTxt")) {
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddAddress")) {
int32_t interface, protocol;
uint32_t flags;
char *name, *address;
AvahiAddress a;
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddAddress")) {
int32_t interface, protocol;
uint32_t flags;
char *name, *address;
AvahiAddress a;
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
if (!(avahi_address_parse(address, AVAHI_PROTO_UNSPEC, &a)))
return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_ADDRESS, NULL);
if (!(avahi_address_parse(address, AVAHI_PROTO_UNSPEC, &a)))
return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_ADDRESS, NULL);
return avahi_dbus_respond_ok(c, m);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddRecord")) {
int32_t interface, protocol;
return avahi_dbus_respond_ok(c, m);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddRecord")) {
int32_t interface, protocol;
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
if (!dbus_message_get_args(
m, &error,
DBUS_TYPE_INT32, &interface,
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
if (!avahi_is_valid_domain_name (name))
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
if (!avahi_is_valid_domain_name (name))
avahi_record_unref (r);
return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_RDATA, NULL);
}
avahi_record_unref (r);
return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_RDATA, NULL);
}
if (avahi_server_add(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, r) < 0) {
avahi_record_unref (r);
return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
if (avahi_server_add(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, r) < 0) {
avahi_record_unref (r);
return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
fail:
if (dbus_error_is_set(&error))
dbus_error_free(&error);
avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
fail:
if (dbus_error_is_set(&error))
dbus_error_free(&error);