/*
 * 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 "E2SM-gNB-X2-controlHeader.h"

static asn_TYPE_member_t asn_MBR_E2SM_gNB_X2_controlHeader_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_gNB_X2_controlHeader, interface_ID),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		+1,	/* EXPLICIT tag at current level */
		&asn_DEF_Interface_ID,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"interface-ID"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_gNB_X2_controlHeader, interfaceDirection),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_InterfaceDirection,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"interfaceDirection"
		},
};
static const ber_tlv_tag_t asn_DEF_E2SM_gNB_X2_controlHeader_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_E2SM_gNB_X2_controlHeader_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* interface-ID */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* interfaceDirection */
};
static asn_SEQUENCE_specifics_t asn_SPC_E2SM_gNB_X2_controlHeader_specs_1 = {
	sizeof(struct E2SM_gNB_X2_controlHeader),
	offsetof(struct E2SM_gNB_X2_controlHeader, _asn_ctx),
	asn_MAP_E2SM_gNB_X2_controlHeader_tag2el_1,
	2,	/* Count of tags in the map */
	0, 0, 0,	/* Optional elements (not needed) */
	2,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_E2SM_gNB_X2_controlHeader = {
	"E2SM-gNB-X2-controlHeader",
	"E2SM-gNB-X2-controlHeader",
	&asn_OP_SEQUENCE,
	asn_DEF_E2SM_gNB_X2_controlHeader_tags_1,
	sizeof(asn_DEF_E2SM_gNB_X2_controlHeader_tags_1)
		/sizeof(asn_DEF_E2SM_gNB_X2_controlHeader_tags_1[0]), /* 1 */
	asn_DEF_E2SM_gNB_X2_controlHeader_tags_1,	/* Same as above */
	sizeof(asn_DEF_E2SM_gNB_X2_controlHeader_tags_1)
		/sizeof(asn_DEF_E2SM_gNB_X2_controlHeader_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_E2SM_gNB_X2_controlHeader_1,
	2,	/* Elements count */
	&asn_SPC_E2SM_gNB_X2_controlHeader_specs_1	/* Additional specs */
};

