/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2SM-KPM-RC"
 * 	found in "e2sm-kpm-rc.asn"
 * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
 */

#include "NRCGI.h"

asn_TYPE_member_t asn_MBR_NRCGI_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct NRCGI, pLMN_Identity),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_PLMN_Identity,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"pLMN-Identity"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct NRCGI, nRCellIdentity),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_NRCellIdentity,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"nRCellIdentity"
		},
};
static const ber_tlv_tag_t asn_DEF_NRCGI_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_NRCGI_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* nRCellIdentity */
};
asn_SEQUENCE_specifics_t asn_SPC_NRCGI_specs_1 = {
	sizeof(struct NRCGI),
	offsetof(struct NRCGI, _asn_ctx),
	asn_MAP_NRCGI_tag2el_1,
	2,	/* Count of tags in the map */
	0, 0, 0,	/* Optional elements (not needed) */
	2,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_NRCGI = {
	"NRCGI",
	"NRCGI",
	&asn_OP_SEQUENCE,
	asn_DEF_NRCGI_tags_1,
	sizeof(asn_DEF_NRCGI_tags_1)
		/sizeof(asn_DEF_NRCGI_tags_1[0]), /* 1 */
	asn_DEF_NRCGI_tags_1,	/* Same as above */
	sizeof(asn_DEF_NRCGI_tags_1)
		/sizeof(asn_DEF_NRCGI_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_NRCGI_1,
	2,	/* Elements count */
	&asn_SPC_NRCGI_specs_1	/* Additional specs */
};

