3 Convert non-ISC result codes to ISC result codes. */
6 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
7 * Copyright (c) 2001-2003 by Internet Software Consortium
9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
13 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Internet Systems Consortium, Inc.
23 * Redwood City, CA 94063
27 * This software has been written for Internet Systems Consortium
28 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
29 * To learn more about Internet Systems Consortium, see
30 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
31 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
32 * ``http://www.nominum.com''.
35 #include <omapip/omapip_p.h>
36 #include "arpa/nameser.h"
37 #include "minires/minires.h"
39 isc_result_t
ns_rcode_to_isc (int nsr
)
49 return ISC_R_SERVFAIL
;
52 return ISC_R_NXDOMAIN
;
61 return ISC_R_YXDOMAIN
;
87 return ISC_R_UNEXPECTED
;
90 isc_result_t
uerr2isc (int err
)
97 return ISC_R_NOTFOUND
;
100 return ISC_R_NOTFOUND
;
103 return ISC_R_IOERROR
;
106 return ISC_R_NOTFOUND
;
109 return ISC_R_NOSPACE
;
112 return ISC_R_FORMERR
;
115 return ISC_R_NOTFOUND
;
118 return ISC_R_NOMEMORY
;
124 return ISC_R_INVALIDARG
;
130 return ISC_R_INVALIDARG
;
133 return ISC_R_INVALIDARG
;
136 return ISC_R_NOSPACE
;
139 return ISC_R_NOSPACE
;
145 return ISC_R_NOSPACE
;
148 return ISC_R_NOTCONNECTED
;
151 return ISC_R_ALREADYRUNNING
;
154 return ISC_R_ALREADYRUNNING
;
157 return ISC_R_INVALIDFILE
;
160 return ISC_R_DESTADDRREQ
;
163 return ISC_R_NOSPACE
;
166 return ISC_R_INVALIDARG
;
169 return ISC_R_NOTIMPLEMENTED
;
171 case EPROTONOSUPPORT
:
172 return ISC_R_NOTIMPLEMENTED
;
174 case ESOCKTNOSUPPORT
:
175 return ISC_R_NOTIMPLEMENTED
;
178 return ISC_R_NOTIMPLEMENTED
;
181 return ISC_R_NOTIMPLEMENTED
;
184 return ISC_R_NOTIMPLEMENTED
;
187 return ISC_R_ADDRINUSE
;
190 return ISC_R_ADDRNOTAVAIL
;
193 return ISC_R_NETDOWN
;
196 return ISC_R_NETUNREACH
;
199 return ISC_R_TIMEDOUT
;
202 return ISC_R_CONNRESET
;
205 return ISC_R_NOSPACE
;
208 return ISC_R_ALREADYRUNNING
;
211 return ISC_R_NOTCONNECTED
;
214 return ISC_R_SHUTTINGDOWN
;
217 return ISC_R_TIMEDOUT
;
220 return ISC_R_CONNREFUSED
;
223 return ISC_R_HOSTDOWN
;
226 return ISC_R_HOSTUNREACH
;
235 return ISC_R_NOTIMPLEMENTED
;
240 return ISC_R_VERSIONMISMATCH
;
245 return ISC_R_VERSIONMISMATCH
;
250 return ISC_R_NOTAUTH
;
255 return ISC_R_NOTAUTH
;
260 return ISC_R_NOSPACE
;
263 return ISC_R_UNEXPECTED
;
266 ns_rcode
isc_rcode_to_ns (isc_result_t isc
)
276 return ns_r_servfail
;
279 return ns_r_nxdomain
;
288 return ns_r_yxdomain
;
314 return ns_r_servfail
;