Source File modules/er/er_facilities.h

    1    | /***************************************
    2    |   $Revision: 1.8 $
    3    |
    4    |   Error reporting (er) er_facilities.h - list of facilities (modules)
    5    |
    6    |   Status: NOT REVUED, TESTED,
    7    |
    8    |   Design and implementation by: Marek Bukowy
    9    |
    10   |   ******************/ /******************
    11   |   Copyright (c) 1999                              RIPE NCC
    12   |
    13   |   All Rights Reserved
    14   |
    15   |   Permission to use, copy, modify, and distribute this software and its
    16   |   documentation for any purpose and without fee is hereby granted,
    17   |   provided that the above copyright notice appear in all copies and that
    18   |   both that copyright notice and this permission notice appear in
    19   |   supporting documentation, and that the name of the author not be
    20   |   used in advertising or publicity pertaining to distribution of the
    21   |   software without specific, written prior permission.
    22   |
    23   |   THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
    24   |   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
    25   |   AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
    26   |   DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
    27   |   AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    28   |   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    29   |   ***************************************/
    30   |
    31   | /* this #include is just for cxref to not get lost completely :-) */
    32   | #include <erroutines.h>
    33   |
    34   | /* this is the file for adding new facilities.
    35   |    This requires three steps:
    36   |    1. Prepare and include a file with your error messages (see other files).
    37   | 	Please follow the filename convention er_??_errors.c
    38   |    2. Declare your facility number in the enum (before the FAC_LAST)
    39   |
    40   |    only when that's ready (for not to prevent other people from working)
    41   |
    42   |    3. Add your facility to the facility table, using the DEFFAC macro
    43   | 	(it takes a two-letter code and a description of the facility).
    44   | 	This will add a pointer to the module-specific error table
    45   | 	to the global table.
    46   |
    47   |    Order of codes in enum does NOT have to match the order of DEFFAC's.
    48   | */
    49   |
    50   | typedef enum {
    51   | 	FAC_NONE=0,
    52   | 	FAC_RX,
    53   | 	FAC_IP,
    54   | 	FAC_ER,
    55   | 	FAC_UP,
    56   | 	FAC_UT,
    57   | 	FAC_WH,
    58   | 	FAC_RP,
    59   | 	FAC_QI,
    60   | 	FAC_QC,
    61   | 	FAC_PW,
    62   | 	FAC_SK,
    63   | 	FAC_TH,
    64   | 	FAC_SQ,
    65   | 	FAC_LAST
    66   | } er_fac_code_t;
    67   |
    68   | /* user code for each facility.
    69   | (kept in other files for easy maintenance) */
    70   |
    71   | #include "er_ER_errors.h"
    72   | #include "er_IP_errors.h"
    73   | #include "er_RX_errors.h"
    74   | #include "er_UP_errors.h"
    75   | #include "er_UT_errors.h"
    76   | #include "er_WH_errors.h"
    77   | #include "er_RP_errors.h"
    78   | #include "er_QI_errors.h"
    79   | #include "er_QC_errors.h"
    80   | #include "er_PW_errors.h"
    81   | #include "er_SK_errors.h"
    82   | #include "er_TH_errors.h"
    83   | #include "er_SQ_errors.h"
    84   | /* so much for user code */
    85   |
    86   | #ifndef ER_IMPL
    87   | /* just a declaration for modules using this */
    88   | #include "erroutines.h"
    89   | extern er_main_t er_main_err[];
    90   | #else
    91   |   er_main_t 	er_main_err[] = {
    92   | 	DEFFAC(RX, "radix tree indexing for IP/route objects"),
    93   | 	DEFFAC(IP, "IP conversion library"),
    94   | 	DEFFAC(ER, "error system") ,
    95   | 	DEFFAC(UP, "upper update layer") ,
    96   | 	DEFFAC(UT, "general utilities and wrappers") ,
    97   | 	DEFFAC(WH, "embedded whois client") ,
    98   | 	DEFFAC(RP, "radix tree payload functions"),
    99   | 	DEFFAC(QI, "query execution"),
    100  | 	DEFFAC(QC, "query preparation"),
    101  | 	DEFFAC(PW, "protocol whois"),
    102  | 	DEFFAC(SK, "socket communication"),
    103  | 	DEFFAC(TH, "thread handling"),
    104  | 	DEFFAC(SQ, "SQL interface"),
    105  | 	{FAC_NONE}
    106  |   };
    107  | #endif /* ER_IMPL */
    108  |