OpenDNSSEC-signer
1.3.16
Main Page
Data Structures
Files
File List
Globals
signer
src
tools
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
53
union
acl_addr_storage
{
54
struct
in_addr
addr
;
55
struct
in6_addr
addr6
;
56
};
57
61
typedef
struct
serverlist_struct
serverlist_type
;
62
struct
serverlist_struct
63
{
64
int
family
;
65
const
char
*
port
;
/* 0 == no port */
66
const
char
*
ipaddr
;
67
union
acl_addr_storage
addr
;
68
serverlist_type
*
next
;
69
};
70
74
typedef
struct
zfzonelist_struct
zfzonelist_type
;
75
struct
zfzonelist_struct
76
{
77
const
char
*
name
;
78
ldns_rdf*
dname
;
79
char
*
input_file
;
80
zfzonelist_type
*
next
;
81
};
82
86
typedef
struct
config_struct
config_type
;
87
struct
config_struct
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
;
95
zfzonelist_type
*
zonelist
;
96
serverlist_type
*
serverlist
;
97
serverlist_type
*
notifylist
;
98
};
99
103
struct
odd_socket
104
{
105
struct
addrinfo*
addr
;
106
int
s
;
107
};
108
109
typedef
struct
sockets_struct
sockets_type
;
110
struct
sockets_struct
111
{
112
struct
odd_socket
tcp
[
MAX_INTERFACES
];
113
struct
odd_socket
udp
[
MAX_INTERFACES
];
114
};
115
119
struct
handle_udp_userdata
{
120
int
udp_sock
;
121
struct
sockaddr_storage
addr_him
;
122
socklen_t
hislen
;
123
};
124
125
struct
handle_tcp_userdata
{
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 */
sockets_struct
Definition:
zone_fetcher.h:110
handle_udp_userdata
Definition:
zone_fetcher.h:119
serverlist_struct::ipaddr
const char * ipaddr
Definition:
zone_fetcher.h:66
config_struct::notifylist
serverlist_type * notifylist
Definition:
zone_fetcher.h:97
config_struct::zonelist
zfzonelist_type * zonelist
Definition:
zone_fetcher.h:95
config_struct::use_tsig
int use_tsig
Definition:
zone_fetcher.h:89
zfzonelist_struct::name
const char * name
Definition:
zone_fetcher.h:77
serverlist_struct::addr
union acl_addr_storage addr
Definition:
zone_fetcher.h:67
handle_udp_userdata::udp_sock
int udp_sock
Definition:
zone_fetcher.h:120
serverlist_struct
Definition:
zone_fetcher.h:62
zfzonelist_struct
Definition:
zone_fetcher.h:75
zfzonelist_struct::dname
ldns_rdf * dname
Definition:
zone_fetcher.h:78
config_struct::pidfile
char * pidfile
Definition:
zone_fetcher.h:93
MAX_INTERFACES
#define MAX_INTERFACES
Definition:
zone_fetcher.h:48
config_struct
Definition:
zone_fetcher.h:87
zfzonelist_struct::next
zfzonelist_type * next
Definition:
zone_fetcher.h:80
odd_socket::s
int s
Definition:
zone_fetcher.h:106
sockets_struct::udp
struct odd_socket udp[MAX_INTERFACES]
Definition:
zone_fetcher.h:113
sockets_struct::tcp
struct odd_socket tcp[MAX_INTERFACES]
Definition:
zone_fetcher.h:112
acl_addr_storage
Definition:
zone_fetcher.h:53
handle_udp_userdata::hislen
socklen_t hislen
Definition:
zone_fetcher.h:122
serverlist_struct::next
serverlist_type * next
Definition:
zone_fetcher.h:68
odd_socket
Definition:
zone_fetcher.h:103
config_struct::tsig_name
char * tsig_name
Definition:
zone_fetcher.h:90
zfzonelist_struct::input_file
char * input_file
Definition:
zone_fetcher.h:79
config_struct::tsig_secret
char * tsig_secret
Definition:
zone_fetcher.h:92
tools_zone_fetcher
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)
Definition:
zone_fetcher.c:1495
config_struct::zonelist_file
const char * zonelist_file
Definition:
zone_fetcher.h:94
config_struct::serverlist
serverlist_type * serverlist
Definition:
zone_fetcher.h:96
handle_tcp_userdata
Definition:
zone_fetcher.h:125
handle_udp_userdata::addr_him
struct sockaddr_storage addr_him
Definition:
zone_fetcher.h:121
odd_socket::addr
struct addrinfo * addr
Definition:
zone_fetcher.h:105
acl_addr_storage::addr
struct in_addr addr
Definition:
zone_fetcher.h:54
serverlist_struct::port
const char * port
Definition:
zone_fetcher.h:65
config_struct::tsig_algo
char * tsig_algo
Definition:
zone_fetcher.h:91
handle_tcp_userdata::s
int s
Definition:
zone_fetcher.h:126
acl_addr_storage::addr6
struct in6_addr addr6
Definition:
zone_fetcher.h:55
serverlist_struct::family
int family
Definition:
zone_fetcher.h:64
Generated on Tue Dec 17 2013 16:35:23 for OpenDNSSEC-signer by
1.8.5