/*
 * 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 "E-RABs-Admitted-ToBeModified-ModAckItem.h"

#include "E-RABs-Admitted-ToBeModified-ModAckItem-SCG-Bearer.h"
#include "E-RABs-Admitted-ToBeModified-ModAckItem-Split-Bearer.h"
static asn_oer_constraints_t asn_OER_type_E_RABs_Admitted_ToBeModified_ModAckItem_constr_1 CC_NOTUSED = {
	{ 0, 0 },
	-1};
static asn_per_constraints_t asn_PER_type_E_RABs_Admitted_ToBeModified_ModAckItem_constr_1 CC_NOTUSED = {
	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
	0, 0	/* No PER value map */
};
static asn_TYPE_member_t asn_MBR_E_RABs_Admitted_ToBeModified_ModAckItem_1[] = {
	{ ATF_POINTER, 0, offsetof(struct E_RABs_Admitted_ToBeModified_ModAckItem, choice.sCG_Bearer),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_E_RABs_Admitted_ToBeModified_ModAckItem_SCG_Bearer,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"sCG-Bearer"
		},
	{ ATF_POINTER, 0, offsetof(struct E_RABs_Admitted_ToBeModified_ModAckItem, choice.split_Bearer),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_E_RABs_Admitted_ToBeModified_ModAckItem_Split_Bearer,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"split-Bearer"
		},
};
static const asn_TYPE_tag2member_t asn_MAP_E_RABs_Admitted_ToBeModified_ModAckItem_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sCG-Bearer */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* split-Bearer */
};
static asn_CHOICE_specifics_t asn_SPC_E_RABs_Admitted_ToBeModified_ModAckItem_specs_1 = {
	sizeof(struct E_RABs_Admitted_ToBeModified_ModAckItem),
	offsetof(struct E_RABs_Admitted_ToBeModified_ModAckItem, _asn_ctx),
	offsetof(struct E_RABs_Admitted_ToBeModified_ModAckItem, present),
	sizeof(((struct E_RABs_Admitted_ToBeModified_ModAckItem *)0)->present),
	asn_MAP_E_RABs_Admitted_ToBeModified_ModAckItem_tag2el_1,
	2,	/* Count of tags in the map */
	0, 0,
	2	/* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_E_RABs_Admitted_ToBeModified_ModAckItem = {
	"E-RABs-Admitted-ToBeModified-ModAckItem",
	"E-RABs-Admitted-ToBeModified-ModAckItem",
	&asn_OP_CHOICE,
	0,	/* No effective tags (pointer) */
	0,	/* No effective tags (count) */
	0,	/* No tags (pointer) */
	0,	/* No tags (count) */
	{ &asn_OER_type_E_RABs_Admitted_ToBeModified_ModAckItem_constr_1, &asn_PER_type_E_RABs_Admitted_ToBeModified_ModAckItem_constr_1, CHOICE_constraint },
	asn_MBR_E_RABs_Admitted_ToBeModified_ModAckItem_1,
	2,	/* Elements count */
	&asn_SPC_E_RABs_Admitted_ToBeModified_ModAckItem_specs_1	/* Additional specs */
};

