mib_api.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #ifndef NET_SNMP_MIB_API_H
  2. #define NET_SNMP_MIB_API_H
  3. /**
  4. * Library API routines concerned with MIB files and objects, and OIDs
  5. */
  6. #include <net-snmp/types.h>
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. /* Initialisation and Shutdown */
  11. NETSNMP_IMPORT
  12. int add_mibdir(const char *);
  13. NETSNMP_IMPORT
  14. void netsnmp_init_mib(void);
  15. #ifndef NETSNMP_NO_LEGACY_DEFINITIONS
  16. NETSNMP_IMPORT
  17. void init_mib(void);
  18. NETSNMP_IMPORT
  19. void init_mib_internals(void);
  20. #endif
  21. NETSNMP_IMPORT
  22. void shutdown_mib(void);
  23. /* Reading and Parsing MIBs */
  24. NETSNMP_IMPORT
  25. struct tree *netsnmp_read_module(const char *);
  26. #ifndef NETSNMP_NO_LEGACY_DEFINITIONS
  27. NETSNMP_IMPORT
  28. struct tree *read_module(const char *);
  29. #endif
  30. NETSNMP_IMPORT
  31. struct tree *read_mib(const char *);
  32. NETSNMP_IMPORT
  33. struct tree *read_all_mibs(void);
  34. NETSNMP_IMPORT
  35. void add_module_replacement(const char *, const char *,
  36. const char *, int);
  37. /* from ucd-compat.h */
  38. NETSNMP_IMPORT
  39. void snmp_set_mib_warnings(int);
  40. NETSNMP_IMPORT
  41. void snmp_set_mib_errors(int);
  42. NETSNMP_IMPORT
  43. void snmp_set_save_descriptions(int);
  44. /* Searching the MIB Tree */
  45. NETSNMP_IMPORT
  46. int read_objid(const char *, oid *, size_t *);
  47. NETSNMP_IMPORT
  48. oid *snmp_parse_oid(const char *, oid *, size_t *);
  49. NETSNMP_IMPORT
  50. int get_module_node(const char *, const char *, oid *, size_t *);
  51. /* Output */
  52. NETSNMP_IMPORT
  53. void print_mib(FILE * fp);
  54. NETSNMP_IMPORT
  55. void print_objid(const oid * objid, size_t objidlen);
  56. NETSNMP_IMPORT
  57. void fprint_objid(FILE * fp,
  58. const oid * objid, size_t objidlen);
  59. NETSNMP_IMPORT
  60. int snprint_objid(char *buf, size_t buf_len,
  61. const oid * objid, size_t objidlen);
  62. NETSNMP_IMPORT
  63. void print_description(oid * objid, size_t objidlen, int width);
  64. NETSNMP_IMPORT
  65. void fprint_description(FILE * fp,
  66. oid * objid, size_t objidlen, int width);
  67. NETSNMP_IMPORT
  68. int snprint_description(char *buf, size_t buf_len,
  69. oid * objid, size_t objidlen, int width);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. /*
  74. * Having extracted the main ("public API") calls relevant
  75. * to this area of the Net-SNMP project, the next step is to
  76. * identify the related "public internal API" routines.
  77. *
  78. * In due course, these should probably be gathered
  79. * together into a companion 'library/mib_api.h' header file.
  80. * [Or some suitable name]
  81. *
  82. * But for the time being, the expectation is that the
  83. * traditional headers that provided the above definitions
  84. * will probably also cover the relevant internal API calls.
  85. * Hence they are listed here:
  86. */
  87. #include <net-snmp/library/snmp_api.h>
  88. #include <net-snmp/library/mib.h>
  89. #ifndef NETSNMP_DISABLE_MIB_LOADING
  90. #include <net-snmp/library/parse.h>
  91. #endif
  92. #include <net-snmp/library/callback.h>
  93. #include <net-snmp/library/oid_stash.h>
  94. #include <net-snmp/library/ucd_compat.h>
  95. #endif /* NET_SNMP_MIB_API_H */