net-snmp 5.7
default_store.h
00001 /* Portions of this file are subject to the following copyright(s).  See
00002  * the Net-SNMP's COPYING file for more details and other copyrights
00003  * that may apply:
00004  */
00005 /*
00006  * Portions of this file are copyrighted by:
00007  * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
00008  * Use is subject to license terms specified in the COPYING file
00009  * distributed with the Net-SNMP package.
00010  */
00011 /*
00012  * Note:
00013  *    If new default_store entries are added to this header file,
00014  *    then remember to run 'perl/default_store/gen' to update the
00015  *    corresponding perl interface.
00016  */
00017 /*
00018  * @file default_store.h: storage space for defaults
00019  *
00020  * @addtogroup default_store
00021  *
00022  * @{
00023  */
00024 #ifndef DEFAULT_STORE_H
00025 #define DEFAULT_STORE_H
00026 
00027 #include <net-snmp/net-snmp-config.h>
00028 
00029 #ifdef __cplusplus
00030 extern          "C" {
00031 #endif
00032 
00033 #define NETSNMP_DS_MAX_IDS 3
00034 #define NETSNMP_DS_MAX_SUBIDS 48        /* needs to be a multiple of 8 */
00035 
00036     /*
00037      * begin storage definitions 
00038      */
00042 #define NETSNMP_DS_LIBRARY_ID     0
00043 #define NETSNMP_DS_APPLICATION_ID 1
00044 #define NETSNMP_DS_TOKEN_ID       2
00045 
00046     /*
00047      * These definitions correspond with the "which" argument to the API,
00048      * when the storeid argument is NETSNMP_DS_LIBRARY_ID 
00049      */
00050     /*
00051      * library booleans 
00052      */
00053 #define NETSNMP_DS_LIB_MIB_ERRORS          0
00054 #define NETSNMP_DS_LIB_SAVE_MIB_DESCRS     1
00055 #define NETSNMP_DS_LIB_MIB_COMMENT_TERM    2
00056 #define NETSNMP_DS_LIB_MIB_PARSE_LABEL     3
00057 #define NETSNMP_DS_LIB_DUMP_PACKET         4
00058 #define NETSNMP_DS_LIB_LOG_TIMESTAMP       5
00059 #define NETSNMP_DS_LIB_DONT_READ_CONFIGS   6    /* don't read normal config files */
00060 #define NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD      NETSNMP_DS_LIB_DONT_READ_CONFIGS
00061 #define NETSNMP_DS_LIB_MIB_REPLACE         7    /* replace objects from latest module */
00062 #define NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM  8    /* print only numeric enum values */
00063 #define NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS  9    /* print only numeric enum values */
00064 #define NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS 10   /* dont print oid indexes specially */
00065 #define NETSNMP_DS_LIB_ALARM_DONT_USE_SIG  11   /* don't use the alarm() signal */
00066 #define NETSNMP_DS_LIB_PRINT_FULL_OID      12   /* print fully qualified oids */
00067 #define NETSNMP_DS_LIB_QUICK_PRINT         13   /* print very brief output for parsing */
00068 #define NETSNMP_DS_LIB_RANDOM_ACCESS       14   /* random access to oid labels */
00069 #define NETSNMP_DS_LIB_REGEX_ACCESS        15   /* regex matching to oid labels */
00070 #define NETSNMP_DS_LIB_DONT_CHECK_RANGE    16   /* don't check values for ranges on send */
00071 #define NETSNMP_DS_LIB_NO_TOKEN_WARNINGS   17   /* no warn about unknown config tokens */
00072 #define NETSNMP_DS_LIB_NUMERIC_TIMETICKS   18   /* print timeticks as a number */
00073 #define NETSNMP_DS_LIB_ESCAPE_QUOTES       19   /* shell escape quote marks in oids */
00074 #define NETSNMP_DS_LIB_REVERSE_ENCODE      20   /* encode packets from back to front */
00075 #define NETSNMP_DS_LIB_PRINT_BARE_VALUE    21   /* just print value (not OID = value) */
00076 #define NETSNMP_DS_LIB_EXTENDED_INDEX      22   /* print extended index format [x1][x2] */
00077 #define NETSNMP_DS_LIB_PRINT_HEX_TEXT      23   /* print ASCII text along with hex strings */
00078 #define NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID 24   /* print OID's using the UCD-style prefix suppression */
00079 #define NETSNMP_DS_LIB_READ_UCD_STYLE_OID  25   /* require top-level OIDs to be prefixed with a dot */
00080 #define NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG 26       /* have the pre-mib parsing config tokens been processed */
00081 #define NETSNMP_DS_LIB_HAVE_READ_CONFIG    27   /* have the config tokens been processed */
00082 #define NETSNMP_DS_LIB_QUICKE_PRINT        28   
00083 #define NETSNMP_DS_LIB_DONT_PRINT_UNITS    29 /* don't print UNITS suffix */
00084 #define NETSNMP_DS_LIB_NO_DISPLAY_HINT     30 /* don't apply DISPLAY-HINTs */
00085 #define NETSNMP_DS_LIB_16BIT_IDS           31   /* restrict requestIDs, etc to 16-bit values */
00086 #define NETSNMP_DS_LIB_DONT_PERSIST_STATE  32   /* don't load config and don't load/save persistent file */
00087 #define NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT   33   /* print a leading 0 on hex values <= 'f' */
00088 #define NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY 34   /* don't complain if no community is specified in the command arguments */
00089 #define NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD  35 /* don't load persistent file */
00090 #define NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE  36 /* don't save persistent file */
00091 #define NETSNMP_DS_LIB_APPEND_LOGFILES     37 /* append, don't overwrite, log files */
00092 #define NETSNMP_DS_LIB_NO_DISCOVERY        38 /* don't support RFC5343 contextEngineID discovery */
00093 #define NETSNMP_DS_LIB_TSM_USE_PREFIX      39 /* TSM's simple security name mapping */
00094 #define NETSNMP_DS_LIB_DONT_LOAD_HOST_FILES 40 /* don't read host.conf files */
00095 #define NETSNMP_DS_LIB_DNSSEC_WARN_ONLY     41 /* tread DNSSEC errors as warnings */
00096 #define NETSNMP_DS_LIB_MAX_BOOL_ID          48 /* match NETSNMP_DS_MAX_SUBIDS */
00097 
00098     /*
00099      * library integers 
00100      */
00101 #define NETSNMP_DS_LIB_MIB_WARNINGS         0
00102 #define NETSNMP_DS_LIB_SECLEVEL             1
00103 #define NETSNMP_DS_LIB_SNMPVERSION          2
00104 #define NETSNMP_DS_LIB_DEFAULT_PORT         3
00105 #define NETSNMP_DS_LIB_OID_OUTPUT_FORMAT    4
00106 #define NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY    NETSNMP_DS_LIB_OID_OUTPUT_FORMAT
00107 #define NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT 5
00108 #define NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH    6
00109 #define NETSNMP_DS_LIB_SERVERSENDBUF        7 /* send buffer (server) */
00110 #define NETSNMP_DS_LIB_SERVERRECVBUF        8 /* receive buffer (server) */
00111 #define NETSNMP_DS_LIB_CLIENTSENDBUF        9 /* send buffer (client) */
00112 #define NETSNMP_DS_LIB_CLIENTRECVBUF       10 /* receive buffer (client) */
00113 #define NETSNMP_DS_SSHDOMAIN_SOCK_PERM     11
00114 #define NETSNMP_DS_SSHDOMAIN_DIR_PERM      12
00115 #define NETSNMP_DS_SSHDOMAIN_SOCK_USER     12
00116 #define NETSNMP_DS_SSHDOMAIN_SOCK_GROUP    13
00117 #define NETSNMP_DS_LIB_TIMEOUT             14
00118 #define NETSNMP_DS_LIB_RETRIES             15
00119 #define NETSNMP_DS_LIB_MAX_INT_ID          48 /* match NETSNMP_DS_MAX_SUBIDS */
00120     
00121     /*
00122      * special meanings for the default SNMP version slot (NETSNMP_DS_LIB_SNMPVERSION) 
00123      */
00124 #ifndef NETSNMP_DISABLE_SNMPV1
00125 #define NETSNMP_DS_SNMP_VERSION_1    128        /* bogus */
00126 #endif
00127 #ifndef NETSNMP_DISABLE_SNMPV2C
00128 #define NETSNMP_DS_SNMP_VERSION_2c   1  /* real */
00129 #endif
00130 #define NETSNMP_DS_SNMP_VERSION_3    3  /* real */
00131 
00132 
00133     /*
00134      * library strings 
00135      */
00136 #define NETSNMP_DS_LIB_SECNAME           0
00137 #define NETSNMP_DS_LIB_CONTEXT           1
00138 #define NETSNMP_DS_LIB_PASSPHRASE        2
00139 #define NETSNMP_DS_LIB_AUTHPASSPHRASE    3
00140 #define NETSNMP_DS_LIB_PRIVPASSPHRASE    4
00141 #define NETSNMP_DS_LIB_OPTIONALCONFIG    5
00142 #define NETSNMP_DS_LIB_APPTYPE           6
00143 #define NETSNMP_DS_LIB_COMMUNITY         7
00144 #define NETSNMP_DS_LIB_PERSISTENT_DIR    8
00145 #define NETSNMP_DS_LIB_CONFIGURATION_DIR 9
00146 #define NETSNMP_DS_LIB_SECMODEL          10
00147 #define NETSNMP_DS_LIB_MIBDIRS           11
00148 #define NETSNMP_DS_LIB_OIDSUFFIX         12
00149 #define NETSNMP_DS_LIB_OIDPREFIX         13
00150 #define NETSNMP_DS_LIB_CLIENT_ADDR       14
00151 #define NETSNMP_DS_LIB_TEMP_FILE_PATTERN 15
00152 #define NETSNMP_DS_LIB_AUTHMASTERKEY     16
00153 #define NETSNMP_DS_LIB_PRIVMASTERKEY     17
00154 #define NETSNMP_DS_LIB_AUTHLOCALIZEDKEY  18
00155 #define NETSNMP_DS_LIB_PRIVLOCALIZEDKEY  19
00156 #define NETSNMP_DS_LIB_APPTYPES          20
00157 #define NETSNMP_DS_LIB_KSM_KEYTAB        21
00158 #define NETSNMP_DS_LIB_KSM_SERVICE_NAME  22
00159 #define NETSNMP_DS_LIB_X509_CLIENT_PUB   23
00160 #define NETSNMP_DS_LIB_X509_SERVER_PUB   24
00161 #define NETSNMP_DS_LIB_SSHTOSNMP_SOCKET  25
00162 #define NETSNMP_DS_LIB_CERT_EXTRA_SUBDIR 26
00163 #define NETSNMP_DS_LIB_HOSTNAME          27
00164 #define NETSNMP_DS_LIB_X509_CRL_FILE     28
00165 #define NETSNMP_DS_LIB_TLS_ALGORITMS     29
00166 #define NETSNMP_DS_LIB_TLS_LOCAL_CERT    30
00167 #define NETSNMP_DS_LIB_TLS_PEER_CERT     31
00168 #define NETSNMP_DS_LIB_SSH_USERNAME      32
00169 #define NETSNMP_DS_LIB_SSH_PUBKEY        33
00170 #define NETSNMP_DS_LIB_SSH_PRIVKEY       34
00171 #define NETSNMP_DS_LIB_MAX_STR_ID        48 /* match NETSNMP_DS_MAX_SUBIDS */
00172 
00173     /*
00174      * end storage definitions 
00175      */
00176 
00177     NETSNMP_IMPORT
00178     int             netsnmp_ds_set_boolean(int storeid, int which, int value);
00179     NETSNMP_IMPORT
00180     int             netsnmp_ds_get_boolean(int storeid, int which);
00181     NETSNMP_IMPORT
00182     int             netsnmp_ds_toggle_boolean(int storeid, int which);
00183     NETSNMP_IMPORT
00184     int             netsnmp_ds_set_int(int storeid, int which, int value);
00185     NETSNMP_IMPORT
00186     int             netsnmp_ds_get_int(int storeid, int which);
00187     NETSNMP_IMPORT
00188     int             netsnmp_ds_set_string(int storeid, int which,
00189                                   const char *value);
00190     NETSNMP_IMPORT
00191     char           *netsnmp_ds_get_string(int storeid, int which);
00192     NETSNMP_IMPORT
00193     int             netsnmp_ds_set_void(int storeid, int which, void *value);
00194     NETSNMP_IMPORT
00195     void           *netsnmp_ds_get_void(int storeid, int which);
00196     NETSNMP_IMPORT
00197     int             netsnmp_ds_register_config(u_char type, const char *ftype,
00198                                        const char *token, int storeid,
00199                                        int which);
00200     NETSNMP_IMPORT
00201     int             netsnmp_ds_register_premib(u_char type, const char *ftype,
00202                                        const char *token, int storeid,
00203                                        int which);
00204     NETSNMP_IMPORT
00205     int             netsnmp_ds_parse_boolean(char *line);
00206     NETSNMP_IMPORT
00207     void            netsnmp_ds_shutdown(void);
00208 
00209 #ifdef __cplusplus
00210 }
00211 #endif
00212 #endif                          /* DEFAULT_STORE_H */
00213