/** Some flags for lookup callback functions */
typedef enum {
- AVAHI_LOOKUP_CALLBACK_NULL = 0,
- AVAHI_LOOKUP_CALLBACK_CACHED = 1, /**< This response originates from the cache */
- AVAHI_LOOKUP_CALLBACK_WIDE_AREA = 2, /**< This response originates from wide area DNS */
- AVAHI_LOOKUP_CALLBACK_MULTICAST = 4, /**< This response originates from multicast DNS */
+ AVAHI_LOOKUP_RESULT_NULL = 0,
+ AVAHI_LOOKUP_RESULT_CACHED = 1, /**< This response originates from the cache */
+ AVAHI_LOOKUP_RESULT_WIDE_AREA = 2, /**< This response originates from wide area DNS */
+ AVAHI_LOOKUP_RESULT_MULTICAST = 4, /**< This response originates from multicast DNS */
} AvahiLookupResultFlags;
/** Type of callback event when browsing */
b->callback(
b, b->interface, b->protocol, AVAHI_BROWSER_FAILURE, NULL,
- b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_CALLBACK_WIDE_AREA : AVAHI_LOOKUP_CALLBACK_MULTICAST,
+ b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_RESULT_WIDE_AREA : AVAHI_LOOKUP_RESULT_MULTICAST,
b->userdata);
avahi_s_record_browser_cancel(b);
/* Tell the client that we're done with the cache */
b->callback(
b, b->interface, b->protocol, AVAHI_BROWSER_CACHE_EXHAUSTED, NULL,
- b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_CALLBACK_WIDE_AREA : AVAHI_LOOKUP_CALLBACK_MULTICAST,
+ b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_RESULT_WIDE_AREA : AVAHI_LOOKUP_RESULT_MULTICAST,
b->userdata);
if (!b->dead && b->root_lookup && b->root_lookup->flags & AVAHI_LOOKUP_USE_WIDE_AREA && n > 0) {
* entries, we assume that it is complete, and tell the user
* so by firing ALL_FOR_NOW. */
- b->callback(b, b->interface, b->protocol, AVAHI_BROWSER_ALL_FOR_NOW, NULL, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, b->userdata);
+ b->callback(b, b->interface, b->protocol, AVAHI_BROWSER_ALL_FOR_NOW, NULL, AVAHI_LOOKUP_RESULT_WIDE_AREA, b->userdata);
}
}
avahi_time_event_free(l->all_for_now_event);
l->all_for_now_event = NULL;
- l->callback(l->engine, l->interface, l->protocol, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_CALLBACK_MULTICAST, NULL, l->userdata);
+ l->callback(l->engine, l->interface, l->protocol, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_RESULT_MULTICAST, NULL, l->userdata);
}
AvahiMulticastLookup *avahi_multicast_lookup_new(
cbdata->interface->hardware->index,
cbdata->interface->protocol,
AVAHI_BROWSER_NEW,
- AVAHI_LOOKUP_CALLBACK_CACHED|AVAHI_LOOKUP_CALLBACK_MULTICAST,
+ AVAHI_LOOKUP_RESULT_CACHED|AVAHI_LOOKUP_RESULT_MULTICAST,
e->record,
cbdata->userdata);
continue;
if (avahi_interface_match(i, l->interface, l->protocol))
- l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_CALLBACK_MULTICAST, record, l->userdata);
+ l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_RESULT_MULTICAST, record, l->userdata);
}
if ((key = avahi_key_new_cname(l->key))) {
if (avahi_key_equal(record->key, key))
- l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_CALLBACK_MULTICAST, record, l->userdata);
+ l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_RESULT_MULTICAST, record, l->userdata);
avahi_key_unref(key);
}
const char *domain,
AvahiLookupResultFlags flags,
void* userdata) {
- avahi_log_debug("SB%i: (%i.%s) <%s> as <%s> in <%s> [%s] cached=%i", b == service_browser1 ? 1 : 2, iface, avahi_proto_to_string(protocol), name, service_type, domain, browser_event_to_string(event), !!(flags & AVAHI_LOOKUP_CALLBACK_CACHED));
+ avahi_log_debug("SB%i: (%i.%s) <%s> as <%s> in <%s> [%s] cached=%i", b == service_browser1 ? 1 : 2, iface, avahi_proto_to_string(protocol), name, service_type, domain, browser_event_to_string(event), !!(flags & AVAHI_LOOKUP_RESULT_CACHED));
}
static void create_second_service_browser(AvahiTimeout *timeout, void* userdata) {
if (l->n_send >= 6) {
avahi_log_warn(__FILE__": Query timed out.");
- l->callback(l->engine, AVAHI_BROWSER_FAILURE, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, NULL, l->userdata);
+ l->callback(l->engine, AVAHI_BROWSER_FAILURE, AVAHI_LOOKUP_RESULT_WIDE_AREA, NULL, l->userdata);
avahi_wide_area_lookup_free(l);
return;
}
if (l->dead || !l->callback)
continue;
- l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, r, l->userdata);
+ l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA, r, l->userdata);
}
if (r->key->clazz == AVAHI_DNS_CLASS_IN && r->key->type == AVAHI_DNS_TYPE_CNAME) {
if ((key = avahi_key_new_cname(l->key))) {
if (avahi_key_equal(r->key, key))
- l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, r, l->userdata);
+ l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA, r, l->userdata);
avahi_key_unref(key);
}
/* Tell the user about the failure */
if (l->callback)
- l->callback(e, r == 3 ? AVAHI_BROWSER_NOT_FOUND : AVAHI_BROWSER_FAILURE, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, NULL, l->userdata);
+ l->callback(e, r == 3 ? AVAHI_BROWSER_NOT_FOUND : AVAHI_BROWSER_FAILURE, AVAHI_LOOKUP_RESULT_WIDE_AREA, NULL, l->userdata);
goto finish;
}
/** Inform the user that this is the last reply */
if (l->callback && !l->dead)
- l->callback(e, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, NULL, l->userdata);
+ l->callback(e, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_RESULT_WIDE_AREA, NULL, l->userdata);
finish:
if (l)
assert(callback);
for (c = avahi_hashmap_lookup(e->cache_by_key, key); c; c = c->by_key_next) {
- callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA|AVAHI_LOOKUP_CALLBACK_CACHED, c->record, userdata);
+ callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA|AVAHI_LOOKUP_RESULT_CACHED, c->record, userdata);
n++;
}
if ((cname_key = avahi_key_new_cname(key))) {
for (c = avahi_hashmap_lookup(e->cache_by_key, cname_key); c; c = c->by_key_next) {
- callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA|AVAHI_LOOKUP_CALLBACK_CACHED, c->record, userdata);
+ callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA|AVAHI_LOOKUP_RESULT_CACHED, c->record, userdata);
n++;
}
t,
avahi_string_list_get_service_cookie(txt),
avahi_client_is_service_local(avahi_service_resolver_get_client(r), interface, protocol, name, type, domain),
- !!(flags & AVAHI_LOOKUP_CALLBACK_WIDE_AREA),
- !!(flags & AVAHI_LOOKUP_CALLBACK_MULTICAST),
- !!(flags & AVAHI_LOOKUP_CALLBACK_CACHED));
+ !!(flags & AVAHI_LOOKUP_RESULT_WIDE_AREA),
+ !!(flags & AVAHI_LOOKUP_RESULT_MULTICAST),
+ !!(flags & AVAHI_LOOKUP_RESULT_CACHED));
avahi_free(t);
}
t,
avahi_string_list_get_service_cookie(txt),
avahi_server_is_service_local(server, interface, protocol, name, type, domain),
- !!(flags & AVAHI_LOOKUP_CALLBACK_WIDE_AREA),
- !!(flags & AVAHI_LOOKUP_CALLBACK_MULTICAST),
- !!(flags & AVAHI_LOOKUP_CALLBACK_CACHED));
+ !!(flags & AVAHI_LOOKUP_RESULT_WIDE_AREA),
+ !!(flags & AVAHI_LOOKUP_RESULT_MULTICAST),
+ !!(flags & AVAHI_LOOKUP_RESULT_CACHED));
avahi_free(t);
}
}