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
#include <avahi-common/domain.h>
#include <avahi-common/malloc.h>
#include <avahi-common/error.h>
#include <avahi-common/domain.h>
#include <avahi-common/malloc.h>
#include <avahi-common/error.h>
for (l = b->server->config.browse_domains; l; l = l->next)
if (avahi_domain_equal((char*) l->text, n))
return;
}
for (l = b->server->config.browse_domains; l; l = l->next)
if (avahi_domain_equal((char*) l->text, n))
return;
}
b->callback(b, interface, protocol, event, n, flags, b->userdata);
}
static void defer_callback(AvahiTimeEvent *e, void *userdata) {
AvahiSDomainBrowser *b = userdata;
AvahiStringList *l;
b->callback(b, interface, protocol, event, n, flags, b->userdata);
}
static void defer_callback(AvahiTimeEvent *e, void *userdata) {
AvahiSDomainBrowser *b = userdata;
AvahiStringList *l;
b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_NEW, (char*) l->text, AVAHI_LOOKUP_RESULT_STATIC, b->userdata);
}
if (b->ref > 1) {
/* If the ALL_FOR_NOW event has already been scheduled, execute it now */
b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_NEW, (char*) l->text, AVAHI_LOOKUP_RESULT_STATIC, b->userdata);
}
if (b->ref > 1) {
/* If the ALL_FOR_NOW event has already been scheduled, execute it now */
b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_ALL_FOR_NOW, NULL, 0, b->userdata);
}
b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_ALL_FOR_NOW, NULL, 0, b->userdata);
}
if (!(b = avahi_new(AvahiSDomainBrowser, 1))) {
avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
return NULL;
if (!(b = avahi_new(AvahiSDomainBrowser, 1))) {
avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
return NULL;
if (!(b->record_browser = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, b)))
goto fail;
if (!(b->record_browser = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, b)))
goto fail;
avahi_key_unref(k);
if (type == AVAHI_DOMAIN_BROWSER_BROWSE && b->server->config.browse_domains)
b->defer_event = avahi_time_event_new(server->time_event_queue, NULL, defer_callback, b);
avahi_key_unref(k);
if (type == AVAHI_DOMAIN_BROWSER_BROWSE && b->server->config.browse_domains)
b->defer_event = avahi_time_event_new(server->time_event_queue, NULL, defer_callback, b);
AVAHI_LLIST_REMOVE(AvahiSDomainBrowser, browser, b->server->domain_browsers, b);
if (b->record_browser)
AVAHI_LLIST_REMOVE(AvahiSDomainBrowser, browser, b->server->domain_browsers, b);
if (b->record_browser)