File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / dhcp / omapip / result.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Oct 9 09:06:54 2012 UTC (11 years, 8 months ago) by misho
Branches: dhcp, MAIN
CVS tags: v4_1_R7p0, v4_1_R7, v4_1_R4, HEAD
dhcp 4.1 r7

    1: /* result.c
    2: 
    3:    Cheap knock-off of libisc result table code.   This is just a place-holder
    4:    until the actual libisc merge. */
    5: 
    6: /*
    7:  * Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
    8:  * Copyright (c) 1999-2003 by Internet Software Consortium
    9:  *
   10:  * Permission to use, copy, modify, and distribute this software for any
   11:  * purpose with or without fee is hereby granted, provided that the above
   12:  * copyright notice and this permission notice appear in all copies.
   13:  *
   14:  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
   15:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   16:  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
   17:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   18:  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   19:  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
   20:  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   21:  *
   22:  *   Internet Systems Consortium, Inc.
   23:  *   950 Charter Street
   24:  *   Redwood City, CA 94063
   25:  *   <info@isc.org>
   26:  *   https://www.isc.org/
   27:  *
   28:  * This software has been written for Internet Systems Consortium
   29:  * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
   30:  * To learn more about Internet Systems Consortium, see
   31:  * ``https://www.isc.org/''.  To learn more about Vixie Enterprises,
   32:  * see ``http://www.vix.com''.   To learn more about Nominum, Inc., see
   33:  * ``http://www.nominum.com''.
   34:  */
   35: 
   36: #include "dhcpd.h"
   37: 
   38: #include <omapip/omapip_p.h>
   39: 
   40: static const char *text[ISC_R_NRESULTS] = {
   41: 	"success",				/*  0 */
   42: 	"out of memory",			/*  1 */
   43: 	"timed out",				/*  2 */
   44: 	"no available threads",			/*  3 */
   45: 	"address not available",		/*  4 */
   46: 	"address in use",			/*  5 */
   47: 	"permission denied",			/*  6 */
   48: 	"no pending connections",		/*  7 */
   49: 	"network unreachable",			/*  8 */
   50: 	"host unreachable",			/*  9 */
   51: 	"network down",				/* 10 */
   52: 	"host down",				/* 11 */
   53: 	"connection refused",			/* 12 */
   54: 	"not enough free resources",		/* 13 */
   55: 	"end of file",				/* 14 */
   56: 	"socket already bound",			/* 15 */
   57: 	"task is done",				/* 16 */
   58: 	"lock busy",				/* 17 */
   59: 	"already exists",			/* 18 */
   60: 	"ran out of space",			/* 19 */
   61: 	"operation canceled",			/* 20 */
   62: 	"sending events is not allowed",	/* 21 */
   63: 	"shutting down",			/* 22 */
   64: 	"not found",				/* 23 */
   65: 	"unexpected end of input",		/* 24 */
   66: 	"failure",				/* 25 */
   67: 	"I/O error",				/* 26 */
   68: 	"not implemented",			/* 27 */
   69: 	"unbalanced parentheses",		/* 28 */
   70: 	"no more",				/* 29 */
   71: 	"invalid file",				/* 30 */
   72: 	"bad base64 encoding",			/* 31 */
   73: 	"unexpected token",			/* 32 */
   74: 	"quota reached",			/* 33 */
   75: 	"unexpected error",			/* 34 */
   76: 	"already running",			/* 35 */
   77: 	"host unknown",				/* 36 */
   78: 	"protocol version mismatch",		/* 37 */
   79: 	"protocol error",			/* 38 */
   80: 	"invalid argument",			/* 39 */
   81: 	"not connected",			/* 40 */
   82: 	"data not yet available",		/* 41 */
   83: 	"object unchanged",			/* 42 */
   84: 	"more than one object matches key",	/* 43 */
   85: 	"key conflict",				/* 44 */
   86: 	"parse error(s) occurred",		/* 45 */
   87: 	"no key specified",			/* 46 */
   88: 	"zone TSIG key not known",		/* 47 */
   89: 	"invalid TSIG key",			/* 48 */
   90: 	"operation in progress",		/* 49 */
   91: 	"DNS format error",			/* 50 */
   92: 	"DNS server failed",			/* 51 */
   93: 	"no such domain",			/* 52 */
   94: 	"not implemented",			/* 53 */
   95: 	"refused",				/* 54 */
   96: 	"domain already exists",		/* 55 */
   97: 	"RRset already exists",			/* 56 */
   98: 	"no such RRset",			/* 57 */
   99: 	"not authorized",			/* 58 */
  100: 	"not a zone",				/* 59 */
  101: 	"bad DNS signature",			/* 60 */
  102: 	"bad DNS key",				/* 61 */
  103: 	"clock skew too great",			/* 62 */
  104: 	"no root zone",				/* 63 */
  105: 	"destination address required",		/* 64 */
  106: 	"cross-zone update",			/* 65 */
  107: 	"no TSIG signature",			/* 66 */
  108: 	"not equal",				/* 67 */
  109: 	"connection reset by peer",		/* 68 */
  110: 	"unknown attribute"			/* 69 */
  111: };
  112: 
  113: const char *isc_result_totext (isc_result_t result)
  114: {
  115: 	static char ebuf[40];
  116: 
  117: 	if (result >= ISC_R_SUCCESS && result < ISC_R_NRESULTS)
  118: 		return text [result];
  119: 	sprintf(ebuf, "unknown error: %d", result);
  120: 	return ebuf;
  121: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>