1 | /*************************************** 2 | $Revision: 1.5 $ 3 | 4 | Error reporting (er) er_ER_errors.{m4,h} - definition of errors for the 5 | error reporting module 6 | 7 | Status: NOT REVUED, TESTED, 8 | 9 | Design and implementation by: Marek Bukowy 10 | 11 | ******************/ /****************** 12 | Copyright (c) 1999,2000,2001,2002 RIPE NCC 13 | 14 | All Rights Reserved 15 | 16 | Permission to use, copy, modify, and distribute this software and its 17 | documentation for any purpose and without fee is hereby granted, 18 | provided that the above copyright notice appear in all copies and that 19 | both that copyright notice and this permission notice appear in 20 | supporting documentation, and that the name of the author not be 21 | used in advertising or publicity pertaining to distribution of the 22 | software without specific, written prior permission. 23 | 24 | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 25 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL 26 | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 27 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 28 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 29 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 30 | ***************************************/ 31 | 32 | /* 33 | NOTE: modify the m4 file only, do not change the resulting .h !!! 34 | */ 35 | 36 | /* use m4 macros to keep stuff in sync */ 37 | 38 | 39 | 40 | 41 | /******************************************/ 42 | /* ***** DEFINE THE CURRENT FACILITY **** */ 43 | /* * make sure no whitespaces are inside! */ 44 | /* */ /* */ 45 | /* ************************************** */ 46 | /******************************************/ 47 | 48 | /* last thing: disable processing of commented text (this allows to comment 49 | out some macro entries. Alas, the #%$@&* designers screwed up, so now we 50 | have to manually disable messing with C preprocessor commands */ 51 | 52 | 53 | 54 | 55 | 56 | typedef enum { 57 | /* fac code sev descr 58 | 59 | current facility specified inside the line below as CFAC 60 | */ 61 | 62 | LOW_SK_OK , 63 | LOW_SK_BADHOST , 64 | LOW_SK_CONNECT , 65 | LOW_SK_BIND , 66 | LOW_SK_SOCKET , 67 | LOW_SK_ACERW , 68 | LOW_SK_ACERF , 69 | LOW_SK_SELECT , 70 | } SK_err_code_t; 71 | 72 | /* paste the #define'd codes */ 73 | #define SK_OK (ER_SEV_I + (FAC_SK<<16) + LOW_SK_OK) 74 | #define SK_BADHOST (ER_SEV_I + (FAC_SK<<16) + LOW_SK_BADHOST) 75 | #define SK_CONNECT (ER_SEV_I + (FAC_SK<<16) + LOW_SK_CONNECT) 76 | #define SK_BIND (ER_SEV_I + (FAC_SK<<16) + LOW_SK_BIND) 77 | #define SK_SOCKET (ER_SEV_I + (FAC_SK<<16) + LOW_SK_SOCKET) 78 | #define SK_ACERW (ER_SEV_W + (FAC_SK<<16) + LOW_SK_ACERW) 79 | #define SK_ACERF (ER_SEV_F + (FAC_SK<<16) + LOW_SK_ACERF) 80 | #define SK_SELECT (ER_SEV_E + (FAC_SK<<16) + LOW_SK_SELECT) 81 | 82 | 83 | #ifdef ER_IMPL 84 | er_list_t SK_mod_err[]={ 85 | 86 | /* paste the ERDUP's */ 87 | { ERDUP(SK_OK),"OK" }, 88 | { ERDUP(SK_BADHOST),"unknown host" }, 89 | { ERDUP(SK_CONNECT),"error while connecting to server" }, 90 | { ERDUP(SK_BIND),"error while binding to socket" }, 91 | { ERDUP(SK_SOCKET),"error while getting socket" }, 92 | { ERDUP(SK_ACERW),"Transient accept error" }, 93 | { ERDUP(SK_ACERF),"Too many accept errors in a row" }, 94 | { ERDUP(SK_SELECT),"error calling select on socket" }, 95 | 96 | 97 | ER_LASTTXT 98 | }; 99 | #endif /* ER_IMPL */