]>
Commit | Line | Data |
---|---|---|
61b844bf TL |
1 | /* result.c |
2 | ||
3 | Cheap knock-off of libisc result table code. This is just a place-holder | |
4 | until the actual libisc merge. */ | |
5 | ||
6 | /* | |
98311e4b DH |
7 | * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") |
8 | * Copyright (c) 1999-2003 by Internet Software Consortium | |
61b844bf | 9 | * |
98311e4b DH |
10 | * Permission to use, copy, modify, and distribute this software for any |
11 | * purpose with or without fee is hereby granted, provided that the above | |
12 | * copyright notice and this permission notice appear in all copies. | |
61b844bf | 13 | * |
98311e4b DH |
14 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES |
15 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
16 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR | |
17 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
18 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
19 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
20 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
61b844bf | 21 | * |
98311e4b DH |
22 | * Internet Systems Consortium, Inc. |
23 | * 950 Charter Street | |
24 | * Redwood City, CA 94063 | |
25 | * <info@isc.org> | |
26 | * http://www.isc.org/ | |
49733f31 | 27 | * |
98311e4b | 28 | * This software has been written for Internet Systems Consortium |
49733f31 | 29 | * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc. |
98311e4b | 30 | * To learn more about Internet Systems Consortium, see |
49733f31 TL |
31 | * ``http://www.isc.org/''. To learn more about Vixie Enterprises, |
32 | * see ``http://www.vix.com''. To learn more about Nominum, Inc., see | |
33 | * ``http://www.nominum.com''. | |
61b844bf TL |
34 | */ |
35 | ||
fe5b0fdd DH |
36 | #include "dhcpd.h" |
37 | ||
6a4c4be8 | 38 | #include <omapip/omapip_p.h> |
61b844bf | 39 | |
b1b7b521 | 40 | static const char *text[ISC_R_NRESULTS] = { |
61b844bf TL |
41 | "success", /* 0 */ |
42 | "out of memory", /* 1 */ | |
43 | "timed out", /* 2 */ | |
44 | "no available threads", /* 3 */ | |
45 | "address not available", /* 4 */ | |
46 | "address in use", /* 5 */ | |
47 | "permission denied", /* 6 */ | |
48 | "no pending connections", /* 7 */ | |
49 | "network unreachable", /* 8 */ | |
50 | "host unreachable", /* 9 */ | |
51 | "network down", /* 10 */ | |
52 | "host down", /* 11 */ | |
53 | "connection refused", /* 12 */ | |
54 | "not enough free resources", /* 13 */ | |
55 | "end of file", /* 14 */ | |
56 | "socket already bound", /* 15 */ | |
57 | "task is done", /* 16 */ | |
58 | "lock busy", /* 17 */ | |
59 | "already exists", /* 18 */ | |
60 | "ran out of space", /* 19 */ | |
61 | "operation canceled", /* 20 */ | |
62 | "sending events is not allowed", /* 21 */ | |
63 | "shutting down", /* 22 */ | |
64 | "not found", /* 23 */ | |
65 | "unexpected end of input", /* 24 */ | |
66 | "failure", /* 25 */ | |
67 | "I/O error", /* 26 */ | |
68 | "not implemented", /* 27 */ | |
69 | "unbalanced parentheses", /* 28 */ | |
70 | "no more", /* 29 */ | |
71 | "invalid file", /* 30 */ | |
72 | "bad base64 encoding", /* 31 */ | |
73 | "unexpected token", /* 32 */ | |
74 | "quota reached", /* 33 */ | |
75 | "unexpected error", /* 34 */ | |
76 | "already running", /* 35 */ | |
77 | "host unknown", /* 36 */ | |
78 | "protocol version mismatch", /* 37 */ | |
79 | "protocol error", /* 38 */ | |
80 | "invalid argument", /* 39 */ | |
81 | "not connected", /* 40 */ | |
82 | "data not yet available", /* 41 */ | |
581e37e4 TL |
83 | "object unchanged", /* 42 */ |
84 | "more than one object matches key", /* 43 */ | |
7e2757c5 | 85 | "key conflict", /* 44 */ |
3989a9e8 TL |
86 | "parse error(s) occurred", /* 45 */ |
87 | "no key specified", /* 46 */ | |
7d9784f6 TL |
88 | "zone TSIG key not known", /* 47 */ |
89 | "invalid TSIG key", /* 48 */ | |
275082dd | 90 | "operation in progress", /* 49 */ |
6e0f9707 TL |
91 | "DNS format error", /* 50 */ |
92 | "DNS server failed", /* 51 */ | |
93 | "no such domain", /* 52 */ | |
94 | "not implemented", /* 53 */ | |
95 | "refused", /* 54 */ | |
96 | "domain already exists", /* 55 */ | |
97 | "RRset already exists", /* 56 */ | |
98 | "no such RRset", /* 57 */ | |
99 | "not authorized", /* 58 */ | |
100 | "not a zone", /* 59 */ | |
101 | "bad DNS signature", /* 60 */ | |
102 | "bad DNS key", /* 61 */ | |
5abf0a44 TL |
103 | "clock skew too great", /* 62 */ |
104 | "no root zone", /* 63 */ | |
105 | "destination address required", /* 64 */ | |
106 | "cross-zone update", /* 65 */ | |
107 | "no TSIG signature", /* 66 */ | |
d758ad8c TL |
108 | "not equal", /* 67 */ |
109 | "connection reset by peer", /* 68 */ | |
110 | "unknown attribute" /* 69 */ | |
61b844bf TL |
111 | }; |
112 | ||
b1b7b521 | 113 | const char *isc_result_totext (isc_result_t result) |
61b844bf | 114 | { |
98311e4b DH |
115 | static char ebuf[40]; |
116 | ||
61b844bf TL |
117 | if (result >= ISC_R_SUCCESS && result < ISC_R_NRESULTS) |
118 | return text [result]; | |
98311e4b DH |
119 | sprintf(ebuf, "unknown error: %d", result); |
120 | return ebuf; | |
61b844bf | 121 | } |