net-snmp 5.7
|
00001 #ifndef VAR_STRUCT_H 00002 #define VAR_STRUCT_H 00003 /* 00004 * The subtree structure contains a subtree prefix which applies to 00005 * all variables in the associated variable list. 00006 * 00007 * By converting to a tree of subtree structures, entries can 00008 * now be subtrees of another subtree in the structure. i.e: 00009 * 1.2 00010 * 1.2.0 00011 */ 00012 00013 #define UCD_REGISTRY_OID_MAX_LEN 128 00014 00015 /* 00016 * subtree flags 00017 */ 00018 #define FULLY_QUALIFIED_INSTANCE 0x01 00019 #define SUBTREE_ATTACHED 0x02 00020 00021 typedef struct netsnmp_subtree_s { 00022 oid *name_a; /* objid prefix of registered subtree */ 00023 u_char namelen; /* number of subid's in name above */ 00024 oid *start_a; /* objid of start of covered range */ 00025 u_char start_len; /* number of subid's in start name */ 00026 oid *end_a; /* objid of end of covered range */ 00027 u_char end_len; /* number of subid's in end name */ 00028 struct variable *variables; /* pointer to variables array */ 00029 int variables_len; /* number of entries in above array */ 00030 int variables_width; /* sizeof each variable entry */ 00031 char *label_a; /* calling module's label */ 00032 netsnmp_session *session; 00033 u_char flags; 00034 u_char priority; 00035 int timeout; 00036 struct netsnmp_subtree_s *next; /* List of 'sibling' subtrees */ 00037 struct netsnmp_subtree_s *prev; /* (doubly-linked list) */ 00038 struct netsnmp_subtree_s *children; /* List of 'child' subtrees */ 00039 int range_subid; 00040 oid range_ubound; 00041 netsnmp_handler_registration *reginfo; /* new API */ 00042 int cacheid; 00043 int global_cacheid; 00044 size_t oid_off; 00045 } netsnmp_subtree; 00046 00047 /* 00048 * This is a new variable structure that doesn't have as much memory 00049 * tied up in the object identifier. It's elements have also been re-arranged 00050 * so that the name field can be variable length. Any number of these 00051 * structures can be created with lengths tailor made to a particular 00052 * application. The first 5 elements of the structure must remain constant. 00053 */ 00054 struct variable1 { 00055 u_char magic; /* passed to function as a hint */ 00056 u_char type; /* type of variable */ 00057 u_short acl; /* access control list for variable */ 00058 FindVarMethod *findVar; /* function that finds variable */ 00059 u_char namelen; /* length of name below */ 00060 oid name[1]; /* object identifier of variable */ 00061 }; 00062 00063 struct variable2 { 00064 u_char magic; /* passed to function as a hint */ 00065 u_char type; /* type of variable */ 00066 u_short acl; /* access control list for variable */ 00067 FindVarMethod *findVar; /* function that finds variable */ 00068 u_char namelen; /* length of name below */ 00069 oid name[2]; /* object identifier of variable */ 00070 }; 00071 00072 struct variable3 { 00073 u_char magic; /* passed to function as a hint */ 00074 u_char type; /* type of variable */ 00075 u_short acl; /* access control list for variable */ 00076 FindVarMethod *findVar; /* function that finds variable */ 00077 u_char namelen; /* length of name below */ 00078 oid name[3]; /* object identifier of variable */ 00079 }; 00080 00081 struct variable4 { 00082 u_char magic; /* passed to function as a hint */ 00083 u_char type; /* type of variable */ 00084 u_short acl; /* access control list for variable */ 00085 FindVarMethod *findVar; /* function that finds variable */ 00086 u_char namelen; /* length of name below */ 00087 oid name[4]; /* object identifier of variable */ 00088 }; 00089 00090 struct variable7 { 00091 u_char magic; /* passed to function as a hint */ 00092 u_char type; /* type of variable */ 00093 u_short acl; /* access control list for variable */ 00094 FindVarMethod *findVar; /* function that finds variable */ 00095 u_char namelen; /* length of name below */ 00096 oid name[7]; /* object identifier of variable */ 00097 }; 00098 00099 struct variable8 { 00100 u_char magic; /* passed to function as a hint */ 00101 u_char type; /* type of variable */ 00102 u_short acl; /* access control list for variable */ 00103 FindVarMethod *findVar; /* function that finds variable */ 00104 u_char namelen; /* length of name below */ 00105 oid name[8]; /* object identifier of variable */ 00106 }; 00107 00108 struct variable13 { 00109 u_char magic; /* passed to function as a hint */ 00110 u_char type; /* type of variable */ 00111 u_short acl; /* access control list for variable */ 00112 FindVarMethod *findVar; /* function that finds variable */ 00113 u_char namelen; /* length of name below */ 00114 oid name[13]; /* object identifier of variable */ 00115 }; 00116 #endif /* VAR_STRUCT_H */