/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "X2AP-PDU-Contents"
 * 	found in "Spec/e2_and_x2-combined-and-minimized.asn1"
 * 	`asn1c -pdu=auto -fincludes-quoted -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example`
 */

#include "ENBConfigurationUpdateFailure.h"

asn_TYPE_member_t asn_MBR_ENBConfigurationUpdateFailure_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct ENBConfigurationUpdateFailure, protocolIEs),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolIE_Container_8807P23,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"protocolIEs"
		},
};
static const ber_tlv_tag_t asn_DEF_ENBConfigurationUpdateFailure_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_ENBConfigurationUpdateFailure_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
asn_SEQUENCE_specifics_t asn_SPC_ENBConfigurationUpdateFailure_specs_1 = {
	sizeof(struct ENBConfigurationUpdateFailure),
	offsetof(struct ENBConfigurationUpdateFailure, _asn_ctx),
	asn_MAP_ENBConfigurationUpdateFailure_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_ENBConfigurationUpdateFailure = {
	"ENBConfigurationUpdateFailure",
	"ENBConfigurationUpdateFailure",
	&asn_OP_SEQUENCE,
	asn_DEF_ENBConfigurationUpdateFailure_tags_1,
	sizeof(asn_DEF_ENBConfigurationUpdateFailure_tags_1)
		/sizeof(asn_DEF_ENBConfigurationUpdateFailure_tags_1[0]), /* 1 */
	asn_DEF_ENBConfigurationUpdateFailure_tags_1,	/* Same as above */
	sizeof(asn_DEF_ENBConfigurationUpdateFailure_tags_1)
		/sizeof(asn_DEF_ENBConfigurationUpdateFailure_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_ENBConfigurationUpdateFailure_1,
	1,	/* Elements count */
	&asn_SPC_ENBConfigurationUpdateFailure_specs_1	/* Additional specs */
};

