/*
 * 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 "SpecialSubframePatterns.h"

/*
 * This type is implemented using NativeEnumerated,
 * so here we adjust the DEF accordingly.
 */
asn_per_constraints_t asn_PER_type_SpecialSubframePatterns_constr_1 CC_NOTUSED = {
	{ APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  8 }	/* (0..8,...) */,
	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
	0, 0	/* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_SpecialSubframePatterns_value2enum_1[] = {
	{ 0,	4,	"ssp0" },
	{ 1,	4,	"ssp1" },
	{ 2,	4,	"ssp2" },
	{ 3,	4,	"ssp3" },
	{ 4,	4,	"ssp4" },
	{ 5,	4,	"ssp5" },
	{ 6,	4,	"ssp6" },
	{ 7,	4,	"ssp7" },
	{ 8,	4,	"ssp8" }
	/* This list is extensible */
};
static const unsigned int asn_MAP_SpecialSubframePatterns_enum2value_1[] = {
	0,	/* ssp0(0) */
	1,	/* ssp1(1) */
	2,	/* ssp2(2) */
	3,	/* ssp3(3) */
	4,	/* ssp4(4) */
	5,	/* ssp5(5) */
	6,	/* ssp6(6) */
	7,	/* ssp7(7) */
	8	/* ssp8(8) */
	/* This list is extensible */
};
const asn_INTEGER_specifics_t asn_SPC_SpecialSubframePatterns_specs_1 = {
	asn_MAP_SpecialSubframePatterns_value2enum_1,	/* "tag" => N; sorted by tag */
	asn_MAP_SpecialSubframePatterns_enum2value_1,	/* N => "tag"; sorted by N */
	9,	/* Number of elements in the maps */
	10,	/* Extensions before this member */
	1,	/* Strict enumeration */
	0,	/* Native long size */
	0
};
static const ber_tlv_tag_t asn_DEF_SpecialSubframePatterns_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_SpecialSubframePatterns = {
	"SpecialSubframePatterns",
	"SpecialSubframePatterns",
	&asn_OP_NativeEnumerated,
	asn_DEF_SpecialSubframePatterns_tags_1,
	sizeof(asn_DEF_SpecialSubframePatterns_tags_1)
		/sizeof(asn_DEF_SpecialSubframePatterns_tags_1[0]), /* 1 */
	asn_DEF_SpecialSubframePatterns_tags_1,	/* Same as above */
	sizeof(asn_DEF_SpecialSubframePatterns_tags_1)
		/sizeof(asn_DEF_SpecialSubframePatterns_tags_1[0]), /* 1 */
	{ 0, &asn_PER_type_SpecialSubframePatterns_constr_1, NativeEnumerated_constraint },
	0, 0,	/* Defined elsewhere */
	&asn_SPC_SpecialSubframePatterns_specs_1	/* Additional specs */
};

