/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "X2AP-PDU-Contents"
 * 	found in "Spec/e2ap-v031ex.asn"
 * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
 */

#include "MeasurementInitiationResult-Item.h"

#include "MeasurementFailureCause-List.h"
#include "ProtocolExtensionContainer.h"
static asn_TYPE_member_t asn_MBR_MeasurementInitiationResult_Item_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct MeasurementInitiationResult_Item, cell_ID),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ECGI,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"cell-ID"
		},
	{ ATF_POINTER, 2, offsetof(struct MeasurementInitiationResult_Item, measurementFailureCause_List),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_MeasurementFailureCause_List,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"measurementFailureCause-List"
		},
	{ ATF_POINTER, 1, offsetof(struct MeasurementInitiationResult_Item, iE_Extensions),
		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolExtensionContainer_9566P10,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"iE-Extensions"
		},
};
static const int asn_MAP_MeasurementInitiationResult_Item_oms_1[] = { 1, 2 };
static const ber_tlv_tag_t asn_DEF_MeasurementInitiationResult_Item_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_MeasurementInitiationResult_Item_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cell-ID */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* measurementFailureCause-List */
    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_MeasurementInitiationResult_Item_specs_1 = {
	sizeof(struct MeasurementInitiationResult_Item),
	offsetof(struct MeasurementInitiationResult_Item, _asn_ctx),
	asn_MAP_MeasurementInitiationResult_Item_tag2el_1,
	3,	/* Count of tags in the map */
	asn_MAP_MeasurementInitiationResult_Item_oms_1,	/* Optional members */
	2, 0,	/* Root/Additions */
	3,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_MeasurementInitiationResult_Item = {
	"MeasurementInitiationResult-Item",
	"MeasurementInitiationResult-Item",
	&asn_OP_SEQUENCE,
	asn_DEF_MeasurementInitiationResult_Item_tags_1,
	sizeof(asn_DEF_MeasurementInitiationResult_Item_tags_1)
		/sizeof(asn_DEF_MeasurementInitiationResult_Item_tags_1[0]), /* 1 */
	asn_DEF_MeasurementInitiationResult_Item_tags_1,	/* Same as above */
	sizeof(asn_DEF_MeasurementInitiationResult_Item_tags_1)
		/sizeof(asn_DEF_MeasurementInitiationResult_Item_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_MeasurementInitiationResult_Item_1,
	3,	/* Elements count */
	&asn_SPC_MeasurementInitiationResult_Item_specs_1	/* Additional specs */
};

