1    | /***************************************
2    |   $Revision: 1.4 $
3    | 
4    |   Public Authentication (PA) - er_PA_errors.h - definition of errors for the
5    | 				PA module.
6    | 
7    |   Status: NOT COMPLETE, NOT REVUED, NOT TESTED, 
8    | 
9    |   Design and implementation by: daniele@ripe.net
10   | 
11   |   ******************/ /******************
12   |   Copyright (c) 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   | /* I see no way of automating things here... Maybe with a perl script.
33   | 
34   |    There are three things to do:
35   |    1. Get a new integer number from the enum 
36   | 	(using a ??_LOW_<mnem> symbol)
37   |    2. define a new error code (??_<mnem>) by adding the facility and
38   | 	severity codes.
39   |    3. put the symbol (using macro ERDUP) and text of the message into the
40   | 	array. Should fit in one line with the macro.
41   | 
42   |    The order of codes in enum does NOT have to match the order of texts.
43   |    The last in the texts array must be the ER_LASTTXT constant.
44   | 
45   |    Sounds familiar ? That's because facilities and errors are parts
46   |    of the error reporting fractal :-)
47   | */
48   | 
49   | /* use m4 macros to keep stuff in sync */
50   | 
51   | 
52   | 
53   | 
54   |      /******************************************/
55   |      /* ***** DEFINE THE CURRENT FACILITY **** */
56   |      /* * make sure no whitespaces are inside! */
57   |      /* */               /* */
58   |      /* ************************************** */
59   |      /******************************************/
60   | 
61   | /* last thing: disable processing of commented text (this allows to comment
62   |    out some macro entries. Alas, the #%$@&* designers screwed up, so now we
63   |    have to manually disable messing with C preprocessor commands */
64   | 
65   | 
66   | 
67   | 
68   | 
69   | typedef enum {
70   |   /*  fac  code    sev  descr
71   |       
72   |       current facility specified inside the line below as CFAC
73   |    */
74   | 
75   |    LOW_PA_OK ,
76   |    LOW_PA_CANTSPWN ,
77   |    LOW_PA_CANTOPEN ,
78   |    LOW_PA_REAP ,
79   |    LOW_PA_CHST ,
80   |    LOW_PA_CHRC ,
81   |    LOW_PA_LINETOOLONG ,
82   |    LOW_PA_NOTEMP ,
83   |    LOW_PA_CANTREAD 
84   | } PA_err_code_t;
85   | 
86   | /* paste the #define'd codes */
87   | #define PA_OK  (ER_SEV_I + (FAC_PA<<16) + LOW_PA_OK)
88   | #define PA_CANTSPWN  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CANTSPWN)
89   | #define PA_CANTOPEN  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CANTOPEN)
90   | #define PA_REAP  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_REAP)
91   | #define PA_CHST  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CHST)
92   | #define PA_CHRC  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CHRC)
93   | #define PA_LINETOOLONG  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_LINETOOLONG)
94   | #define PA_NOTEMP  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_NOTEMP)
95   | #define PA_CANTREAD  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CANTREAD)
96   |  
97   | 
98   | #ifdef ER_IMPL
99   | er_list_t PA_mod_err[]={
100  | 
101  |   /* paste the ERDUP's */
102  |     { ERDUP(PA_OK),"OK" },
103  |   { ERDUP(PA_CANTSPWN),"Cannot spawn" },
104  |   { ERDUP(PA_CANTOPEN),"Cannot open file" },
105  |   { ERDUP(PA_REAP),"Could not reap child" },
106  |   { ERDUP(PA_CHST),"Bad child status:" },
107  |   { ERDUP(PA_CHRC),"Bad child return code:" },
108  |   { ERDUP(PA_LINETOOLONG),"Line too long: line number" },
109  |   { ERDUP(PA_NOTEMP),"Can't create temp file" },
110  |   { ERDUP(PA_CANTREAD),"Can't read from file" },
111  |  
112  |   
113  |   ER_LASTTXT
114  | };
115  | #endif /* ER_IMPL */