00001 #ifndef MIB_H 00002 #define MIB_H 00003 00004 #ifdef __cplusplus 00005 extern "C" { 00006 #endif 00007 /* 00008 * mib.h - Definitions for the variables as defined in the MIB 00009 * 00010 * Update: 1998-07-17 <jhy@gsu.edu> 00011 * Added prototypes for print_oid_report* functions. 00012 */ 00013 /*********************************************************** 00014 Copyright 1988, 1989 by Carnegie Mellon University 00015 00016 All Rights Reserved 00017 00018 Permission to use, copy, modify, and distribute this software and its 00019 documentation for any purpose and without fee is hereby granted, 00020 provided that the above copyright notice appear in all copies and that 00021 both that copyright notice and this permission notice appear in 00022 supporting documentation, and that the name of CMU not be 00023 used in advertising or publicity pertaining to distribution of the 00024 software without specific, written prior permission. 00025 00026 CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 00027 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 00028 CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 00029 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 00030 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 00031 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 00032 SOFTWARE. 00033 ******************************************************************/ 00034 00035 #include <stdio.h> /* for FILE */ 00036 00037 #include <net-snmp/mib_api.h> 00038 00039 #define MIB 1, 3, 6, 1, 2, 1 00040 00041 #define MIB_IFTYPE_OTHER 1 00042 #define MIB_IFTYPE_REGULAR1822 2 00043 #define MIB_IFTYPE_HDH1822 3 00044 #define MIB_IFTYPE_DDNX25 4 00045 #define MIB_IFTYPE_RFC877X25 5 00046 #define MIB_IFTYPE_ETHERNETCSMACD 6 00047 #define MIB_IFTYPE_ISO88023CSMACD 7 00048 #define MIB_IFTYPE_ISO88024TOKENBUS 8 00049 #define MIB_IFTYPE_ISO88025TOKENRING 9 00050 #define MIB_IFTYPE_ISO88026MAN 10 00051 #define MIB_IFTYPE_STARLAN 11 00052 #define MIB_IFTYPE_PROTEON10MBIT 12 00053 #define MIB_IFTYPE_PROTEON80MBIT 13 00054 #define MIB_IFTYPE_HYPERCHANNEL 14 00055 #define MIB_IFTYPE_FDDI 15 00056 #define MIB_IFTYPE_LAPB 16 00057 #define MIB_IFTYPE_SDLC 17 00058 #define MIB_IFTYPE_T1CARRIER 18 00059 #define MIB_IFTYPE_CEPT 19 00060 #define MIB_IFTYPE_BASICISDN 20 00061 #define MIB_IFTYPE_PRIMARYISDN 21 00062 #define MIB_IFTYPE_PROPPOINTTOPOINTSERIAL 22 00063 00064 #define MIB_IFSTATUS_UP 1 00065 #define MIB_IFSTATUS_DOWN 2 00066 #define MIB_IFSTATUS_TESTING 3 00067 00068 #define MIB_FORWARD_GATEWAY 1 00069 #define MIB_FORWARD_HOST 2 00070 00071 #define MIB_IPROUTETYPE_OTHER 1 00072 #define MIB_IPROUTETYPE_INVALID 2 00073 #define MIB_IPROUTETYPE_DIRECT 3 00074 #define MIB_IPROUTETYPE_REMOTE 4 00075 00076 #define MIB_IPROUTEPROTO_OTHER 1 00077 #define MIB_IPROUTEPROTO_LOCAL 2 00078 #define MIB_IPROUTEPROTO_NETMGMT 3 00079 #define MIB_IPROUTEPROTO_ICMP 4 00080 #define MIB_IPROUTEPROTO_EGP 5 00081 #define MIB_IPROUTEPROTO_GGP 6 00082 #define MIB_IPROUTEPROTO_HELLO 7 00083 #define MIB_IPROUTEPROTO_RIP 8 00084 #define MIB_IPROUTEPROTO_ISIS 9 00085 #define MIB_IPROUTEPROTO_ESIS 10 00086 #define MIB_IPROUTEPROTO_CISCOIGRP 11 00087 #define MIB_IPROUTEPROTO_BBNSPFIGP 12 00088 #define MIB_IPROUTEPROTO_OIGP 13 00089 00090 #define MIB_TCPRTOALG_OTHER 1 00091 #define MIB_TCPRTOALG_CONSTANT 2 00092 #define MIB_TCPRTOALG_RSRE 3 00093 #define MIB_TCPRTOALG_VANJ 4 00094 00095 #define MIB_TCPCONNSTATE_CLOSED 1 00096 #define MIB_TCPCONNSTATE_LISTEN 2 00097 #define MIB_TCPCONNSTATE_SYNSENT 3 00098 #define MIB_TCPCONNSTATE_SYNRECEIVED 4 00099 #define MIB_TCPCONNSTATE_ESTABLISHED 5 00100 #define MIB_TCPCONNSTATE_FINWAIT1 6 00101 #define MIB_TCPCONNSTATE_FINWAIT2 7 00102 #define MIB_TCPCONNSTATE_CLOSEWAIT 8 00103 #define MIB_TCPCONNSTATE_LASTACK 9 00104 #define MIB_TCPCONNSTATE_CLOSING 10 00105 #define MIB_TCPCONNSTATE_TIMEWAIT 11 00106 00107 #define MIB_EGPNEIGHSTATE_IDLE 1 00108 #define MIB_EGPNEIGHSTATE_AQUISITION 2 00109 #define MIB_EGPNEIGHSTATE_DOWN 3 00110 #define MIB_EGPNEIGHSTATE_UP 4 00111 #define MIB_EGPNEIGHSTATE_CEASE 5 00112 00113 struct variable_list; 00114 struct enum_list; 00115 00116 void print_ascii_dump(FILE *); 00117 void register_mib_handlers(void); 00118 void netsnmp_set_mib_directory(const char *dir); 00119 char *netsnmp_get_mib_directory(void); 00120 void netsnmp_fixup_mib_directory(void); 00121 void netsnmp_mibindex_load( void ); 00122 char * netsnmp_mibindex_lookup( const char * ); 00123 FILE * netsnmp_mibindex_new( const char * ); 00124 int sprint_realloc_description(u_char ** buf, size_t * buf_len, 00125 size_t * out_len, int allow_realloc, 00126 oid * objid, size_t objidlen, int width); 00127 int get_wild_node(const char *, oid *, size_t *); 00128 int get_node(const char *, oid *, size_t *); 00129 struct tree *get_tree(const oid *, size_t, struct tree *); 00130 struct tree *get_tree_head(void); 00131 void set_function(struct tree *); 00132 00133 int parse_one_oid_index(oid ** oidStart, size_t * oidLen, 00134 netsnmp_variable_list * data, 00135 int complete); 00136 int parse_oid_indexes(oid * oidIndex, size_t oidLen, 00137 netsnmp_variable_list * data); 00138 int build_oid_noalloc(oid * in, size_t in_len, 00139 size_t * out_len, oid * prefix, 00140 size_t prefix_len, 00141 netsnmp_variable_list * indexes); 00142 int build_oid(oid ** out, size_t * out_len, oid * prefix, 00143 size_t prefix_len, 00144 netsnmp_variable_list * indexes); 00145 int build_oid_segment(netsnmp_variable_list * var); 00146 00147 int sprint_realloc_variable(u_char ** buf, size_t * buf_len, 00148 size_t * out_len, int allow_realloc, 00149 const oid * objid, size_t objidlen, 00150 const netsnmp_variable_list * variable); 00151 00152 #ifndef NETSNMP_DISABLE_MIB_LOADING 00153 struct tree * 00154 #else 00155 void 00156 #endif 00157 netsnmp_sprint_realloc_objid_tree(u_char ** buf, 00158 size_t * buf_len, 00159 size_t * out_len, 00160 int allow_realloc, 00161 int *buf_overflow, 00162 const oid * objid, 00163 size_t objidlen); 00164 00165 void 00166 netsnmp_sprint_realloc_objid(u_char ** buf, 00167 size_t * buf_len, 00168 size_t * out_len, 00169 int allow_realloc, 00170 int *buf_overflow, 00171 const oid * objid, 00172 size_t objidlen); 00173 00174 int sprint_realloc_value(u_char ** buf, size_t * buf_len, 00175 size_t * out_len, int allow_realloc, 00176 const oid * objid, size_t objidlen, 00177 const netsnmp_variable_list * variable); 00178 00179 int sprint_realloc_objid(u_char ** buf, size_t * buf_len, 00180 size_t * out_len, int allow_realloc, 00181 const oid * objid, size_t objidlen); 00182 00183 int sprint_realloc_by_type(u_char ** buf, size_t * buf_len, 00184 size_t * out_len, 00185 int allow_realloc, 00186 const netsnmp_variable_list * var, 00187 const struct enum_list *enums, 00188 const char *hint, 00189 const char *units); 00190 00191 int sprint_realloc_hexstring(u_char ** buf, 00192 size_t * buf_len, 00193 size_t * out_len, 00194 int allow_realloc, 00195 const u_char *, size_t); 00196 00197 int sprint_realloc_asciistring(u_char ** buf, 00198 size_t * buf_len, 00199 size_t * out_len, 00200 int allow_realloc, 00201 const u_char * cp, 00202 size_t len); 00203 00204 int sprint_realloc_octet_string(u_char ** buf, 00205 size_t * buf_len, 00206 size_t * out_len, 00207 int allow_realloc, 00208 const netsnmp_variable_list *, 00209 const struct enum_list *, 00210 const char *, 00211 const char *); 00212 00213 int sprint_realloc_opaque(u_char ** buf, size_t * buf_len, 00214 size_t * out_len, 00215 int allow_realloc, 00216 const netsnmp_variable_list *, 00217 const struct enum_list *, const char *, 00218 const char *); 00219 00220 int sprint_realloc_object_identifier(u_char ** buf, 00221 size_t * buf_len, 00222 size_t * out_len, 00223 int allow_realloc, 00224 const netsnmp_variable_list 00225 *, const struct enum_list *, 00226 const char *, 00227 const char *); 00228 00229 int sprint_realloc_timeticks(u_char ** buf, 00230 size_t * buf_len, 00231 size_t * out_len, 00232 int allow_realloc, 00233 const netsnmp_variable_list *, 00234 const struct enum_list *, 00235 const char *, const char *); 00236 00237 int sprint_realloc_hinted_integer(u_char ** buf, 00238 size_t * buf_len, 00239 size_t * out_len, 00240 int allow_realloc, long, 00241 const char, const char *, 00242 const char *); 00243 00244 int sprint_realloc_integer(u_char ** buf, size_t * buf_len, 00245 size_t * out_len, 00246 int allow_realloc, 00247 const netsnmp_variable_list *, 00248 const struct enum_list *, 00249 const char *, const char *); 00250 00251 int sprint_realloc_uinteger(u_char ** buf, 00252 size_t * buf_len, 00253 size_t * out_len, 00254 int allow_realloc, 00255 const netsnmp_variable_list *, 00256 const struct enum_list *, 00257 const char *, const char *); 00258 00259 int sprint_realloc_gauge(u_char ** buf, size_t * buf_len, 00260 size_t * out_len, 00261 int allow_realloc, 00262 const netsnmp_variable_list *, 00263 const struct enum_list *, const char *, 00264 const char *); 00265 00266 int sprint_realloc_counter(u_char ** buf, size_t * buf_len, 00267 size_t * out_len, 00268 int allow_realloc, 00269 const netsnmp_variable_list *, 00270 const struct enum_list *, 00271 const char *, const char *); 00272 00273 int sprint_realloc_networkaddress(u_char ** buf, 00274 size_t * buf_len, 00275 size_t * out_len, 00276 int allow_realloc, 00277 const netsnmp_variable_list *, 00278 const struct enum_list *, 00279 const char *, 00280 const char *); 00281 00282 int sprint_realloc_ipaddress(u_char ** buf, 00283 size_t * buf_len, 00284 size_t * out_len, 00285 int allow_realloc, 00286 const netsnmp_variable_list *, 00287 const struct enum_list *, 00288 const char *, const char *); 00289 00290 int sprint_realloc_null(u_char ** buf, size_t * buf_len, 00291 size_t * out_len, 00292 int allow_realloc, 00293 const netsnmp_variable_list *, 00294 const struct enum_list *, const char *, 00295 const char *); 00296 00297 int sprint_realloc_bitstring(u_char ** buf, 00298 size_t * buf_len, 00299 size_t * out_len, 00300 int allow_realloc, 00301 const netsnmp_variable_list *, 00302 const struct enum_list *, 00303 const char *, const char *); 00304 00305 int sprint_realloc_nsapaddress(u_char ** buf, 00306 size_t * buf_len, 00307 size_t * out_len, 00308 int allow_realloc, 00309 const netsnmp_variable_list *, 00310 const struct enum_list *, 00311 const char *, const char *); 00312 00313 int sprint_realloc_counter64(u_char ** buf, 00314 size_t * buf_len, 00315 size_t * out_len, 00316 int allow_realloc, 00317 const netsnmp_variable_list *, 00318 const struct enum_list *, 00319 const char *, const char *); 00320 00321 int sprint_realloc_badtype(u_char ** buf, size_t * buf_len, 00322 size_t * out_len, 00323 int allow_realloc, 00324 const netsnmp_variable_list *, 00325 const struct enum_list *, 00326 const char *, const char *); 00327 00328 #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES 00329 int sprint_realloc_float(u_char ** buf, size_t * buf_len, 00330 size_t * out_len, 00331 int allow_realloc, 00332 const netsnmp_variable_list *, 00333 const struct enum_list *, const char *, 00334 const char *); 00335 00336 int sprint_realloc_double(u_char ** buf, size_t * buf_len, 00337 size_t * out_len, 00338 int allow_realloc, 00339 const netsnmp_variable_list *, 00340 const struct enum_list *, const char *, 00341 const char *); 00342 #endif 00343 00344 00345 int snprint_by_type(char *buf, size_t buf_len, 00346 netsnmp_variable_list * var, 00347 const struct enum_list *enums, 00348 const char *hint, const char *units); 00349 00350 int snprint_hexstring(char *buf, size_t buf_len, 00351 const u_char *, size_t); 00352 00353 int snprint_asciistring(char *buf, size_t buf_len, 00354 const u_char * cp, size_t len); 00355 00356 int snprint_octet_string(char *buf, size_t buf_len, 00357 const netsnmp_variable_list *, 00358 const struct enum_list *, const char *, 00359 const char *); 00360 00361 int snprint_opaque(char *buf, size_t buf_len, 00362 const netsnmp_variable_list *, 00363 const struct enum_list *, const char *, 00364 const char *); 00365 00366 int snprint_object_identifier(char *buf, size_t buf_len, 00367 const netsnmp_variable_list *, 00368 const struct enum_list *, 00369 const char *, const char *); 00370 00371 int snprint_timeticks(char *buf, size_t buf_len, 00372 const netsnmp_variable_list *, 00373 const struct enum_list *, const char *, 00374 const char *); 00375 00376 int snprint_hinted_integer(char *buf, size_t buf_len, 00377 long, const char *, 00378 const char *); 00379 00380 int snprint_integer(char *buf, size_t buf_len, 00381 const netsnmp_variable_list *, 00382 const struct enum_list *, const char *, 00383 const char *); 00384 00385 int snprint_uinteger(char *buf, size_t buf_len, 00386 const netsnmp_variable_list *, 00387 const struct enum_list *, const char *, 00388 const char *); 00389 00390 int snprint_gauge(char *buf, size_t buf_len, 00391 const netsnmp_variable_list *, 00392 const struct enum_list *, const char *, 00393 const char *); 00394 00395 int snprint_counter(char *buf, size_t buf_len, 00396 const netsnmp_variable_list *, 00397 const struct enum_list *, const char *, 00398 const char *); 00399 00400 int snprint_networkaddress(char *buf, size_t buf_len, 00401 const netsnmp_variable_list *, 00402 const struct enum_list *, 00403 const char *, const char *); 00404 00405 int snprint_ipaddress(char *buf, size_t buf_len, 00406 const netsnmp_variable_list *, 00407 const struct enum_list *, const char *, 00408 const char *); 00409 00410 int snprint_null(char *buf, size_t buf_len, 00411 const netsnmp_variable_list *, 00412 const struct enum_list *, const char *, 00413 const char *); 00414 00415 int snprint_bitstring(char *buf, size_t buf_len, 00416 const netsnmp_variable_list *, 00417 const struct enum_list *, const char *, 00418 const char *); 00419 00420 int snprint_nsapaddress(char *buf, size_t buf_len, 00421 const netsnmp_variable_list *, 00422 const struct enum_list *, const char *, 00423 const char *); 00424 00425 int snprint_counter64(char *buf, size_t buf_len, 00426 const netsnmp_variable_list *, 00427 const struct enum_list *, const char *, 00428 const char *); 00429 00430 int snprint_badtype(char *buf, size_t buf_len, 00431 const netsnmp_variable_list *, 00432 const struct enum_list *, const char *, 00433 const char *); 00434 00435 #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES 00436 int snprint_float(char *buf, size_t buf_len, 00437 const netsnmp_variable_list *, 00438 const struct enum_list *, const char *, 00439 const char *); 00440 00441 int snprint_double(char *buf, size_t buf_len, 00442 const netsnmp_variable_list *, 00443 const struct enum_list *, const char *, 00444 const char *); 00445 #endif 00446 00447 void print_oid_report(FILE *); 00448 void print_oid_report_enable_labeledoid(void); 00449 void print_oid_report_enable_oid(void); 00450 void print_oid_report_enable_suffix(void); 00451 void print_oid_report_enable_symbolic(void); 00452 void print_oid_report_enable_mibchildoid(void); 00453 00454 const char *parse_octet_hint(const char *hint, const char *value, 00455 unsigned char **new_val, int *new_val_len); 00456 00457 void clear_tree_flags(register struct tree *tp); 00458 00459 char *snmp_out_toggle_options(char *); 00460 void snmp_out_toggle_options_usage(const char *, FILE *); 00461 char *snmp_in_toggle_options(char *); 00462 char *snmp_in_options(char *, int, char * const *); 00463 void snmp_in_toggle_options_usage(const char *, FILE *); 00464 u_char mib_to_asn_type(int mib_type); 00465 00466 00467 int netsnmp_str2oid(const char *S, oid * O, int L); 00468 00469 00470 #define NETSNMP_STRING_OUTPUT_GUESS 1 00471 #define NETSNMP_STRING_OUTPUT_ASCII 2 00472 #define NETSNMP_STRING_OUTPUT_HEX 3 00473 00474 #define NETSNMP_OID_OUTPUT_SUFFIX 1 00475 #define NETSNMP_OID_OUTPUT_MODULE 2 00476 #define NETSNMP_OID_OUTPUT_FULL 3 00477 #define NETSNMP_OID_OUTPUT_NUMERIC 4 00478 #define NETSNMP_OID_OUTPUT_UCD 5 00479 #define NETSNMP_OID_OUTPUT_NONE 6 00480 #ifdef __cplusplus 00481 } 00482 #endif 00483 #endif /* MIB_H */
1.5.7.1
Last modified: Tuesday, 23-Dec-2025 17:22:04 UTC
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.