Lines Matching refs:l
68 AvahiMulticastLookup *l = userdata; in all_for_now_callback() local
71 assert(l); in all_for_now_callback()
73 avahi_time_event_free(l->all_for_now_event); in all_for_now_callback()
74 l->all_for_now_event = NULL; in all_for_now_callback()
76 …l->callback(l->engine, l->interface, l->protocol, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_RESULT_M… in all_for_now_callback()
87 AvahiMulticastLookup *l, *t; in avahi_multicast_lookup_new() local
96 l = avahi_new(AvahiMulticastLookup, 1); in avahi_multicast_lookup_new()
97 l->engine = e; in avahi_multicast_lookup_new()
98 l->dead = 0; in avahi_multicast_lookup_new()
99 l->key = avahi_key_ref(key); in avahi_multicast_lookup_new()
100 l->cname_key = avahi_key_new_cname(l->key); in avahi_multicast_lookup_new()
101 l->callback = callback; in avahi_multicast_lookup_new()
102 l->userdata = userdata; in avahi_multicast_lookup_new()
103 l->interface = interface; in avahi_multicast_lookup_new()
104 l->protocol = protocol; in avahi_multicast_lookup_new()
105 l->all_for_now_event = NULL; in avahi_multicast_lookup_new()
106 l->queriers_added = 0; in avahi_multicast_lookup_new()
108 t = avahi_hashmap_lookup(e->lookups_by_key, l->key); in avahi_multicast_lookup_new()
109 AVAHI_LLIST_PREPEND(AvahiMulticastLookup, by_key, t, l); in avahi_multicast_lookup_new()
110 avahi_hashmap_replace(e->lookups_by_key, avahi_key_ref(l->key), t); in avahi_multicast_lookup_new()
112 AVAHI_LLIST_PREPEND(AvahiMulticastLookup, lookups, e->lookups, l); in avahi_multicast_lookup_new()
114 avahi_querier_add_for_all(e->server, interface, protocol, l->key, &tv); in avahi_multicast_lookup_new()
115 l->queriers_added = 1; in avahi_multicast_lookup_new()
121 …l->all_for_now_event = avahi_time_event_new(e->server->time_event_queue, &tv, all_for_now_callback… in avahi_multicast_lookup_new()
123 return l; in avahi_multicast_lookup_new()
126 static void lookup_stop(AvahiMulticastLookup *l) { in lookup_stop() argument
127 assert(l); in lookup_stop()
129 l->callback = NULL; in lookup_stop()
131 if (l->queriers_added) { in lookup_stop()
132 avahi_querier_remove_for_all(l->engine->server, l->interface, l->protocol, l->key); in lookup_stop()
133 l->queriers_added = 0; in lookup_stop()
136 if (l->all_for_now_event) { in lookup_stop()
137 avahi_time_event_free(l->all_for_now_event); in lookup_stop()
138 l->all_for_now_event = NULL; in lookup_stop()
142 static void lookup_destroy(AvahiMulticastLookup *l) { in lookup_destroy() argument
144 assert(l); in lookup_destroy()
146 lookup_stop(l); in lookup_destroy()
148 t = avahi_hashmap_lookup(l->engine->lookups_by_key, l->key); in lookup_destroy()
149 AVAHI_LLIST_REMOVE(AvahiMulticastLookup, by_key, t, l); in lookup_destroy()
151 avahi_hashmap_replace(l->engine->lookups_by_key, avahi_key_ref(l->key), t); in lookup_destroy()
153 avahi_hashmap_remove(l->engine->lookups_by_key, l->key); in lookup_destroy()
155 AVAHI_LLIST_REMOVE(AvahiMulticastLookup, lookups, l->engine->lookups, l); in lookup_destroy()
157 if (l->key) in lookup_destroy()
158 avahi_key_unref(l->key); in lookup_destroy()
160 if (l->cname_key) in lookup_destroy()
161 avahi_key_unref(l->cname_key); in lookup_destroy()
163 avahi_free(l); in lookup_destroy()
166 void avahi_multicast_lookup_free(AvahiMulticastLookup *l) { in avahi_multicast_lookup_free() argument
167 assert(l); in avahi_multicast_lookup_free()
169 if (l->dead) in avahi_multicast_lookup_free()
172 l->dead = 1; in avahi_multicast_lookup_free()
173 l->engine->cleanup_dead = 1; in avahi_multicast_lookup_free()
174 lookup_stop(l); in avahi_multicast_lookup_free()
178 AvahiMulticastLookup *l, *n; in avahi_multicast_lookup_engine_cleanup() local
184 for (l = e->lookups; l; l = n) { in avahi_multicast_lookup_engine_cleanup()
185 n = l->lookups_next; in avahi_multicast_lookup_engine_cleanup()
187 if (l->dead) in avahi_multicast_lookup_engine_cleanup()
188 lookup_destroy(l); in avahi_multicast_lookup_engine_cleanup()
275 AvahiMulticastLookup *l; in avahi_multicast_lookup_engine_new_interface() local
280 for (l = e->lookups; l; l = l->lookups_next) { in avahi_multicast_lookup_engine_new_interface()
282 if (l->dead || !l->callback) in avahi_multicast_lookup_engine_new_interface()
285 if (l->queriers_added && avahi_interface_match(i, l->interface, l->protocol)) in avahi_multicast_lookup_engine_new_interface()
286 avahi_querier_add(i, l->key, NULL); in avahi_multicast_lookup_engine_new_interface()
291 AvahiMulticastLookup *l; in avahi_multicast_lookup_engine_notify() local
297 for (l = avahi_hashmap_lookup(e->lookups_by_key, record->key); l; l = l->by_key_next) { in avahi_multicast_lookup_engine_notify()
298 if (l->dead || !l->callback) in avahi_multicast_lookup_engine_notify()
301 if (avahi_interface_match(i, l->interface, l->protocol)) in avahi_multicast_lookup_engine_notify()
302 …l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_RESULT_MULTICAST, record, l->u… in avahi_multicast_lookup_engine_notify()
309 for (l = e->lookups; l; l = l->lookups_next) { in avahi_multicast_lookup_engine_notify()
312 if (l->dead || !l->callback) in avahi_multicast_lookup_engine_notify()
315 if ((key = avahi_key_new_cname(l->key))) { in avahi_multicast_lookup_engine_notify()
317 …l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_RESULT_MULTICAST, record, l->u… in avahi_multicast_lookup_engine_notify()