/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "X2AP-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 "NSSS-NumOccasionDifferentPrecoder.h"

/*
 * This type is implemented using NativeEnumerated,
 * so here we adjust the DEF accordingly.
 */
static asn_per_constraints_t asn_PER_type_NSSS_NumOccasionDifferentPrecoder_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_NSSS_NumOccasionDifferentPrecoder_value2enum_1[] = {
	{ 0,	3,	"two" },
	{ 1,	4,	"four" },
	{ 2,	5,	"eight" }
	/* This list is extensible */
};
static const unsigned int asn_MAP_NSSS_NumOccasionDifferentPrecoder_enum2value_1[] = {
	2,	/* eight(2) */
	1,	/* four(1) */
	0	/* two(0) */
	/* This list is extensible */
};
static const asn_INTEGER_specifics_t asn_SPC_NSSS_NumOccasionDifferentPrecoder_specs_1 = {
	asn_MAP_NSSS_NumOccasionDifferentPrecoder_value2enum_1,	/* "tag" => N; sorted by tag */
	asn_MAP_NSSS_NumOccasionDifferentPrecoder_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_NSSS_NumOccasionDifferentPrecoder_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_NSSS_NumOccasionDifferentPrecoder = {
	"NSSS-NumOccasionDifferentPrecoder",
	"NSSS-NumOccasionDifferentPrecoder",
	&asn_OP_NativeEnumerated,
	asn_DEF_NSSS_NumOccasionDifferentPrecoder_tags_1,
	sizeof(asn_DEF_NSSS_NumOccasionDifferentPrecoder_tags_1)
		/sizeof(asn_DEF_NSSS_NumOccasionDifferentPrecoder_tags_1[0]), /* 1 */
	asn_DEF_NSSS_NumOccasionDifferentPrecoder_tags_1,	/* Same as above */
	sizeof(asn_DEF_NSSS_NumOccasionDifferentPrecoder_tags_1)
		/sizeof(asn_DEF_NSSS_NumOccasionDifferentPrecoder_tags_1[0]), /* 1 */
	{ 0, &asn_PER_type_NSSS_NumOccasionDifferentPrecoder_constr_1, NativeEnumerated_constraint },
	0, 0,	/* Defined elsewhere */
	&asn_SPC_NSSS_NumOccasionDifferentPrecoder_specs_1	/* Additional specs */
};

