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
s->interface = i;
s->time_event_queue = i->monitor->server->time_event_queue;
AVAHI_LLIST_HEAD_INIT(AvahiProbeJob, s->jobs);
AVAHI_LLIST_HEAD_INIT(AvahiProbeJob, s->history);
s->interface = i;
s->time_event_queue = i->monitor->server->time_event_queue;
AVAHI_LLIST_HEAD_INIT(AvahiProbeJob, s->jobs);
AVAHI_LLIST_HEAD_INIT(AvahiProbeJob, s->history);
/* Create the probe query */
if (!(k = avahi_key_new(pj->record->key->name, pj->record->key->clazz, AVAHI_DNS_TYPE_ANY)))
return 0; /* OOM */
/* Create the probe query */
if (!(k = avahi_key_new(pj->record->key->name, pj->record->key->clazz, AVAHI_DNS_TYPE_ANY)))
return 0; /* OOM */
/* Does the record match the probe? */
if (k->clazz != pj->record->key->clazz || !avahi_domain_equal(k->name, pj->record->key->name))
continue;
/* Does the record match the probe? */
if (k->clazz != pj->record->key->clazz || !avahi_domain_equal(k->name, pj->record->key->name))
continue;
/* This job wouldn't fit in */
if (avahi_record_get_estimate_size(pj->record) > avahi_dns_packet_space(p))
break;
/* This job wouldn't fit in */
if (avahi_record_get_estimate_size(pj->record) > avahi_dns_packet_space(p))
break;
/* Add the import probe */
if (!packet_add_probe_query(s, p, pj)) {
size_t size;
/* Add the import probe */
if (!packet_add_probe_query(s, p, pj)) {
size_t size;
avahi_key_get_estimate_size(pj->record->key) +
avahi_record_get_estimate_size(pj->record) +
AVAHI_DNS_PACKET_HEADER_SIZE;
avahi_key_get_estimate_size(pj->record->key) +
avahi_record_get_estimate_size(pj->record) +
AVAHI_DNS_PACKET_HEADER_SIZE;
b = avahi_dns_packet_append_key(p, k, 0) && avahi_dns_packet_append_record(p, pj->record, 0, 0);
avahi_key_unref(k);
b = avahi_dns_packet_append_key(p, k, 0) && avahi_dns_packet_append_record(p, pj->record, 0, 0);
avahi_key_unref(k);
avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_QDCOUNT, 1);
avahi_interface_send_packet(s->interface, p);
} else
avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_QDCOUNT, 1);
avahi_interface_send_packet(s->interface, p);
} else
/* Create a new job and schedule it */
if (!(pj = job_new(s, record, 0)))
return 0; /* OOM */
/* Create a new job and schedule it */
if (!(pj = job_new(s, record, 0)))
return 0; /* OOM */
pj->delivery = tv;
pj->time_event = avahi_time_event_new(s->time_event_queue, &pj->delivery, elapse_callback, pj);
pj->delivery = tv;
pj->time_event = avahi_time_event_new(s->time_event_queue, &pj->delivery, elapse_callback, pj);