vacm_vars.h
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:4k
源码类别:

SNMP编程

开发平台:

Unix_Linux

  1. /*
  2.  * SNMPv3 View-based Access Control Model
  3.  */
  4. #ifndef _MIBGROUP_VACM_H
  5. #define _MIBGROUP_VACM_H
  6. #include <net-snmp/library/vacm.h>
  7. config_require(util_funcs)
  8. config_require(mibII/vacm_context)
  9. config_require(mibII/vacm_conf)
  10. config_add_mib(SNMP-VIEW-BASED-ACM-MIB)
  11. config_add_mib(SNMP-COMMUNITY-MIB)
  12.      void            init_vacm_vars(void);
  13.      extern FindVarMethod var_vacm_sec2group;
  14.      extern FindVarMethod var_vacm_access;
  15.      extern FindVarMethod var_vacm_view;
  16.      WriteMethod     write_vacmGroupName;
  17.      WriteMethod     write_vacmSecurityToGroupStatus;
  18.      WriteMethod     write_vacmSecurityToGroupStorageType;
  19.      WriteMethod     write_vacmAccessContextMatch;
  20.      WriteMethod     write_vacmAccessNotifyViewName;
  21.      WriteMethod     write_vacmAccessReadViewName;
  22.      WriteMethod     write_vacmAccessWriteViewName;
  23.      WriteMethod     write_vacmAccessStatus;
  24.      WriteMethod     write_vacmAccessStorageType;
  25.      WriteMethod     write_vacmViewSpinLock;
  26.      WriteMethod     write_vacmViewMask;
  27.      WriteMethod     write_vacmViewStatus;
  28.      WriteMethod     write_vacmViewStorageType;
  29.      WriteMethod     write_vacmViewType;
  30.      oid            *access_generate_OID(oid * prefix, size_t prefixLen,
  31.                                          struct vacm_accessEntry *aptr,
  32.                                          size_t * length);
  33.      struct vacm_accessEntry *access_parse_accessEntry(oid * name,
  34.                                                        size_t name_len);
  35.      int             access_parse_oid(oid * oidIndex, size_t oidLen,
  36.                                       unsigned char **groupName,
  37.                                       size_t * groupNameLen,
  38.                                       unsigned char **contextPrefix,
  39.                                       size_t * contextPrefixLen,
  40.                                       int *model, int *level);
  41.      oid            *sec2group_generate_OID(oid * prefix, size_t prefixLen,
  42.                                             struct vacm_groupEntry *geptr,
  43.                                             size_t * length);
  44.      int             sec2group_parse_oid(oid * oidIndex, size_t oidLen,
  45.                                          int *model, unsigned char **name,
  46.                                          size_t * nameLen);
  47.      struct vacm_groupEntry *sec2group_parse_groupEntry(oid * name,
  48.                                                         size_t name_len);
  49.      oid            *view_generate_OID(oid * prefix, size_t prefixLen,
  50.                                        struct vacm_viewEntry *vptr,
  51.                                        size_t * length);
  52.      int             view_parse_oid(oid * oidIndex, size_t oidLen,
  53.                                     unsigned char **viewName,
  54.                                     size_t * viewNameLen, oid ** subtree,
  55.                                     size_t * subtreeLen);
  56.      struct vacm_viewEntry *view_parse_viewEntry(oid * name,
  57.                                                  size_t name_len);
  58. #define OID_SNMPVACMMIB SNMP_OID_SNMPMODULES, 16
  59. #define OID_VACMMIBOBJECTS OID_SNMPVACMMIB, 1
  60. #define OID_VACMCONTEXTTABLE OID_VACMMIBOBJECTS, 1
  61. #define OID_VACMCONTEXTENTRY OID_VACMCONTEXTTABLE, 1
  62. #define OID_VACMGROUPTABLE OID_VACMMIBOBJECTS, 2
  63. #define OID_VACMGROUPENTRY OID_VACMGROUPTABLE, 1
  64. #define OID_VACMACCESSTABLE OID_VACMMIBOBJECTS, 4
  65. #define OID_VACMACCESSENTRY OID_VACMACCESSTABLE, 1
  66. #define OID_VACMMIBVIEWS OID_VACMMIBOBJECTS, 5
  67. #define OID_VACMVIEWTABLE OID_VACMMIBVIEWS, 2
  68. #define OID_VACMVIEWENTRY OID_VACMVIEWTABLE, 1
  69. #define SEC2GROUP_MIB_LENGTH 11
  70. #define ACCESS_MIB_LENGTH 11
  71. #define VIEW_MIB_LENGTH 12
  72. #define CM_EXACT 1
  73. #define CM_PREFIX 2
  74. #endif                          /* _MIBGROUP_VACM_H */