OpenDNSSEC-signer  1.3.16
zone_fetcher.h
Go to the documentation of this file.
1 /*
2  * $Id: zone_fetcher.h 5163 2011-05-26 12:40:24Z matthijs $
3  *
4  * Copyright (c) 2009 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 #include <arpa/inet.h>
29 #include <netdb.h>
30 #include <netinet/in.h>
31 #include <stdio.h>
32 #include <stdint.h>
33 #include <string.h>
34 #include <sys/time.h>
35 #include <sys/types.h>
36 #include <sys/param.h>
37 #include <sys/select.h>
38 #include <sys/socket.h>
39 #include <unistd.h>
40 
41 #include "config.h"
42 
43 #ifndef TOOLS_ZONEFETCHER_H
44 #define TOOLS_ZONEFETCHER_H
45 
46 #define DNS_PORT_STRING "53"
47 #define INBUF_SIZE 4096 /* max size for incoming queries */
48 #define MAX_INTERFACES 128
49 
54  struct in_addr addr;
55  struct in6_addr addr6;
56 };
57 
63 {
64  int family;
65  const char* port; /* 0 == no port */
66  const char* ipaddr;
69 };
70 
76 {
77  const char* name;
78  ldns_rdf* dname;
79  char* input_file;
81 };
82 
86 typedef struct config_struct config_type;
88 {
89  int use_tsig;
90  char* tsig_name;
91  char* tsig_algo;
92  char* tsig_secret;
93  char* pidfile;
94  const char* zonelist_file;
98 };
99 
104 {
105  struct addrinfo* addr;
106  int s;
107 };
108 
111 {
114 };
115 
120  int udp_sock;
121  struct sockaddr_storage addr_him;
122  socklen_t hislen;
123 };
124 
126  int s;
127 };
128 
129 
134 int
135 tools_zone_fetcher(const char* config_file, const char* zonelist_file,
136  const char* group, const char* user, const char* chroot,
137  const char* log_file, int use_syslog, int verbosity);
138 
139 #endif /* TOOLS_ZONEFETCHER_H */
const char * ipaddr
Definition: zone_fetcher.h:66
serverlist_type * notifylist
Definition: zone_fetcher.h:97
zfzonelist_type * zonelist
Definition: zone_fetcher.h:95
const char * name
Definition: zone_fetcher.h:77
union acl_addr_storage addr
Definition: zone_fetcher.h:67
ldns_rdf * dname
Definition: zone_fetcher.h:78
char * pidfile
Definition: zone_fetcher.h:93
#define MAX_INTERFACES
Definition: zone_fetcher.h:48
zfzonelist_type * next
Definition: zone_fetcher.h:80
struct odd_socket udp[MAX_INTERFACES]
Definition: zone_fetcher.h:113
struct odd_socket tcp[MAX_INTERFACES]
Definition: zone_fetcher.h:112
serverlist_type * next
Definition: zone_fetcher.h:68
char * tsig_name
Definition: zone_fetcher.h:90
char * tsig_secret
Definition: zone_fetcher.h:92
int tools_zone_fetcher(const char *config_file, const char *zonelist_file, const char *group, const char *user, const char *chroot, const char *log_file, int use_syslog, int verbosity)
const char * zonelist_file
Definition: zone_fetcher.h:94
serverlist_type * serverlist
Definition: zone_fetcher.h:96
struct sockaddr_storage addr_him
Definition: zone_fetcher.h:121
struct addrinfo * addr
Definition: zone_fetcher.h:105
struct in_addr addr
Definition: zone_fetcher.h:54
const char * port
Definition: zone_fetcher.h:65
char * tsig_algo
Definition: zone_fetcher.h:91
struct in6_addr addr6
Definition: zone_fetcher.h:55