Source File er/er_aspects.h

    1    | /***************************************
    2    |   $Revision: 1.23 $
    3    |
    4    |   Error reporting (er) er_aspects.{m4,h} - definition of error aspects
    5    | 				for the 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   | #ifndef ER_ASPECTS_H
    37   | #define ER_ASPECTS_H
    38   |
    39   | #include "erroutines.h"
    40   |
    41   | typedef struct {
    42   |   er_fac_code_t f;
    43   |   char *n;
    44   |   int v;
    45   | } er_aspstr_t;
    46   |
    47   | #ifdef ER_IMPL
    48   | #define EXTDEF
    49   | #define EXTINI(a,b) a = b;
    50   | #else
    51   | #define EXTDEF extern
    52   | #define EXTINI(a,b) extern a;
    53   | #endif
    54   |
    55   | /* m4 macro: #define a symbol and put its string version into the array
    56   |    at the same time. The string version will have "ASP_" cut off if
    57   |    the string begins with it. The #defines are diverted to stream 9, so
    58   |    they appear later in the output (outside the /endif block)
    59   | */
    60   |
    61   |
    62   |
    63   | typedef enum {
    64   |
    65   |   /* 0x20000000 - 0x01000000  are reserved for global tags */
    66   |
    67   |   /* RADIX: */
    68   |  ASP_RX_NODCRE_GEN = 0x000080 ,     /* general node creation tag */
    69   |  ASP_RX_NODCRE_DET = 0x000040 ,     /* also details on node creation */
    70   |
    71   |  ASP_RX_STKBLD_GEN = 0x000020 ,     /* general stack building */
    72   |  ASP_RX_STKBLD_DET = 0x000010 ,     /* also detailed stack building */
    73   |
    74   |  ASP_RX_SRCH_GEN = 0x000800 ,     /* search */
    75   |  ASP_RX_SRCH_DET = 0x000400 ,
    76   |
    77   |  ASP_RX_TREE_GEN = 0x002000 ,     /* general tree/forest administration */
    78   |  ASP_RX_TREE_DET = 0x001000 ,     /* detailed */
    79   |
    80   |  ASP_RX_TREE_WALK = 0x000001 ,
    81   |
    82   |
    83   |   /* Radix payload */
    84   |  ASP_RP_PACK_DET = 0x000100 ,    /* pack conversion */
    85   |  ASP_RP_TREE_DET = 0x001000 ,    /* finding tree in forest */
    86   |  ASP_RP_LOAD_GEN = 0x010000 ,    /* loading of trees */
    87   |  ASP_RP_LOAD_DET = 0x000010 ,    /* loading of trees - detailed */
    88   |  ASP_RP_SRCH_DATA = 0x000040 ,    /* search - display 'immediate data' */
    89   |  ASP_RP_SRCH_DET = 0x004000 ,    /* search - detailed */
    90   |  ASP_RP_SRCH_GEN = 0x040000 ,    /* search - general */
    91   |
    92   |
    93   |   /* Query instructions */
    94   |  ASP_QI_LAST_DET = 0x000010 ,    /* ids of the objects from the LAST table */
    95   |  ASP_QI_SKIP = 0x004000 ,    /* query skipped */
    96   |
    97   |  ASP_QI_REF_DET = 0x010000 ,    /* referral, detailed */
    98   |  ASP_QI_REF_GEN = 0x020000 ,    /* referral */
    99   |
    100  |  ASP_QI_COLL_DET = 0x100000 ,    /* id collection (exec. of subqueries) */
    101  |  ASP_QI_COLL_GEN = 0x200000 ,    /* query list */
    102  |  ASP_QI_WATCH = 0x080000 ,    /* watchdog */
    103  |
    104  |   /* Query command */
    105  |  ASP_QC_BUILD = 0x800000 ,    /* query preparation */
    106  |
    107  |   /* Threads */
    108  |  ASP_TH_NEW = 0x800000 ,    /* new thread */
    109  |
    110  |   /* Sockets */
    111  |  ASP_SK_GEN = 0x000100 ,    /* general aspect */
    112  |  ASP_SK_WRIT = 0x000001 ,    /* writing functions; buffer printed too */
    113  |  ASP_SK_WATCH = 0x000800 ,    /* watchdog */
    114  |
    115  |   /* Protocol whois */
    116  |  ASP_PW_CONN = 0x001000 ,    /* connection opened */
    117  |
    118  |   /* Protocol whois - aspects for INFO (log) messages */
    119  |  ASP_PW_I_PASSUN = 0x010000 ,    /* unauthorised address passing */
    120  |  ASP_PW_I_QRYLOG = 0x100000 ,    /* log query after it's been processed */
    121  |  ASP_PW_I_DENTRY = 0x200000 ,    /* log connection from a denied host */
    122  |
    123  |  ASP_SQ_QRYTIME = 0x000100 ,     /* log the query,result and time it took */
    124  |  ASP_SQ_ABORT = 0x001000 ,    /* aborting a sql connection */
    125  |
    126  |  ASP_PM_INPUT = 0x000010 ,    /* log the query */
    127  |  ASP_PM_ERESP = 0x000001 ,    /* print server error responses */
    128  |
    129  |   /* MIME Parser module */
    130  |  ASP_MM_GEN = 0x000100 ,     /* General aspect */
    131  |  ASP_MM_SEC = 0x001000 ,     /* Security-related aspect */
    132  |
    133  |   /* Main server (sv) */
    134  |  ASP_SV_PORT = 0x000100 ,    /* listing ports */
    135  |
    136  |   /* UD - core update process */
    137  |  ASP_UD_SQL = 0x000010 ,     /* print SQL queries */
    138  |  ASP_UD_OBJ = 0x000100 ,     /* trace object update process */
    139  |  ASP_UD_UPDLOG = 0x001000 ,     /* print summary information */
    140  |
    141  |   /* Access control */
    142  |  ASP_AC_DECAY = 0x000100 ,    /* decaying process */
    143  |  ASP_AC_PRUNE_DET = 0x000010 ,    /* pruning the access tree, detailed */
    144  |  ASP_AC_I_PERMBAN = 0x002000 ,    /* a permanent ban was set */
    145  |
    146  |   /* Protocol Config */
    147  |  ASP_PC_I_SESSION = 0x000100 ,    /* session event: log on, log off, auth fail */
    148  |  ASP_PC_I_COMMAND = 0x000200 ,    /* command executed */
    149  |
    150  |   /* UP - dbupdate module */
    151  |  ASP_UP_FILE = 0x000001 ,      /* File related */
    152  |  ASP_UP_GEN = 0x000010 ,      /* General */
    153  |
    154  |   /* Public Authentication (GPG) module */
    155  |  ASP_PA_GEN = 0x000100 ,     /* General aspect */
    156  |
    157  |   /* utility module */
    158  |  ASP_UT_MEM = 0x00000001  ,   /* Memory related */
    159  |  ASP_UT_FD = 0x00000010  ,   /* File descriptor related */
    160  |
    161  | ASP_NONE = 0
    162  |
    163  | } er_aspect_en;
    164  |
    165  | EXTDEF
    166  | er_aspstr_t er_asparr[]
    167  | #ifdef ER_IMPL
    168  |  = {
    169  |
    170  |  { FAC_RX, "RX_NODCRE_GEN", ASP_RX_NODCRE_GEN  },
    171  |  { FAC_RX, "RX_NODCRE_DET", ASP_RX_NODCRE_DET  },
    172  |  { FAC_RX, "RX_STKBLD_GEN", ASP_RX_STKBLD_GEN  },
    173  |  { FAC_RX, "RX_STKBLD_DET", ASP_RX_STKBLD_DET  },
    174  |  { FAC_RX, "RX_SRCH_GEN", ASP_RX_SRCH_GEN  },
    175  |  { FAC_RX, "RX_SRCH_DET", ASP_RX_SRCH_DET  },
    176  |  { FAC_RX, "RX_TREE_GEN", ASP_RX_TREE_GEN  },
    177  |  { FAC_RX, "RX_TREE_DET", ASP_RX_TREE_DET  },
    178  |  { FAC_RX, "RX_TREE_WALK", ASP_RX_TREE_WALK  },
    179  |  { FAC_RP, "RP_PACK_DET", ASP_RP_PACK_DET  },
    180  |  { FAC_RP, "RP_TREE_DET", ASP_RP_TREE_DET  },
    181  |  { FAC_RP, "RP_LOAD_GEN", ASP_RP_LOAD_GEN  },
    182  |  { FAC_RP, "RP_LOAD_DET", ASP_RP_LOAD_DET  },
    183  |  { FAC_RP, "RP_SRCH_DATA", ASP_RP_SRCH_DATA  },
    184  |  { FAC_RP, "RP_SRCH_DET", ASP_RP_SRCH_DET  },
    185  |  { FAC_RP, "RP_SRCH_GEN", ASP_RP_SRCH_GEN  },
    186  |  { FAC_QI, "QI_LAST_DET", ASP_QI_LAST_DET  },
    187  |  { FAC_QI, "QI_SKIP", ASP_QI_SKIP  },
    188  |  { FAC_QI, "QI_REF_DET", ASP_QI_REF_DET  },
    189  |  { FAC_QI, "QI_REF_GEN", ASP_QI_REF_GEN  },
    190  |  { FAC_QI, "QI_COLL_DET", ASP_QI_COLL_DET  },
    191  |  { FAC_QI, "QI_COLL_GEN", ASP_QI_COLL_GEN  },
    192  |  { FAC_QI, "QI_WATCH", ASP_QI_WATCH  },
    193  |  { FAC_QC, "QC_BUILD", ASP_QC_BUILD  },
    194  |  { FAC_TH, "TH_NEW", ASP_TH_NEW  },
    195  |  { FAC_SK, "SK_GEN", ASP_SK_GEN  },
    196  |  { FAC_SK, "SK_WRIT", ASP_SK_WRIT  },
    197  |  { FAC_SK, "SK_WATCH", ASP_SK_WATCH  },
    198  |  { FAC_PW, "PW_CONN", ASP_PW_CONN  },
    199  |  { FAC_PW, "PW_I_PASSUN", ASP_PW_I_PASSUN  },
    200  |  { FAC_PW, "PW_I_QRYLOG", ASP_PW_I_QRYLOG  },
    201  |  { FAC_PW, "PW_I_DENTRY", ASP_PW_I_DENTRY  },
    202  |  { FAC_SQ, "SQ_QRYTIME", ASP_SQ_QRYTIME  },
    203  |  { FAC_SQ, "SQ_ABORT", ASP_SQ_ABORT  },
    204  |  { FAC_PM, "PM_INPUT", ASP_PM_INPUT  },
    205  |  { FAC_PM, "PM_ERESP", ASP_PM_ERESP  },
    206  |  { FAC_MM, "MM_GEN", ASP_MM_GEN  },
    207  |  { FAC_MM, "MM_SEC", ASP_MM_SEC  },
    208  |  { FAC_SV, "SV_PORT", ASP_SV_PORT  },
    209  |  { FAC_UD, "UD_SQL", ASP_UD_SQL  },
    210  |  { FAC_UD, "UD_OBJ", ASP_UD_OBJ  },
    211  |  { FAC_UD, "UD_UPDLOG", ASP_UD_UPDLOG  },
    212  |  { FAC_AC, "AC_DECAY", ASP_AC_DECAY  },
    213  |  { FAC_AC, "AC_PRUNE_DET", ASP_AC_PRUNE_DET  },
    214  |  { FAC_AC, "AC_I_PERMBAN", ASP_AC_I_PERMBAN  },
    215  |  { FAC_PC, "PC_I_SESSION", ASP_PC_I_SESSION  },
    216  |  { FAC_PC, "PC_I_COMMAND", ASP_PC_I_COMMAND  },
    217  |  { FAC_UP, "UP_FILE", ASP_UP_FILE  },
    218  |  { FAC_UP, "UP_GEN", ASP_UP_GEN  },
    219  |  { FAC_PA, "PA_GEN", ASP_PA_GEN  },
    220  |  { FAC_UT, "UT_MEM", ASP_UT_MEM  },
    221  |  { FAC_UT, "UT_FD", ASP_UT_FD  },
    222  |  /* m4 - paste the definitions here */
    223  |
    224  |    {FAC_NONE, NULL, 0}
    225  | }
    226  | #endif /* ER_IMPL */
    227  | ;
    228  |
    229  |
    230  | unsigned int ER_aspval(char *key);
    231  |
    232  | #endif /* ER_ASPECTS_H */
    233  |