2 # Define types of data by mib type, and translate into needed C code.
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
11 # writeInit: variable declaration
12 # case: initialization of the variable to a bogus value.
14 # copy: copies the previous definition into the current one,
15 # if most of it (or all of it) is the same.
16 ############################################################################
18 asnType: ASN_OCTET_STR
22 writeInit: static unsigned char string[SPRINT_MAX_LEN];
24 case: *var_len = strlen(string);
25 case: return (unsigned char *) string;
26 ############################################################################
30 variablePtr: &long_ret
32 writeInit: static long *long_ret;
34 case: return (unsigned char *) &long_ret;
35 ############################################################################
38 ############################################################################
42 variablePtr: &ulong_ret
44 writeInit: static unsigned long *ulong_ret;
46 case: return (unsigned char *) &ulong_ret;
47 ############################################################################
49 asnType: ASN_OBJECT_ID
53 writeInit: static oid *objid;
56 case: *var_len = 2*sizeof(oid);
57 case: return (unsigned char *) objid;
58 ############################################################################
60 asnType: ASN_COUNTER64
63 cast: struct counter64 *
64 writeInit: struct counter64 *c64;
67 case: *var_len = sizeof(c64);
68 case: return (unsigned char *) &c64;
69 ############################################################################
74 ############################################################################
77 ############################################################################
82 ############################################################################
86 asnType: ASN_IPADDRESS
87 ############################################################################
90 ############################################################################
95 ############################################################################
100 ############################################################################
104 asnType: ASN_TIMETICKS