3 Convert non-ISC result codes to ISC result codes. */
6 * Copyright (c) 2001 Internet Software Consortium.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of The Internet Software Consortium nor the names
19 * of its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
23 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * This software has been written for the Internet Software Consortium
37 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
38 * To learn more about the Internet Software Consortium, see
39 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
40 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
41 * ``http://www.nominum.com''.
44 #include <omapip/omapip_p.h>
45 #include "arpa/nameser.h"
46 #include "minires/minires.h"
48 isc_result_t ns_rcode_to_isc (int nsr)
58 return ISC_R_SERVFAIL;
61 return ISC_R_NXDOMAIN;
70 return ISC_R_YXDOMAIN;
96 return ISC_R_UNEXPECTED;
99 isc_result_t uerr2isc (int err)
106 return ISC_R_NOTFOUND;
109 return ISC_R_NOTFOUND;
112 return ISC_R_IOERROR;
115 return ISC_R_NOTFOUND;
118 return ISC_R_NOSPACE;
121 return ISC_R_FORMERR;
124 return ISC_R_NOTFOUND;
127 return ISC_R_NOMEMORY;
133 return ISC_R_INVALIDARG;
139 return ISC_R_INVALIDARG;
142 return ISC_R_INVALIDARG;
145 return ISC_R_NOSPACE;
148 return ISC_R_NOSPACE;
154 return ISC_R_NOSPACE;
157 return ISC_R_NOTCONNECTED;
160 return ISC_R_ALREADYRUNNING;
163 return ISC_R_ALREADYRUNNING;
166 return ISC_R_INVALIDFILE;
169 return ISC_R_DESTADDRREQ;
172 return ISC_R_NOSPACE;
175 return ISC_R_INVALIDARG;
178 return ISC_R_NOTIMPLEMENTED;
180 case EPROTONOSUPPORT:
181 return ISC_R_NOTIMPLEMENTED;
183 case ESOCKTNOSUPPORT:
184 return ISC_R_NOTIMPLEMENTED;
187 return ISC_R_NOTIMPLEMENTED;
190 return ISC_R_NOTIMPLEMENTED;
193 return ISC_R_NOTIMPLEMENTED;
196 return ISC_R_ADDRINUSE;
199 return ISC_R_ADDRNOTAVAIL;
202 return ISC_R_NETDOWN;
205 return ISC_R_NETUNREACH;
208 return ISC_R_TIMEDOUT;
211 return ISC_R_CONNRESET;
214 return ISC_R_NOSPACE;
217 return ISC_R_ALREADYRUNNING;
220 return ISC_R_NOTCONNECTED;
223 return ISC_R_SHUTTINGDOWN;
226 return ISC_R_TIMEDOUT;
229 return ISC_R_CONNREFUSED;
232 return ISC_R_HOSTDOWN;
235 return ISC_R_HOSTUNREACH;
244 return ISC_R_NOTIMPLEMENTED;
249 return ISC_R_VERSIONMISMATCH;
254 return ISC_R_VERSIONMISMATCH;
259 return ISC_R_NOTAUTH;
264 return ISC_R_NOTAUTH;
269 return ISC_R_NOSPACE;
272 return ISC_R_UNEXPECTED;
275 ns_rcode isc_rcode_to_ns (isc_result_t isc)
285 return ns_r_servfail;
288 return ns_r_nxdomain;
297 return ns_r_yxdomain;
323 return ns_r_servfail;