snmpv3.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * snmpv3.h
  3. *
  4. * Portions of this file are copyrighted by:
  5. * Copyright (c) 2016 VMware, Inc. All rights reserved.
  6. * Use is subject to license terms specified in the COPYING file
  7. * distributed with the Net-SNMP package.
  8. */
  9. #ifndef SNMPV3_H
  10. #define SNMPV3_H
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define MAX_ENGINEID_LENGTH 32 /* per SNMP-FRAMEWORK-MIB SnmpEngineID TC */
  15. #define ENGINEID_TYPE_IPV4 1
  16. #define ENGINEID_TYPE_IPV6 2
  17. #define ENGINEID_TYPE_MACADDR 3
  18. #define ENGINEID_TYPE_TEXT 4
  19. #define ENGINEID_TYPE_EXACT 5
  20. #define ENGINEID_TYPE_NETSNMP_RND 128
  21. #define DEFAULT_NIC "eth0"
  22. NETSNMP_IMPORT int
  23. snmpv3_parse_args(char *optarg, netsnmp_session * session, char **Apsz,
  24. char **Xpsz, int argc, char *const *argv, int flags);
  25. NETSNMP_IMPORT
  26. int setup_engineID(u_char ** eidp, const char *text);
  27. NETSNMP_IMPORT
  28. int set_exact_engineID(const u_char *id, size_t len);
  29. void engineID_conf(const char *word, char *cptr);
  30. void engineBoots_conf(const char *, char *);
  31. void engineIDType_conf(const char *, char *);
  32. void engineIDNic_conf(const char *, char *);
  33. NETSNMP_IMPORT
  34. void init_snmpv3(const char *);
  35. int init_snmpv3_post_config(int majorid, int minorid,
  36. void *serverarg,
  37. void *clientarg);
  38. int init_snmpv3_post_premib_config(int majorid,
  39. int minorid,
  40. void *serverarg,
  41. void *clientarg);
  42. void shutdown_snmpv3(const char *type);
  43. int snmpv3_store(int majorID, int minorID, void *serverarg,
  44. void *clientarg);
  45. NETSNMP_IMPORT
  46. u_long snmpv3_local_snmpEngineBoots(void);
  47. int snmpv3_clone_engineID(u_char **, size_t *, u_char *,
  48. size_t);
  49. NETSNMP_IMPORT
  50. size_t snmpv3_get_engineID(u_char * buf, size_t buflen);
  51. NETSNMP_IMPORT
  52. u_char *snmpv3_generate_engineID(size_t *);
  53. NETSNMP_IMPORT
  54. u_long snmpv3_local_snmpEngineTime(void);
  55. int get_default_secLevel(void);
  56. void snmpv3_set_engineBootsAndTime(int boots, int ttime);
  57. int free_engineID(int majorid, int minorid, void *serverarg,
  58. void *clientarg);
  59. NETSNMP_IMPORT
  60. int parse_secLevel_conf(const char* word, char *cptr);
  61. NETSNMP_IMPORT int
  62. snmpv3_parse_arg(int arg, char *optarg, netsnmp_session *session,
  63. char **Apsz, char **Xpsz, int argc, char *const *argv,
  64. int flags);
  65. NETSNMP_IMPORT int
  66. snmpv3_options(char *optarg, netsnmp_session * session, char **Apsz,
  67. char **Xpsz, int argc, char *const *argv);
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif /* SNMPV3_H */