/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2AP-Containers"
 * 	found in "e2ap-oran-wg3-v01.00.asn"
 * 	`asn1c -fno-include-deps -fcompound-names -findirect-choice -gen-PER -no-gen-OER`
 */

#include "ProtocolIE-SingleContainer.h"

/*
 * This type is implemented using RICaction_ToBeSetup_ItemIEs,
 * so here we adjust the DEF accordingly.
 */
/*
 * This type is implemented using RICaction_Admitted_ItemIEs,
 * so here we adjust the DEF accordingly.
 */
/*
 * This type is implemented using RICaction_NotAdmitted_ItemIEs,
 * so here we adjust the DEF accordingly.
 */
/*
 * This type is implemented using RANfunction_ItemIEs,
 * so here we adjust the DEF accordingly.
 */
/*
 * This type is implemented using RANfunctionID_ItemIEs,
 * so here we adjust the DEF accordingly.
 */
/*
 * This type is implemented using RANfunctionIDcause_ItemIEs,
 * so here we adjust the DEF accordingly.
 */
static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_1415P0_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_1415P0 = {
	"ProtocolIE-SingleContainer",
	"ProtocolIE-SingleContainer",
	&asn_OP_SEQUENCE,
	asn_DEF_ProtocolIE_SingleContainer_1415P0_tags_1,
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P0_tags_1)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P0_tags_1[0]), /* 1 */
	asn_DEF_ProtocolIE_SingleContainer_1415P0_tags_1,	/* Same as above */
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P0_tags_1)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P0_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RICaction_ToBeSetup_ItemIEs_1,
	3,	/* Elements count */
	&asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1	/* Additional specs */
};

static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_1415P1_tags_2[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_1415P1 = {
	"ProtocolIE-SingleContainer",
	"ProtocolIE-SingleContainer",
	&asn_OP_SEQUENCE,
	asn_DEF_ProtocolIE_SingleContainer_1415P1_tags_2,
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P1_tags_2)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P1_tags_2[0]), /* 1 */
	asn_DEF_ProtocolIE_SingleContainer_1415P1_tags_2,	/* Same as above */
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P1_tags_2)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P1_tags_2[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RICaction_Admitted_ItemIEs_5,
	3,	/* Elements count */
	&asn_SPC_RICaction_Admitted_ItemIEs_specs_5	/* Additional specs */
};

static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_1415P2_tags_3[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_1415P2 = {
	"ProtocolIE-SingleContainer",
	"ProtocolIE-SingleContainer",
	&asn_OP_SEQUENCE,
	asn_DEF_ProtocolIE_SingleContainer_1415P2_tags_3,
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P2_tags_3)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P2_tags_3[0]), /* 1 */
	asn_DEF_ProtocolIE_SingleContainer_1415P2_tags_3,	/* Same as above */
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P2_tags_3)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P2_tags_3[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RICaction_NotAdmitted_ItemIEs_9,
	3,	/* Elements count */
	&asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9	/* Additional specs */
};

static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_1415P3_tags_4[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_1415P3 = {
	"ProtocolIE-SingleContainer",
	"ProtocolIE-SingleContainer",
	&asn_OP_SEQUENCE,
	asn_DEF_ProtocolIE_SingleContainer_1415P3_tags_4,
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P3_tags_4)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P3_tags_4[0]), /* 1 */
	asn_DEF_ProtocolIE_SingleContainer_1415P3_tags_4,	/* Same as above */
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P3_tags_4)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P3_tags_4[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RANfunction_ItemIEs_13,
	3,	/* Elements count */
	&asn_SPC_RANfunction_ItemIEs_specs_13	/* Additional specs */
};

static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_1415P4_tags_5[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_1415P4 = {
	"ProtocolIE-SingleContainer",
	"ProtocolIE-SingleContainer",
	&asn_OP_SEQUENCE,
	asn_DEF_ProtocolIE_SingleContainer_1415P4_tags_5,
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P4_tags_5)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P4_tags_5[0]), /* 1 */
	asn_DEF_ProtocolIE_SingleContainer_1415P4_tags_5,	/* Same as above */
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P4_tags_5)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P4_tags_5[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RANfunctionID_ItemIEs_17,
	3,	/* Elements count */
	&asn_SPC_RANfunctionID_ItemIEs_specs_17	/* Additional specs */
};

static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_1415P5_tags_6[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_1415P5 = {
	"ProtocolIE-SingleContainer",
	"ProtocolIE-SingleContainer",
	&asn_OP_SEQUENCE,
	asn_DEF_ProtocolIE_SingleContainer_1415P5_tags_6,
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P5_tags_6)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P5_tags_6[0]), /* 1 */
	asn_DEF_ProtocolIE_SingleContainer_1415P5_tags_6,	/* Same as above */
	sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P5_tags_6)
		/sizeof(asn_DEF_ProtocolIE_SingleContainer_1415P5_tags_6[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RANfunctionIDcause_ItemIEs_21,
	3,	/* Elements count */
	&asn_SPC_RANfunctionIDcause_ItemIEs_specs_21	/* Additional specs */
};

