]> git.ipfire.org Git - thirdparty/dhcp.git/blame - includes/omapip/isclib.h
copy rights update
[thirdparty/dhcp.git] / includes / omapip / isclib.h
CommitLineData
98bf1607
SR
1/* isclib.h
2
3 connections to the isc and dns libraries */
4
5/*
49a7fb58 6 * Copyright (C) 2009-2022 Internet Systems Consortium, Inc. ("ISC")
98bf1607 7 *
7512d88b
TM
8 * This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this
10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
98bf1607
SR
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.
429a56d7
TM
21 * PO Box 360
22 * Newmarket, NH 03857 USA
98bf1607
SR
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
8194daab
TM
51#include <isc/boolean.h>
52#include <isc/int.h>
53
98bf1607
SR
54#include <isc/buffer.h>
55#include <isc/lex.h>
56#include <isc/lib.h>
57#include <isc/app.h>
58#include <isc/mem.h>
59#include <isc/parseint.h>
60#include <isc/socket.h>
61#include <isc/sockaddr.h>
62#include <isc/task.h>
63#include <isc/timer.h>
64#include <isc/heap.h>
65#include <isc/random.h>
66
e54ff84f
SR
67#include <irs/resconf.h>
68
98bf1607
SR
69#include <dns/client.h>
70#include <dns/fixedname.h>
71#include <dns/keyvalues.h>
72#include <dns/lib.h>
73#include <dns/name.h>
74#include <dns/rdata.h>
75#include <dns/rdataclass.h>
76#include <dns/rdatalist.h>
77#include <dns/rdataset.h>
78#include <dns/rdatastruct.h>
79#include <dns/rdatatype.h>
80#include <dns/result.h>
81#include <dns/secalg.h>
82#include <dns/tsec.h>
83
84#include <dst/dst.h>
85
86#include "result.h"
87
88
89/*
90 * DHCP context structure
91 * This holds the libisc information for a dhcp entity
92 */
93
94typedef struct dhcp_context {
95 isc_mem_t *mctx;
96 isc_appctx_t *actx;
0cd94b5e
TM
97 int actx_started; // ISC_TRUE if ctxstart has been called
98 int actx_running; // ISC_TRUE if ctxrun has been called
98bf1607
SR
99 isc_taskmgr_t *taskmgr;
100 isc_task_t *task;
101 isc_socketmgr_t *socketmgr;
102 isc_timermgr_t *timermgr;
103#if defined (NSUPDATE)
104 dns_client_t *dnsclient;
ca22af89
TM
105 int use_local4;
106 isc_sockaddr_t local4_sockaddr;
107 int use_local6;
108 isc_sockaddr_t local6_sockaddr;
98bf1607
SR
109#endif
110} dhcp_context_t;
111
112extern dhcp_context_t dhcp_gbl_ctx;
113
114#define DHCP_MAXDNS_WIRE 256
115#define DHCP_MAXNS 3
116#define DHCP_HMAC_MD5_NAME "HMAC-MD5.SIG-ALG.REG.INT."
3ffc07de
TM
117#define DHCP_HMAC_SHA1_NAME "HMAC-SHA1.SIG-ALG.REG.INT."
118#define DHCP_HMAC_SHA224_NAME "HMAC-SHA224.SIG-ALG.REG.INT."
119#define DHCP_HMAC_SHA256_NAME "HMAC-SHA256.SIG-ALG.REG.INT."
120#define DHCP_HMAC_SHA384_NAME "HMAC-SHA384.SIG-ALG.REG.INT."
121#define DHCP_HMAC_SHA512_NAME "HMAC-SHA512.SIG-ALG.REG.INT."
98bf1607
SR
122
123isc_result_t dhcp_isc_name(unsigned char *namestr,
124 dns_fixedname_t *namefix,
125 dns_name_t **name);
126
127isc_result_t
128isclib_make_dst_key(char *inname,
129 char *algorithm,
130 unsigned char *secret,
131 int length,
132 dst_key_t **dstkey);
133
61ef216b
SR
134#define DHCP_CONTEXT_PRE_DB 1
135#define DHCP_CONTEXT_POST_DB 2
ca22af89 136#define DHCP_DNS_CLIENT_LAZY_INIT 4
61ef216b
SR
137isc_result_t dhcp_context_create(int flags,
138 struct in_addr *local4,
139 struct in6_addr *local6);
98bf1607
SR
140void isclib_cleanup(void);
141
47e8308d 142void dhcp_signal_handler(int signal);
0895c955 143extern int shutdown_signal;
47e8308d 144
1c779d3b 145#if defined (NSUPDATE)
ca22af89 146isc_result_t dns_client_init();
5df5813d
TM
147#endif /* defined NSUPDATE */
148
ca22af89 149
98bf1607 150#endif /* ISCLIB_H */