Source File include/defs.h

    1    | #ifndef READ_DEFS
    2    | #define READ_DEFS
    3    |
    4    | /***************************************
    5    |   $Revision: 1.9 $
    6    |
    7    |   Objects module (ob) - this _should_ eventually get merged in with the
    8    |   config module.
    9    |
    10   |   Status: NOT REVUED, NOT TESTED
    11   |
    12   |   ******************/ /******************
    13   |   Copyright (c) 1999                              RIPE NCC
    14   |
    15   |   All Rights Reserved
    16   |
    17   |   Permission to use, copy, modify, and distribute this software and its
    18   |   documentation for any purpose and without fee is hereby granted,
    19   |   provided that the above copyright notice appear in all copies and that
    20   |   both that copyright notice and this permission notice appear in
    21   |   supporting documentation, and that the name of the author not be
    22   |   used in advertising or publicity pertaining to distribution of the
    23   |   software without specific, written prior permission.
    24   |
    25   |   THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
    26   |   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
    27   |   AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
    28   |   DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
    29   |   AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    30   |   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    31   |   ***************************************/
    32   | #include <glib.h>
    33   | #include "bitmask.h"
    34   |
    35   | #include "DF_class_enum.def"
    36   | #include "DF_class_mask.def"
    37   |
    38   | #include "DF_attribute_enum.def"
    39   | #include "DF_attribute_inv_attr_mask.def"
    40   |
    41   | typedef enum _R_Type_t {
    42   |   R_SQL=0,
    43   |   R_RADIX,
    44   |   R_END
    45   | } R_Type_t;
    46   |
    47   | typedef enum _Q_Type_t {
    48   |   Q_LOOKUP=0,
    49   |   Q_INVERSE
    50   | } Q_Type_t;
    51   |
    52   | #include "which_keytypes.h"
    53   | #include "iproutines.h"
    54   | #include "rxroutines.h"
    55   |
    56   | typedef struct {
    57   |   R_Type_t refer;
    58   |   Q_Type_t querytype;
    59   |   WK_Type keytype;
    60   |   A_Type_t attribute;
    61   |   C_Type_t class;
    62   |   char * const query;
    63   |   char * const descr;
    64   | } Query_t;
    65   |
    66   | #ifdef DEFS_IMPL
    67   | #include "QI_queries.def"
    68   | #else
    69   | extern Query_t Query[];
    70   | #endif
    71   |
    72   |
    73   | typedef struct {
    74   |   A_Type_t attr;
    75   |   rx_fam_t family;
    76   |   char *   ipv4_load;
    77   |   char *   ipv6_load;
    78   | } DF_Load_t;
    79   | #ifdef DEFS_IMPL
    80   | #include "DF_radix_load.def"
    81   | #else
    82   | extern  DF_Load_t DF_radix_load[];
    83   | #endif
    84   |
    85   |
    86   |
    87   | typedef enum UD_qtype_t {
    88   |   UD_AUX__,
    89   |   UD_AX_PR,
    90   |   UD_AX_MT,
    91   |   UD_AX_MO,
    92   |   UD_AX_MR,
    93   |   UD_AX_MU,
    94   |   UD_LEAF_,
    95   |   UD_LF_IF,
    96   |   UD_LF_RF,
    97   |   UD_LF_AT,
    98   |   UD_LF_OT,
    99   |   UD_LF_AY,
    100  |   UD_MAIN_,
    101  |   UD_MA_RT,
    102  |   UD_MA_OR,
    103  |   UD_MA_PR,
    104  |   UD_MA_U2,
    105  |   UD_MA_IN,
    106  |   UD_MA_I6,
    107  |   UD_MA_AK,
    108  |   UD_NULL_
    109  | } UD_qtype;
    110  |
    111  | typedef struct UD_query_t {
    112  |   UD_qtype qtype;
    113  |   char * const qry;
    114  | } UD_query;
    115  |
    116  |
    117  | char * const *DF_get_filter_names(void);
    118  | char * const *DF_get_class_names(void);
    119  | char * const *DF_get_class_aliases(void);
    120  | int DF_get_class_index(int alias_index);
    121  | char * const DF_get_class_name(int alias_index);
    122  | char * const DF_get_class_code(C_Type_t index);
    123  | int DF_get_class_dbase_code(int class_index);
    124  | char * const DF_get_class_sql_table(C_Type_t index);
    125  | char * const *DF_get_attribute_aliases(void);
    126  | const char *DF_get_attribute_name(A_Type_t index);
    127  | const char *DF_get_attribute_code(A_Type_t index);
    128  | char * const *DF_get_attribute_names(void);
    129  | int DF_get_attribute_index(int alias_index);
    130  | const char *DF_get_class_template(C_Type_t index);
    131  | const char *DF_get_class_template_v(C_Type_t index);
    132  | const char *DF_get_attribute_desc(A_Type_t index);
    133  | const char *DF_get_attribute_frmt(A_Type_t index);
    134  | char *DF_attributes_to_string(void);
    135  | A_Type_t DF_attribute_code2type(const gchar *token);
    136  | A_Type_t DF_attribute_name2type(const gchar *token);
    137  | C_Type_t DF_class_code2type(const gchar *token);
    138  | C_Type_t DF_class_name2type(const gchar *token);
    139  | const char *DF_get_server_query(int index);
    140  | char * const *DF_get_server_queries(void);
    141  | int DF_attrcode_has_radix_lookup(A_Type_t attr);
    142  | const char *DF_get_update_query(A_Type_t index);
    143  | UD_qtype DF_get_update_query_type(A_Type_t index);
    144  | const char *DF_get_insert_query(A_Type_t index);
    145  | UD_qtype DF_get_insert_query_type(A_Type_t index);
    146  | const char *DF_get_select_query(A_Type_t index);
    147  | UD_qtype DF_get_select_query_type(A_Type_t index);
    148  | const char *DF_get_dummy_query(A_Type_t index);
    149  | UD_qtype DF_get_dummy_query_type(A_Type_t index);
    150  | const char *DF_get_database(int index);
    151  | char * DF_attrcode_radix_load_v4(A_Type_t attr);
    152  | char * DF_attrcode_radix_load_v6(A_Type_t attr);
    153  | rx_fam_t DF_attrcode_radix_family(A_Type_t attr);
    154  | #endif /* READ_DEFS */
    155  |