mib2c.vartypes.conf
来自「eCos操作系统源码」· CONF 代码 · 共 90 行
CONF
90 行
# # Define types of data by mib type, and translate into needed C code.# # type: the label in question extracted from the mib.# asnType: the internal type #define we should use for this type.# variable: the name of the variable we're going to use.# variablePtr: How to get a pointer to the variable above (may be# the same, if variable is also a pointer)# cast: how to cast from a void * or a char * to a pointer of # your type.# writeInit: variable declaration# case: initialization of the variable to a bogus value.## copy: copies the previous definition into the current one,# if most of it (or all of it) is the same.############################################################################type: OCTETSTRasnType: ASN_OCTET_STRvariable: stringvariablePtr: stringcast: char *writeInit: static unsigned char string[SPRINT_MAX_LEN];case: *string = 0;case: *var_len = strlen(string);case: return (unsigned char *) string;############################################################################type: INTEGERasnType: ASN_INTEGERvariable: long_retvariablePtr: &long_retcast: long *writeInit: static long *long_ret;case: long_ret = 0;case: return (unsigned char *) &long_ret;############################################################################type: OBJECTIDasnType: ASN_OBJECT_IDvariable: objidvariablePtr: objidcast: oid *writeInit: static oid *objid;case: objid[0] = 0;case: objid[1] = 0;case: *var_len = 2*sizeof(oid);case: return (unsigned char *) objid;############################################################################type: COUNTER64asnType: ASN_COUNTER64variable: c64variablePtr: &c64cast: struct counter64 *writeInit: struct counter64 *c64;case: c64.high = 0;case: c64.low = 0;case: *var_len = sizeof(c64);case: return (unsigned char *) &c64;############################################################################type: COUNTERcopy: INTEGERdelete: asnTypeasnType: ASN_COUNTER############################################################################type: NETADDRcopy: ASN_OBJECT_ID############################################################################type: UINTEGERcopy: INTEGERdelete: asnTypeasnType: ASN_UINTEGER############################################################################type: IPADDRcopy: OCTETSTRdelete: asnTypeasnType: ASN_IPADDRESS############################################################################type: GAUGEcopy: INTEGERdelete: asnTypeasnType: ASN_GAUGE############################################################################type: OPAQUEcopy: OCTETSTRdelete: asnTypeasnType: ASN_OPAQUE############################################################################type: TICKScopy: INTEGERdelete: asnTypeasnType: ASN_TIMETICKS
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?