⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mib2c.vartypes.conf

📁 嵌入式操作系统ECOS的网络开发包
💻 CONF
字号:
# 
# 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:		OCTETSTR
asnType:	ASN_OCTET_STR
variable:	string
variablePtr:	string
cast:		char *
writeInit:	static unsigned char string[SPRINT_MAX_LEN];
case:	        *string = 0;
case:	        *var_len = strlen(string);
case:	        return (unsigned char *) string;
############################################################################
type:		INTEGER
asnType:	ASN_INTEGER
variable:	long_ret
variablePtr:	&long_ret
cast:		long *
writeInit:	static long *long_ret;
case:	        long_ret = 0;
case:	        return (unsigned char *) &long_ret;
############################################################################
type:		OBJECTID
asnType:	ASN_OBJECT_ID
variable:	objid
variablePtr:	objid
cast:		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:		COUNTER64
asnType:	ASN_COUNTER64
variable:	c64
variablePtr:	&c64
cast:		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:		COUNTER
copy:		INTEGER
delete:		asnType
asnType:	ASN_COUNTER
############################################################################
type:		NETADDR
copy:		ASN_OBJECT_ID
############################################################################
type:		UINTEGER
copy:		INTEGER
delete:		asnType
asnType:	ASN_UINTEGER
############################################################################
type:		IPADDR
copy:		OCTETSTR
delete:		asnType
asnType:	ASN_IPADDRESS
############################################################################
type:		GAUGE
copy:		INTEGER
delete:		asnType
asnType:	ASN_GAUGE
############################################################################
type:		OPAQUE
copy:		OCTETSTR
delete:		asnType
asnType:	ASN_OPAQUE
############################################################################
type:		TICKS
copy:		INTEGER
delete:		asnType
asnType:	ASN_TIMETICKS

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -