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
struct AvahiMulticastLookup {
AvahiMulticastLookupEngine *engine;
int dead;
AvahiKey *key, *cname_key;
struct AvahiMulticastLookup {
AvahiMulticastLookupEngine *engine;
int dead;
AvahiKey *key, *cname_key;
AVAHI_LLIST_FIELDS(AvahiMulticastLookup, lookups);
AVAHI_LLIST_FIELDS(AvahiMulticastLookup, by_key);
};
AVAHI_LLIST_FIELDS(AvahiMulticastLookup, lookups);
AVAHI_LLIST_FIELDS(AvahiMulticastLookup, by_key);
};
- 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);
AVAHI_LLIST_PREPEND(AvahiMulticastLookup, lookups, e->lookups, l);
AVAHI_LLIST_PREPEND(AvahiMulticastLookup, lookups, e->lookups, l);
- avahi_querier_add_for_all(e->server, interface, protocol, l->key, &ctime);
+ avahi_querier_add_for_all(e->server, interface, protocol, l->key, &tv);
+ l->queriers_added = 1;
- /* add a second */
- avahi_timeval_add(&ctime, 1000000);
+ /* Add a second */
+ avahi_timeval_add(&tv, 1000000);
+
+ /* Issue the ALL_FOR_NOW event one second after the querier was initially created */
+ l->all_for_now_event = avahi_time_event_new(e->server->time_event_queue, &tv, all_for_now_callback, l);
t = avahi_hashmap_lookup(l->engine->lookups_by_key, l->key);
AVAHI_LLIST_REMOVE(AvahiMulticastLookup, by_key, t, l);
if (t)
t = avahi_hashmap_lookup(l->engine->lookups_by_key, l->key);
AVAHI_LLIST_REMOVE(AvahiMulticastLookup, by_key, t, l);
if (t)
void avahi_multicast_lookup_engine_cleanup(AvahiMulticastLookupEngine *e) {
AvahiMulticastLookup *l, *n;
assert(e);
void avahi_multicast_lookup_engine_cleanup(AvahiMulticastLookupEngine *e) {
AvahiMulticastLookup *l, *n;
assert(e);
cbdata->interface->hardware->index,
cbdata->interface->protocol,
AVAHI_BROWSER_NEW,
cbdata->interface->hardware->index,
cbdata->interface->protocol,
AVAHI_BROWSER_NEW,
avahi_cache_walk(i->cache, cbdata->key, scan_cache_callback, cbdata);
if (cbdata->cname_key)
avahi_cache_walk(i->cache, cbdata->cname_key, scan_cache_callback, cbdata);
avahi_cache_walk(i->cache, cbdata->key, scan_cache_callback, cbdata);
if (cbdata->cname_key)
avahi_cache_walk(i->cache, cbdata->cname_key, scan_cache_callback, cbdata);
avahi_interface_monitor_walk(e->server->monitor, interface, protocol, scan_interface_callback, &cbdata);
avahi_interface_monitor_walk(e->server->monitor, interface, protocol, scan_interface_callback, &cbdata);
void avahi_multicast_lookup_engine_notify(AvahiMulticastLookupEngine *e, AvahiInterface *i, AvahiRecord *record, AvahiBrowserEvent event) {
AvahiMulticastLookup *l;
void avahi_multicast_lookup_engine_notify(AvahiMulticastLookupEngine *e, AvahiInterface *i, AvahiRecord *record, AvahiBrowserEvent event) {
AvahiMulticastLookup *l;
- 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))
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);
AvahiMulticastLookupEngine *avahi_multicast_lookup_engine_new(AvahiServer *s) {
AvahiMulticastLookupEngine *e;
AvahiMulticastLookupEngine *avahi_multicast_lookup_engine_new(AvahiServer *s) {
AvahiMulticastLookupEngine *e;