1    | /***************************************
2    |   $Revision: 1.3 $
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 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_UT,
56   | 	FAC_LAST
57   | } er_fac_code_t;
58   | 
59   | /* user code for each facility. 
60   | (kept in other files for easy maintenance) */
61   | 
62   | #include "er_ER_errors.h"
63   | #include "er_IP_errors.h"
64   | #include "er_RX_errors.h"
65   | #include "er_UT_errors.h"
66   | 
67   | /* so much for user code */
68   | 
69   | #ifndef ER_IMPL
70   | /* just a declaration for modules using this */
71   | #include "erroutines.h"
72   | extern er_main_t *er_main_err;
73   | #else 
74   |   er_main_t 	er_main_err[] = {
75   | 	DEFFAC(RX, "radix tree indexing for IP/route objects"),
76   | 	DEFFAC(IP, "IP conversion library"),
77   | 	DEFFAC(ER, "error system") ,
78   | 	DEFFAC(UT, "general utilities and wrappers") ,
79   | 	{FAC_NONE}
80   |   };
81   | #endif /* ER_IMPL */
82   |