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

#include "CoMPHypothesisSetItem.h"
asn_per_constraints_t asn_PER_type_CoMPHypothesisSet_constr_1 CC_NOTUSED = {
	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
	{ APC_CONSTRAINED,	 5,  5,  1,  32 }	/* (SIZE(1..32)) */,
	0, 0	/* No PER value map */
};
asn_TYPE_member_t asn_MBR_CoMPHypothesisSet_1[] = {
	{ ATF_POINTER, 0, 0,
		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
		0,
		&asn_DEF_CoMPHypothesisSetItem,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		""
		},
};
static const ber_tlv_tag_t asn_DEF_CoMPHypothesisSet_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_SET_OF_specifics_t asn_SPC_CoMPHypothesisSet_specs_1 = {
	sizeof(struct CoMPHypothesisSet),
	offsetof(struct CoMPHypothesisSet, _asn_ctx),
	0,	/* XER encoding is XMLDelimitedItemList */
};
asn_TYPE_descriptor_t asn_DEF_CoMPHypothesisSet = {
	"CoMPHypothesisSet",
	"CoMPHypothesisSet",
	&asn_OP_SEQUENCE_OF,
	asn_DEF_CoMPHypothesisSet_tags_1,
	sizeof(asn_DEF_CoMPHypothesisSet_tags_1)
		/sizeof(asn_DEF_CoMPHypothesisSet_tags_1[0]), /* 1 */
	asn_DEF_CoMPHypothesisSet_tags_1,	/* Same as above */
	sizeof(asn_DEF_CoMPHypothesisSet_tags_1)
		/sizeof(asn_DEF_CoMPHypothesisSet_tags_1[0]), /* 1 */
	{ 0, &asn_PER_type_CoMPHypothesisSet_constr_1, SEQUENCE_OF_constraint },
	asn_MBR_CoMPHypothesisSet_1,
	1,	/* Single element */
	&asn_SPC_CoMPHypothesisSet_specs_1	/* Additional specs */
};

