/*
 * 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 "RLFIndication.h"

static asn_TYPE_member_t asn_MBR_RLFIndication_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct RLFIndication, protocolIEs),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolIE_Container_7632P38,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"protocolIEs"
		},
};
static const ber_tlv_tag_t asn_DEF_RLFIndication_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_RLFIndication_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
static asn_SEQUENCE_specifics_t asn_SPC_RLFIndication_specs_1 = {
	sizeof(struct RLFIndication),
	offsetof(struct RLFIndication, _asn_ctx),
	asn_MAP_RLFIndication_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_RLFIndication = {
	"RLFIndication",
	"RLFIndication",
	&asn_OP_SEQUENCE,
	asn_DEF_RLFIndication_tags_1,
	sizeof(asn_DEF_RLFIndication_tags_1)
		/sizeof(asn_DEF_RLFIndication_tags_1[0]), /* 1 */
	asn_DEF_RLFIndication_tags_1,	/* Same as above */
	sizeof(asn_DEF_RLFIndication_tags_1)
		/sizeof(asn_DEF_RLFIndication_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RLFIndication_1,
	1,	/* Elements count */
	&asn_SPC_RLFIndication_specs_1	/* Additional specs */
};

