/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2SM-gNB-X2-IEs"
 * 	found in "Spec/e2_and_x2-combined-and-minimized.asn1"
 * 	`asn1c -pdu=auto -fincludes-quoted -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example`
 */

#include "InterfaceProtocolIE-Test.h"

/*
 * This type is implemented using NativeEnumerated,
 * so here we adjust the DEF accordingly.
 */
asn_per_constraints_t asn_PER_type_InterfaceProtocolIE_Test_constr_1 CC_NOTUSED = {
	{ APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  4 }	/* (0..4,...) */,
	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
	0, 0	/* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_InterfaceProtocolIE_Test_value2enum_1[] = {
	{ 0,	5,	"equal" },
	{ 1,	11,	"greaterthan" },
	{ 2,	8,	"lessthan" },
	{ 3,	8,	"contains" },
	{ 4,	7,	"present" }
	/* This list is extensible */
};
static const unsigned int asn_MAP_InterfaceProtocolIE_Test_enum2value_1[] = {
	3,	/* contains(3) */
	0,	/* equal(0) */
	1,	/* greaterthan(1) */
	2,	/* lessthan(2) */
	4	/* present(4) */
	/* This list is extensible */
};
const asn_INTEGER_specifics_t asn_SPC_InterfaceProtocolIE_Test_specs_1 = {
	asn_MAP_InterfaceProtocolIE_Test_value2enum_1,	/* "tag" => N; sorted by tag */
	asn_MAP_InterfaceProtocolIE_Test_enum2value_1,	/* N => "tag"; sorted by N */
	5,	/* Number of elements in the maps */
	6,	/* Extensions before this member */
	1,	/* Strict enumeration */
	0,	/* Native long size */
	0
};
static const ber_tlv_tag_t asn_DEF_InterfaceProtocolIE_Test_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_InterfaceProtocolIE_Test = {
	"InterfaceProtocolIE-Test",
	"InterfaceProtocolIE-Test",
	&asn_OP_NativeEnumerated,
	asn_DEF_InterfaceProtocolIE_Test_tags_1,
	sizeof(asn_DEF_InterfaceProtocolIE_Test_tags_1)
		/sizeof(asn_DEF_InterfaceProtocolIE_Test_tags_1[0]), /* 1 */
	asn_DEF_InterfaceProtocolIE_Test_tags_1,	/* Same as above */
	sizeof(asn_DEF_InterfaceProtocolIE_Test_tags_1)
		/sizeof(asn_DEF_InterfaceProtocolIE_Test_tags_1[0]), /* 1 */
	{ 0, &asn_PER_type_InterfaceProtocolIE_Test_constr_1, NativeEnumerated_constraint },
	0, 0,	/* Defined elsewhere */
	&asn_SPC_InterfaceProtocolIE_Test_specs_1	/* Additional specs */
};

