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