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