config_api.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef NET_SNMP_CONFIG_API_H
  2. #define NET_SNMP_CONFIG_API_H
  3. /**
  4. * Library API routines concerned with configuration and control
  5. * of the behaviour of the library, agent and other applications.
  6. */
  7. #include <net-snmp/types.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /* Config Handlers */
  12. NETSNMP_IMPORT
  13. struct config_line *register_config_handler(const char *filePrefix,
  14. const char *token,
  15. void (*parser) (const char *, char *),
  16. void (*releaser) (void),
  17. const char *usageLine);
  18. NETSNMP_IMPORT
  19. struct config_line *register_const_config_handler(const char *filePrefix,
  20. const char *token,
  21. void (*parser) (const char *, const char *),
  22. void (*releaser) (void),
  23. const char *usageLine);
  24. NETSNMP_IMPORT
  25. struct config_line *register_prenetsnmp_mib_handler(const char *filePrefix,
  26. const char *token,
  27. void (*parser) (const char *, char *),
  28. void (*releaser) (void),
  29. const char *usageLine);
  30. NETSNMP_IMPORT
  31. void unregister_config_handler(const char *filePrefix, const char *token);
  32. /* Defined in mib.c, rather than read_config.c */
  33. void register_mib_handlers(void);
  34. void unregister_all_config_handlers(void);
  35. /* Application Handlers */
  36. NETSNMP_IMPORT
  37. struct config_line *register_app_config_handler(
  38. const char *token,
  39. void (*parser) (const char *, char *),
  40. void (*releaser) (void),
  41. const char *usageLine);
  42. NETSNMP_IMPORT
  43. struct config_line *register_app_prenetsnmp_mib_handler(
  44. const char *token,
  45. void (*parser) (const char *, char *),
  46. void (*releaser) (void),
  47. const char *usageLine);
  48. NETSNMP_IMPORT
  49. void unregister_app_config_handler( const char *token);
  50. /* Reading Config Files */
  51. NETSNMP_IMPORT
  52. void read_configs(void);
  53. NETSNMP_IMPORT
  54. void read_premib_configs(void);
  55. /* Help Strings and Errors */
  56. NETSNMP_IMPORT
  57. void read_config_print_usage(const char *lead);
  58. NETSNMP_IMPORT
  59. void config_perror(const char *);
  60. NETSNMP_IMPORT
  61. void config_pwarn(const char *);
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. /*
  66. * Having extracted the main ("public API") calls relevant
  67. * to this area of the Net-SNMP project, the next step is to
  68. * identify the related "public internal API" routines.
  69. *
  70. * In due course, these should probably be gathered
  71. * together into a companion 'library/config_api.h' header file.
  72. * [Or some suitable name]
  73. *
  74. * But for the time being, the expectation is that the
  75. * traditional headers that provided the above definitions
  76. * will probably also cover the relevant internal API calls.
  77. * Hence they are listed here:
  78. */
  79. #include <net-snmp/library/snmp_api.h>
  80. #include <net-snmp/library/read_config.h>
  81. #include <net-snmp/library/default_store.h>
  82. #include <stdio.h> /* for FILE definition */
  83. #include <net-snmp/library/snmp_parse_args.h>
  84. #include <net-snmp/library/snmp_enum.h>
  85. #include <net-snmp/library/vacm.h>
  86. #endif /* NET_SNMP_CONFIG_API_H */