net-snmp
5.4.1
|
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 #ifdef __cplusplus 00028 extern "C" { 00029 #endif 00030 00031 #define NETSNMP_DS_MAX_IDS 3 00032 #define NETSNMP_DS_MAX_SUBIDS 40 /* needs to be a multiple of 8 */ 00033 00034 /* 00035 * begin storage definitions 00036 */ 00040 #define NETSNMP_DS_LIBRARY_ID 0 00041 #define NETSNMP_DS_APPLICATION_ID 1 00042 #define NETSNMP_DS_TOKEN_ID 2 00043 00044 /* 00045 * These definitions correspond with the "which" argument to the API, 00046 * when the storeid argument is NETSNMP_DS_LIBRARY_ID 00047 */ 00048 /* 00049 * library booleans 00050 */ 00051 #define NETSNMP_DS_LIB_MIB_ERRORS 0 00052 #define NETSNMP_DS_LIB_SAVE_MIB_DESCRS 1 00053 #define NETSNMP_DS_LIB_MIB_COMMENT_TERM 2 00054 #define NETSNMP_DS_LIB_MIB_PARSE_LABEL 3 00055 #define NETSNMP_DS_LIB_DUMP_PACKET 4 00056 #define NETSNMP_DS_LIB_LOG_TIMESTAMP 5 00057 #define NETSNMP_DS_LIB_DONT_READ_CONFIGS 6 /* don't read normal config files */ 00058 #define NETSNMP_DS_LIB_DISABLE_CONFIG_LOAD NETSNMP_DS_LIB_DONT_READ_CONFIGS 00059 #define NETSNMP_DS_LIB_MIB_REPLACE 7 /* replace objects from latest module */ 00060 #define NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM 8 /* print only numeric enum values */ 00061 #define NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS 9 /* print only numeric enum values */ 00062 #define NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS 10 /* dont print oid indexes specially */ 00063 #define NETSNMP_DS_LIB_ALARM_DONT_USE_SIG 11 /* don't use the alarm() signal */ 00064 #define NETSNMP_DS_LIB_PRINT_FULL_OID 12 /* print fully qualified oids */ 00065 #define NETSNMP_DS_LIB_QUICK_PRINT 13 /* print very brief output for parsing */ 00066 #define NETSNMP_DS_LIB_RANDOM_ACCESS 14 /* random access to oid labels */ 00067 #define NETSNMP_DS_LIB_REGEX_ACCESS 15 /* regex matching to oid labels */ 00068 #define NETSNMP_DS_LIB_DONT_CHECK_RANGE 16 /* don't check values for ranges on send */ 00069 #define NETSNMP_DS_LIB_NO_TOKEN_WARNINGS 17 /* no warn about unknown config tokens */ 00070 #define NETSNMP_DS_LIB_NUMERIC_TIMETICKS 18 /* print timeticks as a number */ 00071 #define NETSNMP_DS_LIB_ESCAPE_QUOTES 19 /* shell escape quote marks in oids */ 00072 #define NETSNMP_DS_LIB_REVERSE_ENCODE 20 /* encode packets from back to front */ 00073 #define NETSNMP_DS_LIB_PRINT_BARE_VALUE 21 /* just print value (not OID = value) */ 00074 #define NETSNMP_DS_LIB_EXTENDED_INDEX 22 /* print extended index format [x1][x2] */ 00075 #define NETSNMP_DS_LIB_PRINT_HEX_TEXT 23 /* print ASCII text along with hex strings */ 00076 #define NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID 24 /* print OID's using the UCD-style prefix suppression */ 00077 #define NETSNMP_DS_LIB_READ_UCD_STYLE_OID 25 /* require top-level OIDs to be prefixed with a dot */ 00078 #define NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG 26 /* have the pre-mib parsing config tokens been processed */ 00079 #define NETSNMP_DS_LIB_HAVE_READ_CONFIG 27 /* have the config tokens been processed */ 00080 #define NETSNMP_DS_LIB_QUICKE_PRINT 28 00081 #define NETSNMP_DS_LIB_DONT_PRINT_UNITS 29 /* don't print UNITS suffix */ 00082 #define NETSNMP_DS_LIB_NO_DISPLAY_HINT 30 /* don't apply DISPLAY-HINTs */ 00083 #define NETSNMP_DS_LIB_16BIT_IDS 31 /* restrict requestIDs, etc to 16-bit values */ 00084 #define NETSNMP_DS_LIB_DONT_PERSIST_STATE 32 /* don't load config and don't load/save persistent file */ 00085 #define NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT 33 /* print a leading 0 on hex values <= 'f' */ 00086 #define NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY 34 /* don't complain if no community is specified in the command arguments */ 00087 #define NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD 35 /* don't load persistent file */ 00088 #define NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE 36 /* don't save persistent file */ 00089 #define NETSNMP_DS_LIB_APPEND_LOGFILES 37 /* append, don't overwrite, log files */ 00090 00091 /* 00092 * library integers 00093 */ 00094 #define NETSNMP_DS_LIB_MIB_WARNINGS 0 00095 #define NETSNMP_DS_LIB_SECLEVEL 1 00096 #define NETSNMP_DS_LIB_SNMPVERSION 2 00097 #define NETSNMP_DS_LIB_DEFAULT_PORT 3 00098 #define NETSNMP_DS_LIB_OID_OUTPUT_FORMAT 4 00099 #define NETSNMP_DS_LIB_PRINT_SUFFIX_ONLY NETSNMP_DS_LIB_OID_OUTPUT_FORMAT 00100 #define NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT 5 00101 #define NETSNMP_DS_LIB_HEX_OUTPUT_LENGTH 6 00102 #define NETSNMP_DS_LIB_SERVERSENDBUF 7 /* send buffer (server) */ 00103 #define NETSNMP_DS_LIB_SERVERRECVBUF 8 /* receive buffer (server) */ 00104 #define NETSNMP_DS_LIB_CLIENTSENDBUF 9 /* send buffer (client) */ 00105 #define NETSNMP_DS_LIB_CLIENTRECVBUF 10 /* receive buffer (client) */ 00106 00107 /* 00108 * special meanings for the default SNMP version slot (NETSNMP_DS_LIB_SNMPVERSION) 00109 */ 00110 #ifndef NETSNMP_DISABLE_SNMPV1 00111 #define NETSNMP_DS_SNMP_VERSION_1 128 /* bogus */ 00112 #endif 00113 #ifndef NETSNMP_DISABLE_SNMPV2C 00114 #define NETSNMP_DS_SNMP_VERSION_2c 1 /* real */ 00115 #endif 00116 #define NETSNMP_DS_SNMP_VERSION_3 3 /* real */ 00117 00118 00119 /* 00120 * library strings 00121 */ 00122 #define NETSNMP_DS_LIB_SECNAME 0 00123 #define NETSNMP_DS_LIB_CONTEXT 1 00124 #define NETSNMP_DS_LIB_PASSPHRASE 2 00125 #define NETSNMP_DS_LIB_AUTHPASSPHRASE 3 00126 #define NETSNMP_DS_LIB_PRIVPASSPHRASE 4 00127 #define NETSNMP_DS_LIB_OPTIONALCONFIG 5 00128 #define NETSNMP_DS_LIB_APPTYPE 6 00129 #define NETSNMP_DS_LIB_COMMUNITY 7 00130 #define NETSNMP_DS_LIB_PERSISTENT_DIR 8 00131 #define NETSNMP_DS_LIB_CONFIGURATION_DIR 9 00132 #define NETSNMP_DS_LIB_SECMODEL 10 00133 #define NETSNMP_DS_LIB_MIBDIRS 11 00134 #define NETSNMP_DS_LIB_OIDSUFFIX 12 00135 #define NETSNMP_DS_LIB_OIDPREFIX 13 00136 #define NETSNMP_DS_LIB_CLIENT_ADDR 14 00137 #define NETSNMP_DS_LIB_TEMP_FILE_PATTERN 15 00138 #define NETSNMP_DS_LIB_AUTHMASTERKEY 16 00139 #define NETSNMP_DS_LIB_PRIVMASTERKEY 17 00140 #define NETSNMP_DS_LIB_AUTHLOCALIZEDKEY 18 00141 #define NETSNMP_DS_LIB_PRIVLOCALIZEDKEY 19 00142 #define NETSNMP_DS_LIB_APPTYPES 20 00143 #define NETSNMP_DS_LIB_KSM_KEYTAB 21 00144 #define NETSNMP_DS_LIB_KSM_SERVICE_NAME 22 00145 00146 /* 00147 * end storage definitions 00148 */ 00149 00150 int netsnmp_ds_set_boolean(int storeid, int which, int value); 00151 int netsnmp_ds_get_boolean(int storeid, int which); 00152 int netsnmp_ds_toggle_boolean(int storeid, int which); 00153 int netsnmp_ds_set_int(int storeid, int which, int value); 00154 int netsnmp_ds_get_int(int storeid, int which); 00155 int netsnmp_ds_set_string(int storeid, int which, 00156 const char *value); 00157 char *netsnmp_ds_get_string(int storeid, int which); 00158 int netsnmp_ds_set_void(int storeid, int which, void *value); 00159 void *netsnmp_ds_get_void(int storeid, int which); 00160 int netsnmp_ds_register_config(u_char type, const char *ftype, 00161 const char *token, int storeid, 00162 int which); 00163 int netsnmp_ds_register_premib(u_char type, const char *ftype, 00164 const char *token, int storeid, 00165 int which); 00166 int netsnmp_ds_parse_boolean(char *line); 00167 void netsnmp_ds_shutdown(void); 00168 00169 #ifdef __cplusplus 00170 } 00171 #endif 00172 #endif /* DEFAULT_STORE_H */ 00173