ISC DHCP  4.3.1
A reference DHCPv4 and DHCPv6 implementation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
isclib.h
Go to the documentation of this file.
1 /* isclib.h
2 
3  connections to the isc and dns libraries */
4 
5 /*
6  * Copyright (c) 2009,2013 by Internet Systems Consortium, Inc. ("ISC")
7  *
8  * Permission to use, copy, modify, and distribute this software for any
9  * purpose with or without fee is hereby granted, provided that the above
10  * copyright notice and this permission notice appear in all copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
13  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
15  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
18  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19  *
20  * Internet Systems Consortium, Inc.
21  * 950 Charter Street
22  * Redwood City, CA 94063
23  * <info@isc.org>
24  * http://www.isc.org/
25  *
26  */
27 
28 #ifndef ISCLIB_H
29 #define ISCLIB_H
30 
31 #include "config.h"
32 
33 #include <syslog.h>
34 
35 #define MAXWIRE 256
36 
37 #include <sys/types.h>
38 #include <sys/socket.h>
39 
40 #include <netinet/in.h>
41 
42 #include <arpa/inet.h>
43 
44 #include <unistd.h>
45 #include <ctype.h>
46 #include <stdio.h>
47 #include <stdlib.h>
48 #include <string.h>
49 #include <netdb.h>
50 
51 #include <isc/buffer.h>
52 #include <isc/lex.h>
53 #include <isc/lib.h>
54 #include <isc/app.h>
55 #include <isc/mem.h>
56 #include <isc/parseint.h>
57 #include <isc/socket.h>
58 #include <isc/sockaddr.h>
59 #include <isc/task.h>
60 #include <isc/timer.h>
61 #include <isc/heap.h>
62 #include <isc/random.h>
63 
64 #include <irs/resconf.h>
65 
66 #include <dns/client.h>
67 #include <dns/fixedname.h>
68 #include <dns/keyvalues.h>
69 #include <dns/lib.h>
70 #include <dns/name.h>
71 #include <dns/rdata.h>
72 #include <dns/rdataclass.h>
73 #include <dns/rdatalist.h>
74 #include <dns/rdataset.h>
75 #include <dns/rdatastruct.h>
76 #include <dns/rdatatype.h>
77 #include <dns/result.h>
78 #include <dns/secalg.h>
79 #include <dns/tsec.h>
80 
81 #include <dst/dst.h>
82 
83 #include "result.h"
84 
85 
86 /*
87  * DHCP context structure
88  * This holds the libisc information for a dhcp entity
89  */
90 
91 typedef struct dhcp_context {
92  isc_mem_t *mctx;
93  isc_appctx_t *actx;
95  isc_taskmgr_t *taskmgr;
96  isc_task_t *task;
97  isc_socketmgr_t *socketmgr;
98  isc_timermgr_t *timermgr;
99 #if defined (NSUPDATE)
100  dns_client_t *dnsclient;
101 #endif
103 
105 
106 #define DHCP_MAXDNS_WIRE 256
107 #define DHCP_MAXNS 3
108 #define DHCP_HMAC_MD5_NAME "HMAC-MD5.SIG-ALG.REG.INT."
109 
110 isc_result_t dhcp_isc_name(unsigned char *namestr,
111  dns_fixedname_t *namefix,
112  dns_name_t **name);
113 
114 isc_result_t
115 isclib_make_dst_key(char *inname,
116  char *algorithm,
117  unsigned char *secret,
118  int length,
119  dst_key_t **dstkey);
120 
121 #define DHCP_CONTEXT_PRE_DB 1
122 #define DHCP_CONTEXT_POST_DB 2
123 isc_result_t dhcp_context_create(int flags,
124  struct in_addr *local4,
125  struct in6_addr *local6);
126 void isclib_cleanup(void);
127 
128 void dhcp_signal_handler(int signal);
129 extern int shutdown_signal;
130 
131 #endif /* ISCLIB_H */
isc_result_t dhcp_isc_name(unsigned char *namestr, dns_fixedname_t *namefix, dns_name_t **name)
Definition: isclib.c:263
dhcp_context_t dhcp_gbl_ctx
Definition: isclib.c:33
isc_timermgr_t * timermgr
Definition: isclib.h:98
isc_taskmgr_t * taskmgr
Definition: isclib.h:95
isc_socketmgr_t * socketmgr
Definition: isclib.h:97
isc_mem_t * mctx
Definition: isclib.h:92
void dhcp_signal_handler(int signal)
Definition: isclib.c:316
isc_result_t dhcp_context_create(int flags, struct in_addr *local4, struct in6_addr *local6)
Definition: isclib.c:124
int actx_started
Definition: isclib.h:94
isc_appctx_t * actx
Definition: isclib.h:93
int shutdown_signal
Definition: isclib.c:34
isc_result_t isclib_make_dst_key(char *inname, char *algorithm, unsigned char *secret, int length, dst_key_t **dstkey)
Definition: isclib.c:282
struct dhcp_context dhcp_context_t
void isclib_cleanup(void)
Definition: isclib.c:88
isc_task_t * task
Definition: isclib.h:96