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

#include "RNL-Header.h"

#include "GlobalENB-ID.h"
#include "ProtocolExtensionContainer.h"
static asn_TYPE_member_t asn_MBR_RNL_Header_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct RNL_Header, source_GlobalENB_ID),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_GlobalENB_ID,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"source-GlobalENB-ID"
		},
	{ ATF_POINTER, 2, offsetof(struct RNL_Header, target_GlobalENB_ID),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_GlobalENB_ID,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"target-GlobalENB-ID"
		},
	{ ATF_POINTER, 1, offsetof(struct RNL_Header, iE_Extensions),
		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_ProtocolExtensionContainer_9566P16,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"iE-Extensions"
		},
};
static const int asn_MAP_RNL_Header_oms_1[] = { 1, 2 };
static const ber_tlv_tag_t asn_DEF_RNL_Header_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_RNL_Header_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* source-GlobalENB-ID */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* target-GlobalENB-ID */
    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_RNL_Header_specs_1 = {
	sizeof(struct RNL_Header),
	offsetof(struct RNL_Header, _asn_ctx),
	asn_MAP_RNL_Header_tag2el_1,
	3,	/* Count of tags in the map */
	asn_MAP_RNL_Header_oms_1,	/* Optional members */
	2, 0,	/* Root/Additions */
	3,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_RNL_Header = {
	"RNL-Header",
	"RNL-Header",
	&asn_OP_SEQUENCE,
	asn_DEF_RNL_Header_tags_1,
	sizeof(asn_DEF_RNL_Header_tags_1)
		/sizeof(asn_DEF_RNL_Header_tags_1[0]), /* 1 */
	asn_DEF_RNL_Header_tags_1,	/* Same as above */
	sizeof(asn_DEF_RNL_Header_tags_1)
		/sizeof(asn_DEF_RNL_Header_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_RNL_Header_1,
	3,	/* Elements count */
	&asn_SPC_RNL_Header_specs_1	/* Additional specs */
};

