<commit_before>/*
 * Copyright (C) 1998-2000  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* $Id: result.c,v 1.70 2000/08/08 22:50:33 bwelling Exp $ */

#include <config.h>

#include <isc/once.h>
#include <isc/util.h>

#include <dns/result.h>
#include <dns/lib.h>

static const char *text[DNS_R_NRESULTS] = {
	"label too long",		       /*  0 DNS_R_LABELTOOLONG	     */
	"bad escape",			       /*  1 DNS_R_BADESCAPE	     */
	"bad bitstring",		       /*  2 DNS_R_BADBITSTRING	     */
	"bitstring too long",		       /*  3 DNS_R_BITSTRINGTOOLONG  */
	"empty label",			       /*  4 DNS_R_EMPTYLABEL	     */

	"bad dotted quad",		       /*  5 DNS_R_BADDOTTEDQUAD     */
	"invalid NS owner name (wildcard)",    /*  6 DNS_R_INVALIDNS	     */
	"unknown class/type",		       /*  7 DNS_R_UNKNOWN	     */
	"bad label type",		       /*  8 DNS_R_BADLABELTYPE	     */
	"bad compression pointer",	       /*  9 DNS_R_BADPOINTER	     */

	"too many hops",		       /* 10 DNS_R_TOOMANYHOPS	     */
	"disallowed (by application policy)",  /* 11 DNS_R_DISALLOWED	     */
	"extra input text",		       /* 12 DNS_R_EXTRATOKEN	     */
	"extra input data",		       /* 13 DNS_R_EXTRADATA	     */
	"text too long",		       /* 14 DNS_R_TEXTTOOLONG	     */

	"not at top of zone",		       /* 15 DNS_R_NOTZONETOP	     */
	"syntax error",			       /* 16 DNS_R_SYNTAX	     */
	"bad checksum",			       /* 17 DNS_R_BADCKSUM	     */
	"bad IPv6 address",		       /* 18 DNS_R_BADAAAA	     */
	"no owner",			       /* 19 DNS_R_NOOWNER	     */

	"no ttl",			       /* 20 DNS_R_NOTTL	     */
	"bad class",			       /* 21 DNS_R_BADCLASS	     */
	"name too long",		       /* 22 DNS_R_NAMETOOLONG	     */
	"partial match",		       /* 23 DNS_R_PARTIALMATCH	     */
	"new origin",			       /* 24 DNS_R_NEWORIGIN	     */

	"unchanged",			       /* 25 DNS_R_UNCHANGED	     */
	"bad ttl",			       /* 26 DNS_R_BADTTL	     */
	"more data needed/to be rendered",     /* 27 DNS_R_NOREDATA	     */
	"continue",			       /* 28 DNS_R_CONTINUE	     */
	"delegation",			       /* 29 DNS_R_DELEGATION	     */

	"glue",				       /* 30 DNS_R_GLUE		     */
	"dname",			       /* 31 DNS_R_DNAME	     */
	"cname",			       /* 32 DNS_R_CNAME	     */
	"bad database",			       /* 33 DNS_R_BADDB	     */
	"zonecut",			       /* 34 DNS_R_ZONECUT	     */

	"bad zone",			       /* 35 DNS_R_BADZONE	     */
	"more data",			       /* 36 DNS_R_MOREDATA	     */
	"up to date",			       /* 37 DNS_R_UPTODATE	     */
	"tsig verify failure",		       /* 38 DNS_R_TSIGVERIFYFAILURE */
	"tsig indicates error",		       /* 39 DNS_R_TSIGERRORSET	     */

	"SIG failed to verify",		       /* 40 DNS_R_SIGINVALID	     */
	"SIG has expired",		       /* 41 DNS_R_SIGEXPIRED	     */
	"SIG validity period has not begun",   /* 42 DNS_R_SIGFUTURE	     */
	"key is unauthorized to sign data",    /* 43 DNS_R_KEYUNAUTHORIZED   */
	"invalid time",			       /* 44 DNS_R_INVALIDTIME	     */

	"expected a TSIG",		       /* 45 DNS_R_EXPECTEDTSIG	     */
	"did not expect a TSIG",	       /* 46 DNS_R_UNEXPECTEDTSIG    */
	"TKEY is unacceptable",		       /* 47 DNS_R_INVALIDTKEY	     */
	"hint",				       /* 48 DNS_R_HINT		     */
	"drop",				       /* 49 DNS_R_DROP		     */

	"zone not loaded",		       /* 50 DNS_R_NOTLOADED	     */
	"ncache nxdomain",		       /* 51 DNS_R_NCACHENXDOMAIN    */
	"ncache nxrrset",		       /* 52 DNS_R_NCACHENXRRSET     */
	"wait",				       /* 53 DNS_R_WAIT		     */
	"not verified yet",		       /* 54 DNS_R_NOTVERIFIEDYET    */

	"no identity",			       /* 55 DNS_R_NOIDENTITY	     */
	"no journal",			       /* 56 DNS_R_NOJOURNAL	     */
	"alias",			       /* 57 DNS_R_ALIAS	     */
	"use TCP",			       /* 58 DNS_R_USETCP	     */
	"no valid SIG",			       /* 59 DNS_R_NOVALIDSIG	     */

	"no valid NXT",			       /* 60 DNS_R_NOVALIDNXT	     */
	"not insecure"			       /* 61 DNS_R_NOTINSECURE	     */
	"zone too large"		       /* 62 DNS_R_ZONETOOLARGE	     */
};

static const char *rcode_text[DNS_R_NRCODERESULTS] = {<commit_msg>missed a comma when adding the zone too large result text<commit_after>/*
 * Copyright (C) 1998-2000  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* $Id: result.c,v 1.71 2000/08/08 23:33:05 bwelling Exp $ */

#include <config.h>

#include <isc/once.h>
#include <isc/util.h>

#include <dns/result.h>
#include <dns/lib.h>

static const char *text[DNS_R_NRESULTS] = {
	"label too long",		       /*  0 DNS_R_LABELTOOLONG	     */
	"bad escape",			       /*  1 DNS_R_BADESCAPE	     */
	"bad bitstring",		       /*  2 DNS_R_BADBITSTRING	     */
	"bitstring too long",		       /*  3 DNS_R_BITSTRINGTOOLONG  */
	"empty label",			       /*  4 DNS_R_EMPTYLABEL	     */

	"bad dotted quad",		       /*  5 DNS_R_BADDOTTEDQUAD     */
	"invalid NS owner name (wildcard)",    /*  6 DNS_R_INVALIDNS	     */
	"unknown class/type",		       /*  7 DNS_R_UNKNOWN	     */
	"bad label type",		       /*  8 DNS_R_BADLABELTYPE	     */
	"bad compression pointer",	       /*  9 DNS_R_BADPOINTER	     */

	"too many hops",		       /* 10 DNS_R_TOOMANYHOPS	     */
	"disallowed (by application policy)",  /* 11 DNS_R_DISALLOWED	     */
	"extra input text",		       /* 12 DNS_R_EXTRATOKEN	     */
	"extra input data",		       /* 13 DNS_R_EXTRADATA	     */
	"text too long",		       /* 14 DNS_R_TEXTTOOLONG	     */

	"not at top of zone",		       /* 15 DNS_R_NOTZONETOP	     */
	"syntax error",			       /* 16 DNS_R_SYNTAX	     */
	"bad checksum",			       /* 17 DNS_R_BADCKSUM	     */
	"bad IPv6 address",		       /* 18 DNS_R_BADAAAA	     */
	"no owner",			       /* 19 DNS_R_NOOWNER	     */

	"no ttl",			       /* 20 DNS_R_NOTTL	     */
	"bad class",			       /* 21 DNS_R_BADCLASS	     */
	"name too long",		       /* 22 DNS_R_NAMETOOLONG	     */
	"partial match",		       /* 23 DNS_R_PARTIALMATCH	     */
	"new origin",			       /* 24 DNS_R_NEWORIGIN	     */

	"unchanged",			       /* 25 DNS_R_UNCHANGED	     */
	"bad ttl",			       /* 26 DNS_R_BADTTL	     */
	"more data needed/to be rendered",     /* 27 DNS_R_NOREDATA	     */
	"continue",			       /* 28 DNS_R_CONTINUE	     */
	"delegation",			       /* 29 DNS_R_DELEGATION	     */

	"glue",				       /* 30 DNS_R_GLUE		     */
	"dname",			       /* 31 DNS_R_DNAME	     */
	"cname",			       /* 32 DNS_R_CNAME	     */
	"bad database",			       /* 33 DNS_R_BADDB	     */
	"zonecut",			       /* 34 DNS_R_ZONECUT	     */

	"bad zone",			       /* 35 DNS_R_BADZONE	     */
	"more data",			       /* 36 DNS_R_MOREDATA	     */
	"up to date",			       /* 37 DNS_R_UPTODATE	     */
	"tsig verify failure",		       /* 38 DNS_R_TSIGVERIFYFAILURE */
	"tsig indicates error",		       /* 39 DNS_R_TSIGERRORSET	     */

	"SIG failed to verify",		       /* 40 DNS_R_SIGINVALID	     */
	"SIG has expired",		       /* 41 DNS_R_SIGEXPIRED	     */
	"SIG validity period has not begun",   /* 42 DNS_R_SIGFUTURE	     */
	"key is unauthorized to sign data",    /* 43 DNS_R_KEYUNAUTHORIZED   */
	"invalid time",			       /* 44 DNS_R_INVALIDTIME	     */

	"expected a TSIG",		       /* 45 DNS_R_EXPECTEDTSIG	     */
	"did not expect a TSIG",	       /* 46 DNS_R_UNEXPECTEDTSIG    */
	"TKEY is unacceptable",		       /* 47 DNS_R_INVALIDTKEY	     */
	"hint",				       /* 48 DNS_R_HINT		     */
	"drop",				       /* 49 DNS_R_DROP		     */

	"zone not loaded",		       /* 50 DNS_R_NOTLOADED	     */
	"ncache nxdomain",		       /* 51 DNS_R_NCACHENXDOMAIN    */
	"ncache nxrrset",		       /* 52 DNS_R_NCACHENXRRSET     */
	"wait",				       /* 53 DNS_R_WAIT		     */
	"not verified yet",		       /* 54 DNS_R_NOTVERIFIEDYET    */

	"no identity",			       /* 55 DNS_R_NOIDENTITY	     */
	"no journal",			       /* 56 DNS_R_NOJOURNAL	     */
	"alias",			       /* 57 DNS_R_ALIAS	     */
	"use TCP",			       /* 58 DNS_R_USETCP	     */
	"no valid SIG",			       /* 59 DNS_R_NOVALIDSIG	     */

	"no valid NXT",			       /* 60 DNS_R_NOVALIDNXT	     */
	"not insecure",			       /* 61 DNS_R_NOTINSECURE	     */
	"zone too large"		       /* 62 DNS_R_ZONETOOLARGE	     */
};

static const char *rcode_text[DNS_R_NRCODERESULTS] = {
{'fraction_non_alphanumeric': 0.11279302007778828, 'fraction_numerical': 0.02985388415851992, 'mean_word_length': 1.8804117468967605, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4365908', 'n_tokens_mistral': 4061, 'n_tokens_neox': 3417, 'n_words': 874}