Example #1
0
static int lookup_scan_cache(AvahiSRBLookup *l) {
    int n = 0;

    assert(l);

    assert(!(l->flags & AVAHI_LOOKUP_USE_WIDE_AREA) != !(l->flags & AVAHI_LOOKUP_USE_MULTICAST));


    if (l->flags & AVAHI_LOOKUP_USE_WIDE_AREA) {
        n = (int) avahi_wide_area_scan_cache(l->record_browser->server->wide_area_lookup_engine, l->key, lookup_wide_area_callback, l);

    } else {
        assert(l->flags & AVAHI_LOOKUP_USE_MULTICAST);
        n = (int) avahi_multicast_lookup_engine_scan_cache(l->record_browser->server->multicast_lookup_engine, l->interface, l->protocol, l->key, lookup_multicast_callback, l);
    }

    return n;
}
Example #2
0
static int lookup_scan_cache(AvahiSRBLookup *l) {
    int n = 0;

    assert(l);

    assert( (!(l->flags & AVAHI_LOOKUP_USE_WIDE_AREA) && !(l->flags & AVAHI_LOOKUP_USE_LLMNR)) ||
        (!(l->flags & AVAHI_LOOKUP_USE_LLMNR) && !(l->flags & AVAHI_LOOKUP_USE_MULTICAST)) ||
        (!(l->flags & AVAHI_LOOKUP_USE_MULTICAST) && !(l->flags & AVAHI_LOOKUP_USE_WIDE_AREA)) );

    if (l->flags & AVAHI_LOOKUP_USE_WIDE_AREA)
        n = (int) avahi_wide_area_scan_cache(l->record_browser->server->wide_area.wide_area_lookup_engine, l->key, lookup_wide_area_callback, l);

    else if (l->flags & AVAHI_LOOKUP_USE_MULTICAST)
        n = (int) avahi_multicast_lookup_engine_scan_cache(l->record_browser->server->mdns.multicast_lookup_engine, l->interface, l->protocol, l->key, lookup_multicast_callback, l);

    else {
        assert(l->flags & AVAHI_LOOKUP_USE_LLMNR);
        n = (int) avahi_scan_llmnr_cache(l->record_browser->server->llmnr.llmnr_lookup_engine, l->interface, l->protocol, l->key, lookup_llmnr_callback, l);
    }

    return n;
}