/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2AP-PDU-Contents"
 * 	found in "E2AP-PDU-Contents-v01.00.asn"
 * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
 */

#include "E2setupFailure.h"

static asn_TYPE_member_t asn_MBR_E2setupFailure_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailure, protocolIEs),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolIE_Container_87P13,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"protocolIEs"
		},
};
static const ber_tlv_tag_t asn_DEF_E2setupFailure_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_E2setupFailure_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
static asn_SEQUENCE_specifics_t asn_SPC_E2setupFailure_specs_1 = {
	sizeof(struct E2setupFailure),
	offsetof(struct E2setupFailure, _asn_ctx),
	asn_MAP_E2setupFailure_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_E2setupFailure = {
	"E2setupFailure",
	"E2setupFailure",
	&asn_OP_SEQUENCE,
	asn_DEF_E2setupFailure_tags_1,
	sizeof(asn_DEF_E2setupFailure_tags_1)
		/sizeof(asn_DEF_E2setupFailure_tags_1[0]), /* 1 */
	asn_DEF_E2setupFailure_tags_1,	/* Same as above */
	sizeof(asn_DEF_E2setupFailure_tags_1)
		/sizeof(asn_DEF_E2setupFailure_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_E2setupFailure_1,
	1,	/* Elements count */
	&asn_SPC_E2setupFailure_specs_1	/* Additional specs */
};

