and added files
[bcm963xx.git] / userapps / opensource / net-snmp / local / mib2c.vartypes.conf
1
2 # Define types of data by mib type, and translate into needed C code.
3
4 #  type:         the label in question extracted from the mib.
5 #  asnType:      the internal type #define we should use for this type.
6 #  variable:     the name of the variable we're going to use.
7 #  variablePtr:  How to get a pointer to the variable above (may be
8 #                the same, if variable is also a pointer)
9 #  cast:         how to cast from a void * or a char * to a pointer of 
10 #                your type.
11 #  writeInit:    variable declaration
12 #  case:  initialization of the variable to a bogus value.
13 #
14 #  copy:         copies the previous definition into the current one,
15 #                if most of it (or all of it) is the same.
16 ############################################################################
17 type:           OCTETSTR
18 asnType:        ASN_OCTET_STR
19 variable:       string
20 variablePtr:    string
21 cast:           char *
22 writeInit:      static unsigned char string[SPRINT_MAX_LEN];
23 case:           *string = 0;
24 case:           *var_len = strlen(string);
25 case:           return (unsigned char *) string;
26 ############################################################################
27 type:           INTEGER
28 asnType:        ASN_INTEGER
29 variable:       long_ret
30 variablePtr:    &long_ret
31 cast:           long *
32 writeInit:      static long *long_ret;
33 case:           long_ret = 0;
34 case:           return (unsigned char *) &long_ret;
35 ############################################################################
36 type:           INTEGER32
37 copy:           INTEGER
38 ############################################################################
39 type:           UNSIGNED32
40 asnType:        ASN_UNSIGNED
41 variable:       ulong_ret
42 variablePtr:    &ulong_ret
43 cast:           unsigned long *
44 writeInit:      static unsigned long *ulong_ret;
45 case:           ulong_ret = 0;
46 case:           return (unsigned char *) &ulong_ret;
47 ############################################################################
48 type:           OBJECTID
49 asnType:        ASN_OBJECT_ID
50 variable:       objid
51 variablePtr:    objid
52 cast:           oid *
53 writeInit:      static oid *objid;
54 case:           objid[0] = 0;
55 case:           objid[1] = 0;
56 case:           *var_len = 2*sizeof(oid);
57 case:           return (unsigned char *) objid;
58 ############################################################################
59 type:           COUNTER64
60 asnType:        ASN_COUNTER64
61 variable:       c64
62 variablePtr:    &c64
63 cast:           struct counter64 *
64 writeInit:      struct counter64 *c64;
65 case:           c64.high = 0;
66 case:           c64.low = 0;
67 case:           *var_len = sizeof(c64);
68 case:           return (unsigned char *) &c64;
69 ############################################################################
70 type:           COUNTER
71 copy:           INTEGER
72 delete:         asnType
73 asnType:        ASN_COUNTER
74 ############################################################################
75 type:           NETADDR
76 copy:           ASN_OBJECT_ID
77 ############################################################################
78 type:           UINTEGER
79 copy:           INTEGER
80 delete:         asnType
81 asnType:        ASN_UINTEGER
82 ############################################################################
83 type:           IPADDR
84 copy:           OCTETSTR
85 delete:         asnType
86 asnType:        ASN_IPADDRESS
87 ############################################################################
88 type:           BITS
89 copy:           OCTETSTR
90 ############################################################################
91 type:           GAUGE
92 copy:           INTEGER
93 delete:         asnType
94 asnType:        ASN_GAUGE
95 ############################################################################
96 type:           OPAQUE
97 copy:           OCTETSTR
98 delete:         asnType
99 asnType:        ASN_OPAQUE
100 ############################################################################
101 type:           TICKS
102 copy:           INTEGER
103 delete:         asnType
104 asnType:        ASN_TIMETICKS