Source File modules/pa/er_PA_errors.h

    1    | /***************************************
    2    |   $Revision: 1.2 $
    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                              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.  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   | } PA_err_code_t;
    83   |
    84   | /* paste the #define'd codes */
    85   | #define PA_OK  (ER_SEV_I + (FAC_PA<<16) + LOW_PA_OK)
    86   | #define PA_CANTSPWN  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CANTSPWN)
    87   | #define PA_CANTOPEN  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CANTOPEN)
    88   | #define PA_REAP  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_REAP)
    89   | #define PA_CHST  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CHST)
    90   | #define PA_CHRC  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_CHRC)
    91   | #define PA_LINETOOLONG  (ER_SEV_F + (FAC_PA<<16) + LOW_PA_LINETOOLONG)
    92   |
    93   |
    94   | #ifdef ER_IMPL
    95   | er_list_t PA_mod_err[]={
    96   |
    97   |   /* paste the ERDUP's */
    98   |     { ERDUP(PA_OK),"OK" },
    99   |   { ERDUP(PA_CANTSPWN),"Cannot spawn" },
    100  |   { ERDUP(PA_CANTOPEN),"Cannot open file" },
    101  |   { ERDUP(PA_REAP),"Could not reap child" },
    102  |   { ERDUP(PA_CHST),"Bad child status:" },
    103  |   { ERDUP(PA_CHRC),"Bad child return code:" },
    104  |   { ERDUP(PA_LINETOOLONG),"Line too long: line number" },
    105  |
    106  |
    107  |   ER_LASTTXT
    108  | };
    109  | #endif /* ER_IMPL */