OpenDNSSEC-signer  2.1.9
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 }
93 
94 
101 {
102  notify_type* notify = NULL;
103  if (!xfrhandler || !zone) {
104  return NULL;
105  }
106  CHECKALLOC(notify = (notify_type*) malloc(sizeof(notify_type)));
107  if (!notify) {
108  ods_log_error("[%s] unable to create notify structure: "
109  " allocator_alloc() failed", notify_str);
110  return NULL;
111  }
112  notify->zone = zone;
113  notify->xfrhandler = xfrhandler;
114  notify->waiting_next = NULL;
115  notify->secondary = NULL;
116  notify->soa = NULL;
117  notify->tsig_rr = tsig_rr_create();
118  if (!notify->tsig_rr) {
119  notify_cleanup(notify);
120  return NULL;
121  }
122  notify->retry = 0;
123  notify->query_id = 0;
124  notify->is_waiting = 0;
125  notify->handler.fd = -1;
126  notify->timeout.tv_sec = 0;
127  notify->timeout.tv_nsec = 0;
128  notify->handler.timeout = NULL;
129  notify->handler.user_data = notify;
130  notify->handler.event_types =
132  notify->handler.event_handler = notify_handle_zone;
133  return notify;
134 }
135 
136 
141 static void
142 notify_setup(notify_type* notify)
143 {
144  zone_type* zone = NULL;
145  dnsout_type* dnsout = NULL;
146  if (!notify) {
147  return;
148  }
149  zone = (zone_type*) notify->zone;
150  ods_log_assert(zone);
151  ods_log_assert(zone->adoutbound);
152  ods_log_assert(zone->adoutbound->config);
153  ods_log_assert(zone->adoutbound->type == ADAPTER_DNS);
154  dnsout = (dnsout_type*) zone->adoutbound->config;
155  notify->retry = 0;
156  notify->secondary = dnsout->do_notify;
157  ods_log_debug("[%s] setup notify for zone %s", notify_str, zone->name);
158  notify_set_timer(notify, notify_time(notify));
159 }
160 
161 
166 static void
167 notify_disable(notify_type* notify)
168 {
169  xfrhandler_type* xfrhandler = NULL;
170  zone_type* zone = NULL;
171  if (!notify) {
172  return;
173  }
174  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
175  ods_log_assert(xfrhandler);
176  zone = (zone_type*) notify->zone;
177  ods_log_assert(zone);
178  ods_log_assert(zone->name);
179  notify->secondary = NULL;
180  notify->handler.timeout = NULL;
181  if (notify->handler.fd != -1) {
182  close(notify->handler.fd);
183  notify->handler.fd = -1;
184  }
185  if (xfrhandler->notify_udp_num == NOTIFY_MAX_UDP) {
186  while (xfrhandler->notify_waiting_first) {
187  notify_type* wn = xfrhandler->notify_waiting_first;
188  ods_log_assert(wn->is_waiting);
189  wn->is_waiting = 0;
190  xfrhandler->notify_waiting_first = wn->waiting_next;
191  if (xfrhandler->notify_waiting_last == wn) {
192  xfrhandler->notify_waiting_last = NULL;
193  }
194  if (wn->secondary) {
195  ods_log_debug("[%s] zone %s notify off waiting list",
196  notify_str, zone->name);
197  notify_setup(wn);
198  return;
199  }
200  }
201  }
202  ods_log_debug("[%s] notify for zone %s disabled", notify_str, zone->name);
203  xfrhandler->notify_udp_num--;
204 }
205 
206 
211 static void
212 notify_next(notify_type* notify)
213 {
214  if (!notify || !notify->secondary) {
215  return;
216  }
217  notify->secondary = notify->secondary->next;
218  notify->retry = 0;
219  if (!notify->secondary) {
220  zone_type* zone = (zone_type*) notify->zone;
221  ods_log_assert(zone);
222  ods_log_assert(zone->name);
223  ods_log_debug("[%s] zone %s no more secondaries, disable notify",
224  notify_str, zone->name);
225  notify_disable(notify);
226  }
227 }
228 
229 
234 static int
235 notify_udp_read_packet(notify_type* notify)
236 {
237  xfrhandler_type* xfrhandler = NULL;
238  ssize_t received = 0;
239  ods_log_assert(notify);
240  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
241  ods_log_assert(xfrhandler);
242  buffer_clear(xfrhandler->packet);
243  received = recvfrom(notify->handler.fd, buffer_begin(xfrhandler->packet),
244  buffer_remaining(xfrhandler->packet), 0, NULL, NULL);
245  if (received == -1) {
246  ods_log_error("[%s] unable to read packet: recvfrom() failed fd %d "
247  "(%s)", notify_str, notify->handler.fd, strerror(errno));
248  return 0;
249  }
250  buffer_set_limit(xfrhandler->packet, received);
251  return 1;
252 }
253 
254 
259 static int
260 notify_handle_reply(notify_type* notify)
261 {
262  xfrhandler_type* xfrhandler = NULL;
263  zone_type* zone = NULL;
264  ods_log_assert(notify);
265  ods_log_assert(notify->secondary);
266  ods_log_assert(notify->secondary->address);
267  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
268  zone = (zone_type*) notify->zone;
269  ods_log_assert(xfrhandler);
270  ods_log_assert(zone);
271  ods_log_assert(zone->name);
272  if (xfrhandler->packet->limit < 3 ||
273  (buffer_pkt_opcode(xfrhandler->packet) != LDNS_PACKET_NOTIFY) ||
274  (buffer_pkt_qr(xfrhandler->packet) == 0)) {
275  ods_log_error("[%s] zone %s received bad notify reply opcode/qr from %s",
276  notify_str, zone->name, notify->secondary->address);
277  return 0;
278  }
279  if (buffer_pkt_id(xfrhandler->packet) != notify->query_id) {
280  ods_log_error("[%s] zone %s received bad notify reply id from %s",
281  notify_str, zone->name, notify->secondary->address);
282  return 0;
283  }
284  /* could check tsig */
285  if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOERROR) {
286  const char* str = buffer_rcode2str(buffer_pkt_rcode(xfrhandler->packet));
287  ods_log_error("[%s] zone %s received bad notify rcode %s from %s",
288  notify_str, zone->name, str?str:"UNKNOWN",
289  notify->secondary->address);
290  if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOTIMPL) {
291  return 1;
292  }
293  return 0;
294  }
295  ods_log_debug("[%s] zone %s secondary %s notify reply ok", notify_str,
296  zone->name, notify->secondary->address);
297  return 1;
298 }
299 
300 
305 static int
306 notify_send_udp(notify_type* notify, buffer_type* buffer)
307 {
308  struct sockaddr_storage to;
309  socklen_t to_len = 0;
310  int fd = -1;
311  int family = PF_INET;
312  ssize_t nb = 0;
313  ods_log_assert(buffer);
314  ods_log_assert(notify);
315  ods_log_assert(notify->secondary);
316  ods_log_assert(notify->secondary->address);
317  /* this will set the remote port to acl->port or TCP_PORT */
318  to_len = xfrd_acl_sockaddr_to(notify->secondary, &to);
319  /* get the address family of the remote host */
320  if (notify->secondary->family == AF_INET6) {
321  family = PF_INET6;
322  }
323  /* create socket */
324  fd = socket(family, SOCK_DGRAM, IPPROTO_UDP);
325  if (fd == -1) {
326  ods_log_error("[%s] unable to send data over udp to %s: "
327  "socket() failed (%s)", notify_str, notify->secondary->address,
328  strerror(errno));
329  return -1;
330  }
331  /* bind it */
332  interface_type interface = notify->xfrhandler->engine->dnshandler->interfaces->interfaces[0];
333  if (!interface.address) {
334  ods_log_error("[%s] unable to get the address of interface", notify_str);
335  close(fd);
336  return -1;
337  }
338  if (acl_parse_family(interface.address) == AF_INET) {
339  struct sockaddr_in addr;
340  addr.sin_family = acl_parse_family(interface.address);
341  addr.sin_addr = interface.addr.addr;
342  addr.sin_port = 0;
343  if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) != 0) {
344  ods_log_error("[%s] unable to bind address %s: bind failed %s", notify_str, interface.address, strerror(errno));
345  close(fd);
346  return -1;
347  }
348  }
349  else {
350  struct sockaddr_in6 addr6;
351  addr6.sin6_family = acl_parse_family(interface.address);
352  addr6.sin6_addr = interface.addr.addr6;
353  addr6.sin6_port = 0;
354  if (bind(fd, (struct sockaddr *) &addr6, sizeof(addr6)) != 0) {
355  ods_log_error("[%s] unable to bind address %s: bind() failed %s", notify_str, interface.address, strerror(errno));
356  close(fd);
357  return -1;
358  }
359  }
360 
361  /* send it (udp) */
362  ods_log_deeebug("[%s] send %ld bytes over udp to %s", notify_str,
363  (unsigned long)buffer_remaining(buffer), notify->secondary->address);
364  nb = sendto(fd, buffer_current(buffer), buffer_remaining(buffer), 0,
365  (struct sockaddr*)&to, to_len);
366  if (nb == -1) {
367  ods_log_error("[%s] unable to send data over udp to %s: "
368  "sendto() failed (%s)", notify_str, notify->secondary->address,
369  strerror(errno));
370  close(fd);
371  return -1;
372  }
373  return fd;
374 }
375 
376 
381 static void
382 notify_tsig_sign(notify_type* notify, buffer_type* buffer)
383 {
384  tsig_algo_type* algo = NULL;
385  if (!notify || !notify->tsig_rr || !notify->secondary ||
386  !notify->secondary->tsig || !notify->secondary->tsig->key ||
387  !buffer) {
388  return; /* no tsig configured */
389  }
390  algo = tsig_lookup_algo(notify->secondary->tsig->algorithm);
391  if (!algo) {
392  ods_log_error("[%s] unable to sign notify: tsig unknown algorithm "
393  "%s", notify_str, notify->secondary->tsig->algorithm);
394  return;
395  }
396  ods_log_assert(algo);
397  tsig_rr_reset(notify->tsig_rr, algo, notify->secondary->tsig->key);
398  notify->tsig_rr->original_query_id = buffer_pkt_id(buffer);
399  notify->tsig_rr->algo_name =
400  ldns_rdf_clone(notify->tsig_rr->algo->wf_name);
401  notify->tsig_rr->key_name = ldns_rdf_clone(notify->tsig_rr->key->dname);
402  log_dname(notify->tsig_rr->key_name, "tsig sign notify with key",
403  LOG_DEBUG);
404  log_dname(notify->tsig_rr->algo_name, "tsig sign notify with algorithm",
405  LOG_DEBUG);
406  tsig_rr_prepare(notify->tsig_rr);
407  tsig_rr_update(notify->tsig_rr, buffer, buffer_position(buffer));
408  tsig_rr_sign(notify->tsig_rr);
409  ods_log_debug("[%s] tsig append rr to notify id=%u", notify_str,
410  buffer_pkt_id(buffer));
411  tsig_rr_append(notify->tsig_rr, buffer);
412  buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)+1);
413  tsig_rr_prepare(notify->tsig_rr);
414 }
415 
416 
421 void
423 {
424  xfrhandler_type* xfrhandler = NULL;
425  zone_type* zone = NULL;
426  ods_log_assert(notify);
427  ods_log_assert(notify->secondary);
428  ods_log_assert(notify->secondary->address);
429  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
430  zone = (zone_type*) notify->zone;
431  ods_log_assert(xfrhandler);
432  ods_log_assert(zone);
433  ods_log_assert(zone->name);
434  if (notify->handler.fd != -1) {
435  close(notify->handler.fd);
436  }
437  notify->handler.fd = -1;
438  notify->timeout.tv_sec = notify_time(notify) + NOTIFY_RETRY_TIMEOUT;
439  buffer_pkt_notify(xfrhandler->packet, zone->apex, LDNS_RR_CLASS_IN);
440  notify->query_id = buffer_pkt_id(xfrhandler->packet);
441  buffer_pkt_set_aa(xfrhandler->packet);
442  /* add current SOA to answer section */
443  if (notify->soa) {
444  if (buffer_write_rr(xfrhandler->packet, notify->soa)) {
445  buffer_pkt_set_ancount(xfrhandler->packet, 1);
446  }
447  }
448  if (notify->secondary->tsig) {
449  notify_tsig_sign(notify, xfrhandler->packet);
450  }
451  buffer_flip(xfrhandler->packet);
452  notify->handler.fd = notify_send_udp(notify, xfrhandler->packet);
453  if (notify->handler.fd == -1) {
454  ods_log_error("[%s] unable to send notify retry %u for zone %s to "
455  "%s: notify_send_udp() failed", notify_str, notify->retry,
456  zone->name, notify->secondary->address);
457  return;
458  }
459  ods_log_verbose("[%s] notify retry %u for zone %s sent to %s", notify_str,
460  notify->retry, zone->name, notify->secondary->address);
461 }
462 
463 
468 static void
469 notify_handle_zone(netio_type* ATTR_UNUSED(netio),
470  netio_handler_type* handler, netio_events_type event_types)
471 {
472  notify_type* notify = NULL;
473  xfrhandler_type* xfrhandler = NULL;
474  zone_type* zone = NULL;
475  if (!handler) {
476  return;
477  }
478  notify = (notify_type*) handler->user_data;
479  ods_log_assert(notify);
480  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
481  zone = (zone_type*) notify->zone;
482  ods_log_assert(xfrhandler);
483  ods_log_assert(zone);
484  ods_log_assert(zone->name);
485  ods_log_debug("[%s] handle notify for zone %s", notify_str, zone->name);
486 
487  if (notify->is_waiting) {
488  ods_log_debug("[%s] already waiting, skipping notify for zone %s",
489  notify_str, zone->name);
490  ods_log_assert(notify->handler.fd == -1);
491  return;
492  }
493  if (event_types & NETIO_EVENT_READ) {
494  ods_log_debug("[%s] read notify ok for zone %s", notify_str,
495  zone->name);
496  ods_log_assert(notify->handler.fd != -1);
497  if (notify_udp_read_packet(notify)) {
498  if (notify_handle_reply(notify)) {
499  notify_next(notify);
500  }
501  }
502  } else if(event_types & NETIO_EVENT_TIMEOUT) {
503  ods_log_debug("[%s] notify timeout for zone %s", notify_str,
504  zone->name);
505  /* timeout, try again */
506  }
507  /* see if notify is still enabled */
508  if (notify->secondary) {
509  ods_log_assert(notify->secondary->address);
510  notify->retry++;
511  if (notify->retry > NOTIFY_MAX_RETRY) {
512  ods_log_verbose("[%s] notify max retry for zone %s, %s unreachable",
513  notify_str, zone->name, notify->secondary->address);
514  notify_next(notify);
515  } else {
516  notify_send(notify);
517  }
518  }
519 }
520 
521 
526 static void
527 notify_update_soa(notify_type* notify, ldns_rr* soa)
528 {
529  if (!notify) {
530  return;
531  }
532  if (notify->soa) {
533  ldns_rr_free(notify->soa);
534  }
535  notify->soa = soa;
536 }
537 
538 
543 void
544 notify_enable(notify_type* notify, ldns_rr* soa)
545 {
546  xfrhandler_type* xfrhandler = NULL;
547  zone_type* zone = NULL;
548  dnsout_type* dnsout = NULL;
549  if (!notify) {
550  return;
551  }
552  xfrhandler = (xfrhandler_type*) notify->xfrhandler;
553  ods_log_assert(xfrhandler);
554  zone = (zone_type*) notify->zone;
555  ods_log_assert(zone);
556  ods_log_assert(zone->name);
557  ods_log_assert(zone->adoutbound);
558  ods_log_assert(zone->adoutbound->config);
559  ods_log_assert(zone->adoutbound->type == ADAPTER_DNS);
560  dnsout = (dnsout_type*) zone->adoutbound->config;
561  if (!dnsout->do_notify) {
562  ods_log_warning("[%s] zone %s has no notify acl", notify_str,
563  zone->name);
564  return; /* nothing to do */
565  }
566  if (notify->is_waiting || notify->handler.fd != -1) {
567  ods_log_debug("[%s] zone %s already on waiting list", notify_str,
568  zone->name);
569  return;
570  }
571  notify_update_soa(notify, soa);
572  if (xfrhandler->notify_udp_num < NOTIFY_MAX_UDP) {
573  notify_setup(notify);
574  xfrhandler->notify_udp_num++;
575  ods_log_debug("[%s] zone %s notify enabled", notify_str,
576  zone->name);
577  return;
578  }
579  /* put it in waiting list */
580  notify->secondary = dnsout->do_notify;
581  notify->is_waiting = 1;
582  notify->waiting_next = NULL;
583  if (xfrhandler->notify_waiting_last) {
584  xfrhandler->notify_waiting_last->waiting_next = notify;
585  } else {
586  xfrhandler->notify_waiting_first = notify;
587  }
588  xfrhandler->notify_waiting_last = notify;
589  notify->handler.timeout = NULL;
590  ods_log_debug("[%s] zone %s notify on waiting list", notify_str,
591  zone->name);
592 }
593 
594 
599 void
601 {
602  if (!notify) {
603  return;
604  }
605  if (notify->handler.fd != -1) {
606  close(notify->handler.fd);
607  notify->handler.fd = -1;
608  }
609  if (notify->soa) {
610  ldns_rr_free(notify->soa);
611  }
612  tsig_rr_cleanup(notify->tsig_rr);
613  free(notify);
614 }
int acl_parse_family(const char *a)
Definition: acl.c:104
@ ADAPTER_DNS
Definition: adapter.h:42
void buffer_clear(buffer_type *buffer)
Definition: buffer.c:99
void buffer_set_limit(buffer_type *buffer, size_t limit)
Definition: buffer.c:385
int buffer_pkt_qr(buffer_type *buffer)
Definition: buffer.c:810
ldns_pkt_opcode buffer_pkt_opcode(buffer_type *buffer)
Definition: buffer.c:846
uint8_t * buffer_begin(buffer_type *buffer)
Definition: buffer.c:426
ldns_pkt_rcode buffer_pkt_rcode(buffer_type *buffer)
Definition: buffer.c:954
void buffer_flip(buffer_type *buffer)
Definition: buffer.c:112
size_t buffer_position(buffer_type *buffer)
Definition: buffer.c:125
void buffer_pkt_notify(buffer_type *buffer, ldns_rdf *qname, ldns_rr_class qclass)
Definition: buffer.c:1133
uint16_t buffer_pkt_arcount(buffer_type *buffer)
Definition: buffer.c:1066
uint8_t * buffer_current(buffer_type *buffer)
Definition: buffer.c:438
size_t buffer_remaining(buffer_type *buffer)
Definition: buffer.c:463
const char * buffer_rcode2str(ldns_pkt_rcode rcode)
Definition: buffer.c:978
int buffer_write_rr(buffer_type *buffer, ldns_rr *rr)
Definition: buffer.c:605
void buffer_pkt_set_ancount(buffer_type *buffer, uint16_t count)
Definition: buffer.c:1030
void buffer_pkt_set_aa(buffer_type *buffer)
Definition: buffer.c:882
void buffer_pkt_set_arcount(buffer_type *buffer, uint16_t count)
Definition: buffer.c:1078
uint16_t buffer_pkt_id(buffer_type *buffer)
Definition: buffer.c:751
void log_dname(ldns_rdf *rdf, const char *pre, int level)
Definition: domain.c:48
#define PF_INET6
Definition: netio.h:61
enum netio_events_enum netio_events_type
Definition: netio.h:76
#define PF_INET
Definition: netio.h:58
@ NETIO_EVENT_TIMEOUT
Definition: netio.h:74
@ NETIO_EVENT_READ
Definition: netio.h:71
notify_type * notify_create(xfrhandler_type *xfrhandler, zone_type *zone)
Definition: notify.c:100
void notify_send(notify_type *notify)
Definition: notify.c:422
void notify_cleanup(notify_type *notify)
Definition: notify.c:600
void notify_enable(notify_type *notify, ldns_rr *soa)
Definition: notify.c:544
#define NOTIFY_MAX_RETRY
Definition: notify.h:49
#define NOTIFY_RETRY_TIMEOUT
Definition: notify.h:50
#define NOTIFY_MAX_UDP
Definition: notify.h:48
int family
Definition: acl.h:63
acl_type * next
Definition: acl.h:59
char * address
Definition: acl.h:61
tsig_type * tsig
Definition: acl.h:69
void * config
Definition: adapter.h:61
adapter_mode type
Definition: adapter.h:58
size_t limit
Definition: buffer.h:114
acl_type * do_notify
Definition: addns.h:63
struct timespec * timeout
Definition: netio.h:115
netio_events_type event_types
Definition: netio.h:124
netio_event_handler_type event_handler
Definition: netio.h:131
void * user_data
Definition: netio.h:119
notify_type * waiting_next
Definition: notify.h:57
acl_type * secondary
Definition: notify.h:60
unsigned is_waiting
Definition: notify.h:67
struct timespec timeout
Definition: notify.h:64
xfrhandler_type * xfrhandler
Definition: notify.h:62
netio_handler_type handler
Definition: notify.h:63
uint8_t retry
Definition: notify.h:66
zone_type * zone
Definition: notify.h:61
tsig_rr_type * tsig_rr
Definition: notify.h:59
ldns_rr * soa
Definition: notify.h:58
uint16_t query_id
Definition: notify.h:65
ldns_rdf * wf_name
Definition: tsig.h:91
ldns_rdf * dname
Definition: tsig.h:79
tsig_algo_type * algo
Definition: tsig.h:129
tsig_key_type * key
Definition: tsig.h:130
uint16_t original_query_id
Definition: tsig.h:141
ldns_rdf * algo_name
Definition: tsig.h:135
ldns_rdf * key_name
Definition: tsig.h:134
tsig_key_type * key
Definition: tsig.h:115
const char * algorithm
Definition: tsig.h:113
buffer_type * packet
Definition: xfrhandler.h:62
notify_type * notify_waiting_last
Definition: xfrhandler.h:68
notify_type * notify_waiting_first
Definition: xfrhandler.h:67
ldns_rdf * apex
Definition: zone.h:61
const char * name
Definition: zone.h:69
adapter_type * adoutbound
Definition: zone.h:75
void tsig_rr_cleanup(tsig_rr_type *trr)
Definition: tsig.c:832
tsig_algo_type * tsig_lookup_algo(const char *name)
Definition: tsig.c:257
void tsig_rr_append(tsig_rr_type *trr, buffer_type *buffer)
Definition: tsig.c:672
void tsig_rr_sign(tsig_rr_type *trr)
Definition: tsig.c:629
void tsig_rr_reset(tsig_rr_type *trr, tsig_algo_type *algo, tsig_key_type *key)
Definition: tsig.c:292
void tsig_rr_update(tsig_rr_type *trr, buffer_type *buffer, size_t length)
Definition: tsig.c:559
void tsig_rr_prepare(tsig_rr_type *trr)
Definition: tsig.c:537
tsig_rr_type * tsig_rr_create()
Definition: tsig.c:274
socklen_t xfrd_acl_sockaddr_to(acl_type *acl, struct sockaddr_storage *to)
Definition: xfrd.c:537
time_t xfrhandler_time(xfrhandler_type *xfrhandler)
Definition: xfrhandler.c:141