var_struct.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #ifndef VAR_STRUCT_H
  2. #define VAR_STRUCT_H
  3. /*
  4. * The subtree structure contains a subtree prefix which applies to
  5. * all variables in the associated variable list.
  6. *
  7. * By converting to a tree of subtree structures, entries can
  8. * now be subtrees of another subtree in the structure. i.e:
  9. * 1.2
  10. * 1.2.0
  11. */
  12. #define UCD_REGISTRY_OID_MAX_LEN 128
  13. /*
  14. * subtree flags
  15. */
  16. #define FULLY_QUALIFIED_INSTANCE 0x01
  17. #define SUBTREE_ATTACHED 0x02
  18. typedef struct netsnmp_subtree_s {
  19. oid *name_a; /* objid prefix of registered subtree */
  20. u_char namelen; /* number of subid's in name above */
  21. oid *start_a; /* objid of start of covered range */
  22. u_char start_len; /* number of subid's in start name */
  23. oid *end_a; /* objid of end of covered range */
  24. u_char end_len; /* number of subid's in end name */
  25. struct variable *variables; /* pointer to variables array */
  26. int variables_len; /* number of entries in above array */
  27. int variables_width; /* sizeof each variable entry */
  28. char *label_a; /* calling module's label */
  29. netsnmp_session *session;
  30. u_char flags;
  31. u_char priority;
  32. int timeout;
  33. struct netsnmp_subtree_s *next; /* List of 'sibling' subtrees */
  34. struct netsnmp_subtree_s *prev; /* (doubly-linked list) */
  35. struct netsnmp_subtree_s *children; /* List of 'child' subtrees */
  36. int range_subid;
  37. oid range_ubound;
  38. netsnmp_handler_registration *reginfo; /* new API */
  39. int cacheid;
  40. int global_cacheid;
  41. size_t oid_off;
  42. } netsnmp_subtree;
  43. /*
  44. * This is a new variable structure that doesn't have as much memory
  45. * tied up in the object identifier. It's elements have also been re-arranged
  46. * so that the name field can be variable length. Any number of these
  47. * structures can be created with lengths tailor made to a particular
  48. * application. The first 5 elements of the structure must remain constant.
  49. */
  50. struct variable1 {
  51. u_char magic; /* passed to function as a hint */
  52. u_char type; /* type of variable */
  53. u_short acl; /* access control list for variable */
  54. FindVarMethod *findVar; /* function that finds variable */
  55. u_char namelen; /* length of name below */
  56. oid name[1]; /* object identifier of variable */
  57. };
  58. struct variable2 {
  59. u_char magic; /* passed to function as a hint */
  60. u_char type; /* type of variable */
  61. u_short acl; /* access control list for variable */
  62. FindVarMethod *findVar; /* function that finds variable */
  63. u_char namelen; /* length of name below */
  64. oid name[2]; /* object identifier of variable */
  65. };
  66. struct variable3 {
  67. u_char magic; /* passed to function as a hint */
  68. u_char type; /* type of variable */
  69. u_short acl; /* access control list for variable */
  70. FindVarMethod *findVar; /* function that finds variable */
  71. u_char namelen; /* length of name below */
  72. oid name[3]; /* object identifier of variable */
  73. };
  74. struct variable4 {
  75. u_char magic; /* passed to function as a hint */
  76. u_char type; /* type of variable */
  77. u_short acl; /* access control list for variable */
  78. FindVarMethod *findVar; /* function that finds variable */
  79. u_char namelen; /* length of name below */
  80. oid name[4]; /* object identifier of variable */
  81. };
  82. struct variable7 {
  83. u_char magic; /* passed to function as a hint */
  84. u_char type; /* type of variable */
  85. u_short acl; /* access control list for variable */
  86. FindVarMethod *findVar; /* function that finds variable */
  87. u_char namelen; /* length of name below */
  88. oid name[7]; /* object identifier of variable */
  89. };
  90. struct variable8 {
  91. u_char magic; /* passed to function as a hint */
  92. u_char type; /* type of variable */
  93. u_short acl; /* access control list for variable */
  94. FindVarMethod *findVar; /* function that finds variable */
  95. u_char namelen; /* length of name below */
  96. oid name[8]; /* object identifier of variable */
  97. };
  98. struct variable13 {
  99. u_char magic; /* passed to function as a hint */
  100. u_char type; /* type of variable */
  101. u_short acl; /* access control list for variable */
  102. FindVarMethod *findVar; /* function that finds variable */
  103. u_char namelen; /* length of name below */
  104. oid name[13]; /* object identifier of variable */
  105. };
  106. #endif /* VAR_STRUCT_H */