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