assert(s);
assert(r);
+ AVAHI_CHECK_VALIDITY_RETURN_NULL(s, s->state != AVAHI_SERVER_FAILURE && s->state != AVAHI_SERVER_INVALID, AVAHI_ERR_BAD_STATE);
AVAHI_CHECK_VALIDITY_RETURN_NULL(s, AVAHI_IF_VALID(interface), AVAHI_ERR_INVALID_INTERFACE);
AVAHI_CHECK_VALIDITY_RETURN_NULL(s, AVAHI_PROTO_VALID(protocol), AVAHI_ERR_INVALID_PROTOCOL);
AVAHI_CHECK_VALIDITY_RETURN_NULL(s, AVAHI_FLAGS_VALID(
transport_flags_from_domain(s, &flags, r->key->name);
AVAHI_CHECK_VALIDITY_RETURN_NULL(s, flags & AVAHI_PUBLISH_USE_MULTICAST, AVAHI_ERR_NOT_SUPPORTED);
AVAHI_CHECK_VALIDITY_RETURN_NULL(s, !s->config.disable_publishing, AVAHI_ERR_NOT_PERMITTED);
+ AVAHI_CHECK_VALIDITY_RETURN_NULL(s, !g || (g->state != AVAHI_ENTRY_GROUP_ESTABLISHED && g->state != AVAHI_ENTRY_GROUP_REGISTERING), AVAHI_ERR_BAD_STATE);
if (flags & AVAHI_PUBLISH_UPDATE) {
AvahiRecord *old_record;
char t[AVAHI_ADDRESS_STR_MAX];
avahi_address_snprint(t, sizeof(t), &a->address);
- avahi_log_info("Registering new address %s on %s.", t, a->interface->hardware->name);
+ avahi_log_info("Registering new address record for %s on %s.", t, a->interface->hardware->name);
if (avahi_server_add_address(m->server, a->entry_group, a->interface->hardware->index, a->interface->protocol, 0, NULL, &a->address) < 0) {
avahi_log_warn(__FILE__": avahi_server_add_address() failed: %s", avahi_strerror(m->server->error));
m->server->state == AVAHI_SERVER_REGISTERING)
avahi_server_decrease_host_rr_pending(m->server);
- avahi_log_info("Withdrawing address %s on %s.", t, a->interface->hardware->name);
+ avahi_log_info("Withdrawing address record for %s on %s.", t, a->interface->hardware->name);
avahi_s_entry_group_reset(a->entry_group);
}
i->local_mcast_address = a->address;
}
- avahi_log_info("%s mDNS multicast group on interface %s.%s with address %s",
+ avahi_log_info("%s mDNS multicast group on interface %s.%s with address %s.",
join ? "Joining" : "Leaving",
i->hardware->name,
avahi_proto_to_string(i->protocol),
b = avahi_interface_is_relevant(i);
if (m->list_complete && b && !i->announcing) {
- avahi_log_info("New relevant interface %s.%s.", i->hardware->name, avahi_proto_to_string(i->protocol));
+ avahi_log_info("New relevant interface %s.%s for mDNS.", i->hardware->name, avahi_proto_to_string(i->protocol));
interface_mdns_mcast_join(i, 1);
avahi_announce_interface(m->server, i);
avahi_multicast_lookup_engine_new_interface(m->server->multicast_lookup_engine, i);
} else if (!b && i->announcing) {
- avahi_log_info("Interface %s.%s no longer relevant.", i->hardware->name, avahi_proto_to_string(i->protocol));
+ avahi_log_info("Interface %s.%s no longer relevant for mDNS.", i->hardware->name, avahi_proto_to_string(i->protocol));
interface_mdns_mcast_join(i, 0);
r->data.hinfo.cpu = avahi_strdup(avahi_strup(utsname.machine));
r->data.hinfo.os = avahi_strdup(avahi_strup(utsname.sysname));
- avahi_log_info("Adding HINFO record with values '%s/%s'", r->data.hinfo.cpu, r->data.hinfo.os);
+ avahi_log_info("Registering HINFO record with values '%s'/'%s'.", r->data.hinfo.cpu, r->data.hinfo.os);
if (avahi_server_add(s, s->hinfo_entry_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_PUBLISH_UNIQUE, r) < 0) {
avahi_log_warn("Failed to add HINFO RR: %s", avahi_strerror(s->error));