result.c revision c71f625e241f85f481a7037c5c5841fd0239334b
/*
* 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.
*/
#include <config.h>
#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 */
"unknown class/type", /* 11 */
};
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]);
}