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

asn_TYPE_member_t asn_MBR_SeNBModificationRefuse_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct SeNBModificationRefuse, protocolIEs),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolIE_Container_9515P53,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"protocolIEs"
		},
};
static const ber_tlv_tag_t asn_DEF_SeNBModificationRefuse_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_SeNBModificationRefuse_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
asn_SEQUENCE_specifics_t asn_SPC_SeNBModificationRefuse_specs_1 = {
	sizeof(struct SeNBModificationRefuse),
	offsetof(struct SeNBModificationRefuse, _asn_ctx),
	asn_MAP_SeNBModificationRefuse_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_SeNBModificationRefuse = {
	"SeNBModificationRefuse",
	"SeNBModificationRefuse",
	&asn_OP_SEQUENCE,
	asn_DEF_SeNBModificationRefuse_tags_1,
	sizeof(asn_DEF_SeNBModificationRefuse_tags_1)
		/sizeof(asn_DEF_SeNBModificationRefuse_tags_1[0]), /* 1 */
	asn_DEF_SeNBModificationRefuse_tags_1,	/* Same as above */
	sizeof(asn_DEF_SeNBModificationRefuse_tags_1)
		/sizeof(asn_DEF_SeNBModificationRefuse_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_SeNBModificationRefuse_1,
	1,	/* Elements count */
	&asn_SPC_SeNBModificationRefuse_specs_1	/* Additional specs */
};

