/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "X2AP-CommonDataTypes"
 * 	found in "Spec/e2ap-v031ex.asn"
 * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
 */

#include "TriggeringMessage.h"

/*
 * This type is implemented using NativeEnumerated,
 * so here we adjust the DEF accordingly.
 */
static asn_oer_constraints_t asn_OER_type_TriggeringMessage_constr_1 CC_NOTUSED = {
	{ 0, 0 },
	-1};
asn_per_constraints_t asn_PER_type_TriggeringMessage_constr_1 CC_NOTUSED = {
	{ APC_CONSTRAINED,	 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_TriggeringMessage_value2enum_1[] = {
	{ 0,	18,	"initiating-message" },
	{ 1,	18,	"successful-outcome" },
	{ 2,	20,	"unsuccessful-outcome" }
};
static const unsigned int asn_MAP_TriggeringMessage_enum2value_1[] = {
	0,	/* initiating-message(0) */
	1,	/* successful-outcome(1) */
	2	/* unsuccessful-outcome(2) */
};
const asn_INTEGER_specifics_t asn_SPC_TriggeringMessage_specs_1 = {
	asn_MAP_TriggeringMessage_value2enum_1,	/* "tag" => N; sorted by tag */
	asn_MAP_TriggeringMessage_enum2value_1,	/* N => "tag"; sorted by N */
	3,	/* Number of elements in the maps */
	0,	/* Enumeration is not extensible */
	1,	/* Strict enumeration */
	0,	/* Native long size */
	0
};
static const ber_tlv_tag_t asn_DEF_TriggeringMessage_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_TriggeringMessage = {
	"TriggeringMessage",
	"TriggeringMessage",
	&asn_OP_NativeEnumerated,
	asn_DEF_TriggeringMessage_tags_1,
	sizeof(asn_DEF_TriggeringMessage_tags_1)
		/sizeof(asn_DEF_TriggeringMessage_tags_1[0]), /* 1 */
	asn_DEF_TriggeringMessage_tags_1,	/* Same as above */
	sizeof(asn_DEF_TriggeringMessage_tags_1)
		/sizeof(asn_DEF_TriggeringMessage_tags_1[0]), /* 1 */
	{ &asn_OER_type_TriggeringMessage_constr_1, &asn_PER_type_TriggeringMessage_constr_1, NativeEnumerated_constraint },
	0, 0,	/* Defined elsewhere */
	&asn_SPC_TriggeringMessage_specs_1	/* Additional specs */
};

