servicechangeaddress.c

来自「H.248协议编解码协议栈」· C语言 代码 · 共 149 行

C
149
字号
/* * Generated by asn1c-0.9.16 (http://lionet.info/asn1c) * From ASN.1 module "MEDIA-GATEWAY-CONTROL" * 	found in "h248_2.asn" */#include <asn_internal.h>#include "ServiceChangeAddress.h"static intmemb_portNumber_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,			asn_app_consume_bytes_f *app_errlog, void *app_key) {	const INTEGER_t *st = (const INTEGER_t *)sptr;	long value;		if(!sptr) {		_ASN_ERRLOG(app_errlog, app_key,			"%s: value not given (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}		if(asn_INTEGER2long(st, &value)) {		_ASN_ERRLOG(app_errlog, app_key,			"%s: value too large (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}		if((value >= 0 && value <= 65535)) {		/* Constraint check succeeded */		return 0;	} else {		_ASN_ERRLOG(app_errlog, app_key,			"%s: constraint failed (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}}static intmemb_mtpAddress_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,			asn_app_consume_bytes_f *app_errlog, void *app_key) {	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;	size_t size;		if(!sptr) {		_ASN_ERRLOG(app_errlog, app_key,			"%s: value not given (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}		size = st->size;		if((size >= 2 && size <= 4)) {		/* Constraint check succeeded */		return 0;	} else {		_ASN_ERRLOG(app_errlog, app_key,			"%s: constraint failed (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}}static asn_TYPE_member_t asn_MBR_ServiceChangeAddress_1[] = {	{ ATF_NOFLAGS, 0, offsetof(struct ServiceChangeAddress, choice.portNumber),		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),		-1,	/* IMPLICIT tag at current level */		(void *)&asn_DEF_INTEGER,		memb_portNumber_1_constraint,		"portNumber"		},	{ ATF_NOFLAGS, 0, offsetof(struct ServiceChangeAddress, choice.ip4Address),		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),		-1,	/* IMPLICIT tag at current level */		(void *)&asn_DEF_IP4Address,		0,	/* Defer constraints checking to the member type */		"ip4Address"		},	{ ATF_NOFLAGS, 0, offsetof(struct ServiceChangeAddress, choice.ip6Address),		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),		-1,	/* IMPLICIT tag at current level */		(void *)&asn_DEF_IP6Address,		0,	/* Defer constraints checking to the member type */		"ip6Address"		},	{ ATF_NOFLAGS, 0, offsetof(struct ServiceChangeAddress, choice.domainName),		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),		-1,	/* IMPLICIT tag at current level */		(void *)&asn_DEF_DomainName,		0,	/* Defer constraints checking to the member type */		"domainName"		},	{ ATF_NOFLAGS, 0, offsetof(struct ServiceChangeAddress, choice.deviceName),		(ASN_TAG_CLASS_CONTEXT | (4 << 2)),		-1,	/* IMPLICIT tag at current level */		(void *)&asn_DEF_PathName,		0,	/* Defer constraints checking to the member type */		"deviceName"		},	{ ATF_NOFLAGS, 0, offsetof(struct ServiceChangeAddress, choice.mtpAddress),		(ASN_TAG_CLASS_CONTEXT | (5 << 2)),		-1,	/* IMPLICIT tag at current level */		(void *)&asn_DEF_OCTET_STRING,		memb_mtpAddress_1_constraint,		"mtpAddress"		},};static asn_TYPE_tag2member_t asn_MAP_ServiceChangeAddress_1_tag2el[] = {    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* portNumber at 876 */    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ip4Address at 877 */    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ip6Address at 878 */    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* domainName at 879 */    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* deviceName at 880 */    { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* mtpAddress at 881 */};static asn_CHOICE_specifics_t asn_SPC_ServiceChangeAddress_1_specs = {	sizeof(struct ServiceChangeAddress),	offsetof(struct ServiceChangeAddress, _asn_ctx),	offsetof(struct ServiceChangeAddress, present),	sizeof(((struct ServiceChangeAddress *)0)->present),	asn_MAP_ServiceChangeAddress_1_tag2el,	6,	/* Count of tags in the map */	1	/* Whether extensible */};asn_TYPE_descriptor_t asn_DEF_ServiceChangeAddress = {	"ServiceChangeAddress",	"ServiceChangeAddress",	CHOICE_free,	CHOICE_print,	CHOICE_constraint,	CHOICE_decode_ber,	CHOICE_encode_der,	CHOICE_decode_xer,	CHOICE_encode_xer,	CHOICE_outmost_tag,	0,	/* No effective tags (pointer) */	0,	/* No effective tags (count) */	0,	/* No tags (pointer) */	0,	/* No tags (count) */	asn_MBR_ServiceChangeAddress_1,	6,	/* Elements count */	&asn_SPC_ServiceChangeAddress_1_specs	/* Additional specs */};

⌨️ 快捷键说明

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