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