/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "X2AP-PDU-Contents"
 * 	found in "X2AP-15-4-0.asn1"
 * 	`asn1c -D ./asn1_n1 -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
 */

#include "MobilityChangeFailure.h"

static asn_TYPE_member_t asn_MBR_MobilityChangeFailure_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct MobilityChangeFailure, protocolIEs),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolIE_Container_7632P37,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"protocolIEs"
		},
};
static const ber_tlv_tag_t asn_DEF_MobilityChangeFailure_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_MobilityChangeFailure_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
static asn_SEQUENCE_specifics_t asn_SPC_MobilityChangeFailure_specs_1 = {
	sizeof(struct MobilityChangeFailure),
	offsetof(struct MobilityChangeFailure, _asn_ctx),
	asn_MAP_MobilityChangeFailure_tag2el_1,
	1,	/* Count of tags in the map */
	0, 0, 0,	/* Optional elements (not needed) */
	1,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_MobilityChangeFailure = {
	"MobilityChangeFailure",
	"MobilityChangeFailure",
	&asn_OP_SEQUENCE,
	asn_DEF_MobilityChangeFailure_tags_1,
	sizeof(asn_DEF_MobilityChangeFailure_tags_1)
		/sizeof(asn_DEF_MobilityChangeFailure_tags_1[0]), /* 1 */
	asn_DEF_MobilityChangeFailure_tags_1,	/* Same as above */
	sizeof(asn_DEF_MobilityChangeFailure_tags_1)
		/sizeof(asn_DEF_MobilityChangeFailure_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_MobilityChangeFailure_1,
	1,	/* Elements count */
	&asn_SPC_MobilityChangeFailure_specs_1	/* Additional specs */
};

