/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "X2AP-PDU-Contents"
 * 	found in "Spec/e2ap-v031ex.asn"
 * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
 */

#include "E-RABs-Admitted-ToBeAdded-ModAckItem-Split-Bearer.h"

#include "ProtocolExtensionContainer.h"
asn_TYPE_member_t asn_MBR_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer, e_RAB_ID),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_E_RAB_ID,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"e-RAB-ID"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer, seNB_GTPtunnelEndpoint),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_GTPtunnelEndpoint,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"seNB-GTPtunnelEndpoint"
		},
	{ ATF_POINTER, 1, offsetof(struct E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer, iE_Extensions),
		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolExtensionContainer_9566P31,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"iE-Extensions"
		},
};
static const int asn_MAP_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_oms_1[] = { 2 };
static const ber_tlv_tag_t asn_DEF_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* e-RAB-ID */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* seNB-GTPtunnelEndpoint */
    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
};
asn_SEQUENCE_specifics_t asn_SPC_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_specs_1 = {
	sizeof(struct E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer),
	offsetof(struct E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer, _asn_ctx),
	asn_MAP_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tag2el_1,
	3,	/* Count of tags in the map */
	asn_MAP_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_oms_1,	/* Optional members */
	1, 0,	/* Root/Additions */
	3,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer = {
	"E-RABs-Admitted-ToBeAdded-ModAckItem-Split-Bearer",
	"E-RABs-Admitted-ToBeAdded-ModAckItem-Split-Bearer",
	&asn_OP_SEQUENCE,
	asn_DEF_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tags_1,
	sizeof(asn_DEF_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tags_1)
		/sizeof(asn_DEF_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tags_1[0]), /* 1 */
	asn_DEF_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tags_1,	/* Same as above */
	sizeof(asn_DEF_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tags_1)
		/sizeof(asn_DEF_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_1,
	3,	/* Elements count */
	&asn_SPC_E_RABs_Admitted_ToBeAdded_ModAckItem_Split_Bearer_specs_1	/* Additional specs */
};

