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

static asn_TYPE_member_t asn_MBR_SgNBChangeRefuse_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct SgNBChangeRefuse, protocolIEs),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolIE_Container_7632P83,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"protocolIEs"
		},
};
static const ber_tlv_tag_t asn_DEF_SgNBChangeRefuse_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_SgNBChangeRefuse_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
static asn_SEQUENCE_specifics_t asn_SPC_SgNBChangeRefuse_specs_1 = {
	sizeof(struct SgNBChangeRefuse),
	offsetof(struct SgNBChangeRefuse, _asn_ctx),
	asn_MAP_SgNBChangeRefuse_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_SgNBChangeRefuse = {
	"SgNBChangeRefuse",
	"SgNBChangeRefuse",
	&asn_OP_SEQUENCE,
	asn_DEF_SgNBChangeRefuse_tags_1,
	sizeof(asn_DEF_SgNBChangeRefuse_tags_1)
		/sizeof(asn_DEF_SgNBChangeRefuse_tags_1[0]), /* 1 */
	asn_DEF_SgNBChangeRefuse_tags_1,	/* Same as above */
	sizeof(asn_DEF_SgNBChangeRefuse_tags_1)
		/sizeof(asn_DEF_SgNBChangeRefuse_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_SgNBChangeRefuse_1,
	1,	/* Elements count */
	&asn_SPC_SgNBChangeRefuse_specs_1	/* Additional specs */
};

