result.c revision 1.1 1 1.1 christos /* $NetBSD: result.c,v 1.1 2018/04/07 22:34:27 christos Exp $ */
2 1.1 christos
3 1.1 christos /* result.c
4 1.1 christos */
5 1.1 christos
6 1.1 christos /*
7 1.1 christos * Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
8 1.1 christos * Copyright (c) 1999-2003 by Internet Software Consortium
9 1.1 christos *
10 1.1 christos * This Source Code Form is subject to the terms of the Mozilla Public
11 1.1 christos * License, v. 2.0. If a copy of the MPL was not distributed with this
12 1.1 christos * file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 1.1 christos *
14 1.1 christos * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
15 1.1 christos * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16 1.1 christos * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
17 1.1 christos * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18 1.1 christos * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
19 1.1 christos * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 1.1 christos * PERFORMANCE OF THIS SOFTWARE.
21 1.1 christos *
22 1.1 christos * Internet Systems Consortium, Inc.
23 1.1 christos * 950 Charter Street
24 1.1 christos * Redwood City, CA 94063
25 1.1 christos * <info (at) isc.org>
26 1.1 christos * https://www.isc.org/
27 1.1 christos *
28 1.1 christos */
29 1.1 christos
30 1.1 christos #include <sys/cdefs.h>
31 1.1 christos __RCSID("$NetBSD: result.c,v 1.1 2018/04/07 22:34:27 christos Exp $");
32 1.1 christos
33 1.1 christos #include "dhcpd.h"
34 1.1 christos
35 1.1 christos /*
36 1.1 christos * In the previous code the results started at 36
37 1.1 christos * rather than ISC_RESULTCLASS_DHCP + 0
38 1.1 christos * ISC_R_NOTCONNECTED was + 4 (40), it has been superseeded by the isc version
39 1.1 christos */
40 1.1 christos
41 1.1 christos static const char *text[DHCP_R_NRESULTS] = {
42 1.1 christos "host unknown", /* 0 */
43 1.1 christos "protocol version mismatch", /* 1 */
44 1.1 christos "protocol error", /* 2 */
45 1.1 christos "invalid argument", /* 3 */
46 1.1 christos "data not yet available", /* 4 */
47 1.1 christos "object unchanged", /* 5 */
48 1.1 christos "more than one object matches key", /* 6 */
49 1.1 christos "key conflict", /* 7 */
50 1.1 christos "parse error(s) occurred", /* 8 */
51 1.1 christos "no key specified", /* 9 */
52 1.1 christos "zone TSIG key not known", /* 10 */
53 1.1 christos "invalid TSIG key", /* 11 */
54 1.1 christos "operation in progress", /* 12 */
55 1.1 christos "DNS format error", /* 13 */
56 1.1 christos "DNS server failed", /* 14 */
57 1.1 christos "no such domain", /* 15 */
58 1.1 christos "not implemented", /* 16 */
59 1.1 christos "refused", /* 17 */
60 1.1 christos "domain already exists", /* 18 */
61 1.1 christos "RRset already exists", /* 19 */
62 1.1 christos "no such RRset", /* 20 */
63 1.1 christos "not authorized", /* 21 */
64 1.1 christos "not a zone", /* 22 */
65 1.1 christos "bad DNS signature", /* 23 */
66 1.1 christos "bad DNS key", /* 24 */
67 1.1 christos "clock skew too great", /* 25 */
68 1.1 christos "no root zone", /* 26 */
69 1.1 christos "destination address required", /* 27 */
70 1.1 christos "cross-zone update", /* 28 */
71 1.1 christos "no TSIG signature", /* 29 */
72 1.1 christos "not equal", /* 30 */
73 1.1 christos "connection reset by peer", /* 31 */
74 1.1 christos "unknown attribute" /* 32 */
75 1.1 christos };
76 1.1 christos
77 1.1 christos #define DHCP_RESULT_RESULTSET 2
78 1.1 christos #define DHCP_RESULT_UNAVAILABLESET 3
79 1.1 christos
80 1.1 christos // This is a placeholder as we don't allow for external message catalogs yet
81 1.1 christos isc_msgcat_t * dhcp_msgcat = NULL;
82 1.1 christos
83 1.1 christos isc_result_t
84 1.1 christos dhcp_result_register(void) {
85 1.1 christos isc_result_t result;
86 1.1 christos
87 1.1 christos result = isc_result_register(ISC_RESULTCLASS_DHCP, DHCP_R_NRESULTS,
88 1.1 christos text, dhcp_msgcat, DHCP_RESULT_RESULTSET);
89 1.1 christos
90 1.1 christos return(result);
91 1.1 christos }
92