1998-12-12 20:48:14 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 1998 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.
|
|
|
|
|
*/
|
1998-12-04 02:27:01 +00:00
|
|
|
|
1998-12-12 19:25:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
1998-12-04 02:27:01 +00:00
|
|
|
#include <dns/result.h>
|
|
|
|
|
|
|
|
|
|
static char *text_table[DNS_R_LASTENTRY + 1] = {
|
|
|
|
|
"success", /* 0 */
|
|
|
|
|
"out of memory", /* 1 */
|
|
|
|
|
"ran out of space", /* 2 */
|
|
|
|
|
"label too long", /* 3 */
|
|
|
|
|
"bad escape", /* 4 */
|
|
|
|
|
"bad bitstring", /* 5 */
|
|
|
|
|
"bitstring too long", /* 6 */
|
|
|
|
|
"empty label", /* 7 */
|
|
|
|
|
"bad dotted quad", /* 8 */
|
|
|
|
|
"unexpected end of input", /* 9 */
|
|
|
|
|
"not implemented", /* 10 */
|
1998-12-16 01:50:35 +00:00
|
|
|
"unknown class/type", /* 11 */
|
1998-12-04 02:27:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
char *
|
|
|
|
|
dns_result_totext(dns_result_t result) {
|
|
|
|
|
if (result == DNS_R_UNEXPECTED)
|
|
|
|
|
return ("unexpected error");
|
|
|
|
|
if (result > DNS_R_LASTENTRY)
|
|
|
|
|
return ("unknown result code");
|
|
|
|
|
return (text_table[result]);
|
|
|
|
|
}
|