/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2SM-RC-IEs"
 * 	found in "e2sm-rc-nov2021.asn"
 * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
 */

#include "RANParameter-STRUCTURE-Item.h"

#include "RANParameter-ValueType.h"
asn_TYPE_member_t asn_MBR_RANParameter_STRUCTURE_Item_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct RANParameter_STRUCTURE_Item, ranParameter_ID),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_RANParameter_ID,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"ranParameter-ID"
		},
	{ ATF_POINTER, 0, offsetof(struct RANParameter_STRUCTURE_Item, ranParameter_valueType),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		+1,	/* EXPLICIT tag at current level */
		&asn_DEF_RANParameter_ValueType,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"ranParameter-valueType"
		},
};
static const ber_tlv_tag_t asn_DEF_RANParameter_STRUCTURE_Item_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_RANParameter_STRUCTURE_Item_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranParameter-ID */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ranParameter-valueType */
};
asn_SEQUENCE_specifics_t asn_SPC_RANParameter_STRUCTURE_Item_specs_1 = {
	sizeof(struct RANParameter_STRUCTURE_Item),
	offsetof(struct RANParameter_STRUCTURE_Item, _asn_ctx),
	asn_MAP_RANParameter_STRUCTURE_Item_tag2el_1,
	2,	/* Count of tags in the map */
	0, 0, 0,	/* Optional elements (not needed) */
	2,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_RANParameter_STRUCTURE_Item = {
	"RANParameter-STRUCTURE-Item",
	"RANParameter-STRUCTURE-Item",
	&asn_OP_SEQUENCE,
	asn_DEF_RANParameter_STRUCTURE_Item_tags_1,
	sizeof(asn_DEF_RANParameter_STRUCTURE_Item_tags_1)
		/sizeof(asn_DEF_RANParameter_STRUCTURE_Item_tags_1[0]), /* 1 */
	asn_DEF_RANParameter_STRUCTURE_Item_tags_1,	/* Same as above */
	sizeof(asn_DEF_RANParameter_STRUCTURE_Item_tags_1)
		/sizeof(asn_DEF_RANParameter_STRUCTURE_Item_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RANParameter_STRUCTURE_Item_1,
	2,	/* Elements count */
	&asn_SPC_RANParameter_STRUCTURE_Item_specs_1	/* Additional specs */
};

