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

static asn_TYPE_member_t asn_MBR_E2SM_gNB_X2_indicationHeader_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct E2SM_gNB_X2_indicationHeader, 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_indicationHeader, 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"
		},
	{ ATF_POINTER, 1, offsetof(struct E2SM_gNB_X2_indicationHeader, timestamp),
		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_TimeStamp,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"timestamp"
		},
};
static const int asn_MAP_E2SM_gNB_X2_indicationHeader_oms_1[] = { 2 };
static const ber_tlv_tag_t asn_DEF_E2SM_gNB_X2_indicationHeader_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_E2SM_gNB_X2_indicationHeader_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* interface-ID */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* interfaceDirection */
    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* timestamp */
};
static asn_SEQUENCE_specifics_t asn_SPC_E2SM_gNB_X2_indicationHeader_specs_1 = {
	sizeof(struct E2SM_gNB_X2_indicationHeader),
	offsetof(struct E2SM_gNB_X2_indicationHeader, _asn_ctx),
	asn_MAP_E2SM_gNB_X2_indicationHeader_tag2el_1,
	3,	/* Count of tags in the map */
	asn_MAP_E2SM_gNB_X2_indicationHeader_oms_1,	/* Optional members */
	1, 0,	/* Root/Additions */
	3,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_E2SM_gNB_X2_indicationHeader = {
	"E2SM-gNB-X2-indicationHeader",
	"E2SM-gNB-X2-indicationHeader",
	&asn_OP_SEQUENCE,
	asn_DEF_E2SM_gNB_X2_indicationHeader_tags_1,
	sizeof(asn_DEF_E2SM_gNB_X2_indicationHeader_tags_1)
		/sizeof(asn_DEF_E2SM_gNB_X2_indicationHeader_tags_1[0]), /* 1 */
	asn_DEF_E2SM_gNB_X2_indicationHeader_tags_1,	/* Same as above */
	sizeof(asn_DEF_E2SM_gNB_X2_indicationHeader_tags_1)
		/sizeof(asn_DEF_E2SM_gNB_X2_indicationHeader_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_E2SM_gNB_X2_indicationHeader_1,
	3,	/* Elements count */
	&asn_SPC_E2SM_gNB_X2_indicationHeader_specs_1	/* Additional specs */
};

