OpenDNSSEC-signer  1.4.6
notify.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 NLNet Labs. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
32 #include "config.h"
33 #include "adapter/addns.h"
34 #include "daemon/xfrhandler.h"
35 #include "signer/domain.h"
36 #include "signer/zone.h"
37 #include "wire/notify.h"
38 #include "wire/xfrd.h"
39 
40 #include <sys/socket.h>
41 
42 static const char* notify_str = "notify";
43 
44 static void notify_handle_zone(netio_type* netio,
45  netio_handler_type* handler, netio_events_type event_types);
46 
47 
52 static time_t
53 notify_time(notify_type* notify)
54 {
55  ods_log_assert(notify);
56  ods_log_assert(notify->xfrhandler);
57  return xfrhandler_time((xfrhandler_type*) notify->xfrhandler);
58 }
59 
60 
65 static void
66 notify_set_timer(notify_type* notify, time_t t)
67 {
68  if (!notify || !notify->xfrhandler) {
69  return;
70  }
75  if(t > notify_time(notify) + 10) {
76  time_t extra = t - notify_time(notify);
77  time_t base = extra*9/10;
78 #ifdef HAVE_ARC4RANDOM_UNIFORM
79  t = notify_time(notify) + base +
80  arc4random_uniform(extra-base);
81 #elif HAVE_ARC4RANDOM
82  t = notify_time(notify) + base +
83  arc4random()%(extra-base);
84 #else
85  t = notify_time(notify) + base +
86  random()%(extra-base);
87 #endif
88  }
89  notify->handler.timeout = &notify->timeout;
90  notify->timeout.tv_sec = t;
91  notify->timeout.tv_nsec = 0;
92  return;
93 }
94 
95 
101 notify_create(void* xfrhandler, void* zone)
102 {
103  notify_type* notify = NULL;
104  allocator_type* allocator = NULL;
105  if (!xfrhandler || !zone) {
106  return NULL;
107  }
108  allocator = allocator_create(malloc, free);
109  if (!allocator) {
110  ods_log_error("[%s] unable to create notify structure: "
111  "allocator_create() failed", notify_str);
112  return NULL;
113  }
114  notify = (notify_type*) allocator_alloc(allocator, sizeof(notify_type));
115  if (!notify) {
116  ods_log_error("[%s] unable to create notify structure: "
117  " allocator_alloc() failed", notify_str);
118  allocator_cleanup(allocator);
119  return NULL;
120  }
121  notify->allocator = allocator;
122  notify->zone = zone;
123  notify->xfrhandler = xfrhandler;
124  notify->waiting_next = NULL;
125  notify->secondary = NULL;
126  notify->soa = NULL;
127  notify->tsig_rr = tsig_rr_create(allocator);
128  if (!notify->tsig_rr) {
129  notify_cleanup(notify);
130  return NULL;
131  }
132  notify->retry = 0;
133  notify->query_id = 0;
134  notify->is_waiting = 0;
135  notify->handler.fd = -1;
136  notify->timeout.tv_sec = 0;
137  notify->timeout.tv_nsec = 0;
138  notify->handler.timeout = NULL;
139  notify->handler.user_data = notify;
140  notify->handler.event_types =
142  notify->handler.event_handler = notify_handle_zone;
143  return notify;
144 }
145 
146 
151 static void
152 notify_setup(notify_type* notify)
153 {
154  zone_type* zone = NULL;
155  dnsout_type* dnsout = NULL;
156  if (!notify) {
157  return;
158  }
159  zone = (zone_type*) notify->zone;
160  ods_log_assert(zone);
161  ods_log_assert(zone->adoutbound);
164  dnsout = (dnsout_type*) zone->adoutbound->config;
165  notify->retry = 0;
166  notify->secondary = dnsout->do_notify;
167  ods_log_debug("[%s] setup notify for zone %s", notify_str, zone->name);
168  notify_set_timer(notify, notify_time(notify));
169  return;
170 }
171 
172 
177 static void
178 notify_disable(notify_type* notify)
179 {
180  xfrhandler_type* xfrhandler = NULL;
181  zone_type* zone = NULL;
182  if (!notify) {
183  return;
184  }
185  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
186  ods_log_assert(xfrhandler);
187  zone = (zone_type*) notify->zone;
188  ods_log_assert(zone);
189  ods_log_assert(zone->name);
190  notify->secondary = NULL;
191  notify->handler.timeout = NULL;
192  if (notify->handler.fd != -1) {
193  close(notify->handler.fd);
194  notify->handler.fd = -1;
195  }
196  if (xfrhandler->notify_udp_num == NOTIFY_MAX_UDP) {
197  while (xfrhandler->notify_waiting_first) {
198  notify_type* wn = xfrhandler->notify_waiting_first;
200  wn->is_waiting = 0;
201  xfrhandler->notify_waiting_first = wn->waiting_next;
202  if (xfrhandler->notify_waiting_last == wn) {
203  xfrhandler->notify_waiting_last = NULL;
204  }
205  if (wn->secondary) {
206  ods_log_debug("[%s] zone %s notify off waiting list",
207  notify_str, zone->name);
208  notify_setup(wn);
209  return;
210  }
211  }
212  }
213  ods_log_debug("[%s] notify for zone %s disabled", notify_str, zone->name);
214  xfrhandler->notify_udp_num--;
215  return;
216 }
217 
218 
223 static void
224 notify_next(notify_type* notify)
225 {
226  if (!notify || !notify->secondary) {
227  return;
228  }
229  notify->secondary = notify->secondary->next;
230  notify->retry = 0;
231  if (!notify->secondary) {
232  zone_type* zone = (zone_type*) notify->zone;
233  ods_log_assert(zone);
234  ods_log_assert(zone->name);
235  ods_log_debug("[%s] zone %s no more secondaries, disable notify",
236  notify_str, zone->name);
237  notify_disable(notify);
238  }
239  return;
240 }
241 
242 
247 static int
248 notify_udp_read_packet(notify_type* notify)
249 {
250  xfrhandler_type* xfrhandler = NULL;
251  ssize_t received = 0;
252  ods_log_assert(notify);
253  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
254  ods_log_assert(xfrhandler);
255  buffer_clear(xfrhandler->packet);
256  received = recvfrom(notify->handler.fd, buffer_begin(xfrhandler->packet),
257  buffer_remaining(xfrhandler->packet), 0, NULL, NULL);
258  if (received == -1) {
259  ods_log_error("[%s] unable to read packet: recvfrom() failed fd %d "
260  "(%s)", notify_str, notify->handler.fd, strerror(errno));
261  return 0;
262  }
263  buffer_set_limit(xfrhandler->packet, received);
264  return 1;
265 }
266 
267 
272 static int
273 notify_handle_reply(notify_type* notify)
274 {
275  xfrhandler_type* xfrhandler = NULL;
276  zone_type* zone = NULL;
277  ods_log_assert(notify);
278  ods_log_assert(notify->secondary);
279  ods_log_assert(notify->secondary->address);
280  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
281  zone = (zone_type*) notify->zone;
282  ods_log_assert(xfrhandler);
283  ods_log_assert(zone);
284  ods_log_assert(zone->name);
285  if ((buffer_pkt_opcode(xfrhandler->packet) != LDNS_PACKET_NOTIFY) ||
286  (buffer_pkt_qr(xfrhandler->packet) == 0)) {
287  ods_log_error("[%s] zone %s received bad notify reply opcode/qr from %s",
288  notify_str, zone->name, notify->secondary->address);
289  return 0;
290  }
291  if (buffer_pkt_id(xfrhandler->packet) != notify->query_id) {
292  ods_log_error("[%s] zone %s received bad notify reply id from %s",
293  notify_str, zone->name, notify->secondary->address);
294  return 0;
295  }
296  /* could check tsig */
297  if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOERROR) {
298  const char* str = buffer_rcode2str(buffer_pkt_rcode(xfrhandler->packet));
299  ods_log_error("[%s] zone %s received bad notify rcode %s from %s",
300  notify_str, zone->name, str?str:"UNKNOWN",
301  notify->secondary->address);
302  if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOTIMPL) {
303  return 1;
304  }
305  return 0;
306  }
307  ods_log_debug("[%s] zone %s secondary %s notify reply ok", notify_str,
308  zone->name, notify->secondary->address);
309  return 1;
310 }
311 
312 
317 static int
318 notify_send_udp(notify_type* notify, buffer_type* buffer)
319 {
320  struct sockaddr_storage to;
321  socklen_t to_len = 0;
322  int fd = -1;
323  int family = PF_INET;
324  ssize_t nb = 0;
325  ods_log_assert(buffer);
326  ods_log_assert(notify);
327  ods_log_assert(notify->secondary);
328  ods_log_assert(notify->secondary->address);
329  /* this will set the remote port to acl->port or TCP_PORT */
330  to_len = xfrd_acl_sockaddr_to(notify->secondary, &to);
331  /* get the address family of the remote host */
332  if (notify->secondary->family == AF_INET6) {
333  family = PF_INET6;
334  }
335  /* create socket */
336  fd = socket(family, SOCK_DGRAM, IPPROTO_UDP);
337  if (fd == -1) {
338  ods_log_error("[%s] unable to send data over udp to %s: "
339  "socket() failed (%s)", notify_str, notify->secondary->address,
340  strerror(errno));
341  return -1;
342  }
343  /* bind it? */
344 
345  /* send it (udp) */
346  ods_log_deeebug("[%s] send %d bytes over udp to %s", notify_str,
347  buffer_remaining(buffer), notify->secondary->address);
348  nb = sendto(fd, buffer_current(buffer), buffer_remaining(buffer), 0,
349  (struct sockaddr*)&to, to_len);
350  if (nb == -1) {
351  ods_log_error("[%s] unable to send data over udp to %s: "
352  "sendto() failed (%s)", notify_str, notify->secondary->address,
353  strerror(errno));
354  close(fd);
355  return -1;
356  }
357  return fd;
358 }
359 
360 
365 static void
366 notify_tsig_sign(notify_type* notify, buffer_type* buffer)
367 {
368  tsig_algo_type* algo = NULL;
369  if (!notify || !notify->tsig_rr || !notify->secondary ||
370  !notify->secondary->tsig || !notify->secondary->tsig->key ||
371  !buffer) {
372  return; /* no tsig configured */
373  }
374  algo = tsig_lookup_algo(notify->secondary->tsig->algorithm);
375  if (!algo) {
376  ods_log_error("[%s] unable to sign notify: tsig unknown algorithm "
377  "%s", notify_str, notify->secondary->tsig->algorithm);
378  return;
379  }
380  ods_log_assert(algo);
381  tsig_rr_reset(notify->tsig_rr, algo, notify->secondary->tsig->key);
382  notify->tsig_rr->original_query_id = buffer_pkt_id(buffer);
383  notify->tsig_rr->algo_name =
384  ldns_rdf_clone(notify->tsig_rr->algo->wf_name);
385  notify->tsig_rr->key_name = ldns_rdf_clone(notify->tsig_rr->key->dname);
386  log_dname(notify->tsig_rr->key_name, "tsig sign notify with key",
387  LOG_DEBUG);
388  log_dname(notify->tsig_rr->algo_name, "tsig sign notify with algorithm",
389  LOG_DEBUG);
390  tsig_rr_prepare(notify->tsig_rr);
391  tsig_rr_update(notify->tsig_rr, buffer, buffer_position(buffer));
392  tsig_rr_sign(notify->tsig_rr);
393  ods_log_debug("[%s] tsig append rr to notify id=%u", notify_str,
394  buffer_pkt_id(buffer));
395  tsig_rr_append(notify->tsig_rr, buffer);
396  buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)+1);
397  tsig_rr_prepare(notify->tsig_rr);
398  return;
399 }
400 
401 
406 void
408 {
409  xfrhandler_type* xfrhandler = NULL;
410  zone_type* zone = NULL;
411  ods_log_assert(notify);
412  ods_log_assert(notify->secondary);
413  ods_log_assert(notify->secondary->address);
414  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
415  zone = (zone_type*) notify->zone;
416  ods_log_assert(xfrhandler);
417  ods_log_assert(zone);
418  ods_log_assert(zone->name);
419  if (notify->handler.fd != -1) {
420  close(notify->handler.fd);
421  }
422  notify->handler.fd = -1;
423  notify->timeout.tv_sec = notify_time(notify) + NOTIFY_RETRY_TIMEOUT;
424  buffer_pkt_notify(xfrhandler->packet, zone->apex, LDNS_RR_CLASS_IN);
425  notify->query_id = buffer_pkt_id(xfrhandler->packet);
426  buffer_pkt_set_aa(xfrhandler->packet);
427  /* add current SOA to answer section */
428  if (notify->soa) {
429  if (buffer_write_rr(xfrhandler->packet, notify->soa)) {
430  buffer_pkt_set_ancount(xfrhandler->packet, 1);
431  }
432  }
433  if (notify->secondary->tsig) {
434  notify_tsig_sign(notify, xfrhandler->packet);
435  }
436  buffer_flip(xfrhandler->packet);
437  notify->handler.fd = notify_send_udp(notify, xfrhandler->packet);
438  if (notify->handler.fd == -1) {
439  ods_log_error("[%s] unable to send notify retry %u for zone %s to "
440  "%s: notify_send_udp() failed", notify_str, notify->retry,
441  zone->name, notify->secondary->address);
442  return;
443  }
444  ods_log_verbose("[%s] notify retry %u for zone %s sent to %s", notify_str,
445  notify->retry, zone->name, notify->secondary->address);
446  return;
447 }
448 
449 
454 static void
455 notify_handle_zone(netio_type* ATTR_UNUSED(netio),
456  netio_handler_type* handler, netio_events_type event_types)
457 {
458  notify_type* notify = NULL;
459  xfrhandler_type* xfrhandler = NULL;
460  zone_type* zone = NULL;
461  if (!handler) {
462  return;
463  }
464  notify = (notify_type*) handler->user_data;
465  ods_log_assert(notify);
466  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
467  zone = (zone_type*) notify->zone;
468  ods_log_assert(xfrhandler);
469  ods_log_assert(zone);
470  ods_log_assert(zone->name);
471  ods_log_debug("[%s] handle notify for zone %s", notify_str, zone->name);
472 
473  if (notify->is_waiting) {
474  ods_log_debug("[%s] already waiting, skipping notify for zone %s",
475  notify_str, zone->name);
476  ods_log_assert(notify->handler.fd == -1);
477  return;
478  }
479  if (event_types & NETIO_EVENT_READ) {
480  ods_log_debug("[%s] read notify ok for zone %s", notify_str,
481  zone->name);
482  ods_log_assert(notify->handler.fd != -1);
483  if (notify_udp_read_packet(notify)) {
484  if (notify_handle_reply(notify)) {
485  notify_next(notify);
486  }
487  }
488  } else if(event_types & NETIO_EVENT_TIMEOUT) {
489  ods_log_debug("[%s] notify timeout for zone %s", notify_str,
490  zone->name);
491  /* timeout, try again */
492  }
493  /* see if notify is still enabled */
494  if (notify->secondary) {
495  ods_log_assert(notify->secondary->address);
496  notify->retry++;
497  if (notify->retry > NOTIFY_MAX_RETRY) {
498  ods_log_verbose("[%s] notify max retry for zone %s, %s unreachable",
499  notify_str, zone->name, notify->secondary->address);
500  notify_next(notify);
501  } else {
502  notify_send(notify);
503  }
504  }
505  return;
506 }
507 
508 
513 static void
514 notify_update_soa(notify_type* notify, ldns_rr* soa)
515 {
516  if (!notify) {
517  return;
518  }
519  if (notify->soa) {
520  ldns_rr_free(notify->soa);
521  }
522  notify->soa = soa;
523  return;
524 }
525 
526 
531 void
532 notify_enable(notify_type* notify, ldns_rr* soa)
533 {
534  xfrhandler_type* xfrhandler = NULL;
535  zone_type* zone = NULL;
536  dnsout_type* dnsout = NULL;
537  if (!notify) {
538  return;
539  }
540  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
541  ods_log_assert(xfrhandler);
542  zone = (zone_type*) notify->zone;
543  ods_log_assert(zone);
544  ods_log_assert(zone->name);
545  ods_log_assert(zone->adoutbound);
548  dnsout = (dnsout_type*) zone->adoutbound->config;
549  if (!dnsout->do_notify) {
550  ods_log_warning("[%s] zone %s has no notify acl", notify_str,
551  zone->name);
552  return; /* nothing to do */
553  }
554  notify_update_soa(notify, soa);
555  if (notify->is_waiting) {
556  ods_log_debug("[%s] zone %s already on waiting list", notify_str,
557  zone->name);
558  return;
559  }
560  if (xfrhandler->notify_udp_num < NOTIFY_MAX_UDP) {
561  notify_setup(notify);
562  xfrhandler->notify_udp_num++;
563  ods_log_debug("[%s] zone %s notify enabled", notify_str,
564  zone->name);
565  return;
566  }
567  /* put it in waiting list */
568  notify->secondary = dnsout->do_notify;
569  notify->is_waiting = 1;
570  notify->waiting_next = NULL;
571  if (xfrhandler->notify_waiting_last) {
572  xfrhandler->notify_waiting_last->waiting_next = notify;
573  } else {
574  xfrhandler->notify_waiting_first = notify;
575  }
576  xfrhandler->notify_waiting_last = notify;
577  notify->handler.timeout = NULL;
578  ods_log_debug("[%s] zone %s notify on waiting list", notify_str,
579  zone->name);
580  return;
581 }
582 
583 
588 void
590 {
591  allocator_type* allocator = NULL;
592  if (!notify) {
593  return;
594  }
595  allocator = notify->allocator;
596  if (notify->handler.fd != -1) {
597  close(notify->handler.fd);
598  notify->handler.fd = -1;
599  }
600  if (notify->soa) {
601  ldns_rr_free(notify->soa);
602  }
603  tsig_rr_cleanup(notify->tsig_rr);
604  allocator_deallocate(allocator, (void*) notify);
605  allocator_cleanup(allocator);
606  return;
607 }
ldns_pkt_opcode buffer_pkt_opcode(buffer_type *buffer)
Definition: buffer.c:910
tsig_rr_type * tsig_rr
Definition: notify.h:57
tsig_algo_type * algo
Definition: tsig.h:131
void * xfrhandler
Definition: notify.h:60
unsigned is_waiting
Definition: notify.h:65
void tsig_rr_update(tsig_rr_type *trr, buffer_type *buffer, size_t length)
Definition: tsig.c:604
#define PF_INET6
Definition: netio.h:61
void notify_enable(notify_type *notify, ldns_rr *soa)
Definition: notify.c:532
void notify_send(notify_type *notify)
Definition: notify.c:407
void * config
Definition: adapter.h:61
void ods_log_debug(const char *format,...)
Definition: log.c:270
#define NOTIFY_MAX_UDP
Definition: notify.h:44
notify_type * notify_create(void *xfrhandler, void *zone)
Definition: notify.c:101
uint16_t buffer_pkt_arcount(buffer_type *buffer)
Definition: buffer.c:1136
void * allocator_alloc(allocator_type *allocator, size_t size)
Definition: allocator.c:66
buffer_type * packet
Definition: xfrhandler.h:60
void buffer_flip(buffer_type *buffer)
Definition: buffer.c:133
void buffer_clear(buffer_type *buffer)
Definition: buffer.c:119
void * zone
Definition: notify.h:59
enum netio_events_enum netio_events_type
Definition: netio.h:76
socklen_t xfrd_acl_sockaddr_to(acl_type *acl, struct sockaddr_storage *to)
Definition: xfrd.c:558
tsig_algo_type * tsig_lookup_algo(const char *name)
Definition: tsig.c:288
#define NOTIFY_MAX_RETRY
Definition: notify.h:45
void ods_log_error(const char *format,...)
Definition: log.c:334
acl_type * next
Definition: acl.h:59
adapter_mode type
Definition: adapter.h:58
uint16_t query_id
Definition: notify.h:63
int family
Definition: acl.h:63
ldns_rdf * wf_name
Definition: tsig.h:92
int buffer_pkt_qr(buffer_type *buffer)
Definition: buffer.c:872
void tsig_rr_reset(tsig_rr_type *trr, tsig_algo_type *algo, tsig_key_type *key)
Definition: tsig.c:332
void tsig_rr_append(tsig_rr_type *trr, buffer_type *buffer)
Definition: tsig.c:720
uint16_t buffer_pkt_id(buffer_type *buffer)
Definition: buffer.c:811
void notify_cleanup(notify_type *notify)
Definition: notify.c:589
uint8_t * buffer_current(buffer_type *buffer)
Definition: buffer.c:489
adapter_type * adoutbound
Definition: zone.h:82
const char * algorithm
Definition: tsig.h:114
void * user_data
Definition: netio.h:119
void tsig_rr_prepare(tsig_rr_type *trr)
Definition: tsig.c:579
tsig_key_type * key
Definition: tsig.h:116
time_t xfrhandler_time(xfrhandler_type *xfrhandler)
Definition: xfrhandler.c:156
void buffer_pkt_set_ancount(buffer_type *buffer, uint16_t count)
Definition: buffer.c:1098
ldns_rdf * key_name
Definition: tsig.h:136
void buffer_set_limit(buffer_type *buffer, size_t limit)
Definition: buffer.c:423
allocator_type * allocator_create(void *(*allocator)(size_t size), void(*deallocator)(void *))
Definition: allocator.c:47
notify_type * notify_waiting_first
Definition: xfrhandler.h:64
netio_event_handler_type event_handler
Definition: netio.h:131
void tsig_rr_cleanup(tsig_rr_type *trr)
Definition: tsig.c:883
void log_dname(ldns_rdf *rdf, const char *pre, int level)
Definition: domain.c:48
notify_type * notify_waiting_last
Definition: xfrhandler.h:65
ldns_rr * soa
Definition: notify.h:56
allocator_type * allocator
Definition: notify.h:55
struct timespec timeout
Definition: notify.h:62
tsig_key_type * key
Definition: tsig.h:132
#define NOTIFY_RETRY_TIMEOUT
Definition: notify.h:46
ldns_rdf * dname
Definition: tsig.h:80
char * address
Definition: acl.h:61
uint8_t retry
Definition: notify.h:64
void buffer_pkt_set_aa(buffer_type *buffer)
Definition: buffer.c:947
tsig_rr_type * tsig_rr_create(allocator_type *allocator)
Definition: tsig.c:305
const char * buffer_rcode2str(ldns_pkt_rcode rcode)
Definition: buffer.c:1045
void ods_log_verbose(const char *format,...)
Definition: log.c:286
acl_type * do_notify
Definition: addns.h:66
netio_events_type event_types
Definition: netio.h:124
void buffer_pkt_notify(buffer_type *buffer, ldns_rdf *qname, ldns_rr_class qclass)
Definition: buffer.c:1206
void allocator_cleanup(allocator_type *allocator)
Definition: allocator.c:151
const char * name
Definition: zone.h:76
#define PF_INET
Definition: netio.h:58
size_t buffer_remaining(buffer_type *buffer)
Definition: buffer.c:514
void ods_log_deeebug(const char *format,...)
Definition: log.c:254
int buffer_write_rr(buffer_type *buffer, ldns_rr *rr)
Definition: buffer.c:664
void tsig_rr_sign(tsig_rr_type *trr)
Definition: tsig.c:676
notify_type * waiting_next
Definition: notify.h:54
void allocator_deallocate(allocator_type *allocator, void *data)
Definition: allocator.c:135
#define LOG_DEBUG
Definition: log.h:51
acl_type * secondary
Definition: notify.h:58
size_t buffer_position(buffer_type *buffer)
Definition: buffer.c:160
ldns_rdf * algo_name
Definition: tsig.h:137
void buffer_pkt_set_arcount(buffer_type *buffer, uint16_t count)
Definition: buffer.c:1148
netio_handler_type handler
Definition: notify.h:61
struct timespec * timeout
Definition: netio.h:115
#define ods_log_assert(x)
Definition: log.h:154
void ods_log_warning(const char *format,...)
Definition: log.c:318
uint16_t original_query_id
Definition: tsig.h:143
tsig_type * tsig
Definition: acl.h:69
ldns_rdf * apex
Definition: zone.h:68
uint8_t * buffer_begin(buffer_type *buffer)
Definition: buffer.c:465
ldns_pkt_rcode buffer_pkt_rcode(buffer_type *buffer)
Definition: buffer.c:1020