/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2AP-IEs"
 * 	found in "spec/e2ap-v01.00.00.asn"
 * 	`asn1c -pdu=auto -fincludes-quoted -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example`
 */

#include "RICcontrolAckRequest.h"

/*
 * This type is implemented using NativeEnumerated,
 * so here we adjust the DEF accordingly.
 */
static asn_per_constraints_t asn_PER_type_RICcontrolAckRequest_constr_1 CC_NOTUSED = {
	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
	0, 0	/* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_RICcontrolAckRequest_value2enum_1[] = {
	{ 0,	5,	"noAck" },
	{ 1,	3,	"ack" },
	{ 2,	4,	"nAck" }
	/* This list is extensible */
};
static const unsigned int asn_MAP_RICcontrolAckRequest_enum2value_1[] = {
	1,	/* ack(1) */
	2,	/* nAck(2) */
	0	/* noAck(0) */
	/* This list is extensible */
};
static const asn_INTEGER_specifics_t asn_SPC_RICcontrolAckRequest_specs_1 = {
	asn_MAP_RICcontrolAckRequest_value2enum_1,	/* "tag" => N; sorted by tag */
	asn_MAP_RICcontrolAckRequest_enum2value_1,	/* N => "tag"; sorted by N */
	3,	/* Number of elements in the maps */
	4,	/* Extensions before this member */
	1,	/* Strict enumeration */
	0,	/* Native long size */
	0
};
static const ber_tlv_tag_t asn_DEF_RICcontrolAckRequest_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_RICcontrolAckRequest = {
	"RICcontrolAckRequest",
	"RICcontrolAckRequest",
	&asn_OP_NativeEnumerated,
	asn_DEF_RICcontrolAckRequest_tags_1,
	sizeof(asn_DEF_RICcontrolAckRequest_tags_1)
		/sizeof(asn_DEF_RICcontrolAckRequest_tags_1[0]), /* 1 */
	asn_DEF_RICcontrolAckRequest_tags_1,	/* Same as above */
	sizeof(asn_DEF_RICcontrolAckRequest_tags_1)
		/sizeof(asn_DEF_RICcontrolAckRequest_tags_1[0]), /* 1 */
	{ 0, &asn_PER_type_RICcontrolAckRequest_constr_1, NativeEnumerated_constraint },
	0, 0,	/* Defined elsewhere */
	&asn_SPC_RICcontrolAckRequest_specs_1	/* Additional specs */
};

