Dave Shield | 00ef569 | 2011-02-22 08:55:48 +0000 | [diff] [blame] | 1 | #ifndef NET_SNMP_MIB_API_H |
| 2 | #define NET_SNMP_MIB_API_H |
| 3 | |
| 4 | /** |
| 5 | * Library API routines concerned with MIB files and objects, and OIDs |
| 6 | */ |
| 7 | |
| 8 | #include <net-snmp/types.h> |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
| 14 | /* Initialisation and Shutdown */ |
| 15 | void netsnmp_init_mib(void); |
| 16 | #ifndef NETSNMP_NO_LEGACY_DEFINITIONS |
| 17 | void init_mib(void); |
| 18 | void init_mib_internals(void); |
| 19 | #endif |
| 20 | void shutdown_mib(void); |
| 21 | |
| 22 | /* Reading and Parsing MIBs */ |
| 23 | int add_mibdir(const char *); |
| 24 | NETSNMP_IMPORT |
| 25 | struct tree *netsnmp_read_module(const char *); |
| 26 | #ifndef NETSNMP_NO_LEGACY_DEFINITIONS |
| 27 | struct tree *read_module(const char *); |
| 28 | #endif |
| 29 | struct tree *read_mib(const char *); |
| 30 | struct tree *read_all_mibs(void); |
| 31 | void add_module_replacement(const char *, const char *, |
| 32 | const char *, int); |
| 33 | |
| 34 | /* from ucd-compat.h */ |
| 35 | void snmp_set_mib_warnings(int); |
| 36 | void snmp_set_mib_errors(int); |
| 37 | void snmp_set_save_descriptions(int); |
| 38 | |
| 39 | |
| 40 | /* Searching the MIB Tree */ |
| 41 | oid *snmp_parse_oid(const char *, oid *, size_t *); |
| 42 | int read_objid(const char *, oid *, size_t *); |
| 43 | int get_module_node(const char *, const char *, oid *, size_t *); |
| 44 | |
| 45 | /* Output */ |
| 46 | void print_mib(FILE * fp); |
| 47 | |
| 48 | void print_objid(const oid * objid, size_t objidlen); |
| 49 | void fprint_objid(FILE * fp, |
| 50 | const oid * objid, size_t objidlen); |
| 51 | int snprint_objid(char *buf, size_t buf_len, |
| 52 | const oid * objid, size_t objidlen); |
| 53 | |
| 54 | void print_description(oid * objid, size_t objidlen, int width); |
| 55 | void fprint_description(FILE * fp, |
| 56 | oid * objid, size_t objidlen, int width); |
| 57 | int snprint_description(char *buf, size_t buf_len, |
| 58 | oid * objid, size_t objidlen, int width); |
| 59 | |
| 60 | #ifdef __cplusplus |
| 61 | } |
| 62 | #endif |
| 63 | |
| 64 | /* |
| 65 | * For the initial release, this will just refer to the |
| 66 | * relevant UCD header files. |
| 67 | * In due course, the routines relevant to this area of the |
| 68 | * API will be identified, and listed here directly. |
| 69 | * |
| 70 | * But for the time being, this header file is a placeholder, |
| 71 | * to allow application writers to adopt the new header file names. |
| 72 | */ |
| 73 | |
| 74 | #include <net-snmp/library/snmp_api.h> |
| 75 | #include <net-snmp/library/mib.h> |
| 76 | #ifndef NETSNMP_DISABLE_MIB_LOADING |
| 77 | #include <net-snmp/library/parse.h> |
| 78 | #endif |
| 79 | #include <net-snmp/library/callback.h> |
| 80 | #include <net-snmp/library/oid_stash.h> |
| 81 | #include <net-snmp/library/ucd_compat.h> |
| 82 | |
| 83 | #endif /* NET_SNMP_MIB_API_H */ |