/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2AP-PDU-Contents"
 * 	found in "E2AP-PDU-Contents-v01.00.asn"
 * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
 */

#include "RICsubscriptionResponse.h"

static asn_TYPE_member_t asn_MBR_RICsubscriptionResponse_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse, protocolIEs),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolIE_Container_87P1,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"protocolIEs"
		},
};
static const ber_tlv_tag_t asn_DEF_RICsubscriptionResponse_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionResponse_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionResponse_specs_1 = {
	sizeof(struct RICsubscriptionResponse),
	offsetof(struct RICsubscriptionResponse, _asn_ctx),
	asn_MAP_RICsubscriptionResponse_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_RICsubscriptionResponse = {
	"RICsubscriptionResponse",
	"RICsubscriptionResponse",
	&asn_OP_SEQUENCE,
	asn_DEF_RICsubscriptionResponse_tags_1,
	sizeof(asn_DEF_RICsubscriptionResponse_tags_1)
		/sizeof(asn_DEF_RICsubscriptionResponse_tags_1[0]), /* 1 */
	asn_DEF_RICsubscriptionResponse_tags_1,	/* Same as above */
	sizeof(asn_DEF_RICsubscriptionResponse_tags_1)
		/sizeof(asn_DEF_RICsubscriptionResponse_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RICsubscriptionResponse_1,
	1,	/* Elements count */
	&asn_SPC_RICsubscriptionResponse_specs_1	/* Additional specs */
};

