]> git.ipfire.org Git - thirdparty/dhcp.git/blob - includes/minires/minires.h
- Replaced ./configure shellscripting with GNU Autoconf. [ISC-Bugs #16405b]
[thirdparty/dhcp.git] / includes / minires / minires.h
1 /*
2 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (c) 2001-2003 by Internet Software Consortium
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 *
17 * Internet Systems Consortium, Inc.
18 * 950 Charter Street
19 * Redwood City, CA 94063
20 * <info@isc.org>
21 * http://www.isc.org/
22 */
23
24 #include "cdefs.h"
25 #include "osdep.h"
26
27 #define _ns_flagdata MR_ns_flagdata
28
29 #include "minires/resolv.h"
30 #include "minires/res_update.h"
31 #include "isc-dhcp/result.h"
32
33 /*
34 * Based on the Dynamic DNS reference implementation by Viraj Bais
35 * <viraj_bais@ccm.fm.intel.com>
36 */
37
38 int minires_mkupdate (ns_updrec *, unsigned char *, unsigned);
39 int minires_update (ns_updrec *);
40 ns_updrec *minires_mkupdrec (int, const char *, unsigned int,
41 unsigned int, unsigned long);
42 void minires_freeupdrec (ns_updrec *);
43 int minires_nmkupdate (res_state, ns_updrec *, double *, unsigned *);
44 isc_result_t minires_nupdate (res_state, ns_updrec *);
45 int minires_ninit (res_state);
46 ns_rcode isc_rcode_to_ns (isc_result_t);
47
48 int MRns_name_compress(const char *, u_char *, size_t, const unsigned char **,
49 const unsigned char **);
50 int MRns_name_unpack(const unsigned char *, const unsigned char *,
51 const unsigned char *, unsigned char *, size_t);
52 int MRns_name_ntop(const unsigned char *, char *, size_t);
53 int MRns_name_pton(const char *, u_char *, size_t);
54
55 #if defined (MINIRES_LIB)
56 #define res_update minires_update
57 #define res_mkupdate minires_mkupdate
58 #define res_mkupdrec minires_mkupdrec
59 #define res_freeupdrec minires_freeupdrec
60 #define res_nmkupdate minires_nmkupdate
61 #define res_nupdate minires_nupdate
62 #define __p_type_syms MR__p_type_syms
63 #define dn_comp MRdn_comp
64 #define loc_aton MRloc_aton
65 #define sym_ston MRsym_ston
66 #define res_buildservicelist MRres_buildservicelist
67 #define res_destroyservicelist MRres_destroyservicelist
68 #define res_buildprotolist MRres_buildprotolist
69 #define res_destroyprotolist MRres_destroyprotolist
70 #define res_servicenumber MRres_servicenumber
71 #define res_protocolnumber MRres_protocolnumber
72 #define res_protocolname MRres_protocolname
73 #define res_servicename MRres_servicename
74 #define ns_datetosecs MRns_datetosecs
75 #define b64_pton MRb64_pton
76 #define res_ninit minires_ninit
77 #define res_randomid MRres_randomid
78 #define res_findzonecut MRres_findzonecut
79 #define res_nsend MRres_nsend
80 #define res_nsendsigned MRres_nsendsigned
81 #define ns_samename MRns_samename
82 #define res_nameinquery MRres_nameinquery
83 #define res_queriesmatch MRres_queriesmatch
84 #define dn_expand MRdn_expand
85 #define ns_get16 MRns_get16
86 #define res_close MRres_close
87 #define res_nclose MRres_nclose
88 #define res_ourserver_p MRres_ourserver_p
89 #define ns_sign MRns_sign
90 #define p_class MRp_class
91 #define p_section MRp_section
92 #define ns_makecanon MRns_makecanon
93 #define ns_parserr MRns_parserr
94 #define ns_samedomain MRns_samedomain
95 #define ns_name_uncompress MRns_name_uncompress
96 #define res_nmkquery MRres_nmkquery
97 #define ns_initparse MRns_initparse
98 #define res_nquery MRres_nquery
99 #define res_nsearch MRres_nsearch
100 #define res_hostalias MRres_hostalias
101 #define res_nquerydomain MRres_nquerydomain
102 #define ns_skiprr MRns_skiprr
103 #define dn_skipname MRdn_skipname
104 #define ns_name_ntol MRns_name_ntol
105 #define ns_sign_tcp_init MRns_sign_tcp_init
106 #define ns_sign_tcp MRns_sign_tcp
107 #define ns_name_ntop MRns_name_ntop
108 #define ns_name_pton MRns_name_pton
109 #define ns_name_unpack MRns_name_unpack
110 #define ns_name_pack MRns_name_pack
111 #define ns_name_compress MRns_name_compress
112 #define ns_name_skip MRns_name_skip
113 #define ns_subdomain MRns_subdomain
114 #define ns_find_tsig MRns_find_tsig
115 #define ns_verify MRns_verify
116 #define ns_verify_tcp_init MRns_verify_tcp_init
117 #define ns_verify_tcp MRns_verify_tcp
118 #define b64_ntop MRb64_ntop
119
120 extern const struct res_sym __p_type_syms[];
121 extern time_t cur_time;
122
123 int dn_comp (const char *,
124 unsigned char *, unsigned, unsigned char **, unsigned char **);
125 int loc_aton (const char *, u_char *);
126 int sym_ston (const struct res_sym *, const char *, int *);
127 void res_buildservicelist (void);
128 void res_destroyservicelist (void);
129 void res_buildprotolist(void);
130 void res_destroyprotolist(void);
131 int res_servicenumber(const char *);
132 int res_protocolnumber(const char *);
133 const char *res_protocolname(int);
134 const char *res_servicename(u_int16_t, const char *);
135 u_int32_t ns_datetosecs (const char *cp, int *errp);
136 int b64_pton (char const *, unsigned char *, size_t);
137 u_int res_randomid(void);
138 isc_result_t res_findzonecut (res_state, const char *, ns_class, int, char *,
139 size_t, struct in_addr *, int, int *, void *);
140 isc_result_t res_nsend (res_state,
141 double *, unsigned, double *, unsigned, unsigned *);
142 isc_result_t res_nsendsigned (res_state, double *, unsigned, ns_tsig_key *,
143 double *, unsigned, unsigned *);
144 int ns_samename (const char *, const char *);
145 int res_nameinquery (const char *, int, int,
146 const unsigned char *, const unsigned char *);
147 int res_queriesmatch (const unsigned char *, const unsigned char *,
148 const unsigned char *, const unsigned char *);
149 int dn_expand (const unsigned char *,
150 const unsigned char *, const unsigned char *, char *, unsigned);
151 unsigned int ns_get16 (const unsigned char *);
152 void res_close (void);
153 void res_nclose (res_state);
154 int res_ourserver_p (const res_state, const struct sockaddr_in *);
155 isc_result_t ns_sign (unsigned char *, unsigned *,
156 unsigned, int, void *, const unsigned char *,
157 unsigned, unsigned char *, unsigned *, time_t);
158 const char *p_class (int);
159 const char *p_section (int section, int opcode);
160 isc_result_t ns_makecanon (const char *, char *, size_t);
161 isc_result_t ns_parserr (ns_msg *, ns_sect, int, ns_rr *);
162 int ns_samedomain (const char *, const char *);
163 int ns_name_uncompress (const u_char *, const u_char *,
164 const u_char *, char *, size_t);
165 isc_result_t res_nmkquery (res_state, int, const char *, ns_class, ns_type,
166 const unsigned char *, unsigned,
167 const unsigned char *, double *,
168 unsigned, unsigned *);
169 isc_result_t ns_initparse (const unsigned char *, unsigned, ns_msg *);
170 isc_result_t res_nquery(res_state, const char *,
171 ns_class, ns_type, double *, unsigned, unsigned *);
172 isc_result_t res_nsearch(res_state, const char *,
173 ns_class, ns_type, double *, unsigned, unsigned *);
174 const char *res_hostalias (const res_state, const char *, char *, size_t);
175 isc_result_t res_nquerydomain(res_state, const char *, const char *,
176 ns_class class, ns_type type,
177 double *, unsigned, unsigned *);
178
179 isc_result_t ns_skiprr(const unsigned char *,
180 const unsigned char *, ns_sect, int, int *);
181 int dn_skipname (const unsigned char *, const unsigned char *);
182 u_int32_t getULong (const unsigned char *);
183 int32_t getLong (const unsigned char *);
184 u_int32_t getUShort (const unsigned char *);
185 int32_t getShort (const unsigned char *);
186 u_int32_t getUChar (const unsigned char *);
187 void putULong (unsigned char *, u_int32_t);
188 void putLong (unsigned char *, int32_t);
189 void putUShort (unsigned char *, u_int32_t);
190 void putShort (unsigned char *, int32_t);
191 void putUChar (unsigned char *, u_int32_t);
192 int ns_name_ntol (const unsigned char *, unsigned char *, size_t);
193 isc_result_t ns_sign_tcp_init (void *, const unsigned char *,
194 unsigned, ns_tcp_tsig_state *);
195 isc_result_t ns_sign_tcp (unsigned char *,
196 unsigned *, unsigned, int, ns_tcp_tsig_state *, int);
197 int ns_name_pton (const char *, unsigned char *, size_t);
198 int ns_name_pack (const unsigned char *, unsigned char *,
199 unsigned, const unsigned char **, const unsigned char **);
200 int ns_name_compress (const char *, unsigned char *,
201 size_t, const unsigned char **, const unsigned char **);
202 int ns_name_skip (const unsigned char **, const unsigned char *);
203 int ns_subdomain (const char *, const char *);
204 unsigned char *ns_find_tsig (unsigned char *, unsigned char *);
205 isc_result_t ns_verify (unsigned char *, unsigned *, void *,
206 const unsigned char *,
207 unsigned, unsigned char *, unsigned *, time_t *, int);
208 isc_result_t ns_verify_tcp_init (void *, const unsigned char *, unsigned,
209 ns_tcp_tsig_state *);
210 isc_result_t ns_verify_tcp (unsigned char *, unsigned *,
211 ns_tcp_tsig_state *, int);
212 int b64_ntop (unsigned char const *, size_t, char *, size_t);
213
214 ns_rcode find_cached_zone (const char *, ns_class, char *,
215 size_t, struct in_addr *, int, int *, void *);
216 int find_tsig_key (ns_tsig_key **, const char *, void *);
217 int forget_zone (void *);
218 int repudiate_zone (void *);
219 void cache_found_zone (ns_class, char *, struct in_addr *, int);
220 isc_result_t uerr2isc (int);
221 isc_result_t ns_rcode_to_isc (int);
222
223 #define DprintQ(a,b,c,d)
224 #define Dprint(a,b)
225 #define Perror(a, b, c, d)
226 #define Aerror(a, b, c, d, e)
227 #define DPRINTF(x)
228
229 #define USE_MD5
230 #endif
231
232 #if defined (TRACING)
233 void trace_mr_statp_setup (res_state);
234 #endif