1 /* $NetBSD: dst_result.c,v 1.8 2014/12/10 04:37:58 christos Exp $ */
4 * Copyright (C) 2004, 2005, 2007, 2008, 2012-2014 Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (C) 1999-2001 Internet Software Consortium.
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
21 * Principal Author: Brian Wellington
22 * Id: dst_result.c,v 1.7 2008/04/01 23:47:10 tbox Exp
30 #include <dst/result.h>
33 static const char *text
[DST_R_NRESULTS
] = {
34 "algorithm is unsupported", /*%< 0 */
35 "crypto failure", /*%< 1 */
36 "built with no crypto support", /*%< 2 */
37 "illegal operation for a null key", /*%< 3 */
38 "public key is invalid", /*%< 4 */
39 "private key is invalid", /*%< 5 */
40 "external key", /*%< 6 */
41 "error occurred writing key to disk", /*%< 7 */
42 "invalid algorithm specific parameter", /*%< 8 */
44 "UNUSED10", /*%< 10 */
45 "sign failure", /*%< 11 */
46 "UNUSED12", /*%< 12 */
47 "UNUSED13", /*%< 13 */
48 "verify failure", /*%< 14 */
49 "not a public key", /*%< 15 */
50 "not a private key", /*%< 16 */
51 "not a key that can compute a secret", /*%< 17 */
52 "failure computing a shared secret", /*%< 18 */
53 "no randomness available", /*%< 19 */
54 "bad key type", /*%< 20 */
55 "no engine", /*%< 21 */
56 "illegal operation for an external key",/*%< 22 */
59 #define DST_RESULT_RESULTSET 2
61 static isc_once_t once
= ISC_ONCE_INIT
;
64 initialize_action(void) {
67 result
= isc_result_register(ISC_RESULTCLASS_DST
, DST_R_NRESULTS
,
68 text
, dst_msgcat
, DST_RESULT_RESULTSET
);
69 if (result
!= ISC_R_SUCCESS
)
70 UNEXPECTED_ERROR(__FILE__
, __LINE__
,
71 "isc_result_register() failed: %u", result
);
77 RUNTIME_CHECK(isc_once_do(&once
, initialize_action
) == ISC_R_SUCCESS
);
81 dst_result_totext(isc_result_t result
) {
84 return (isc_result_totext(result
));
88 dst_result_register(void) {