OpenDNSSEC-signer  1.4.10
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 (xfrhandler->packet->limit < 3 ||
286  (buffer_pkt_opcode(xfrhandler->packet) != LDNS_PACKET_NOTIFY) ||
287  (buffer_pkt_qr(xfrhandler->packet) == 0)) {
288  ods_log_error("[%s] zone %s received bad notify reply opcode/qr from %s",
289  notify_str, zone->name, notify->secondary->address);
290  return 0;
291  }
292  if (buffer_pkt_id(xfrhandler->packet) != notify->query_id) {
293  ods_log_error("[%s] zone %s received bad notify reply id from %s",
294  notify_str, zone->name, notify->secondary->address);
295  return 0;
296  }
297  /* could check tsig */
298  if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOERROR) {
299  const char* str = buffer_rcode2str(buffer_pkt_rcode(xfrhandler->packet));
300  ods_log_error("[%s] zone %s received bad notify rcode %s from %s",
301  notify_str, zone->name, str?str:"UNKNOWN",
302  notify->secondary->address);
303  if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOTIMPL) {
304  return 1;
305  }
306  return 0;
307  }
308  ods_log_debug("[%s] zone %s secondary %s notify reply ok", notify_str,
309  zone->name, notify->secondary->address);
310  return 1;
311 }
312 
313 
318 static int
319 notify_send_udp(notify_type* notify, buffer_type* buffer)
320 {
321  struct sockaddr_storage to;
322  socklen_t to_len = 0;
323  int fd = -1;
324  int family = PF_INET;
325  ssize_t nb = 0;
326  ods_log_assert(buffer);
327  ods_log_assert(notify);
328  ods_log_assert(notify->secondary);
329  ods_log_assert(notify->secondary->address);
330  /* this will set the remote port to acl->port or TCP_PORT */
331  to_len = xfrd_acl_sockaddr_to(notify->secondary, &to);
332  /* get the address family of the remote host */
333  if (notify->secondary->family == AF_INET6) {
334  family = PF_INET6;
335  }
336  /* create socket */
337  fd = socket(family, SOCK_DGRAM, IPPROTO_UDP);
338  if (fd == -1) {
339  ods_log_error("[%s] unable to send data over udp to %s: "
340  "socket() failed (%s)", notify_str, notify->secondary->address,
341  strerror(errno));
342  return -1;
343  }
344  /* bind it? */
345 
346  /* send it (udp) */
347  ods_log_deeebug("[%s] send %d bytes over udp to %s", notify_str,
348  buffer_remaining(buffer), notify->secondary->address);
349  nb = sendto(fd, buffer_current(buffer), buffer_remaining(buffer), 0,
350  (struct sockaddr*)&to, to_len);
351  if (nb == -1) {
352  ods_log_error("[%s] unable to send data over udp to %s: "
353  "sendto() failed (%s)", notify_str, notify->secondary->address,
354  strerror(errno));
355  close(fd);
356  return -1;
357  }
358  return fd;
359 }
360 
361 
366 static void
367 notify_tsig_sign(notify_type* notify, buffer_type* buffer)
368 {
369  tsig_algo_type* algo = NULL;
370  if (!notify || !notify->tsig_rr || !notify->secondary ||
371  !notify->secondary->tsig || !notify->secondary->tsig->key ||
372  !buffer) {
373  return; /* no tsig configured */
374  }
375  algo = tsig_lookup_algo(notify->secondary->tsig->algorithm);
376  if (!algo) {
377  ods_log_error("[%s] unable to sign notify: tsig unknown algorithm "
378  "%s", notify_str, notify->secondary->tsig->algorithm);
379  return;
380  }
381  ods_log_assert(algo);
382  tsig_rr_reset(notify->tsig_rr, algo, notify->secondary->tsig->key);
383  notify->tsig_rr->original_query_id = buffer_pkt_id(buffer);
384  notify->tsig_rr->algo_name =
385  ldns_rdf_clone(notify->tsig_rr->algo->wf_name);
386  notify->tsig_rr->key_name = ldns_rdf_clone(notify->tsig_rr->key->dname);
387  log_dname(notify->tsig_rr->key_name, "tsig sign notify with key",
388  LOG_DEBUG);
389  log_dname(notify->tsig_rr->algo_name, "tsig sign notify with algorithm",
390  LOG_DEBUG);
391  tsig_rr_prepare(notify->tsig_rr);
392  tsig_rr_update(notify->tsig_rr, buffer, buffer_position(buffer));
393  tsig_rr_sign(notify->tsig_rr);
394  ods_log_debug("[%s] tsig append rr to notify id=%u", notify_str,
395  buffer_pkt_id(buffer));
396  tsig_rr_append(notify->tsig_rr, buffer);
397  buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)+1);
398  tsig_rr_prepare(notify->tsig_rr);
399  return;
400 }
401 
402 
407 void
409 {
410  xfrhandler_type* xfrhandler = NULL;
411  zone_type* zone = NULL;
412  ods_log_assert(notify);
413  ods_log_assert(notify->secondary);
414  ods_log_assert(notify->secondary->address);
415  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
416  zone = (zone_type*) notify->zone;
417  ods_log_assert(xfrhandler);
418  ods_log_assert(zone);
419  ods_log_assert(zone->name);
420  if (notify->handler.fd != -1) {
421  close(notify->handler.fd);
422  }
423  notify->handler.fd = -1;
424  notify->timeout.tv_sec = notify_time(notify) + NOTIFY_RETRY_TIMEOUT;
425  buffer_pkt_notify(xfrhandler->packet, zone->apex, LDNS_RR_CLASS_IN);
426  notify->query_id = buffer_pkt_id(xfrhandler->packet);
427  buffer_pkt_set_aa(xfrhandler->packet);
428  /* add current SOA to answer section */
429  if (notify->soa) {
430  if (buffer_write_rr(xfrhandler->packet, notify->soa)) {
431  buffer_pkt_set_ancount(xfrhandler->packet, 1);
432  }
433  }
434  if (notify->secondary->tsig) {
435  notify_tsig_sign(notify, xfrhandler->packet);
436  }
437  buffer_flip(xfrhandler->packet);
438  notify->handler.fd = notify_send_udp(notify, xfrhandler->packet);
439  if (notify->handler.fd == -1) {
440  ods_log_error("[%s] unable to send notify retry %u for zone %s to "
441  "%s: notify_send_udp() failed", notify_str, notify->retry,
442  zone->name, notify->secondary->address);
443  return;
444  }
445  ods_log_verbose("[%s] notify retry %u for zone %s sent to %s", notify_str,
446  notify->retry, zone->name, notify->secondary->address);
447  return;
448 }
449 
450 
455 static void
456 notify_handle_zone(netio_type* ATTR_UNUSED(netio),
457  netio_handler_type* handler, netio_events_type event_types)
458 {
459  notify_type* notify = NULL;
460  xfrhandler_type* xfrhandler = NULL;
461  zone_type* zone = NULL;
462  if (!handler) {
463  return;
464  }
465  notify = (notify_type*) handler->user_data;
466  ods_log_assert(notify);
467  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
468  zone = (zone_type*) notify->zone;
469  ods_log_assert(xfrhandler);
470  ods_log_assert(zone);
471  ods_log_assert(zone->name);
472  ods_log_debug("[%s] handle notify for zone %s", notify_str, zone->name);
473 
474  if (notify->is_waiting) {
475  ods_log_debug("[%s] already waiting, skipping notify for zone %s",
476  notify_str, zone->name);
477  ods_log_assert(notify->handler.fd == -1);
478  return;
479  }
480  if (event_types & NETIO_EVENT_READ) {
481  ods_log_debug("[%s] read notify ok for zone %s", notify_str,
482  zone->name);
483  ods_log_assert(notify->handler.fd != -1);
484  if (notify_udp_read_packet(notify)) {
485  if (notify_handle_reply(notify)) {
486  notify_next(notify);
487  }
488  }
489  } else if(event_types & NETIO_EVENT_TIMEOUT) {
490  ods_log_debug("[%s] notify timeout for zone %s", notify_str,
491  zone->name);
492  /* timeout, try again */
493  }
494  /* see if notify is still enabled */
495  if (notify->secondary) {
496  ods_log_assert(notify->secondary->address);
497  notify->retry++;
498  if (notify->retry > NOTIFY_MAX_RETRY) {
499  ods_log_verbose("[%s] notify max retry for zone %s, %s unreachable",
500  notify_str, zone->name, notify->secondary->address);
501  notify_next(notify);
502  } else {
503  notify_send(notify);
504  }
505  }
506  return;
507 }
508 
509 
514 static void
515 notify_update_soa(notify_type* notify, ldns_rr* soa)
516 {
517  if (!notify) {
518  return;
519  }
520  if (notify->soa) {
521  ldns_rr_free(notify->soa);
522  }
523  notify->soa = soa;
524  return;
525 }
526 
527 
532 void
533 notify_enable(notify_type* notify, ldns_rr* soa)
534 {
535  xfrhandler_type* xfrhandler = NULL;
536  zone_type* zone = NULL;
537  dnsout_type* dnsout = NULL;
538  if (!notify) {
539  return;
540  }
541  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
542  ods_log_assert(xfrhandler);
543  zone = (zone_type*) notify->zone;
544  ods_log_assert(zone);
545  ods_log_assert(zone->name);
546  ods_log_assert(zone->adoutbound);
549  dnsout = (dnsout_type*) zone->adoutbound->config;
550  if (!dnsout->do_notify) {
551  ods_log_warning("[%s] zone %s has no notify acl", notify_str,
552  zone->name);
553  return; /* nothing to do */
554  }
555  if (notify->is_waiting || notify->handler.fd != -1) {
556  ods_log_debug("[%s] zone %s already on waiting list", notify_str,
557  zone->name);
558  return;
559  }
560  notify_update_soa(notify, soa);
561  if (xfrhandler->notify_udp_num < NOTIFY_MAX_UDP) {
562  notify_setup(notify);
563  xfrhandler->notify_udp_num++;
564  ods_log_debug("[%s] zone %s notify enabled", notify_str,
565  zone->name);
566  return;
567  }
568  /* put it in waiting list */
569  notify->secondary = dnsout->do_notify;
570  notify->is_waiting = 1;
571  notify->waiting_next = NULL;
572  if (xfrhandler->notify_waiting_last) {
573  xfrhandler->notify_waiting_last->waiting_next = notify;
574  } else {
575  xfrhandler->notify_waiting_first = notify;
576  }
577  xfrhandler->notify_waiting_last = notify;
578  notify->handler.timeout = NULL;
579  ods_log_debug("[%s] zone %s notify on waiting list", notify_str,
580  zone->name);
581  return;
582 }
583 
584 
589 void
591 {
592  allocator_type* allocator = NULL;
593  if (!notify) {
594  return;
595  }
596  allocator = notify->allocator;
597  if (notify->handler.fd != -1) {
598  close(notify->handler.fd);
599  notify->handler.fd = -1;
600  }
601  if (notify->soa) {
602  ldns_rr_free(notify->soa);
603  }
604  tsig_rr_cleanup(notify->tsig_rr);
605  allocator_deallocate(allocator, (void*) notify);
606  allocator_cleanup(allocator);
607  return;
608 }
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:605
#define PF_INET6
Definition: netio.h:61
void notify_enable(notify_type *notify, ldns_rr *soa)
Definition: notify.c:533
void notify_send(notify_type *notify)
Definition: notify.c:408
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:289
#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:333
void tsig_rr_append(tsig_rr_type *trr, buffer_type *buffer)
Definition: tsig.c:721
uint16_t buffer_pkt_id(buffer_type *buffer)
Definition: buffer.c:811
void notify_cleanup(notify_type *notify)
Definition: notify.c:590
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:580
tsig_key_type * key
Definition: tsig.h:116
time_t xfrhandler_time(xfrhandler_type *xfrhandler)
Definition: xfrhandler.c:157
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:65
netio_event_handler_type event_handler
Definition: netio.h:131
void tsig_rr_cleanup(tsig_rr_type *trr)
Definition: tsig.c:884
void log_dname(ldns_rdf *rdf, const char *pre, int level)
Definition: domain.c:48
notify_type * notify_waiting_last
Definition: xfrhandler.h:66
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:306
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
size_t limit
Definition: buffer.h:114
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:677
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