diff --git a/e2ap/headers/ANY.h b/e2ap/headers/ANY.h
new file mode 100644
index 0000000..b30381f
--- /dev/null
+++ b/e2ap/headers/ANY.h
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_TYPE_ANY_H
+#define ASN_TYPE_ANY_H
+
+#include <OCTET_STRING.h>	/* Implemented via OCTET STRING type */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct ANY {
+	uint8_t *buf;	/* BER-encoded ANY contents */
+	int size;	/* Size of the above buffer */
+
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
+} ANY_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_ANY;
+extern asn_TYPE_operation_t asn_OP_ANY;
+extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;
+
+asn_struct_free_f ANY_free;
+asn_struct_print_f ANY_print;
+ber_type_decoder_f ANY_decode_ber;
+der_type_encoder_f ANY_encode_der;
+xer_type_encoder_f ANY_encode_xer;
+per_type_decoder_f ANY_decode_uper;
+per_type_encoder_f ANY_encode_uper;
+per_type_decoder_f ANY_decode_aper;
+per_type_encoder_f ANY_encode_aper;
+
+#define ANY_free         OCTET_STRING_free
+#define ANY_print        OCTET_STRING_print
+#define ANY_compare      OCTET_STRING_compare
+#define ANY_constraint   asn_generic_no_constraint
+#define ANY_decode_ber   OCTET_STRING_decode_ber
+#define ANY_encode_der   OCTET_STRING_encode_der
+#define ANY_decode_xer   OCTET_STRING_decode_xer_hex
+
+/******************************
+ * Handy conversion routines. *
+ ******************************/
+
+/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
+int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
+int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
+ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
+ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
+
+/* Convert the contents of the ANY type into the specified type. */
+int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
+int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
+
+#define	ANY_fromBuf(s, buf, size)	OCTET_STRING_fromBuf((s), (buf), (size))
+#define	ANY_new_fromBuf(buf, size)	OCTET_STRING_new_fromBuf(	\
+						&asn_DEF_ANY, (buf), (size))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_TYPE_ANY_H */
diff --git a/e2ap/headers/BIT_STRING.h b/e2ap/headers/BIT_STRING.h
new file mode 100644
index 0000000..c1bdbbc
--- /dev/null
+++ b/e2ap/headers/BIT_STRING.h
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BIT_STRING_H_
+#define	_BIT_STRING_H_
+
+#include <OCTET_STRING.h>	/* Some help from OCTET STRING */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct BIT_STRING_s {
+	uint8_t *buf;	/* BIT STRING body */
+	size_t size;	/* Size of the above buffer */
+
+	int bits_unused;/* Unused trailing bits in the last octet (0..7) */
+
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
+} BIT_STRING_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
+extern asn_TYPE_operation_t asn_OP_BIT_STRING;
+extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
+
+asn_struct_print_f BIT_STRING_print;	/* Human-readable output */
+asn_struct_compare_f BIT_STRING_compare;
+asn_constr_check_f BIT_STRING_constraint;
+xer_type_encoder_f BIT_STRING_encode_xer;
+oer_type_decoder_f BIT_STRING_decode_oer;
+oer_type_encoder_f BIT_STRING_encode_oer;
+per_type_decoder_f BIT_STRING_decode_uper;
+per_type_encoder_f BIT_STRING_encode_uper;
+asn_random_fill_f  BIT_STRING_random_fill;
+
+#define BIT_STRING_free              OCTET_STRING_free
+#define BIT_STRING_decode_ber        OCTET_STRING_decode_ber
+#define BIT_STRING_encode_der        OCTET_STRING_encode_der
+#define BIT_STRING_decode_xer        OCTET_STRING_decode_xer_binary
+#define BIT_STRING_decode_aper       OCTET_STRING_decode_aper
+#define BIT_STRING_encode_aper       OCTET_STRING_encode_aper
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BIT_STRING_H_ */
diff --git a/e2ap/headers/Cause.h b/e2ap/headers/Cause.h
new file mode 100644
index 0000000..7bd7e80
--- /dev/null
+++ b/e2ap/headers/Cause.h
@@ -0,0 +1,68 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_Cause_H_
+#define	_Cause_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "CauseRIC.h"
+#include "CauseRICservice.h"
+#include "CauseTransport.h"
+#include "CauseProtocol.h"
+#include "CauseMisc.h"
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum Cause_PR {
+	Cause_PR_NOTHING,	/* No components present */
+	Cause_PR_ricRequest,
+	Cause_PR_ricService,
+	Cause_PR_transport,
+	Cause_PR_protocol,
+	Cause_PR_misc
+	/* Extensions may appear below */
+	
+} Cause_PR;
+
+/* Cause */
+typedef struct Cause {
+	Cause_PR present;
+	union Cause_u {
+		CauseRIC_t	 ricRequest;
+		CauseRICservice_t	 ricService;
+		CauseTransport_t	 transport;
+		CauseProtocol_t	 protocol;
+		CauseMisc_t	 misc;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} Cause_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_Cause;
+extern asn_CHOICE_specifics_t asn_SPC_Cause_specs_1;
+extern asn_TYPE_member_t asn_MBR_Cause_1[5];
+extern asn_per_constraints_t asn_PER_type_Cause_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Cause_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseMisc.h b/e2ap/headers/CauseMisc.h
new file mode 100644
index 0000000..1b1efcf
--- /dev/null
+++ b/e2ap/headers/CauseMisc.h
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseMisc_H_
+#define	_CauseMisc_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseMisc {
+	CauseMisc_control_processing_overload	= 0,
+	CauseMisc_hardware_failure	= 1,
+	CauseMisc_om_intervention	= 2,
+	CauseMisc_unspecified	= 3
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseMisc;
+
+/* CauseMisc */
+typedef long	 CauseMisc_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseMisc_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseMisc;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseMisc_specs_1;
+asn_struct_free_f CauseMisc_free;
+asn_struct_print_f CauseMisc_print;
+asn_constr_check_f CauseMisc_constraint;
+ber_type_decoder_f CauseMisc_decode_ber;
+der_type_encoder_f CauseMisc_encode_der;
+xer_type_decoder_f CauseMisc_decode_xer;
+xer_type_encoder_f CauseMisc_encode_xer;
+oer_type_decoder_f CauseMisc_decode_oer;
+oer_type_encoder_f CauseMisc_encode_oer;
+per_type_decoder_f CauseMisc_decode_uper;
+per_type_encoder_f CauseMisc_encode_uper;
+per_type_decoder_f CauseMisc_decode_aper;
+per_type_encoder_f CauseMisc_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseMisc_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseProtocol.h b/e2ap/headers/CauseProtocol.h
new file mode 100644
index 0000000..8b49178
--- /dev/null
+++ b/e2ap/headers/CauseProtocol.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseProtocol_H_
+#define	_CauseProtocol_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseProtocol {
+	CauseProtocol_transfer_syntax_error	= 0,
+	CauseProtocol_abstract_syntax_error_reject	= 1,
+	CauseProtocol_abstract_syntax_error_ignore_and_notify	= 2,
+	CauseProtocol_message_not_compatible_with_receiver_state	= 3,
+	CauseProtocol_semantic_error	= 4,
+	CauseProtocol_abstract_syntax_error_falsely_constructed_message	= 5,
+	CauseProtocol_unspecified	= 6
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseProtocol;
+
+/* CauseProtocol */
+typedef long	 CauseProtocol_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseProtocol_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseProtocol;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseProtocol_specs_1;
+asn_struct_free_f CauseProtocol_free;
+asn_struct_print_f CauseProtocol_print;
+asn_constr_check_f CauseProtocol_constraint;
+ber_type_decoder_f CauseProtocol_decode_ber;
+der_type_encoder_f CauseProtocol_encode_der;
+xer_type_decoder_f CauseProtocol_decode_xer;
+xer_type_encoder_f CauseProtocol_encode_xer;
+oer_type_decoder_f CauseProtocol_decode_oer;
+oer_type_encoder_f CauseProtocol_encode_oer;
+per_type_decoder_f CauseProtocol_decode_uper;
+per_type_encoder_f CauseProtocol_encode_uper;
+per_type_decoder_f CauseProtocol_decode_aper;
+per_type_encoder_f CauseProtocol_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseProtocol_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseRIC.h b/e2ap/headers/CauseRIC.h
new file mode 100644
index 0000000..92cbb95
--- /dev/null
+++ b/e2ap/headers/CauseRIC.h
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseRIC_H_
+#define	_CauseRIC_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseRIC {
+	CauseRIC_ran_function_id_Invalid	= 0,
+	CauseRIC_action_not_supported	= 1,
+	CauseRIC_excessive_actions	= 2,
+	CauseRIC_duplicate_action	= 3,
+	CauseRIC_duplicate_event	= 4,
+	CauseRIC_function_resource_limit	= 5,
+	CauseRIC_request_id_unknown	= 6,
+	CauseRIC_inconsistent_action_subsequent_action_sequence	= 7,
+	CauseRIC_control_message_invalid	= 8,
+	CauseRIC_call_process_id_invalid	= 9,
+	CauseRIC_unspecified	= 10
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseRIC;
+
+/* CauseRIC */
+typedef long	 CauseRIC_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseRIC_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseRIC;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseRIC_specs_1;
+asn_struct_free_f CauseRIC_free;
+asn_struct_print_f CauseRIC_print;
+asn_constr_check_f CauseRIC_constraint;
+ber_type_decoder_f CauseRIC_decode_ber;
+der_type_encoder_f CauseRIC_encode_der;
+xer_type_decoder_f CauseRIC_decode_xer;
+xer_type_encoder_f CauseRIC_encode_xer;
+oer_type_decoder_f CauseRIC_decode_oer;
+oer_type_encoder_f CauseRIC_encode_oer;
+per_type_decoder_f CauseRIC_decode_uper;
+per_type_encoder_f CauseRIC_encode_uper;
+per_type_decoder_f CauseRIC_decode_aper;
+per_type_encoder_f CauseRIC_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseRIC_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseRICservice.h b/e2ap/headers/CauseRICservice.h
new file mode 100644
index 0000000..99ec743
--- /dev/null
+++ b/e2ap/headers/CauseRICservice.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseRICservice_H_
+#define	_CauseRICservice_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseRICservice {
+	CauseRICservice_function_not_required	= 0,
+	CauseRICservice_excessive_functions	= 1,
+	CauseRICservice_ric_resource_limit	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseRICservice;
+
+/* CauseRICservice */
+typedef long	 CauseRICservice_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseRICservice_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseRICservice;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseRICservice_specs_1;
+asn_struct_free_f CauseRICservice_free;
+asn_struct_print_f CauseRICservice_print;
+asn_constr_check_f CauseRICservice_constraint;
+ber_type_decoder_f CauseRICservice_decode_ber;
+der_type_encoder_f CauseRICservice_encode_der;
+xer_type_decoder_f CauseRICservice_decode_xer;
+xer_type_encoder_f CauseRICservice_encode_xer;
+oer_type_decoder_f CauseRICservice_decode_oer;
+oer_type_encoder_f CauseRICservice_encode_oer;
+per_type_decoder_f CauseRICservice_decode_uper;
+per_type_encoder_f CauseRICservice_encode_uper;
+per_type_decoder_f CauseRICservice_decode_aper;
+per_type_encoder_f CauseRICservice_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseRICservice_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CauseTransport.h b/e2ap/headers/CauseTransport.h
new file mode 100644
index 0000000..5204d28
--- /dev/null
+++ b/e2ap/headers/CauseTransport.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CauseTransport_H_
+#define	_CauseTransport_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum CauseTransport {
+	CauseTransport_unspecified	= 0,
+	CauseTransport_transport_resource_unavailable	= 1
+	/*
+	 * Enumeration is extensible
+	 */
+} e_CauseTransport;
+
+/* CauseTransport */
+typedef long	 CauseTransport_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_CauseTransport_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_CauseTransport;
+extern const asn_INTEGER_specifics_t asn_SPC_CauseTransport_specs_1;
+asn_struct_free_f CauseTransport_free;
+asn_struct_print_f CauseTransport_print;
+asn_constr_check_f CauseTransport_constraint;
+ber_type_decoder_f CauseTransport_decode_ber;
+der_type_encoder_f CauseTransport_encode_der;
+xer_type_decoder_f CauseTransport_decode_xer;
+xer_type_encoder_f CauseTransport_encode_xer;
+oer_type_decoder_f CauseTransport_decode_oer;
+oer_type_encoder_f CauseTransport_encode_oer;
+per_type_decoder_f CauseTransport_decode_uper;
+per_type_encoder_f CauseTransport_encode_uper;
+per_type_decoder_f CauseTransport_decode_aper;
+per_type_encoder_f CauseTransport_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CauseTransport_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/Criticality.h b/e2ap/headers/Criticality.h
new file mode 100644
index 0000000..3d32aff
--- /dev/null
+++ b/e2ap/headers/Criticality.h
@@ -0,0 +1,54 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_Criticality_H_
+#define	_Criticality_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum Criticality {
+	Criticality_reject	= 0,
+	Criticality_ignore	= 1,
+	Criticality_notify	= 2
+} e_Criticality;
+
+/* Criticality */
+typedef long	 Criticality_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_Criticality_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Criticality;
+extern const asn_INTEGER_specifics_t asn_SPC_Criticality_specs_1;
+asn_struct_free_f Criticality_free;
+asn_struct_print_f Criticality_print;
+asn_constr_check_f Criticality_constraint;
+ber_type_decoder_f Criticality_decode_ber;
+der_type_encoder_f Criticality_encode_der;
+xer_type_decoder_f Criticality_decode_xer;
+xer_type_encoder_f Criticality_encode_xer;
+oer_type_decoder_f Criticality_decode_oer;
+oer_type_encoder_f Criticality_encode_oer;
+per_type_decoder_f Criticality_decode_uper;
+per_type_encoder_f Criticality_encode_uper;
+per_type_decoder_f Criticality_decode_aper;
+per_type_encoder_f Criticality_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Criticality_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CriticalityDiagnostics-IE-Item.h b/e2ap/headers/CriticalityDiagnostics-IE-Item.h
new file mode 100644
index 0000000..5992ce7
--- /dev/null
+++ b/e2ap/headers/CriticalityDiagnostics-IE-Item.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CriticalityDiagnostics_IE_Item_H_
+#define	_CriticalityDiagnostics_IE_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "Criticality.h"
+#include "ProtocolIE-ID.h"
+#include "TypeOfError.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* CriticalityDiagnostics-IE-Item */
+typedef struct CriticalityDiagnostics_IE_Item {
+	Criticality_t	 iECriticality;
+	ProtocolIE_ID_t	 iE_ID;
+	TypeOfError_t	 typeOfError;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} CriticalityDiagnostics_IE_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_IE_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_Item_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CriticalityDiagnostics_IE_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CriticalityDiagnostics-IE-List.h b/e2ap/headers/CriticalityDiagnostics-IE-List.h
new file mode 100644
index 0000000..b823da4
--- /dev/null
+++ b/e2ap/headers/CriticalityDiagnostics-IE-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CriticalityDiagnostics_IE_List_H_
+#define	_CriticalityDiagnostics_IE_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct CriticalityDiagnostics_IE_Item;
+
+/* CriticalityDiagnostics-IE-List */
+typedef struct CriticalityDiagnostics_IE_List {
+	A_SEQUENCE_OF(struct CriticalityDiagnostics_IE_Item) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} CriticalityDiagnostics_IE_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_List;
+extern asn_SET_OF_specifics_t asn_SPC_CriticalityDiagnostics_IE_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_List_1[1];
+extern asn_per_constraints_t asn_PER_type_CriticalityDiagnostics_IE_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CriticalityDiagnostics_IE_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/CriticalityDiagnostics.h b/e2ap/headers/CriticalityDiagnostics.h
new file mode 100644
index 0000000..ae04eef
--- /dev/null
+++ b/e2ap/headers/CriticalityDiagnostics.h
@@ -0,0 +1,54 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_CriticalityDiagnostics_H_
+#define	_CriticalityDiagnostics_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProcedureCode.h"
+#include "TriggeringMessage.h"
+#include "Criticality.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RICrequestID;
+struct CriticalityDiagnostics_IE_List;
+
+/* CriticalityDiagnostics */
+typedef struct CriticalityDiagnostics {
+	ProcedureCode_t	*procedureCode;	/* OPTIONAL */
+	TriggeringMessage_t	*triggeringMessage;	/* OPTIONAL */
+	Criticality_t	*procedureCriticality;	/* OPTIONAL */
+	struct RICrequestID	*ricRequestorID;	/* OPTIONAL */
+	struct CriticalityDiagnostics_IE_List	*iEsCriticalityDiagnostics;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} CriticalityDiagnostics_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics;
+extern asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_specs_1;
+extern asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_1[5];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CriticalityDiagnostics_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/E2AP-PDU.h b/e2ap/headers/E2AP-PDU.h
new file mode 100644
index 0000000..1cf3fc7
--- /dev/null
+++ b/e2ap/headers/E2AP-PDU.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_E2AP_PDU_H_
+#define	_E2AP_PDU_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum E2AP_PDU_PR {
+	E2AP_PDU_PR_NOTHING,	/* No components present */
+	E2AP_PDU_PR_initiatingMessage,
+	E2AP_PDU_PR_successfulOutcome,
+	E2AP_PDU_PR_unsuccessfulOutcome
+	/* Extensions may appear below */
+	
+} E2AP_PDU_PR;
+
+/* Forward declarations */
+struct InitiatingMessage;
+struct SuccessfulOutcome;
+struct UnsuccessfulOutcome;
+
+/* E2AP-PDU */
+typedef struct E2AP_PDU {
+	E2AP_PDU_PR present;
+	union E2AP_PDU_u {
+		struct InitiatingMessage	*initiatingMessage;
+		struct SuccessfulOutcome	*successfulOutcome;
+		struct UnsuccessfulOutcome	*unsuccessfulOutcome;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2AP_PDU_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2AP_PDU;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2AP_PDU_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/E2setupFailure.h b/e2ap/headers/E2setupFailure.h
new file mode 100644
index 0000000..9bfcf0b
--- /dev/null
+++ b/e2ap/headers/E2setupFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_E2setupFailure_H_
+#define	_E2setupFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2setupFailure */
+typedef struct E2setupFailure {
+	ProtocolIE_Container_87P13_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2setupFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2setupFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/E2setupRequest.h b/e2ap/headers/E2setupRequest.h
new file mode 100644
index 0000000..c70a6a5
--- /dev/null
+++ b/e2ap/headers/E2setupRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_E2setupRequest_H_
+#define	_E2setupRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2setupRequest */
+typedef struct E2setupRequest {
+	ProtocolIE_Container_87P11_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2setupRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2setupRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/E2setupResponse.h b/e2ap/headers/E2setupResponse.h
new file mode 100644
index 0000000..f8920af
--- /dev/null
+++ b/e2ap/headers/E2setupResponse.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_E2setupResponse_H_
+#define	_E2setupResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* E2setupResponse */
+typedef struct E2setupResponse {
+	ProtocolIE_Container_87P12_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_E2setupResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _E2setupResponse_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ENB-ID-Choice.h b/e2ap/headers/ENB-ID-Choice.h
new file mode 100644
index 0000000..0ccc3ee
--- /dev/null
+++ b/e2ap/headers/ENB-ID-Choice.h
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ENB_ID_Choice_H_
+#define	_ENB_ID_Choice_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENB_ID_Choice_PR {
+	ENB_ID_Choice_PR_NOTHING,	/* No components present */
+	ENB_ID_Choice_PR_enb_ID_macro,
+	ENB_ID_Choice_PR_enb_ID_shortmacro,
+	ENB_ID_Choice_PR_enb_ID_longmacro
+	/* Extensions may appear below */
+	
+} ENB_ID_Choice_PR;
+
+/* ENB-ID-Choice */
+typedef struct ENB_ID_Choice {
+	ENB_ID_Choice_PR present;
+	union ENB_ID_Choice_u {
+		BIT_STRING_t	 enb_ID_macro;
+		BIT_STRING_t	 enb_ID_shortmacro;
+		BIT_STRING_t	 enb_ID_longmacro;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENB_ID_Choice_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENB_ID_Choice;
+extern asn_CHOICE_specifics_t asn_SPC_ENB_ID_Choice_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENB_ID_Choice_1[3];
+extern asn_per_constraints_t asn_PER_type_ENB_ID_Choice_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENB_ID_Choice_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ENB-ID.h b/e2ap/headers/ENB-ID.h
new file mode 100644
index 0000000..500a7d2
--- /dev/null
+++ b/e2ap/headers/ENB-ID.h
@@ -0,0 +1,61 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ENB_ID_H_
+#define	_ENB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENB_ID_PR {
+	ENB_ID_PR_NOTHING,	/* No components present */
+	ENB_ID_PR_macro_eNB_ID,
+	ENB_ID_PR_home_eNB_ID,
+	/* Extensions may appear below */
+	ENB_ID_PR_short_Macro_eNB_ID,
+	ENB_ID_PR_long_Macro_eNB_ID
+} ENB_ID_PR;
+
+/* ENB-ID */
+typedef struct ENB_ID {
+	ENB_ID_PR present;
+	union ENB_ID_u {
+		BIT_STRING_t	 macro_eNB_ID;
+		BIT_STRING_t	 home_eNB_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+		BIT_STRING_t	 short_Macro_eNB_ID;
+		BIT_STRING_t	 long_Macro_eNB_ID;
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENB_ID;
+extern asn_CHOICE_specifics_t asn_SPC_ENB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENB_ID_1[4];
+extern asn_per_constraints_t asn_PER_type_ENB_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ENGNB-ID.h b/e2ap/headers/ENGNB-ID.h
new file mode 100644
index 0000000..58a8c7c
--- /dev/null
+++ b/e2ap/headers/ENGNB-ID.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ENGNB_ID_H_
+#define	_ENGNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum ENGNB_ID_PR {
+	ENGNB_ID_PR_NOTHING,	/* No components present */
+	ENGNB_ID_PR_gNB_ID
+	/* Extensions may appear below */
+	
+} ENGNB_ID_PR;
+
+/* ENGNB-ID */
+typedef struct ENGNB_ID {
+	ENGNB_ID_PR present;
+	union ENGNB_ID_u {
+		BIT_STRING_t	 gNB_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ENGNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ENGNB_ID;
+extern asn_CHOICE_specifics_t asn_SPC_ENGNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_ENGNB_ID_1[1];
+extern asn_per_constraints_t asn_PER_type_ENGNB_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ENGNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ErrorIndication.h b/e2ap/headers/ErrorIndication.h
new file mode 100644
index 0000000..88e402e
--- /dev/null
+++ b/e2ap/headers/ErrorIndication.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ErrorIndication_H_
+#define	_ErrorIndication_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ErrorIndication */
+typedef struct ErrorIndication {
+	ProtocolIE_Container_87P10_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ErrorIndication_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ErrorIndication;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ErrorIndication_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GNB-CU-UP-ID.h b/e2ap/headers/GNB-CU-UP-ID.h
new file mode 100644
index 0000000..d7df7d8
--- /dev/null
+++ b/e2ap/headers/GNB-CU-UP-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GNB_CU_UP_ID_H_
+#define	_GNB_CU_UP_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GNB-CU-UP-ID */
+typedef INTEGER_t	 GNB_CU_UP_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_GNB_CU_UP_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_GNB_CU_UP_ID;
+asn_struct_free_f GNB_CU_UP_ID_free;
+asn_struct_print_f GNB_CU_UP_ID_print;
+asn_constr_check_f GNB_CU_UP_ID_constraint;
+ber_type_decoder_f GNB_CU_UP_ID_decode_ber;
+der_type_encoder_f GNB_CU_UP_ID_encode_der;
+xer_type_decoder_f GNB_CU_UP_ID_decode_xer;
+xer_type_encoder_f GNB_CU_UP_ID_encode_xer;
+oer_type_decoder_f GNB_CU_UP_ID_decode_oer;
+oer_type_encoder_f GNB_CU_UP_ID_encode_oer;
+per_type_decoder_f GNB_CU_UP_ID_decode_uper;
+per_type_encoder_f GNB_CU_UP_ID_encode_uper;
+per_type_decoder_f GNB_CU_UP_ID_decode_aper;
+per_type_encoder_f GNB_CU_UP_ID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_CU_UP_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GNB-DU-ID.h b/e2ap/headers/GNB-DU-ID.h
new file mode 100644
index 0000000..b0889fe
--- /dev/null
+++ b/e2ap/headers/GNB-DU-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GNB_DU_ID_H_
+#define	_GNB_DU_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GNB-DU-ID */
+typedef INTEGER_t	 GNB_DU_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_GNB_DU_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_GNB_DU_ID;
+asn_struct_free_f GNB_DU_ID_free;
+asn_struct_print_f GNB_DU_ID_print;
+asn_constr_check_f GNB_DU_ID_constraint;
+ber_type_decoder_f GNB_DU_ID_decode_ber;
+der_type_encoder_f GNB_DU_ID_encode_der;
+xer_type_decoder_f GNB_DU_ID_decode_xer;
+xer_type_encoder_f GNB_DU_ID_encode_xer;
+oer_type_decoder_f GNB_DU_ID_decode_oer;
+oer_type_encoder_f GNB_DU_ID_encode_oer;
+per_type_decoder_f GNB_DU_ID_decode_uper;
+per_type_encoder_f GNB_DU_ID_encode_uper;
+per_type_decoder_f GNB_DU_ID_decode_aper;
+per_type_encoder_f GNB_DU_ID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_DU_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GNB-ID-Choice.h b/e2ap/headers/GNB-ID-Choice.h
new file mode 100644
index 0000000..ec65f85
--- /dev/null
+++ b/e2ap/headers/GNB-ID-Choice.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GNB_ID_Choice_H_
+#define	_GNB_ID_Choice_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <BIT_STRING.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum GNB_ID_Choice_PR {
+	GNB_ID_Choice_PR_NOTHING,	/* No components present */
+	GNB_ID_Choice_PR_gnb_ID
+	/* Extensions may appear below */
+	
+} GNB_ID_Choice_PR;
+
+/* GNB-ID-Choice */
+typedef struct GNB_ID_Choice {
+	GNB_ID_Choice_PR present;
+	union GNB_ID_Choice_u {
+		BIT_STRING_t	 gnb_ID;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GNB_ID_Choice_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GNB_ID_Choice;
+extern asn_CHOICE_specifics_t asn_SPC_GNB_ID_Choice_specs_1;
+extern asn_TYPE_member_t asn_MBR_GNB_ID_Choice_1[1];
+extern asn_per_constraints_t asn_PER_type_GNB_ID_Choice_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GNB_ID_Choice_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-ID.h b/e2ap/headers/GlobalE2node-ID.h
new file mode 100644
index 0000000..843e1c2
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-ID.h
@@ -0,0 +1,67 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_ID_H_
+#define	_GlobalE2node_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum GlobalE2node_ID_PR {
+	GlobalE2node_ID_PR_NOTHING,	/* No components present */
+	GlobalE2node_ID_PR_gNB,
+	GlobalE2node_ID_PR_en_gNB,
+	GlobalE2node_ID_PR_ng_eNB,
+	GlobalE2node_ID_PR_eNB
+	/* Extensions may appear below */
+	
+} GlobalE2node_ID_PR;
+
+/* Forward declarations */
+struct GlobalE2node_gNB_ID;
+struct GlobalE2node_en_gNB_ID;
+struct GlobalE2node_ng_eNB_ID;
+struct GlobalE2node_eNB_ID;
+
+/* GlobalE2node-ID */
+typedef struct GlobalE2node_ID {
+	GlobalE2node_ID_PR present;
+	union GlobalE2node_ID_u {
+		struct GlobalE2node_gNB_ID	*gNB;
+		struct GlobalE2node_en_gNB_ID	*en_gNB;
+		struct GlobalE2node_ng_eNB_ID	*ng_eNB;
+		struct GlobalE2node_eNB_ID	*eNB;
+		/*
+		 * This type is extensible,
+		 * possible extensions are below.
+		 */
+	} choice;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ID;
+extern asn_CHOICE_specifics_t asn_SPC_GlobalE2node_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_ID_1[4];
+extern asn_per_constraints_t asn_PER_type_GlobalE2node_ID_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-eNB-ID.h b/e2ap/headers/GlobalE2node-eNB-ID.h
new file mode 100644
index 0000000..c92e774
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-eNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_eNB_ID_H_
+#define	_GlobalE2node_eNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalENB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-eNB-ID */
+typedef struct GlobalE2node_eNB_ID {
+	GlobalENB_ID_t	 global_eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_eNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_eNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_eNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_eNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_eNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-en-gNB-ID.h b/e2ap/headers/GlobalE2node-en-gNB-ID.h
new file mode 100644
index 0000000..b13588a
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-en-gNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_en_gNB_ID_H_
+#define	_GlobalE2node_en_gNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalenGNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-en-gNB-ID */
+typedef struct GlobalE2node_en_gNB_ID {
+	GlobalenGNB_ID_t	 global_gNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_en_gNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_en_gNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_en_gNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_en_gNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_en_gNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-gNB-ID.h b/e2ap/headers/GlobalE2node-gNB-ID.h
new file mode 100644
index 0000000..a2121b9
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-gNB-ID.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_gNB_ID_H_
+#define	_GlobalE2node_gNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalgNB-ID.h"
+#include "GNB-CU-UP-ID.h"
+#include "GNB-DU-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-gNB-ID */
+typedef struct GlobalE2node_gNB_ID {
+	GlobalgNB_ID_t	 global_gNB_ID;
+	GNB_CU_UP_ID_t	*gNB_CU_UP_ID;	/* OPTIONAL */
+	GNB_DU_ID_t	*gNB_DU_ID;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_gNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_gNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_gNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_gNB_ID_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_gNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalE2node-ng-eNB-ID.h b/e2ap/headers/GlobalE2node-ng-eNB-ID.h
new file mode 100644
index 0000000..7a3e0f5
--- /dev/null
+++ b/e2ap/headers/GlobalE2node-ng-eNB-ID.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalE2node_ng_eNB_ID_H_
+#define	_GlobalE2node_ng_eNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "GlobalngeNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalE2node-ng-eNB-ID */
+typedef struct GlobalE2node_ng_eNB_ID {
+	GlobalngeNB_ID_t	 global_ng_eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalE2node_ng_eNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ng_eNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_ng_eNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalE2node_ng_eNB_ID_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalE2node_ng_eNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalENB-ID.h b/e2ap/headers/GlobalENB-ID.h
new file mode 100644
index 0000000..2b6cf1c
--- /dev/null
+++ b/e2ap/headers/GlobalENB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalENB_ID_H_
+#define	_GlobalENB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalENB-ID */
+typedef struct GlobalENB_ID {
+	PLMN_Identity_t	 pLMN_Identity;
+	ENB_ID_t	 eNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalENB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalENB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalENB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalENB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalENB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalRIC-ID.h b/e2ap/headers/GlobalRIC-ID.h
new file mode 100644
index 0000000..ad389c3
--- /dev/null
+++ b/e2ap/headers/GlobalRIC-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalRIC_ID_H_
+#define	_GlobalRIC_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include <BIT_STRING.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalRIC-ID */
+typedef struct GlobalRIC_ID {
+	PLMN_Identity_t	 pLMN_Identity;
+	BIT_STRING_t	 ric_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalRIC_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalRIC_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalRIC_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalRIC_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalRIC_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalenGNB-ID.h b/e2ap/headers/GlobalenGNB-ID.h
new file mode 100644
index 0000000..7df68b1
--- /dev/null
+++ b/e2ap/headers/GlobalenGNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalenGNB_ID_H_
+#define	_GlobalenGNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENGNB-ID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalenGNB-ID */
+typedef struct GlobalenGNB_ID {
+	PLMN_Identity_t	 pLMN_Identity;
+	ENGNB_ID_t	 gNB_ID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalenGNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalenGNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalenGNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalenGNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalenGNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalgNB-ID.h b/e2ap/headers/GlobalgNB-ID.h
new file mode 100644
index 0000000..242edf2
--- /dev/null
+++ b/e2ap/headers/GlobalgNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalgNB_ID_H_
+#define	_GlobalgNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "GNB-ID-Choice.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalgNB-ID */
+typedef struct GlobalgNB_ID {
+	PLMN_Identity_t	 plmn_id;
+	GNB_ID_Choice_t	 gnb_id;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalgNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalgNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalgNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalgNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalgNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/GlobalngeNB-ID.h b/e2ap/headers/GlobalngeNB-ID.h
new file mode 100644
index 0000000..8aba4cc
--- /dev/null
+++ b/e2ap/headers/GlobalngeNB-ID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_GlobalngeNB_ID_H_
+#define	_GlobalngeNB_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "PLMN-Identity.h"
+#include "ENB-ID-Choice.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GlobalngeNB-ID */
+typedef struct GlobalngeNB_ID {
+	PLMN_Identity_t	 plmn_id;
+	ENB_ID_Choice_t	 enb_id;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} GlobalngeNB_ID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_GlobalngeNB_ID;
+extern asn_SEQUENCE_specifics_t asn_SPC_GlobalngeNB_ID_specs_1;
+extern asn_TYPE_member_t asn_MBR_GlobalngeNB_ID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _GlobalngeNB_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/INTEGER.h b/e2ap/headers/INTEGER.h
new file mode 100644
index 0000000..f776c07
--- /dev/null
+++ b/e2ap/headers/INTEGER.h
@@ -0,0 +1,108 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_INTEGER_H_
+#define	_INTEGER_H_
+
+#include <asn_application.h>
+#include <asn_codecs_prim.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef ASN__PRIMITIVE_TYPE_t INTEGER_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_INTEGER;
+extern asn_TYPE_operation_t asn_OP_INTEGER;
+
+/* Map with <tag> to integer value association */
+typedef struct asn_INTEGER_enum_map_s {
+	long		 nat_value;	/* associated native integer value */
+	size_t		 enum_len;	/* strlen("tag") */
+	const char	*enum_name;	/* "tag" */
+} asn_INTEGER_enum_map_t;
+
+/* This type describes an enumeration for INTEGER and ENUMERATED types */
+typedef struct asn_INTEGER_specifics_s {
+	const asn_INTEGER_enum_map_t *value2enum;	/* N -> "tag"; sorted by N */
+	const unsigned int *enum2value;		/* "tag" => N; sorted by tag */
+	int map_count;				/* Elements in either map */
+	int extension;				/* This map is extensible */
+	int strict_enumeration;			/* Enumeration set is fixed */
+	int field_width;			/* Size of native integer */
+	int field_unsigned;			/* Signed=0, unsigned=1 */
+} asn_INTEGER_specifics_t;
+
+#define INTEGER_free    ASN__PRIMITIVE_TYPE_free
+#define INTEGER_decode_ber	ber_decode_primitive
+#define INTEGER_constraint	asn_generic_no_constraint
+asn_struct_print_f INTEGER_print;
+asn_struct_compare_f INTEGER_compare;
+der_type_encoder_f INTEGER_encode_der;
+xer_type_decoder_f INTEGER_decode_xer;
+xer_type_encoder_f INTEGER_encode_xer;
+oer_type_decoder_f INTEGER_decode_oer;
+oer_type_encoder_f INTEGER_encode_oer;
+per_type_decoder_f INTEGER_decode_uper;
+per_type_encoder_f INTEGER_encode_uper;
+per_type_decoder_f INTEGER_decode_aper;
+per_type_encoder_f INTEGER_encode_aper;
+asn_random_fill_f  INTEGER_random_fill;
+
+/***********************************
+ * Some handy conversion routines. *
+ ***********************************/
+
+/*
+ * Natiwe size-independent conversion of native integers to/from INTEGER.
+ * (l_size) is in bytes.
+ * Returns 0 if it was possible to convert, -1 otherwise.
+ * -1/EINVAL: Mandatory argument missing
+ * -1/ERANGE: Value encoded is out of range for long representation
+ * -1/ENOMEM: Memory allocation failed (in asn_*2INTEGER()).
+ */
+int asn_INTEGER2imax(const INTEGER_t *i, intmax_t *l);
+int asn_INTEGER2umax(const INTEGER_t *i, uintmax_t *l);
+int asn_imax2INTEGER(INTEGER_t *i, intmax_t l);
+int asn_umax2INTEGER(INTEGER_t *i, uintmax_t l);
+
+/*
+ * Size-specific conversion helpers.
+ */
+int asn_INTEGER2long(const INTEGER_t *i, long *l);
+int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l);
+int asn_long2INTEGER(INTEGER_t *i, long l);
+int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l);
+int asn_int642INTEGER(INTEGER_t *i, int64_t l);
+int asn_uint642INTEGER(INTEGER_t *i, uint64_t l);
+
+/* A version of strtol/strtoimax(3) with nicer error reporting. */
+enum asn_strtox_result_e {
+    ASN_STRTOX_ERROR_RANGE = -3,  /* Input outside of supported numeric range */
+    ASN_STRTOX_ERROR_INVAL = -2,  /* Invalid data encountered (e.g., "+-") */
+    ASN_STRTOX_EXPECT_MORE = -1,  /* More data expected (e.g. "+") */
+    ASN_STRTOX_OK          =  0,  /* Conversion succeded, number ends at (*end) */
+    ASN_STRTOX_EXTRA_DATA  =  1   /* Conversion succeded, but the string has extra stuff */
+};
+enum asn_strtox_result_e asn_strtol_lim(const char *str, const char **end,
+                                        long *l);
+enum asn_strtox_result_e asn_strtoul_lim(const char *str, const char **end,
+                                         unsigned long *l);
+enum asn_strtox_result_e asn_strtoimax_lim(const char *str, const char **end,
+                                           intmax_t *l);
+enum asn_strtox_result_e asn_strtoumax_lim(const char *str, const char **end,
+                                           uintmax_t *l);
+
+/*
+ * Convert the integer value into the corresponding enumeration map entry.
+ */
+const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(
+    const asn_INTEGER_specifics_t *specs, long value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _INTEGER_H_ */
diff --git a/e2ap/headers/InitiatingMessage.h b/e2ap/headers/InitiatingMessage.h
new file mode 100644
index 0000000..fd10bc7
--- /dev/null
+++ b/e2ap/headers/InitiatingMessage.h
@@ -0,0 +1,97 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_InitiatingMessage_H_
+#define	_InitiatingMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProcedureCode.h"
+#include "Criticality.h"
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "RICsubscriptionRequest.h"
+#include "RICsubscriptionResponse.h"
+#include "RICsubscriptionFailure.h"
+#include "RICsubscriptionDeleteRequest.h"
+#include "RICsubscriptionDeleteResponse.h"
+#include "RICsubscriptionDeleteFailure.h"
+#include "RICserviceUpdate.h"
+#include "RICserviceUpdateAcknowledge.h"
+#include "RICserviceUpdateFailure.h"
+#include "RICcontrolRequest.h"
+#include "RICcontrolAcknowledge.h"
+#include "RICcontrolFailure.h"
+#include "E2setupRequest.h"
+#include "E2setupResponse.h"
+#include "E2setupFailure.h"
+#include "ResetRequest.h"
+#include "ResetResponse.h"
+#include "RICindication.h"
+#include "RICserviceQuery.h"
+#include "ErrorIndication.h"
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum InitiatingMessage__value_PR {
+	InitiatingMessage__value_PR_NOTHING,	/* No components present */
+	InitiatingMessage__value_PR_RICsubscriptionRequest,
+	InitiatingMessage__value_PR_RICsubscriptionDeleteRequest,
+	InitiatingMessage__value_PR_RICserviceUpdate,
+	InitiatingMessage__value_PR_RICcontrolRequest,
+	InitiatingMessage__value_PR_E2setupRequest,
+	InitiatingMessage__value_PR_ResetRequest,
+	InitiatingMessage__value_PR_RICindication,
+	InitiatingMessage__value_PR_RICserviceQuery,
+	InitiatingMessage__value_PR_ErrorIndication
+} InitiatingMessage__value_PR;
+
+/* InitiatingMessage */
+typedef struct InitiatingMessage {
+	ProcedureCode_t	 procedureCode;
+	Criticality_t	 criticality;
+	struct InitiatingMessage__value {
+		InitiatingMessage__value_PR present;
+		union InitiatingMessage__value_u {
+			RICsubscriptionRequest_t	 RICsubscriptionRequest;
+			RICsubscriptionDeleteRequest_t	 RICsubscriptionDeleteRequest;
+			RICserviceUpdate_t	 RICserviceUpdate;
+			RICcontrolRequest_t	 RICcontrolRequest;
+			E2setupRequest_t	 E2setupRequest;
+			ResetRequest_t	 ResetRequest;
+			RICindication_t	 RICindication;
+			RICserviceQuery_t	 RICserviceQuery;
+			ErrorIndication_t	 ErrorIndication;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} InitiatingMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_InitiatingMessage;
+extern asn_SEQUENCE_specifics_t asn_SPC_InitiatingMessage_specs_1;
+extern asn_TYPE_member_t asn_MBR_InitiatingMessage_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _InitiatingMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/NativeEnumerated.h b/e2ap/headers/NativeEnumerated.h
new file mode 100644
index 0000000..459f0e6
--- /dev/null
+++ b/e2ap/headers/NativeEnumerated.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This type differs from the standard ENUMERATED in that it is modelled using
+ * the fixed machine type (long, int, short), so it can hold only values of
+ * limited length. There is no type (i.e., NativeEnumerated_t, any integer type
+ * will do).
+ * This type may be used when integer range is limited by subtype constraints.
+ */
+#ifndef	_NativeEnumerated_H_
+#define	_NativeEnumerated_H_
+
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated;
+extern asn_TYPE_operation_t asn_OP_NativeEnumerated;
+
+xer_type_encoder_f NativeEnumerated_encode_xer;
+oer_type_decoder_f NativeEnumerated_decode_oer;
+oer_type_encoder_f NativeEnumerated_encode_oer;
+per_type_decoder_f NativeEnumerated_decode_uper;
+per_type_encoder_f NativeEnumerated_encode_uper;
+per_type_decoder_f NativeEnumerated_decode_aper;
+per_type_encoder_f NativeEnumerated_encode_aper;
+
+#define NativeEnumerated_free       NativeInteger_free
+#define NativeEnumerated_print      NativeInteger_print
+#define NativeEnumerated_compare    NativeInteger_compare
+#define NativeEnumerated_random_fill NativeInteger_random_fill
+#define NativeEnumerated_constraint asn_generic_no_constraint
+#define NativeEnumerated_decode_ber NativeInteger_decode_ber
+#define NativeEnumerated_encode_der NativeInteger_encode_der
+#define NativeEnumerated_decode_xer NativeInteger_decode_xer
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NativeEnumerated_H_ */
diff --git a/e2ap/headers/NativeInteger.h b/e2ap/headers/NativeInteger.h
new file mode 100644
index 0000000..c74406a
--- /dev/null
+++ b/e2ap/headers/NativeInteger.h
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This type differs from the standard INTEGER in that it is modelled using
+ * the fixed machine type (long, int, short), so it can hold only values of
+ * limited length. There is no type (i.e., NativeInteger_t, any integer type
+ * will do).
+ * This type may be used when integer range is limited by subtype constraints.
+ */
+#ifndef	_NativeInteger_H_
+#define	_NativeInteger_H_
+
+#include <asn_application.h>
+#include <INTEGER.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern asn_TYPE_descriptor_t asn_DEF_NativeInteger;
+extern asn_TYPE_operation_t asn_OP_NativeInteger;
+
+asn_struct_free_f  NativeInteger_free;
+asn_struct_print_f NativeInteger_print;
+asn_struct_compare_f NativeInteger_compare;
+ber_type_decoder_f NativeInteger_decode_ber;
+der_type_encoder_f NativeInteger_encode_der;
+xer_type_decoder_f NativeInteger_decode_xer;
+xer_type_encoder_f NativeInteger_encode_xer;
+oer_type_decoder_f NativeInteger_decode_oer;
+oer_type_encoder_f NativeInteger_encode_oer;
+per_type_decoder_f NativeInteger_decode_uper;
+per_type_encoder_f NativeInteger_encode_uper;
+per_type_decoder_f NativeInteger_decode_aper;
+per_type_encoder_f NativeInteger_encode_aper;
+asn_random_fill_f  NativeInteger_random_fill;
+
+#define NativeInteger_constraint  asn_generic_no_constraint
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _NativeInteger_H_ */
diff --git a/e2ap/headers/OCTET_STRING.h b/e2ap/headers/OCTET_STRING.h
new file mode 100644
index 0000000..c2f8bae
--- /dev/null
+++ b/e2ap/headers/OCTET_STRING.h
@@ -0,0 +1,102 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_OCTET_STRING_H_
+#define	_OCTET_STRING_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct OCTET_STRING {
+	uint8_t *buf;	/* Buffer with consecutive OCTET_STRING bits */
+	size_t size;	/* Size of the buffer */
+
+	asn_struct_ctx_t _asn_ctx;	/* Parsing across buffer boundaries */
+} OCTET_STRING_t;
+
+extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING;
+extern asn_TYPE_operation_t asn_OP_OCTET_STRING;
+
+asn_struct_free_f OCTET_STRING_free;
+asn_struct_print_f OCTET_STRING_print;
+asn_struct_print_f OCTET_STRING_print_utf8;
+asn_struct_compare_f OCTET_STRING_compare;
+ber_type_decoder_f OCTET_STRING_decode_ber;
+der_type_encoder_f OCTET_STRING_encode_der;
+xer_type_decoder_f OCTET_STRING_decode_xer_hex;		/* Hexadecimal */
+xer_type_decoder_f OCTET_STRING_decode_xer_binary;	/* 01010111010 */
+xer_type_decoder_f OCTET_STRING_decode_xer_utf8;	/* ASCII/UTF-8 */
+xer_type_encoder_f OCTET_STRING_encode_xer;
+xer_type_encoder_f OCTET_STRING_encode_xer_utf8;
+oer_type_decoder_f OCTET_STRING_decode_oer;
+oer_type_encoder_f OCTET_STRING_encode_oer;
+per_type_decoder_f OCTET_STRING_decode_uper;
+per_type_encoder_f OCTET_STRING_encode_uper;
+per_type_decoder_f OCTET_STRING_decode_aper;
+per_type_encoder_f OCTET_STRING_encode_aper;
+asn_random_fill_f  OCTET_STRING_random_fill;
+
+#define OCTET_STRING_constraint  asn_generic_no_constraint
+#define OCTET_STRING_decode_xer  OCTET_STRING_decode_xer_hex
+
+/******************************
+ * Handy conversion routines. *
+ ******************************/
+
+/*
+ * This function clears the previous value of the OCTET STRING (if any)
+ * and then allocates a new memory with the specified content (str/size).
+ * If size = -1, the size of the original string will be determined
+ * using strlen(str).
+ * If str equals to NULL, the function will silently clear the
+ * current contents of the OCTET STRING.
+ * Returns 0 if it was possible to perform operation, -1 otherwise.
+ */
+int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size);
+
+/* Handy conversion from the C string into the OCTET STRING. */
+#define	OCTET_STRING_fromString(s, str)	OCTET_STRING_fromBuf(s, str, -1)
+
+/*
+ * Allocate and fill the new OCTET STRING and return a pointer to the newly
+ * allocated object. NULL is permitted in str: the function will just allocate
+ * empty OCTET STRING.
+ */
+OCTET_STRING_t *OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td,
+                                         const char *str, int size);
+
+/****************************
+ * Internally useful stuff. *
+ ****************************/
+
+typedef struct asn_OCTET_STRING_specifics_s {
+    /*
+     * Target structure description.
+     */
+    unsigned struct_size;   /* Size of the structure */
+    unsigned ctx_offset;    /* Offset of the asn_struct_ctx_t member */
+
+    enum asn_OS_Subvariant {
+        ASN_OSUBV_ANY, /* The open type (ANY) */
+        ASN_OSUBV_BIT, /* BIT STRING */
+        ASN_OSUBV_STR, /* String types, not {BMP,Universal}String  */
+        ASN_OSUBV_U16, /* 16-bit character (BMPString) */
+        ASN_OSUBV_U32  /* 32-bit character (UniversalString) */
+    } subvariant;
+} asn_OCTET_STRING_specifics_t;
+
+extern asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs;
+
+size_t OCTET_STRING_random_length_constrained(
+    const asn_TYPE_descriptor_t *, const asn_encoding_constraints_t *,
+    size_t max_length);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _OCTET_STRING_H_ */
diff --git a/e2ap/headers/OPEN_TYPE.h b/e2ap/headers/OPEN_TYPE.h
new file mode 100644
index 0000000..b0d023c
--- /dev/null
+++ b/e2ap/headers/OPEN_TYPE.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 2017-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_OPEN_TYPE_H
+#define ASN_OPEN_TYPE_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define OPEN_TYPE_free CHOICE_free
+#define OPEN_TYPE_print CHOICE_print
+#define OPEN_TYPE_compare CHOICE_compare
+#define OPEN_TYPE_constraint CHOICE_constraint
+#define OPEN_TYPE_decode_ber NULL
+#define OPEN_TYPE_encode_der CHOICE_encode_der
+#define OPEN_TYPE_decode_xer NULL
+#define OPEN_TYPE_encode_xer CHOICE_encode_xer
+#define OPEN_TYPE_decode_oer NULL
+#define OPEN_TYPE_encode_oer CHOICE_encode_oer
+#define OPEN_TYPE_decode_uper NULL
+#define OPEN_TYPE_decode_aper NULL
+
+extern asn_TYPE_operation_t asn_OP_OPEN_TYPE;
+
+/*
+ * Decode an Open Type which is potentially constraiend
+ * by the other members of the parent structure.
+ */
+asn_dec_rval_t OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 const asn_TYPE_member_t *element,
+                                 const void *ptr, size_t size);
+
+asn_dec_rval_t OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 const asn_TYPE_member_t *element,
+                                 const void *ptr, size_t size);
+
+asn_dec_rval_t OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                 const asn_TYPE_descriptor_t *parent_type,
+                                 void *parent_structure,
+                                 asn_TYPE_member_t *element, const void *ptr,
+                                 size_t size);
+
+asn_dec_rval_t OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *parent_type,
+                                  void *parent_structure,
+                                  const asn_TYPE_member_t *element,
+                                  asn_per_data_t *pd);
+
+asn_dec_rval_t OPEN_TYPE_aper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *parent_type,
+                                  void *parent_structure,
+                                  const asn_TYPE_member_t *element,
+                                  asn_per_data_t *pd);
+
+asn_enc_rval_t OPEN_TYPE_encode_uper(
+    const asn_TYPE_descriptor_t *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+asn_enc_rval_t OPEN_TYPE_encode_aper(
+    const asn_TYPE_descriptor_t *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_OPEN_TYPE_H */
diff --git a/e2ap/headers/PLMN-Identity.h b/e2ap/headers/PLMN-Identity.h
new file mode 100644
index 0000000..2fb1a85
--- /dev/null
+++ b/e2ap/headers/PLMN-Identity.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_PLMN_Identity_H_
+#define	_PLMN_Identity_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PLMN-Identity */
+typedef OCTET_STRING_t	 PLMN_Identity_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_PLMN_Identity_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_PLMN_Identity;
+asn_struct_free_f PLMN_Identity_free;
+asn_struct_print_f PLMN_Identity_print;
+asn_constr_check_f PLMN_Identity_constraint;
+ber_type_decoder_f PLMN_Identity_decode_ber;
+der_type_encoder_f PLMN_Identity_encode_der;
+xer_type_decoder_f PLMN_Identity_decode_xer;
+xer_type_encoder_f PLMN_Identity_encode_xer;
+oer_type_decoder_f PLMN_Identity_decode_oer;
+oer_type_encoder_f PLMN_Identity_encode_oer;
+per_type_decoder_f PLMN_Identity_decode_uper;
+per_type_encoder_f PLMN_Identity_encode_uper;
+per_type_decoder_f PLMN_Identity_decode_aper;
+per_type_encoder_f PLMN_Identity_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PLMN_Identity_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/Presence.h b/e2ap/headers/Presence.h
new file mode 100644
index 0000000..06713ac
--- /dev/null
+++ b/e2ap/headers/Presence.h
@@ -0,0 +1,54 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_Presence_H_
+#define	_Presence_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum Presence {
+	Presence_optional	= 0,
+	Presence_conditional	= 1,
+	Presence_mandatory	= 2
+} e_Presence;
+
+/* Presence */
+typedef long	 Presence_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_Presence_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_Presence;
+extern const asn_INTEGER_specifics_t asn_SPC_Presence_specs_1;
+asn_struct_free_f Presence_free;
+asn_struct_print_f Presence_print;
+asn_constr_check_f Presence_constraint;
+ber_type_decoder_f Presence_decode_ber;
+der_type_encoder_f Presence_encode_der;
+xer_type_decoder_f Presence_decode_xer;
+xer_type_encoder_f Presence_encode_xer;
+oer_type_decoder_f Presence_decode_oer;
+oer_type_encoder_f Presence_encode_oer;
+per_type_decoder_f Presence_decode_uper;
+per_type_encoder_f Presence_encode_uper;
+per_type_decoder_f Presence_decode_aper;
+per_type_encoder_f Presence_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _Presence_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProcedureCode.h b/e2ap/headers/ProcedureCode.h
new file mode 100644
index 0000000..2b76e8b
--- /dev/null
+++ b/e2ap/headers/ProcedureCode.h
@@ -0,0 +1,55 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProcedureCode_H_
+#define	_ProcedureCode_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ProcedureCode */
+typedef long	 ProcedureCode_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_ProcedureCode_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_ProcedureCode;
+asn_struct_free_f ProcedureCode_free;
+asn_struct_print_f ProcedureCode_print;
+asn_constr_check_f ProcedureCode_constraint;
+ber_type_decoder_f ProcedureCode_decode_ber;
+der_type_encoder_f ProcedureCode_encode_der;
+xer_type_decoder_f ProcedureCode_decode_xer;
+xer_type_encoder_f ProcedureCode_encode_xer;
+oer_type_decoder_f ProcedureCode_decode_oer;
+oer_type_encoder_f ProcedureCode_encode_oer;
+per_type_decoder_f ProcedureCode_decode_uper;
+per_type_encoder_f ProcedureCode_encode_uper;
+per_type_decoder_f ProcedureCode_decode_aper;
+per_type_encoder_f ProcedureCode_encode_aper;
+#define ProcedureCode_id_E2setup	((ProcedureCode_t)1)
+#define ProcedureCode_id_ErrorIndication	((ProcedureCode_t)2)
+#define ProcedureCode_id_Reset	((ProcedureCode_t)3)
+#define ProcedureCode_id_RICcontrol	((ProcedureCode_t)4)
+#define ProcedureCode_id_RICindication	((ProcedureCode_t)5)
+#define ProcedureCode_id_RICserviceQuery	((ProcedureCode_t)6)
+#define ProcedureCode_id_RICserviceUpdate	((ProcedureCode_t)7)
+#define ProcedureCode_id_RICsubscription	((ProcedureCode_t)8)
+#define ProcedureCode_id_RICsubscriptionDelete	((ProcedureCode_t)9)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProcedureCode_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-Container.h b/e2ap/headers/ProtocolIE-Container.h
new file mode 100644
index 0000000..361db9c
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-Container.h
@@ -0,0 +1,253 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_Container_H_
+#define	_ProtocolIE_Container_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RICsubscriptionRequest_IEs;
+struct RICsubscriptionResponse_IEs;
+struct RICsubscriptionFailure_IEs;
+struct RICsubscriptionDeleteRequest_IEs;
+struct RICsubscriptionDeleteResponse_IEs;
+struct RICsubscriptionDeleteFailure_IEs;
+struct RICindication_IEs;
+struct RICcontrolRequest_IEs;
+struct RICcontrolAcknowledge_IEs;
+struct RICcontrolFailure_IEs;
+struct ErrorIndication_IEs;
+struct E2setupRequestIEs;
+struct E2setupResponseIEs;
+struct E2setupFailureIEs;
+struct ResetRequestIEs;
+struct ResetResponseIEs;
+struct RICserviceUpdate_IEs;
+struct RICserviceUpdateAcknowledge_IEs;
+struct RICserviceUpdateFailure_IEs;
+struct RICserviceQuery_IEs;
+
+/* ProtocolIE-Container */
+typedef struct ProtocolIE_Container_87P0 {
+	A_SEQUENCE_OF(struct RICsubscriptionRequest_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P0_t;
+typedef struct ProtocolIE_Container_87P1 {
+	A_SEQUENCE_OF(struct RICsubscriptionResponse_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P1_t;
+typedef struct ProtocolIE_Container_87P2 {
+	A_SEQUENCE_OF(struct RICsubscriptionFailure_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P2_t;
+typedef struct ProtocolIE_Container_87P3 {
+	A_SEQUENCE_OF(struct RICsubscriptionDeleteRequest_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P3_t;
+typedef struct ProtocolIE_Container_87P4 {
+	A_SEQUENCE_OF(struct RICsubscriptionDeleteResponse_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P4_t;
+typedef struct ProtocolIE_Container_87P5 {
+	A_SEQUENCE_OF(struct RICsubscriptionDeleteFailure_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P5_t;
+typedef struct ProtocolIE_Container_87P6 {
+	A_SEQUENCE_OF(struct RICindication_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P6_t;
+typedef struct ProtocolIE_Container_87P7 {
+	A_SEQUENCE_OF(struct RICcontrolRequest_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P7_t;
+typedef struct ProtocolIE_Container_87P8 {
+	A_SEQUENCE_OF(struct RICcontrolAcknowledge_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P8_t;
+typedef struct ProtocolIE_Container_87P9 {
+	A_SEQUENCE_OF(struct RICcontrolFailure_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P9_t;
+typedef struct ProtocolIE_Container_87P10 {
+	A_SEQUENCE_OF(struct ErrorIndication_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P10_t;
+typedef struct ProtocolIE_Container_87P11 {
+	A_SEQUENCE_OF(struct E2setupRequestIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P11_t;
+typedef struct ProtocolIE_Container_87P12 {
+	A_SEQUENCE_OF(struct E2setupResponseIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P12_t;
+typedef struct ProtocolIE_Container_87P13 {
+	A_SEQUENCE_OF(struct E2setupFailureIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P13_t;
+typedef struct ProtocolIE_Container_87P14 {
+	A_SEQUENCE_OF(struct ResetRequestIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P14_t;
+typedef struct ProtocolIE_Container_87P15 {
+	A_SEQUENCE_OF(struct ResetResponseIEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P15_t;
+typedef struct ProtocolIE_Container_87P16 {
+	A_SEQUENCE_OF(struct RICserviceUpdate_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P16_t;
+typedef struct ProtocolIE_Container_87P17 {
+	A_SEQUENCE_OF(struct RICserviceUpdateAcknowledge_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P17_t;
+typedef struct ProtocolIE_Container_87P18 {
+	A_SEQUENCE_OF(struct RICserviceUpdateFailure_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P18_t;
+typedef struct ProtocolIE_Container_87P19 {
+	A_SEQUENCE_OF(struct RICserviceQuery_IEs) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ProtocolIE_Container_87P19_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P0;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P0_1[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P0_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P1;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P1_specs_3;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P1_3[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P1_constr_3;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P2;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P2_specs_5;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P2_5[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P2_constr_5;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P3;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P3_specs_7;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P3_7[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P3_constr_7;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P4;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P4_specs_9;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P4_9[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P4_constr_9;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P5;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P5_specs_11;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P5_11[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P5_constr_11;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P6;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P6_specs_13;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P6_13[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P6_constr_13;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P7;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P7_specs_15;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P7_15[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P7_constr_15;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P8;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P8_specs_17;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P8_17[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P8_constr_17;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P9;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P9_specs_19;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P9_19[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P9_constr_19;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P10;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P10_specs_21;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P10_21[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P10_constr_21;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P11;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P11_specs_23;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P11_23[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P11_constr_23;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P12;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P12_specs_25;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P12_25[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P12_constr_25;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P13;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P13_specs_27;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P13_27[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P13_constr_27;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P14;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P14_specs_29;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P14_29[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P14_constr_29;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P15;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P15_specs_31;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P15_31[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P15_constr_31;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P16;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P16_specs_33;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P16_33[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P16_constr_33;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P17;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P17_specs_35;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P17_35[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P17_constr_35;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P18;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P18_specs_37;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P18_37[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P18_constr_37;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P19;
+extern asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P19_specs_39;
+extern asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P19_39[1];
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P19_constr_39;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_Container_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-ContainerList.h b/e2ap/headers/ProtocolIE-ContainerList.h
new file mode 100644
index 0000000..44b1d2a
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-ContainerList.h
@@ -0,0 +1,23 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_ContainerList_H_
+#define	_ProtocolIE_ContainerList_H_
+
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ContainerList_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-ContainerPair.h b/e2ap/headers/ProtocolIE-ContainerPair.h
new file mode 100644
index 0000000..cac7e26
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-ContainerPair.h
@@ -0,0 +1,23 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_ContainerPair_H_
+#define	_ProtocolIE_ContainerPair_H_
+
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ContainerPair_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-ContainerPairList.h b/e2ap/headers/ProtocolIE-ContainerPairList.h
new file mode 100644
index 0000000..9d6a2d3
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-ContainerPairList.h
@@ -0,0 +1,23 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_ContainerPairList_H_
+#define	_ProtocolIE_ContainerPairList_H_
+
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ContainerPairList_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-Field.h b/e2ap/headers/ProtocolIE-Field.h
new file mode 100644
index 0000000..8bbef66
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-Field.h
@@ -0,0 +1,757 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_Field_H_
+#define	_ProtocolIE_Field_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-ID.h"
+#include "Criticality.h"
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "RICaction-ToBeSetup-Item.h"
+#include "Presence.h"
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+#include "RICaction-Admitted-Item.h"
+#include "RICaction-NotAdmitted-Item.h"
+#include "RANfunction-Item.h"
+#include "RANfunctionID-Item.h"
+#include "RANfunctionIDcause-Item.h"
+#include "RICrequestID.h"
+#include "RANfunctionID.h"
+#include "RICsubscriptionDetails.h"
+#include "RICaction-Admitted-List.h"
+#include "RICaction-NotAdmitted-List.h"
+#include "CriticalityDiagnostics.h"
+#include "Cause.h"
+#include "RICactionID.h"
+#include "RICindicationSN.h"
+#include "RICindicationType.h"
+#include "RICindicationHeader.h"
+#include "RICindicationMessage.h"
+#include "RICcallProcessID.h"
+#include "RICcontrolHeader.h"
+#include "RICcontrolMessage.h"
+#include "RICcontrolAckRequest.h"
+#include "RICcontrolStatus.h"
+#include "RICcontrolOutcome.h"
+#include "GlobalE2node-ID.h"
+#include "RANfunctions-List.h"
+#include "GlobalRIC-ID.h"
+#include "RANfunctionsID-List.h"
+#include "RANfunctionsIDcause-List.h"
+#include "TimeToWait.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICaction_ToBeSetup_ItemIEs__value_PR {
+	RICaction_ToBeSetup_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RICaction_ToBeSetup_ItemIEs__value_PR_RICaction_ToBeSetup_Item
+} RICaction_ToBeSetup_ItemIEs__value_PR;
+typedef enum RICaction_Admitted_ItemIEs__value_PR {
+	RICaction_Admitted_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RICaction_Admitted_ItemIEs__value_PR_RICaction_Admitted_Item
+} RICaction_Admitted_ItemIEs__value_PR;
+typedef enum RICaction_NotAdmitted_ItemIEs__value_PR {
+	RICaction_NotAdmitted_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RICaction_NotAdmitted_ItemIEs__value_PR_RICaction_NotAdmitted_Item
+} RICaction_NotAdmitted_ItemIEs__value_PR;
+typedef enum RANfunction_ItemIEs__value_PR {
+	RANfunction_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RANfunction_ItemIEs__value_PR_RANfunction_Item
+} RANfunction_ItemIEs__value_PR;
+typedef enum RANfunctionID_ItemIEs__value_PR {
+	RANfunctionID_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RANfunctionID_ItemIEs__value_PR_RANfunctionID_Item
+} RANfunctionID_ItemIEs__value_PR;
+typedef enum RANfunctionIDcause_ItemIEs__value_PR {
+	RANfunctionIDcause_ItemIEs__value_PR_NOTHING,	/* No components present */
+	RANfunctionIDcause_ItemIEs__value_PR_RANfunctionIDcause_Item
+} RANfunctionIDcause_ItemIEs__value_PR;
+typedef enum RICsubscriptionRequest_IEs__value_PR {
+	RICsubscriptionRequest_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionRequest_IEs__value_PR_RICrequestID,
+	RICsubscriptionRequest_IEs__value_PR_RANfunctionID,
+	RICsubscriptionRequest_IEs__value_PR_RICsubscriptionDetails
+} RICsubscriptionRequest_IEs__value_PR;
+typedef enum RICsubscriptionResponse_IEs__value_PR {
+	RICsubscriptionResponse_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionResponse_IEs__value_PR_RICrequestID,
+	RICsubscriptionResponse_IEs__value_PR_RANfunctionID,
+	RICsubscriptionResponse_IEs__value_PR_RICaction_Admitted_List,
+	RICsubscriptionResponse_IEs__value_PR_RICaction_NotAdmitted_List
+} RICsubscriptionResponse_IEs__value_PR;
+typedef enum RICsubscriptionFailure_IEs__value_PR {
+	RICsubscriptionFailure_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionFailure_IEs__value_PR_RICrequestID,
+	RICsubscriptionFailure_IEs__value_PR_RANfunctionID,
+	RICsubscriptionFailure_IEs__value_PR_RICaction_NotAdmitted_List,
+	RICsubscriptionFailure_IEs__value_PR_CriticalityDiagnostics
+} RICsubscriptionFailure_IEs__value_PR;
+typedef enum RICsubscriptionDeleteRequest_IEs__value_PR {
+	RICsubscriptionDeleteRequest_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionDeleteRequest_IEs__value_PR_RICrequestID,
+	RICsubscriptionDeleteRequest_IEs__value_PR_RANfunctionID
+} RICsubscriptionDeleteRequest_IEs__value_PR;
+typedef enum RICsubscriptionDeleteResponse_IEs__value_PR {
+	RICsubscriptionDeleteResponse_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionDeleteResponse_IEs__value_PR_RICrequestID,
+	RICsubscriptionDeleteResponse_IEs__value_PR_RANfunctionID
+} RICsubscriptionDeleteResponse_IEs__value_PR;
+typedef enum RICsubscriptionDeleteFailure_IEs__value_PR {
+	RICsubscriptionDeleteFailure_IEs__value_PR_NOTHING,	/* No components present */
+	RICsubscriptionDeleteFailure_IEs__value_PR_RICrequestID,
+	RICsubscriptionDeleteFailure_IEs__value_PR_RANfunctionID,
+	RICsubscriptionDeleteFailure_IEs__value_PR_Cause,
+	RICsubscriptionDeleteFailure_IEs__value_PR_CriticalityDiagnostics
+} RICsubscriptionDeleteFailure_IEs__value_PR;
+typedef enum RICindication_IEs__value_PR {
+	RICindication_IEs__value_PR_NOTHING,	/* No components present */
+	RICindication_IEs__value_PR_RICrequestID,
+	RICindication_IEs__value_PR_RANfunctionID,
+	RICindication_IEs__value_PR_RICactionID,
+	RICindication_IEs__value_PR_RICindicationSN,
+	RICindication_IEs__value_PR_RICindicationType,
+	RICindication_IEs__value_PR_RICindicationHeader,
+	RICindication_IEs__value_PR_RICindicationMessage,
+	RICindication_IEs__value_PR_RICcallProcessID
+} RICindication_IEs__value_PR;
+typedef enum RICcontrolRequest_IEs__value_PR {
+	RICcontrolRequest_IEs__value_PR_NOTHING,	/* No components present */
+	RICcontrolRequest_IEs__value_PR_RICrequestID,
+	RICcontrolRequest_IEs__value_PR_RANfunctionID,
+	RICcontrolRequest_IEs__value_PR_RICcallProcessID,
+	RICcontrolRequest_IEs__value_PR_RICcontrolHeader,
+	RICcontrolRequest_IEs__value_PR_RICcontrolMessage,
+	RICcontrolRequest_IEs__value_PR_RICcontrolAckRequest
+} RICcontrolRequest_IEs__value_PR;
+typedef enum RICcontrolAcknowledge_IEs__value_PR {
+	RICcontrolAcknowledge_IEs__value_PR_NOTHING,	/* No components present */
+	RICcontrolAcknowledge_IEs__value_PR_RICrequestID,
+	RICcontrolAcknowledge_IEs__value_PR_RANfunctionID,
+	RICcontrolAcknowledge_IEs__value_PR_RICcallProcessID,
+	RICcontrolAcknowledge_IEs__value_PR_RICcontrolStatus,
+	RICcontrolAcknowledge_IEs__value_PR_RICcontrolOutcome
+} RICcontrolAcknowledge_IEs__value_PR;
+typedef enum RICcontrolFailure_IEs__value_PR {
+	RICcontrolFailure_IEs__value_PR_NOTHING,	/* No components present */
+	RICcontrolFailure_IEs__value_PR_RICrequestID,
+	RICcontrolFailure_IEs__value_PR_RANfunctionID,
+	RICcontrolFailure_IEs__value_PR_RICcallProcessID,
+	RICcontrolFailure_IEs__value_PR_Cause,
+	RICcontrolFailure_IEs__value_PR_RICcontrolOutcome
+} RICcontrolFailure_IEs__value_PR;
+typedef enum ErrorIndication_IEs__value_PR {
+	ErrorIndication_IEs__value_PR_NOTHING,	/* No components present */
+	ErrorIndication_IEs__value_PR_RICrequestID,
+	ErrorIndication_IEs__value_PR_RANfunctionID,
+	ErrorIndication_IEs__value_PR_Cause,
+	ErrorIndication_IEs__value_PR_CriticalityDiagnostics
+} ErrorIndication_IEs__value_PR;
+typedef enum E2setupRequestIEs__value_PR {
+	E2setupRequestIEs__value_PR_NOTHING,	/* No components present */
+	E2setupRequestIEs__value_PR_GlobalE2node_ID,
+	E2setupRequestIEs__value_PR_RANfunctions_List
+} E2setupRequestIEs__value_PR;
+typedef enum E2setupResponseIEs__value_PR {
+	E2setupResponseIEs__value_PR_NOTHING,	/* No components present */
+	E2setupResponseIEs__value_PR_GlobalRIC_ID,
+	E2setupResponseIEs__value_PR_RANfunctionsID_List,
+	E2setupResponseIEs__value_PR_RANfunctionsIDcause_List
+} E2setupResponseIEs__value_PR;
+typedef enum E2setupFailureIEs__value_PR {
+	E2setupFailureIEs__value_PR_NOTHING,	/* No components present */
+	E2setupFailureIEs__value_PR_Cause,
+	E2setupFailureIEs__value_PR_TimeToWait,
+	E2setupFailureIEs__value_PR_CriticalityDiagnostics
+} E2setupFailureIEs__value_PR;
+typedef enum ResetRequestIEs__value_PR {
+	ResetRequestIEs__value_PR_NOTHING,	/* No components present */
+	ResetRequestIEs__value_PR_Cause
+} ResetRequestIEs__value_PR;
+typedef enum ResetResponseIEs__value_PR {
+	ResetResponseIEs__value_PR_NOTHING,	/* No components present */
+	ResetResponseIEs__value_PR_CriticalityDiagnostics
+} ResetResponseIEs__value_PR;
+typedef enum RICserviceUpdate_IEs__value_PR {
+	RICserviceUpdate_IEs__value_PR_NOTHING,	/* No components present */
+	RICserviceUpdate_IEs__value_PR_RANfunctions_List,
+	RICserviceUpdate_IEs__value_PR_RANfunctionsID_List
+} RICserviceUpdate_IEs__value_PR;
+typedef enum RICserviceUpdateAcknowledge_IEs__value_PR {
+	RICserviceUpdateAcknowledge_IEs__value_PR_NOTHING,	/* No components present */
+	RICserviceUpdateAcknowledge_IEs__value_PR_RANfunctionsID_List,
+	RICserviceUpdateAcknowledge_IEs__value_PR_RANfunctionsIDcause_List
+} RICserviceUpdateAcknowledge_IEs__value_PR;
+typedef enum RICserviceUpdateFailure_IEs__value_PR {
+	RICserviceUpdateFailure_IEs__value_PR_NOTHING,	/* No components present */
+	RICserviceUpdateFailure_IEs__value_PR_RANfunctionsIDcause_List,
+	RICserviceUpdateFailure_IEs__value_PR_TimeToWait,
+	RICserviceUpdateFailure_IEs__value_PR_CriticalityDiagnostics
+} RICserviceUpdateFailure_IEs__value_PR;
+typedef enum RICserviceQuery_IEs__value_PR {
+	RICserviceQuery_IEs__value_PR_NOTHING,	/* No components present */
+	RICserviceQuery_IEs__value_PR_RANfunctionsID_List
+} RICserviceQuery_IEs__value_PR;
+
+/* ProtocolIE-Field */
+typedef struct RICaction_ToBeSetup_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICaction_ToBeSetup_ItemIEs__value {
+		RICaction_ToBeSetup_ItemIEs__value_PR present;
+		union RICaction_ToBeSetup_ItemIEs__value_u {
+			RICaction_ToBeSetup_Item_t	 RICaction_ToBeSetup_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_ToBeSetup_ItemIEs_t;
+typedef struct RICaction_Admitted_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICaction_Admitted_ItemIEs__value {
+		RICaction_Admitted_ItemIEs__value_PR present;
+		union RICaction_Admitted_ItemIEs__value_u {
+			RICaction_Admitted_Item_t	 RICaction_Admitted_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_Admitted_ItemIEs_t;
+typedef struct RICaction_NotAdmitted_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICaction_NotAdmitted_ItemIEs__value {
+		RICaction_NotAdmitted_ItemIEs__value_PR present;
+		union RICaction_NotAdmitted_ItemIEs__value_u {
+			RICaction_NotAdmitted_Item_t	 RICaction_NotAdmitted_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_NotAdmitted_ItemIEs_t;
+typedef struct RANfunction_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RANfunction_ItemIEs__value {
+		RANfunction_ItemIEs__value_PR present;
+		union RANfunction_ItemIEs__value_u {
+			RANfunction_Item_t	 RANfunction_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunction_ItemIEs_t;
+typedef struct RANfunctionID_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RANfunctionID_ItemIEs__value {
+		RANfunctionID_ItemIEs__value_PR present;
+		union RANfunctionID_ItemIEs__value_u {
+			RANfunctionID_Item_t	 RANfunctionID_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionID_ItemIEs_t;
+typedef struct RANfunctionIDcause_ItemIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RANfunctionIDcause_ItemIEs__value {
+		RANfunctionIDcause_ItemIEs__value_PR present;
+		union RANfunctionIDcause_ItemIEs__value_u {
+			RANfunctionIDcause_Item_t	 RANfunctionIDcause_Item;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionIDcause_ItemIEs_t;
+typedef struct RICsubscriptionRequest_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionRequest_IEs__value {
+		RICsubscriptionRequest_IEs__value_PR present;
+		union RICsubscriptionRequest_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICsubscriptionDetails_t	 RICsubscriptionDetails;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionRequest_IEs_t;
+typedef struct RICsubscriptionResponse_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionResponse_IEs__value {
+		RICsubscriptionResponse_IEs__value_PR present;
+		union RICsubscriptionResponse_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICaction_Admitted_List_t	 RICaction_Admitted_List;
+			RICaction_NotAdmitted_List_t	 RICaction_NotAdmitted_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionResponse_IEs_t;
+typedef struct RICsubscriptionFailure_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionFailure_IEs__value {
+		RICsubscriptionFailure_IEs__value_PR present;
+		union RICsubscriptionFailure_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICaction_NotAdmitted_List_t	 RICaction_NotAdmitted_List;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionFailure_IEs_t;
+typedef struct RICsubscriptionDeleteRequest_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionDeleteRequest_IEs__value {
+		RICsubscriptionDeleteRequest_IEs__value_PR present;
+		union RICsubscriptionDeleteRequest_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteRequest_IEs_t;
+typedef struct RICsubscriptionDeleteResponse_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionDeleteResponse_IEs__value {
+		RICsubscriptionDeleteResponse_IEs__value_PR present;
+		union RICsubscriptionDeleteResponse_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteResponse_IEs_t;
+typedef struct RICsubscriptionDeleteFailure_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICsubscriptionDeleteFailure_IEs__value {
+		RICsubscriptionDeleteFailure_IEs__value_PR present;
+		union RICsubscriptionDeleteFailure_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			Cause_t	 Cause;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteFailure_IEs_t;
+typedef struct RICindication_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICindication_IEs__value {
+		RICindication_IEs__value_PR present;
+		union RICindication_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICactionID_t	 RICactionID;
+			RICindicationSN_t	 RICindicationSN;
+			RICindicationType_t	 RICindicationType;
+			RICindicationHeader_t	 RICindicationHeader;
+			RICindicationMessage_t	 RICindicationMessage;
+			RICcallProcessID_t	 RICcallProcessID;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICindication_IEs_t;
+typedef struct RICcontrolRequest_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICcontrolRequest_IEs__value {
+		RICcontrolRequest_IEs__value_PR present;
+		union RICcontrolRequest_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICcallProcessID_t	 RICcallProcessID;
+			RICcontrolHeader_t	 RICcontrolHeader;
+			RICcontrolMessage_t	 RICcontrolMessage;
+			RICcontrolAckRequest_t	 RICcontrolAckRequest;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolRequest_IEs_t;
+typedef struct RICcontrolAcknowledge_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICcontrolAcknowledge_IEs__value {
+		RICcontrolAcknowledge_IEs__value_PR present;
+		union RICcontrolAcknowledge_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICcallProcessID_t	 RICcallProcessID;
+			RICcontrolStatus_t	 RICcontrolStatus;
+			RICcontrolOutcome_t	 RICcontrolOutcome;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolAcknowledge_IEs_t;
+typedef struct RICcontrolFailure_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICcontrolFailure_IEs__value {
+		RICcontrolFailure_IEs__value_PR present;
+		union RICcontrolFailure_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			RICcallProcessID_t	 RICcallProcessID;
+			Cause_t	 Cause;
+			RICcontrolOutcome_t	 RICcontrolOutcome;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolFailure_IEs_t;
+typedef struct ErrorIndication_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct ErrorIndication_IEs__value {
+		ErrorIndication_IEs__value_PR present;
+		union ErrorIndication_IEs__value_u {
+			RICrequestID_t	 RICrequestID;
+			RANfunctionID_t	 RANfunctionID;
+			Cause_t	 Cause;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ErrorIndication_IEs_t;
+typedef struct E2setupRequestIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct E2setupRequestIEs__value {
+		E2setupRequestIEs__value_PR present;
+		union E2setupRequestIEs__value_u {
+			GlobalE2node_ID_t	 GlobalE2node_ID;
+			RANfunctions_List_t	 RANfunctions_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupRequestIEs_t;
+typedef struct E2setupResponseIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct E2setupResponseIEs__value {
+		E2setupResponseIEs__value_PR present;
+		union E2setupResponseIEs__value_u {
+			GlobalRIC_ID_t	 GlobalRIC_ID;
+			RANfunctionsID_List_t	 RANfunctionsID_List;
+			RANfunctionsIDcause_List_t	 RANfunctionsIDcause_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupResponseIEs_t;
+typedef struct E2setupFailureIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct E2setupFailureIEs__value {
+		E2setupFailureIEs__value_PR present;
+		union E2setupFailureIEs__value_u {
+			Cause_t	 Cause;
+			TimeToWait_t	 TimeToWait;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} E2setupFailureIEs_t;
+typedef struct ResetRequestIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct ResetRequestIEs__value {
+		ResetRequestIEs__value_PR present;
+		union ResetRequestIEs__value_u {
+			Cause_t	 Cause;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResetRequestIEs_t;
+typedef struct ResetResponseIEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct ResetResponseIEs__value {
+		ResetResponseIEs__value_PR present;
+		union ResetResponseIEs__value_u {
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResetResponseIEs_t;
+typedef struct RICserviceUpdate_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICserviceUpdate_IEs__value {
+		RICserviceUpdate_IEs__value_PR present;
+		union RICserviceUpdate_IEs__value_u {
+			RANfunctions_List_t	 RANfunctions_List;
+			RANfunctionsID_List_t	 RANfunctionsID_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdate_IEs_t;
+typedef struct RICserviceUpdateAcknowledge_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICserviceUpdateAcknowledge_IEs__value {
+		RICserviceUpdateAcknowledge_IEs__value_PR present;
+		union RICserviceUpdateAcknowledge_IEs__value_u {
+			RANfunctionsID_List_t	 RANfunctionsID_List;
+			RANfunctionsIDcause_List_t	 RANfunctionsIDcause_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdateAcknowledge_IEs_t;
+typedef struct RICserviceUpdateFailure_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICserviceUpdateFailure_IEs__value {
+		RICserviceUpdateFailure_IEs__value_PR present;
+		union RICserviceUpdateFailure_IEs__value_u {
+			RANfunctionsIDcause_List_t	 RANfunctionsIDcause_List;
+			TimeToWait_t	 TimeToWait;
+			CriticalityDiagnostics_t	 CriticalityDiagnostics;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdateFailure_IEs_t;
+typedef struct RICserviceQuery_IEs {
+	ProtocolIE_ID_t	 id;
+	Criticality_t	 criticality;
+	struct RICserviceQuery_IEs__value {
+		RICserviceQuery_IEs__value_PR present;
+		union RICserviceQuery_IEs__value_u {
+			RANfunctionsID_List_t	 RANfunctionsID_List;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceQuery_IEs_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_ToBeSetup_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_ToBeSetup_ItemIEs_1[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_Admitted_ItemIEs_specs_5;
+extern asn_TYPE_member_t asn_MBR_RICaction_Admitted_ItemIEs_5[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9;
+extern asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_ItemIEs_9[3];
+extern asn_TYPE_descriptor_t asn_DEF_RANfunction_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunction_ItemIEs_specs_13;
+extern asn_TYPE_member_t asn_MBR_RANfunction_ItemIEs_13[3];
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionID_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunctionID_ItemIEs_specs_17;
+extern asn_TYPE_member_t asn_MBR_RANfunctionID_ItemIEs_17[3];
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionIDcause_ItemIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunctionIDcause_ItemIEs_specs_21;
+extern asn_TYPE_member_t asn_MBR_RANfunctionIDcause_ItemIEs_21[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionRequest_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionRequest_IEs_specs_25;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionRequest_IEs_25[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionResponse_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionResponse_IEs_specs_29;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionResponse_IEs_29[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionFailure_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionFailure_IEs_specs_33;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionFailure_IEs_33[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteRequest_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteRequest_IEs_specs_37;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteRequest_IEs_37[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteResponse_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteResponse_IEs_specs_41;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteResponse_IEs_41[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteFailure_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteFailure_IEs_specs_45;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteFailure_IEs_45[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICindication_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICindication_IEs_specs_49;
+extern asn_TYPE_member_t asn_MBR_RICindication_IEs_49[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolRequest_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICcontrolRequest_IEs_specs_53;
+extern asn_TYPE_member_t asn_MBR_RICcontrolRequest_IEs_53[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolAcknowledge_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICcontrolAcknowledge_IEs_specs_57;
+extern asn_TYPE_member_t asn_MBR_RICcontrolAcknowledge_IEs_57[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolFailure_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICcontrolFailure_IEs_specs_61;
+extern asn_TYPE_member_t asn_MBR_RICcontrolFailure_IEs_61[3];
+extern asn_TYPE_descriptor_t asn_DEF_ErrorIndication_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_ErrorIndication_IEs_specs_65;
+extern asn_TYPE_member_t asn_MBR_ErrorIndication_IEs_65[3];
+extern asn_TYPE_descriptor_t asn_DEF_E2setupRequestIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2setupRequestIEs_specs_69;
+extern asn_TYPE_member_t asn_MBR_E2setupRequestIEs_69[3];
+extern asn_TYPE_descriptor_t asn_DEF_E2setupResponseIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2setupResponseIEs_specs_73;
+extern asn_TYPE_member_t asn_MBR_E2setupResponseIEs_73[3];
+extern asn_TYPE_descriptor_t asn_DEF_E2setupFailureIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_E2setupFailureIEs_specs_77;
+extern asn_TYPE_member_t asn_MBR_E2setupFailureIEs_77[3];
+extern asn_TYPE_descriptor_t asn_DEF_ResetRequestIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_ResetRequestIEs_specs_81;
+extern asn_TYPE_member_t asn_MBR_ResetRequestIEs_81[3];
+extern asn_TYPE_descriptor_t asn_DEF_ResetResponseIEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_ResetResponseIEs_specs_85;
+extern asn_TYPE_member_t asn_MBR_ResetResponseIEs_85[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdate_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdate_IEs_specs_89;
+extern asn_TYPE_member_t asn_MBR_RICserviceUpdate_IEs_89[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateAcknowledge_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateAcknowledge_IEs_specs_93;
+extern asn_TYPE_member_t asn_MBR_RICserviceUpdateAcknowledge_IEs_93[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateFailure_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateFailure_IEs_specs_97;
+extern asn_TYPE_member_t asn_MBR_RICserviceUpdateFailure_IEs_97[3];
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceQuery_IEs;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICserviceQuery_IEs_specs_101;
+extern asn_TYPE_member_t asn_MBR_RICserviceQuery_IEs_101[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_Field_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-FieldPair.h b/e2ap/headers/ProtocolIE-FieldPair.h
new file mode 100644
index 0000000..17a19c7
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-FieldPair.h
@@ -0,0 +1,23 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_FieldPair_H_
+#define	_ProtocolIE_FieldPair_H_
+
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_FieldPair_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-ID.h b/e2ap/headers/ProtocolIE-ID.h
new file mode 100644
index 0000000..dc75633
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-ID.h
@@ -0,0 +1,78 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_ID_H_
+#define	_ProtocolIE_ID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ProtocolIE-ID */
+typedef long	 ProtocolIE_ID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_ProtocolIE_ID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_ID;
+asn_struct_free_f ProtocolIE_ID_free;
+asn_struct_print_f ProtocolIE_ID_print;
+asn_constr_check_f ProtocolIE_ID_constraint;
+ber_type_decoder_f ProtocolIE_ID_decode_ber;
+der_type_encoder_f ProtocolIE_ID_encode_der;
+xer_type_decoder_f ProtocolIE_ID_decode_xer;
+xer_type_encoder_f ProtocolIE_ID_encode_xer;
+oer_type_decoder_f ProtocolIE_ID_decode_oer;
+oer_type_encoder_f ProtocolIE_ID_encode_oer;
+per_type_decoder_f ProtocolIE_ID_decode_uper;
+per_type_encoder_f ProtocolIE_ID_encode_uper;
+per_type_decoder_f ProtocolIE_ID_decode_aper;
+per_type_encoder_f ProtocolIE_ID_encode_aper;
+#define ProtocolIE_ID_id_Cause	((ProtocolIE_ID_t)1)
+#define ProtocolIE_ID_id_CriticalityDiagnostics	((ProtocolIE_ID_t)2)
+#define ProtocolIE_ID_id_GlobalE2node_ID	((ProtocolIE_ID_t)3)
+#define ProtocolIE_ID_id_GlobalRIC_ID	((ProtocolIE_ID_t)4)
+#define ProtocolIE_ID_id_RANfunctionID	((ProtocolIE_ID_t)5)
+#define ProtocolIE_ID_id_RANfunctionID_Item	((ProtocolIE_ID_t)6)
+#define ProtocolIE_ID_id_RANfunctionIEcause_Item	((ProtocolIE_ID_t)7)
+#define ProtocolIE_ID_id_RANfunction_Item	((ProtocolIE_ID_t)8)
+#define ProtocolIE_ID_id_RANfunctionsAccepted	((ProtocolIE_ID_t)9)
+#define ProtocolIE_ID_id_RANfunctionsAdded	((ProtocolIE_ID_t)10)
+#define ProtocolIE_ID_id_RANfunctionsDeleted	((ProtocolIE_ID_t)11)
+#define ProtocolIE_ID_id_RANfunctionsModified	((ProtocolIE_ID_t)12)
+#define ProtocolIE_ID_id_RANfunctionsRejected	((ProtocolIE_ID_t)13)
+#define ProtocolIE_ID_id_RICaction_Admitted_Item	((ProtocolIE_ID_t)14)
+#define ProtocolIE_ID_id_RICactionID	((ProtocolIE_ID_t)15)
+#define ProtocolIE_ID_id_RICaction_NotAdmitted_Item	((ProtocolIE_ID_t)16)
+#define ProtocolIE_ID_id_RICactions_Admitted	((ProtocolIE_ID_t)17)
+#define ProtocolIE_ID_id_RICactions_NotAdmitted	((ProtocolIE_ID_t)18)
+#define ProtocolIE_ID_id_RICaction_ToBeSetup_Item	((ProtocolIE_ID_t)19)
+#define ProtocolIE_ID_id_RICcallProcessID	((ProtocolIE_ID_t)20)
+#define ProtocolIE_ID_id_RICcontrolAckRequest	((ProtocolIE_ID_t)21)
+#define ProtocolIE_ID_id_RICcontrolHeader	((ProtocolIE_ID_t)22)
+#define ProtocolIE_ID_id_RICcontrolMessage	((ProtocolIE_ID_t)23)
+#define ProtocolIE_ID_id_RICcontrolStatus	((ProtocolIE_ID_t)24)
+#define ProtocolIE_ID_id_RICindicationHeader	((ProtocolIE_ID_t)25)
+#define ProtocolIE_ID_id_RICindicationMessage	((ProtocolIE_ID_t)26)
+#define ProtocolIE_ID_id_RICindicationSN	((ProtocolIE_ID_t)27)
+#define ProtocolIE_ID_id_RICindicationType	((ProtocolIE_ID_t)28)
+#define ProtocolIE_ID_id_RICrequestID	((ProtocolIE_ID_t)29)
+#define ProtocolIE_ID_id_RICsubscriptionDetails	((ProtocolIE_ID_t)30)
+#define ProtocolIE_ID_id_TimeToWait	((ProtocolIE_ID_t)31)
+#define ProtocolIE_ID_id_RICcontrolOutcome	((ProtocolIE_ID_t)32)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_ID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ProtocolIE-SingleContainer.h b/e2ap/headers/ProtocolIE-SingleContainer.h
new file mode 100644
index 0000000..eadd741
--- /dev/null
+++ b/e2ap/headers/ProtocolIE-SingleContainer.h
@@ -0,0 +1,120 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ProtocolIE_SingleContainer_H_
+#define	_ProtocolIE_SingleContainer_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Field.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ProtocolIE-SingleContainer */
+typedef RICaction_ToBeSetup_ItemIEs_t	 ProtocolIE_SingleContainer_90P0_t;
+typedef RICaction_Admitted_ItemIEs_t	 ProtocolIE_SingleContainer_90P1_t;
+typedef RICaction_NotAdmitted_ItemIEs_t	 ProtocolIE_SingleContainer_90P2_t;
+typedef RANfunction_ItemIEs_t	 ProtocolIE_SingleContainer_90P3_t;
+typedef RANfunctionID_ItemIEs_t	 ProtocolIE_SingleContainer_90P4_t;
+typedef RANfunctionIDcause_ItemIEs_t	 ProtocolIE_SingleContainer_90P5_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P0;
+asn_struct_free_f ProtocolIE_SingleContainer_90P0_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P0_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P0_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P0_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P0_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P1;
+asn_struct_free_f ProtocolIE_SingleContainer_90P1_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P1_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P1_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P1_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P1_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P2;
+asn_struct_free_f ProtocolIE_SingleContainer_90P2_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P2_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P2_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P2_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P2_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P3;
+asn_struct_free_f ProtocolIE_SingleContainer_90P3_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P3_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P3_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P3_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P3_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P4;
+asn_struct_free_f ProtocolIE_SingleContainer_90P4_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P4_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P4_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P4_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P4_encode_aper;
+extern asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P5;
+asn_struct_free_f ProtocolIE_SingleContainer_90P5_free;
+asn_struct_print_f ProtocolIE_SingleContainer_90P5_print;
+asn_constr_check_f ProtocolIE_SingleContainer_90P5_constraint;
+ber_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_ber;
+der_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_der;
+xer_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_xer;
+xer_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_xer;
+oer_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_oer;
+oer_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_oer;
+per_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_uper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_uper;
+per_type_decoder_f ProtocolIE_SingleContainer_90P5_decode_aper;
+per_type_encoder_f ProtocolIE_SingleContainer_90P5_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ProtocolIE_SingleContainer_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunction-Item.h b/e2ap/headers/RANfunction-Item.h
new file mode 100644
index 0000000..38b5e97
--- /dev/null
+++ b/e2ap/headers/RANfunction-Item.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunction_Item_H_
+#define	_RANfunction_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANfunctionID.h"
+#include "RANfunctionDefinition.h"
+#include "RANfunctionRevision.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunction-Item */
+typedef struct RANfunction_Item {
+	RANfunctionID_t	 ranFunctionID;
+	RANfunctionDefinition_t	 ranFunctionDefinition;
+	RANfunctionRevision_t	 ranFunctionRevision;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunction_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunction_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunction_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunction_Item_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunction_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionDefinition.h b/e2ap/headers/RANfunctionDefinition.h
new file mode 100644
index 0000000..3676c45
--- /dev/null
+++ b/e2ap/headers/RANfunctionDefinition.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionDefinition_H_
+#define	_RANfunctionDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionDefinition */
+typedef OCTET_STRING_t	 RANfunctionDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionDefinition;
+asn_struct_free_f RANfunctionDefinition_free;
+asn_struct_print_f RANfunctionDefinition_print;
+asn_constr_check_f RANfunctionDefinition_constraint;
+ber_type_decoder_f RANfunctionDefinition_decode_ber;
+der_type_encoder_f RANfunctionDefinition_encode_der;
+xer_type_decoder_f RANfunctionDefinition_decode_xer;
+xer_type_encoder_f RANfunctionDefinition_encode_xer;
+oer_type_decoder_f RANfunctionDefinition_decode_oer;
+oer_type_encoder_f RANfunctionDefinition_encode_oer;
+per_type_decoder_f RANfunctionDefinition_decode_uper;
+per_type_encoder_f RANfunctionDefinition_encode_uper;
+per_type_decoder_f RANfunctionDefinition_decode_aper;
+per_type_encoder_f RANfunctionDefinition_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionID-Item.h b/e2ap/headers/RANfunctionID-Item.h
new file mode 100644
index 0000000..f4a643d
--- /dev/null
+++ b/e2ap/headers/RANfunctionID-Item.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionID_Item_H_
+#define	_RANfunctionID_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANfunctionID.h"
+#include "RANfunctionRevision.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionID-Item */
+typedef struct RANfunctionID_Item {
+	RANfunctionID_t	 ranFunctionID;
+	RANfunctionRevision_t	 ranFunctionRevision;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionID_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionID_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunctionID_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctionID_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionID_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionID.h b/e2ap/headers/RANfunctionID.h
new file mode 100644
index 0000000..00c4765
--- /dev/null
+++ b/e2ap/headers/RANfunctionID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionID_H_
+#define	_RANfunctionID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionID */
+typedef long	 RANfunctionID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RANfunctionID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionID;
+asn_struct_free_f RANfunctionID_free;
+asn_struct_print_f RANfunctionID_print;
+asn_constr_check_f RANfunctionID_constraint;
+ber_type_decoder_f RANfunctionID_decode_ber;
+der_type_encoder_f RANfunctionID_encode_der;
+xer_type_decoder_f RANfunctionID_decode_xer;
+xer_type_encoder_f RANfunctionID_encode_xer;
+oer_type_decoder_f RANfunctionID_decode_oer;
+oer_type_encoder_f RANfunctionID_encode_oer;
+per_type_decoder_f RANfunctionID_decode_uper;
+per_type_encoder_f RANfunctionID_encode_uper;
+per_type_decoder_f RANfunctionID_decode_aper;
+per_type_encoder_f RANfunctionID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionIDcause-Item.h b/e2ap/headers/RANfunctionIDcause-Item.h
new file mode 100644
index 0000000..65d1d16
--- /dev/null
+++ b/e2ap/headers/RANfunctionIDcause-Item.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionIDcause_Item_H_
+#define	_RANfunctionIDcause_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RANfunctionID.h"
+#include "Cause.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionIDcause-Item */
+typedef struct RANfunctionIDcause_Item {
+	RANfunctionID_t	 ranFunctionID;
+	Cause_t	 cause;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionIDcause_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionIDcause_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RANfunctionIDcause_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctionIDcause_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionIDcause_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionRevision.h b/e2ap/headers/RANfunctionRevision.h
new file mode 100644
index 0000000..76f500a
--- /dev/null
+++ b/e2ap/headers/RANfunctionRevision.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionRevision_H_
+#define	_RANfunctionRevision_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RANfunctionRevision */
+typedef long	 RANfunctionRevision_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RANfunctionRevision_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionRevision;
+asn_struct_free_f RANfunctionRevision_free;
+asn_struct_print_f RANfunctionRevision_print;
+asn_constr_check_f RANfunctionRevision_constraint;
+ber_type_decoder_f RANfunctionRevision_decode_ber;
+der_type_encoder_f RANfunctionRevision_encode_der;
+xer_type_decoder_f RANfunctionRevision_decode_xer;
+xer_type_encoder_f RANfunctionRevision_encode_xer;
+oer_type_decoder_f RANfunctionRevision_decode_oer;
+oer_type_encoder_f RANfunctionRevision_encode_oer;
+per_type_decoder_f RANfunctionRevision_decode_uper;
+per_type_encoder_f RANfunctionRevision_encode_uper;
+per_type_decoder_f RANfunctionRevision_decode_aper;
+per_type_encoder_f RANfunctionRevision_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionRevision_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctions-List.h b/e2ap/headers/RANfunctions-List.h
new file mode 100644
index 0000000..c3fd3e3
--- /dev/null
+++ b/e2ap/headers/RANfunctions-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctions_List_H_
+#define	_RANfunctions_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RANfunctions-List */
+typedef struct RANfunctions_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctions_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctions_List;
+extern asn_SET_OF_specifics_t asn_SPC_RANfunctions_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctions_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RANfunctions_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctions_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionsID-List.h b/e2ap/headers/RANfunctionsID-List.h
new file mode 100644
index 0000000..1a77d70
--- /dev/null
+++ b/e2ap/headers/RANfunctionsID-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionsID_List_H_
+#define	_RANfunctionsID_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RANfunctionsID-List */
+typedef struct RANfunctionsID_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionsID_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionsID_List;
+extern asn_SET_OF_specifics_t asn_SPC_RANfunctionsID_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctionsID_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RANfunctionsID_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionsID_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RANfunctionsIDcause-List.h b/e2ap/headers/RANfunctionsIDcause-List.h
new file mode 100644
index 0000000..3fd51d1
--- /dev/null
+++ b/e2ap/headers/RANfunctionsIDcause-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RANfunctionsIDcause_List_H_
+#define	_RANfunctionsIDcause_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RANfunctionsIDcause-List */
+typedef struct RANfunctionsIDcause_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RANfunctionsIDcause_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RANfunctionsIDcause_List;
+extern asn_SET_OF_specifics_t asn_SPC_RANfunctionsIDcause_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RANfunctionsIDcause_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RANfunctionsIDcause_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RANfunctionsIDcause_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-Admitted-Item.h b/e2ap/headers/RICaction-Admitted-Item.h
new file mode 100644
index 0000000..5031b7d
--- /dev/null
+++ b/e2ap/headers/RICaction-Admitted-Item.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_Admitted_Item_H_
+#define	_RICaction_Admitted_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICactionID.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICaction-Admitted-Item */
+typedef struct RICaction_Admitted_Item {
+	RICactionID_t	 ricActionID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_Admitted_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_Admitted_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_Admitted_Item_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_Admitted_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-Admitted-List.h b/e2ap/headers/RICaction-Admitted-List.h
new file mode 100644
index 0000000..9464982
--- /dev/null
+++ b/e2ap/headers/RICaction-Admitted-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_Admitted_List_H_
+#define	_RICaction_Admitted_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RICaction-Admitted-List */
+typedef struct RICaction_Admitted_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_Admitted_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_List;
+extern asn_SET_OF_specifics_t asn_SPC_RICaction_Admitted_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_Admitted_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RICaction_Admitted_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_Admitted_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-NotAdmitted-Item.h b/e2ap/headers/RICaction-NotAdmitted-Item.h
new file mode 100644
index 0000000..b94f69c
--- /dev/null
+++ b/e2ap/headers/RICaction-NotAdmitted-Item.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_NotAdmitted_Item_H_
+#define	_RICaction_NotAdmitted_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICactionID.h"
+#include "Cause.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICaction-NotAdmitted-Item */
+typedef struct RICaction_NotAdmitted_Item {
+	RICactionID_t	 ricActionID;
+	Cause_t	 cause;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_NotAdmitted_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_NotAdmitted_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_Item_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_NotAdmitted_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-NotAdmitted-List.h b/e2ap/headers/RICaction-NotAdmitted-List.h
new file mode 100644
index 0000000..642683d
--- /dev/null
+++ b/e2ap/headers/RICaction-NotAdmitted-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_NotAdmitted_List_H_
+#define	_RICaction_NotAdmitted_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RICaction-NotAdmitted-List */
+typedef struct RICaction_NotAdmitted_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_NotAdmitted_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_List;
+extern asn_SET_OF_specifics_t asn_SPC_RICaction_NotAdmitted_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RICaction_NotAdmitted_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_NotAdmitted_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICaction-ToBeSetup-Item.h b/e2ap/headers/RICaction-ToBeSetup-Item.h
new file mode 100644
index 0000000..a616014
--- /dev/null
+++ b/e2ap/headers/RICaction-ToBeSetup-Item.h
@@ -0,0 +1,52 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICaction_ToBeSetup_Item_H_
+#define	_RICaction_ToBeSetup_Item_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICactionID.h"
+#include "RICactionType.h"
+#include "RICactionDefinition.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct RICsubsequentAction;
+
+/* RICaction-ToBeSetup-Item */
+typedef struct RICaction_ToBeSetup_Item {
+	RICactionID_t	 ricActionID;
+	RICactionType_t	 ricActionType;
+	RICactionDefinition_t	*ricActionDefinition;	/* OPTIONAL */
+	struct RICsubsequentAction	*ricSubsequentAction;	/* OPTIONAL */
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICaction_ToBeSetup_Item_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICaction_ToBeSetup_Item;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICaction_ToBeSetup_Item_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICaction_ToBeSetup_Item_1[4];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICaction_ToBeSetup_Item_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICactionDefinition.h b/e2ap/headers/RICactionDefinition.h
new file mode 100644
index 0000000..349e2a8
--- /dev/null
+++ b/e2ap/headers/RICactionDefinition.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICactionDefinition_H_
+#define	_RICactionDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICactionDefinition */
+typedef OCTET_STRING_t	 RICactionDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICactionDefinition;
+asn_struct_free_f RICactionDefinition_free;
+asn_struct_print_f RICactionDefinition_print;
+asn_constr_check_f RICactionDefinition_constraint;
+ber_type_decoder_f RICactionDefinition_decode_ber;
+der_type_encoder_f RICactionDefinition_encode_der;
+xer_type_decoder_f RICactionDefinition_decode_xer;
+xer_type_encoder_f RICactionDefinition_encode_xer;
+oer_type_decoder_f RICactionDefinition_decode_oer;
+oer_type_encoder_f RICactionDefinition_encode_oer;
+per_type_decoder_f RICactionDefinition_decode_uper;
+per_type_encoder_f RICactionDefinition_encode_uper;
+per_type_decoder_f RICactionDefinition_decode_aper;
+per_type_encoder_f RICactionDefinition_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICactionDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICactionID.h b/e2ap/headers/RICactionID.h
new file mode 100644
index 0000000..b8f6447
--- /dev/null
+++ b/e2ap/headers/RICactionID.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICactionID_H_
+#define	_RICactionID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICactionID */
+typedef long	 RICactionID_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICactionID_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICactionID;
+asn_struct_free_f RICactionID_free;
+asn_struct_print_f RICactionID_print;
+asn_constr_check_f RICactionID_constraint;
+ber_type_decoder_f RICactionID_decode_ber;
+der_type_encoder_f RICactionID_encode_der;
+xer_type_decoder_f RICactionID_decode_xer;
+xer_type_encoder_f RICactionID_encode_xer;
+oer_type_decoder_f RICactionID_decode_oer;
+oer_type_encoder_f RICactionID_encode_oer;
+per_type_decoder_f RICactionID_decode_uper;
+per_type_encoder_f RICactionID_encode_uper;
+per_type_decoder_f RICactionID_decode_aper;
+per_type_encoder_f RICactionID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICactionID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICactionType.h b/e2ap/headers/RICactionType.h
new file mode 100644
index 0000000..e4349fd
--- /dev/null
+++ b/e2ap/headers/RICactionType.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICactionType_H_
+#define	_RICactionType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICactionType {
+	RICactionType_report	= 0,
+	RICactionType_insert	= 1,
+	RICactionType_policy	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICactionType;
+
+/* RICactionType */
+typedef long	 RICactionType_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICactionType_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICactionType;
+extern const asn_INTEGER_specifics_t asn_SPC_RICactionType_specs_1;
+asn_struct_free_f RICactionType_free;
+asn_struct_print_f RICactionType_print;
+asn_constr_check_f RICactionType_constraint;
+ber_type_decoder_f RICactionType_decode_ber;
+der_type_encoder_f RICactionType_encode_der;
+xer_type_decoder_f RICactionType_decode_xer;
+xer_type_encoder_f RICactionType_encode_xer;
+oer_type_decoder_f RICactionType_decode_oer;
+oer_type_encoder_f RICactionType_encode_oer;
+per_type_decoder_f RICactionType_decode_uper;
+per_type_encoder_f RICactionType_encode_uper;
+per_type_decoder_f RICactionType_decode_aper;
+per_type_encoder_f RICactionType_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICactionType_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICactions-ToBeSetup-List.h b/e2ap/headers/RICactions-ToBeSetup-List.h
new file mode 100644
index 0000000..632b420
--- /dev/null
+++ b/e2ap/headers/RICactions-ToBeSetup-List.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICactions_ToBeSetup_List_H_
+#define	_RICactions_ToBeSetup_List_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <asn_SEQUENCE_OF.h>
+#include <constr_SEQUENCE_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declarations */
+struct ProtocolIE_SingleContainer;
+
+/* RICactions-ToBeSetup-List */
+typedef struct RICactions_ToBeSetup_List {
+	A_SEQUENCE_OF(struct ProtocolIE_SingleContainer) list;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICactions_ToBeSetup_List_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICactions_ToBeSetup_List;
+extern asn_SET_OF_specifics_t asn_SPC_RICactions_ToBeSetup_List_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICactions_ToBeSetup_List_1[1];
+extern asn_per_constraints_t asn_PER_type_RICactions_ToBeSetup_List_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICactions_ToBeSetup_List_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcallProcessID.h b/e2ap/headers/RICcallProcessID.h
new file mode 100644
index 0000000..a1a4983
--- /dev/null
+++ b/e2ap/headers/RICcallProcessID.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcallProcessID_H_
+#define	_RICcallProcessID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcallProcessID */
+typedef OCTET_STRING_t	 RICcallProcessID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcallProcessID;
+asn_struct_free_f RICcallProcessID_free;
+asn_struct_print_f RICcallProcessID_print;
+asn_constr_check_f RICcallProcessID_constraint;
+ber_type_decoder_f RICcallProcessID_decode_ber;
+der_type_encoder_f RICcallProcessID_encode_der;
+xer_type_decoder_f RICcallProcessID_decode_xer;
+xer_type_encoder_f RICcallProcessID_encode_xer;
+oer_type_decoder_f RICcallProcessID_decode_oer;
+oer_type_encoder_f RICcallProcessID_encode_oer;
+per_type_decoder_f RICcallProcessID_decode_uper;
+per_type_encoder_f RICcallProcessID_encode_uper;
+per_type_decoder_f RICcallProcessID_decode_aper;
+per_type_encoder_f RICcallProcessID_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcallProcessID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolAckRequest.h b/e2ap/headers/RICcontrolAckRequest.h
new file mode 100644
index 0000000..abb9553
--- /dev/null
+++ b/e2ap/headers/RICcontrolAckRequest.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolAckRequest_H_
+#define	_RICcontrolAckRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICcontrolAckRequest {
+	RICcontrolAckRequest_noAck	= 0,
+	RICcontrolAckRequest_ack	= 1,
+	RICcontrolAckRequest_nAck	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICcontrolAckRequest;
+
+/* RICcontrolAckRequest */
+typedef long	 RICcontrolAckRequest_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICcontrolAckRequest_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolAckRequest;
+extern const asn_INTEGER_specifics_t asn_SPC_RICcontrolAckRequest_specs_1;
+asn_struct_free_f RICcontrolAckRequest_free;
+asn_struct_print_f RICcontrolAckRequest_print;
+asn_constr_check_f RICcontrolAckRequest_constraint;
+ber_type_decoder_f RICcontrolAckRequest_decode_ber;
+der_type_encoder_f RICcontrolAckRequest_encode_der;
+xer_type_decoder_f RICcontrolAckRequest_decode_xer;
+xer_type_encoder_f RICcontrolAckRequest_encode_xer;
+oer_type_decoder_f RICcontrolAckRequest_decode_oer;
+oer_type_encoder_f RICcontrolAckRequest_encode_oer;
+per_type_decoder_f RICcontrolAckRequest_decode_uper;
+per_type_encoder_f RICcontrolAckRequest_encode_uper;
+per_type_decoder_f RICcontrolAckRequest_decode_aper;
+per_type_encoder_f RICcontrolAckRequest_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolAckRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolAcknowledge.h b/e2ap/headers/RICcontrolAcknowledge.h
new file mode 100644
index 0000000..361f3d6
--- /dev/null
+++ b/e2ap/headers/RICcontrolAcknowledge.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolAcknowledge_H_
+#define	_RICcontrolAcknowledge_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolAcknowledge */
+typedef struct RICcontrolAcknowledge {
+	ProtocolIE_Container_87P8_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolAcknowledge_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolAcknowledge;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolAcknowledge_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolFailure.h b/e2ap/headers/RICcontrolFailure.h
new file mode 100644
index 0000000..6eb6a04
--- /dev/null
+++ b/e2ap/headers/RICcontrolFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolFailure_H_
+#define	_RICcontrolFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolFailure */
+typedef struct RICcontrolFailure {
+	ProtocolIE_Container_87P9_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolHeader.h b/e2ap/headers/RICcontrolHeader.h
new file mode 100644
index 0000000..d7cad7d
--- /dev/null
+++ b/e2ap/headers/RICcontrolHeader.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolHeader_H_
+#define	_RICcontrolHeader_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolHeader */
+typedef OCTET_STRING_t	 RICcontrolHeader_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolHeader;
+asn_struct_free_f RICcontrolHeader_free;
+asn_struct_print_f RICcontrolHeader_print;
+asn_constr_check_f RICcontrolHeader_constraint;
+ber_type_decoder_f RICcontrolHeader_decode_ber;
+der_type_encoder_f RICcontrolHeader_encode_der;
+xer_type_decoder_f RICcontrolHeader_decode_xer;
+xer_type_encoder_f RICcontrolHeader_encode_xer;
+oer_type_decoder_f RICcontrolHeader_decode_oer;
+oer_type_encoder_f RICcontrolHeader_encode_oer;
+per_type_decoder_f RICcontrolHeader_decode_uper;
+per_type_encoder_f RICcontrolHeader_encode_uper;
+per_type_decoder_f RICcontrolHeader_decode_aper;
+per_type_encoder_f RICcontrolHeader_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolHeader_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolMessage.h b/e2ap/headers/RICcontrolMessage.h
new file mode 100644
index 0000000..08fdf4a
--- /dev/null
+++ b/e2ap/headers/RICcontrolMessage.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolMessage_H_
+#define	_RICcontrolMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolMessage */
+typedef OCTET_STRING_t	 RICcontrolMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolMessage;
+asn_struct_free_f RICcontrolMessage_free;
+asn_struct_print_f RICcontrolMessage_print;
+asn_constr_check_f RICcontrolMessage_constraint;
+ber_type_decoder_f RICcontrolMessage_decode_ber;
+der_type_encoder_f RICcontrolMessage_encode_der;
+xer_type_decoder_f RICcontrolMessage_decode_xer;
+xer_type_encoder_f RICcontrolMessage_encode_xer;
+oer_type_decoder_f RICcontrolMessage_decode_oer;
+oer_type_encoder_f RICcontrolMessage_encode_oer;
+per_type_decoder_f RICcontrolMessage_decode_uper;
+per_type_encoder_f RICcontrolMessage_encode_uper;
+per_type_decoder_f RICcontrolMessage_decode_aper;
+per_type_encoder_f RICcontrolMessage_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolOutcome.h b/e2ap/headers/RICcontrolOutcome.h
new file mode 100644
index 0000000..d70b5a5
--- /dev/null
+++ b/e2ap/headers/RICcontrolOutcome.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolOutcome_H_
+#define	_RICcontrolOutcome_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolOutcome */
+typedef OCTET_STRING_t	 RICcontrolOutcome_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolOutcome;
+asn_struct_free_f RICcontrolOutcome_free;
+asn_struct_print_f RICcontrolOutcome_print;
+asn_constr_check_f RICcontrolOutcome_constraint;
+ber_type_decoder_f RICcontrolOutcome_decode_ber;
+der_type_encoder_f RICcontrolOutcome_encode_der;
+xer_type_decoder_f RICcontrolOutcome_decode_xer;
+xer_type_encoder_f RICcontrolOutcome_encode_xer;
+oer_type_decoder_f RICcontrolOutcome_decode_oer;
+oer_type_encoder_f RICcontrolOutcome_encode_oer;
+per_type_decoder_f RICcontrolOutcome_decode_uper;
+per_type_encoder_f RICcontrolOutcome_encode_uper;
+per_type_decoder_f RICcontrolOutcome_decode_aper;
+per_type_encoder_f RICcontrolOutcome_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolOutcome_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolRequest.h b/e2ap/headers/RICcontrolRequest.h
new file mode 100644
index 0000000..db5ba24
--- /dev/null
+++ b/e2ap/headers/RICcontrolRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolRequest_H_
+#define	_RICcontrolRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICcontrolRequest */
+typedef struct RICcontrolRequest {
+	ProtocolIE_Container_87P7_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICcontrolRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICcontrolStatus.h b/e2ap/headers/RICcontrolStatus.h
new file mode 100644
index 0000000..033f5a9
--- /dev/null
+++ b/e2ap/headers/RICcontrolStatus.h
@@ -0,0 +1,57 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICcontrolStatus_H_
+#define	_RICcontrolStatus_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICcontrolStatus {
+	RICcontrolStatus_success	= 0,
+	RICcontrolStatus_rejected	= 1,
+	RICcontrolStatus_failed	= 2
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICcontrolStatus;
+
+/* RICcontrolStatus */
+typedef long	 RICcontrolStatus_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICcontrolStatus_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICcontrolStatus;
+extern const asn_INTEGER_specifics_t asn_SPC_RICcontrolStatus_specs_1;
+asn_struct_free_f RICcontrolStatus_free;
+asn_struct_print_f RICcontrolStatus_print;
+asn_constr_check_f RICcontrolStatus_constraint;
+ber_type_decoder_f RICcontrolStatus_decode_ber;
+der_type_encoder_f RICcontrolStatus_encode_der;
+xer_type_decoder_f RICcontrolStatus_decode_xer;
+xer_type_encoder_f RICcontrolStatus_encode_xer;
+oer_type_decoder_f RICcontrolStatus_decode_oer;
+oer_type_encoder_f RICcontrolStatus_encode_oer;
+per_type_decoder_f RICcontrolStatus_decode_uper;
+per_type_encoder_f RICcontrolStatus_encode_uper;
+per_type_decoder_f RICcontrolStatus_decode_aper;
+per_type_encoder_f RICcontrolStatus_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICcontrolStatus_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICeventTriggerDefinition.h b/e2ap/headers/RICeventTriggerDefinition.h
new file mode 100644
index 0000000..58ec4d2
--- /dev/null
+++ b/e2ap/headers/RICeventTriggerDefinition.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICeventTriggerDefinition_H_
+#define	_RICeventTriggerDefinition_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICeventTriggerDefinition */
+typedef OCTET_STRING_t	 RICeventTriggerDefinition_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICeventTriggerDefinition;
+asn_struct_free_f RICeventTriggerDefinition_free;
+asn_struct_print_f RICeventTriggerDefinition_print;
+asn_constr_check_f RICeventTriggerDefinition_constraint;
+ber_type_decoder_f RICeventTriggerDefinition_decode_ber;
+der_type_encoder_f RICeventTriggerDefinition_encode_der;
+xer_type_decoder_f RICeventTriggerDefinition_decode_xer;
+xer_type_encoder_f RICeventTriggerDefinition_encode_xer;
+oer_type_decoder_f RICeventTriggerDefinition_decode_oer;
+oer_type_encoder_f RICeventTriggerDefinition_encode_oer;
+per_type_decoder_f RICeventTriggerDefinition_decode_uper;
+per_type_encoder_f RICeventTriggerDefinition_encode_uper;
+per_type_decoder_f RICeventTriggerDefinition_decode_aper;
+per_type_encoder_f RICeventTriggerDefinition_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICeventTriggerDefinition_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindication.h b/e2ap/headers/RICindication.h
new file mode 100644
index 0000000..c984ab6
--- /dev/null
+++ b/e2ap/headers/RICindication.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindication_H_
+#define	_RICindication_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICindication */
+typedef struct RICindication {
+	ProtocolIE_Container_87P6_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICindication_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICindication;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindication_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindicationHeader.h b/e2ap/headers/RICindicationHeader.h
new file mode 100644
index 0000000..3220602
--- /dev/null
+++ b/e2ap/headers/RICindicationHeader.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindicationHeader_H_
+#define	_RICindicationHeader_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICindicationHeader */
+typedef OCTET_STRING_t	 RICindicationHeader_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICindicationHeader;
+asn_struct_free_f RICindicationHeader_free;
+asn_struct_print_f RICindicationHeader_print;
+asn_constr_check_f RICindicationHeader_constraint;
+ber_type_decoder_f RICindicationHeader_decode_ber;
+der_type_encoder_f RICindicationHeader_encode_der;
+xer_type_decoder_f RICindicationHeader_decode_xer;
+xer_type_encoder_f RICindicationHeader_encode_xer;
+oer_type_decoder_f RICindicationHeader_decode_oer;
+oer_type_encoder_f RICindicationHeader_encode_oer;
+per_type_decoder_f RICindicationHeader_decode_uper;
+per_type_encoder_f RICindicationHeader_encode_uper;
+per_type_decoder_f RICindicationHeader_decode_aper;
+per_type_encoder_f RICindicationHeader_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindicationHeader_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindicationMessage.h b/e2ap/headers/RICindicationMessage.h
new file mode 100644
index 0000000..f00ebe7
--- /dev/null
+++ b/e2ap/headers/RICindicationMessage.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindicationMessage_H_
+#define	_RICindicationMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <OCTET_STRING.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICindicationMessage */
+typedef OCTET_STRING_t	 RICindicationMessage_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICindicationMessage;
+asn_struct_free_f RICindicationMessage_free;
+asn_struct_print_f RICindicationMessage_print;
+asn_constr_check_f RICindicationMessage_constraint;
+ber_type_decoder_f RICindicationMessage_decode_ber;
+der_type_encoder_f RICindicationMessage_encode_der;
+xer_type_decoder_f RICindicationMessage_decode_xer;
+xer_type_encoder_f RICindicationMessage_encode_xer;
+oer_type_decoder_f RICindicationMessage_decode_oer;
+oer_type_encoder_f RICindicationMessage_encode_oer;
+per_type_decoder_f RICindicationMessage_decode_uper;
+per_type_encoder_f RICindicationMessage_encode_uper;
+per_type_decoder_f RICindicationMessage_decode_aper;
+per_type_encoder_f RICindicationMessage_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindicationMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindicationSN.h b/e2ap/headers/RICindicationSN.h
new file mode 100644
index 0000000..498aaef
--- /dev/null
+++ b/e2ap/headers/RICindicationSN.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindicationSN_H_
+#define	_RICindicationSN_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICindicationSN */
+typedef long	 RICindicationSN_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICindicationSN_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICindicationSN;
+asn_struct_free_f RICindicationSN_free;
+asn_struct_print_f RICindicationSN_print;
+asn_constr_check_f RICindicationSN_constraint;
+ber_type_decoder_f RICindicationSN_decode_ber;
+der_type_encoder_f RICindicationSN_encode_der;
+xer_type_decoder_f RICindicationSN_decode_xer;
+xer_type_encoder_f RICindicationSN_encode_xer;
+oer_type_decoder_f RICindicationSN_decode_oer;
+oer_type_encoder_f RICindicationSN_encode_oer;
+per_type_decoder_f RICindicationSN_decode_uper;
+per_type_encoder_f RICindicationSN_encode_uper;
+per_type_decoder_f RICindicationSN_decode_aper;
+per_type_encoder_f RICindicationSN_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindicationSN_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICindicationType.h b/e2ap/headers/RICindicationType.h
new file mode 100644
index 0000000..ffc0335
--- /dev/null
+++ b/e2ap/headers/RICindicationType.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICindicationType_H_
+#define	_RICindicationType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICindicationType {
+	RICindicationType_report	= 0,
+	RICindicationType_insert	= 1
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICindicationType;
+
+/* RICindicationType */
+typedef long	 RICindicationType_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICindicationType_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICindicationType;
+extern const asn_INTEGER_specifics_t asn_SPC_RICindicationType_specs_1;
+asn_struct_free_f RICindicationType_free;
+asn_struct_print_f RICindicationType_print;
+asn_constr_check_f RICindicationType_constraint;
+ber_type_decoder_f RICindicationType_decode_ber;
+der_type_encoder_f RICindicationType_encode_der;
+xer_type_decoder_f RICindicationType_decode_xer;
+xer_type_encoder_f RICindicationType_encode_xer;
+oer_type_decoder_f RICindicationType_decode_oer;
+oer_type_encoder_f RICindicationType_encode_oer;
+per_type_decoder_f RICindicationType_decode_uper;
+per_type_encoder_f RICindicationType_encode_uper;
+per_type_decoder_f RICindicationType_decode_aper;
+per_type_encoder_f RICindicationType_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICindicationType_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICrequestID.h b/e2ap/headers/RICrequestID.h
new file mode 100644
index 0000000..b76c37c
--- /dev/null
+++ b/e2ap/headers/RICrequestID.h
@@ -0,0 +1,45 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICrequestID_H_
+#define	_RICrequestID_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICrequestID */
+typedef struct RICrequestID {
+	long	 ricRequestorID;
+	long	 ricInstanceID;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICrequestID_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICrequestID;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICrequestID_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICrequestID_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICrequestID_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICserviceQuery.h b/e2ap/headers/RICserviceQuery.h
new file mode 100644
index 0000000..3b2c4ee
--- /dev/null
+++ b/e2ap/headers/RICserviceQuery.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICserviceQuery_H_
+#define	_RICserviceQuery_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICserviceQuery */
+typedef struct RICserviceQuery {
+	ProtocolIE_Container_87P19_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceQuery_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceQuery;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICserviceQuery_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICserviceUpdate.h b/e2ap/headers/RICserviceUpdate.h
new file mode 100644
index 0000000..9ade74f
--- /dev/null
+++ b/e2ap/headers/RICserviceUpdate.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICserviceUpdate_H_
+#define	_RICserviceUpdate_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICserviceUpdate */
+typedef struct RICserviceUpdate {
+	ProtocolIE_Container_87P16_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdate_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdate;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICserviceUpdate_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICserviceUpdateAcknowledge.h b/e2ap/headers/RICserviceUpdateAcknowledge.h
new file mode 100644
index 0000000..4b08d1a
--- /dev/null
+++ b/e2ap/headers/RICserviceUpdateAcknowledge.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICserviceUpdateAcknowledge_H_
+#define	_RICserviceUpdateAcknowledge_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICserviceUpdateAcknowledge */
+typedef struct RICserviceUpdateAcknowledge {
+	ProtocolIE_Container_87P17_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdateAcknowledge_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateAcknowledge;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICserviceUpdateAcknowledge_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICserviceUpdateFailure.h b/e2ap/headers/RICserviceUpdateFailure.h
new file mode 100644
index 0000000..c00559e
--- /dev/null
+++ b/e2ap/headers/RICserviceUpdateFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICserviceUpdateFailure_H_
+#define	_RICserviceUpdateFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICserviceUpdateFailure */
+typedef struct RICserviceUpdateFailure {
+	ProtocolIE_Container_87P18_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICserviceUpdateFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICserviceUpdateFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionDeleteFailure.h b/e2ap/headers/RICsubscriptionDeleteFailure.h
new file mode 100644
index 0000000..59bb7d4
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionDeleteFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionDeleteFailure_H_
+#define	_RICsubscriptionDeleteFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionDeleteFailure */
+typedef struct RICsubscriptionDeleteFailure {
+	ProtocolIE_Container_87P5_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionDeleteFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionDeleteRequest.h b/e2ap/headers/RICsubscriptionDeleteRequest.h
new file mode 100644
index 0000000..5019dab
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionDeleteRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionDeleteRequest_H_
+#define	_RICsubscriptionDeleteRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionDeleteRequest */
+typedef struct RICsubscriptionDeleteRequest {
+	ProtocolIE_Container_87P3_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionDeleteRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionDeleteResponse.h b/e2ap/headers/RICsubscriptionDeleteResponse.h
new file mode 100644
index 0000000..b1aeba6
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionDeleteResponse.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionDeleteResponse_H_
+#define	_RICsubscriptionDeleteResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionDeleteResponse */
+typedef struct RICsubscriptionDeleteResponse {
+	ProtocolIE_Container_87P4_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDeleteResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionDeleteResponse_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionDetails.h b/e2ap/headers/RICsubscriptionDetails.h
new file mode 100644
index 0000000..9b0a03e
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionDetails.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionDetails_H_
+#define	_RICsubscriptionDetails_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICeventTriggerDefinition.h"
+#include "RICactions-ToBeSetup-List.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionDetails */
+typedef struct RICsubscriptionDetails {
+	RICeventTriggerDefinition_t	 ricEventTriggerDefinition;
+	RICactions_ToBeSetup_List_t	 ricAction_ToBeSetup_List;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionDetails_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDetails;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDetails_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICsubscriptionDetails_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionDetails_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionFailure.h b/e2ap/headers/RICsubscriptionFailure.h
new file mode 100644
index 0000000..c8c4a77
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionFailure.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionFailure_H_
+#define	_RICsubscriptionFailure_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionFailure */
+typedef struct RICsubscriptionFailure {
+	ProtocolIE_Container_87P2_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionFailure_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionFailure;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionFailure_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionRequest.h b/e2ap/headers/RICsubscriptionRequest.h
new file mode 100644
index 0000000..9e9e0bb
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionRequest_H_
+#define	_RICsubscriptionRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionRequest */
+typedef struct RICsubscriptionRequest {
+	ProtocolIE_Container_87P0_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubscriptionResponse.h b/e2ap/headers/RICsubscriptionResponse.h
new file mode 100644
index 0000000..9b8bb17
--- /dev/null
+++ b/e2ap/headers/RICsubscriptionResponse.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubscriptionResponse_H_
+#define	_RICsubscriptionResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubscriptionResponse */
+typedef struct RICsubscriptionResponse {
+	ProtocolIE_Container_87P1_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubscriptionResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubscriptionResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubscriptionResponse_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubsequentAction.h b/e2ap/headers/RICsubsequentAction.h
new file mode 100644
index 0000000..fffdc21
--- /dev/null
+++ b/e2ap/headers/RICsubsequentAction.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubsequentAction_H_
+#define	_RICsubsequentAction_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "RICsubsequentActionType.h"
+#include "RICtimeToWait.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RICsubsequentAction */
+typedef struct RICsubsequentAction {
+	RICsubsequentActionType_t	 ricSubsequentActionType;
+	RICtimeToWait_t	 ricTimeToWait;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} RICsubsequentAction_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_RICsubsequentAction;
+extern asn_SEQUENCE_specifics_t asn_SPC_RICsubsequentAction_specs_1;
+extern asn_TYPE_member_t asn_MBR_RICsubsequentAction_1[2];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubsequentAction_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICsubsequentActionType.h b/e2ap/headers/RICsubsequentActionType.h
new file mode 100644
index 0000000..1dea790
--- /dev/null
+++ b/e2ap/headers/RICsubsequentActionType.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICsubsequentActionType_H_
+#define	_RICsubsequentActionType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICsubsequentActionType {
+	RICsubsequentActionType_continue	= 0,
+	RICsubsequentActionType_wait	= 1
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICsubsequentActionType;
+
+/* RICsubsequentActionType */
+typedef long	 RICsubsequentActionType_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICsubsequentActionType_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICsubsequentActionType;
+extern const asn_INTEGER_specifics_t asn_SPC_RICsubsequentActionType_specs_1;
+asn_struct_free_f RICsubsequentActionType_free;
+asn_struct_print_f RICsubsequentActionType_print;
+asn_constr_check_f RICsubsequentActionType_constraint;
+ber_type_decoder_f RICsubsequentActionType_decode_ber;
+der_type_encoder_f RICsubsequentActionType_encode_der;
+xer_type_decoder_f RICsubsequentActionType_decode_xer;
+xer_type_encoder_f RICsubsequentActionType_encode_xer;
+oer_type_decoder_f RICsubsequentActionType_decode_oer;
+oer_type_encoder_f RICsubsequentActionType_encode_oer;
+per_type_decoder_f RICsubsequentActionType_decode_uper;
+per_type_encoder_f RICsubsequentActionType_encode_uper;
+per_type_decoder_f RICsubsequentActionType_decode_aper;
+per_type_encoder_f RICsubsequentActionType_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICsubsequentActionType_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/RICtimeToWait.h b/e2ap/headers/RICtimeToWait.h
new file mode 100644
index 0000000..efe9b2a
--- /dev/null
+++ b/e2ap/headers/RICtimeToWait.h
@@ -0,0 +1,72 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_RICtimeToWait_H_
+#define	_RICtimeToWait_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum RICtimeToWait {
+	RICtimeToWait_zero	= 0,
+	RICtimeToWait_w1ms	= 1,
+	RICtimeToWait_w2ms	= 2,
+	RICtimeToWait_w5ms	= 3,
+	RICtimeToWait_w10ms	= 4,
+	RICtimeToWait_w20ms	= 5,
+	RICtimeToWait_w30ms	= 6,
+	RICtimeToWait_w40ms	= 7,
+	RICtimeToWait_w50ms	= 8,
+	RICtimeToWait_w100ms	= 9,
+	RICtimeToWait_w200ms	= 10,
+	RICtimeToWait_w500ms	= 11,
+	RICtimeToWait_w1s	= 12,
+	RICtimeToWait_w2s	= 13,
+	RICtimeToWait_w5s	= 14,
+	RICtimeToWait_w10s	= 15,
+	RICtimeToWait_w20s	= 16,
+	RICtimeToWait_w60s	= 17
+	/*
+	 * Enumeration is extensible
+	 */
+} e_RICtimeToWait;
+
+/* RICtimeToWait */
+typedef long	 RICtimeToWait_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_RICtimeToWait_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_RICtimeToWait;
+extern const asn_INTEGER_specifics_t asn_SPC_RICtimeToWait_specs_1;
+asn_struct_free_f RICtimeToWait_free;
+asn_struct_print_f RICtimeToWait_print;
+asn_constr_check_f RICtimeToWait_constraint;
+ber_type_decoder_f RICtimeToWait_decode_ber;
+der_type_encoder_f RICtimeToWait_encode_der;
+xer_type_decoder_f RICtimeToWait_decode_xer;
+xer_type_encoder_f RICtimeToWait_encode_xer;
+oer_type_decoder_f RICtimeToWait_decode_oer;
+oer_type_encoder_f RICtimeToWait_encode_oer;
+per_type_decoder_f RICtimeToWait_decode_uper;
+per_type_encoder_f RICtimeToWait_encode_uper;
+per_type_decoder_f RICtimeToWait_decode_aper;
+per_type_encoder_f RICtimeToWait_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _RICtimeToWait_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ResetRequest.h b/e2ap/headers/ResetRequest.h
new file mode 100644
index 0000000..b8ccee4
--- /dev/null
+++ b/e2ap/headers/ResetRequest.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ResetRequest_H_
+#define	_ResetRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ResetRequest */
+typedef struct ResetRequest {
+	ProtocolIE_Container_87P14_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResetRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ResetRequest;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ResetRequest_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/ResetResponse.h b/e2ap/headers/ResetResponse.h
new file mode 100644
index 0000000..cfd7a3c
--- /dev/null
+++ b/e2ap/headers/ResetResponse.h
@@ -0,0 +1,42 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_ResetResponse_H_
+#define	_ResetResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProtocolIE-Container.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ResetResponse */
+typedef struct ResetResponse {
+	ProtocolIE_Container_87P15_t	 protocolIEs;
+	/*
+	 * This type is extensible,
+	 * possible extensions are below.
+	 */
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} ResetResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_ResetResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _ResetResponse_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/SuccessfulOutcome.h b/e2ap/headers/SuccessfulOutcome.h
new file mode 100644
index 0000000..734bd7e
--- /dev/null
+++ b/e2ap/headers/SuccessfulOutcome.h
@@ -0,0 +1,91 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_SuccessfulOutcome_H_
+#define	_SuccessfulOutcome_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProcedureCode.h"
+#include "Criticality.h"
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "RICsubscriptionRequest.h"
+#include "RICsubscriptionResponse.h"
+#include "RICsubscriptionFailure.h"
+#include "RICsubscriptionDeleteRequest.h"
+#include "RICsubscriptionDeleteResponse.h"
+#include "RICsubscriptionDeleteFailure.h"
+#include "RICserviceUpdate.h"
+#include "RICserviceUpdateAcknowledge.h"
+#include "RICserviceUpdateFailure.h"
+#include "RICcontrolRequest.h"
+#include "RICcontrolAcknowledge.h"
+#include "RICcontrolFailure.h"
+#include "E2setupRequest.h"
+#include "E2setupResponse.h"
+#include "E2setupFailure.h"
+#include "ResetRequest.h"
+#include "ResetResponse.h"
+#include "RICindication.h"
+#include "RICserviceQuery.h"
+#include "ErrorIndication.h"
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum SuccessfulOutcome__value_PR {
+	SuccessfulOutcome__value_PR_NOTHING,	/* No components present */
+	SuccessfulOutcome__value_PR_RICsubscriptionResponse,
+	SuccessfulOutcome__value_PR_RICsubscriptionDeleteResponse,
+	SuccessfulOutcome__value_PR_RICserviceUpdateAcknowledge,
+	SuccessfulOutcome__value_PR_RICcontrolAcknowledge,
+	SuccessfulOutcome__value_PR_E2setupResponse,
+	SuccessfulOutcome__value_PR_ResetResponse
+} SuccessfulOutcome__value_PR;
+
+/* SuccessfulOutcome */
+typedef struct SuccessfulOutcome {
+	ProcedureCode_t	 procedureCode;
+	Criticality_t	 criticality;
+	struct SuccessfulOutcome__value {
+		SuccessfulOutcome__value_PR present;
+		union SuccessfulOutcome__value_u {
+			RICsubscriptionResponse_t	 RICsubscriptionResponse;
+			RICsubscriptionDeleteResponse_t	 RICsubscriptionDeleteResponse;
+			RICserviceUpdateAcknowledge_t	 RICserviceUpdateAcknowledge;
+			RICcontrolAcknowledge_t	 RICcontrolAcknowledge;
+			E2setupResponse_t	 E2setupResponse;
+			ResetResponse_t	 ResetResponse;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} SuccessfulOutcome_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_SuccessfulOutcome;
+extern asn_SEQUENCE_specifics_t asn_SPC_SuccessfulOutcome_specs_1;
+extern asn_TYPE_member_t asn_MBR_SuccessfulOutcome_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _SuccessfulOutcome_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/TimeToWait.h b/e2ap/headers/TimeToWait.h
new file mode 100644
index 0000000..9627535
--- /dev/null
+++ b/e2ap/headers/TimeToWait.h
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_TimeToWait_H_
+#define	_TimeToWait_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum TimeToWait {
+	TimeToWait_v1s	= 0,
+	TimeToWait_v2s	= 1,
+	TimeToWait_v5s	= 2,
+	TimeToWait_v10s	= 3,
+	TimeToWait_v20s	= 4,
+	TimeToWait_v60s	= 5
+	/*
+	 * Enumeration is extensible
+	 */
+} e_TimeToWait;
+
+/* TimeToWait */
+typedef long	 TimeToWait_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_TimeToWait_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_TimeToWait;
+extern const asn_INTEGER_specifics_t asn_SPC_TimeToWait_specs_1;
+asn_struct_free_f TimeToWait_free;
+asn_struct_print_f TimeToWait_print;
+asn_constr_check_f TimeToWait_constraint;
+ber_type_decoder_f TimeToWait_decode_ber;
+der_type_encoder_f TimeToWait_encode_der;
+xer_type_decoder_f TimeToWait_decode_xer;
+xer_type_encoder_f TimeToWait_encode_xer;
+oer_type_decoder_f TimeToWait_decode_oer;
+oer_type_encoder_f TimeToWait_encode_oer;
+per_type_decoder_f TimeToWait_decode_uper;
+per_type_encoder_f TimeToWait_encode_uper;
+per_type_decoder_f TimeToWait_decode_aper;
+per_type_encoder_f TimeToWait_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TimeToWait_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/TriggeringMessage.h b/e2ap/headers/TriggeringMessage.h
new file mode 100644
index 0000000..6f9f42e
--- /dev/null
+++ b/e2ap/headers/TriggeringMessage.h
@@ -0,0 +1,54 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_TriggeringMessage_H_
+#define	_TriggeringMessage_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum TriggeringMessage {
+	TriggeringMessage_initiating_message	= 0,
+	TriggeringMessage_successful_outcome	= 1,
+	TriggeringMessage_unsuccessfull_outcome	= 2
+} e_TriggeringMessage;
+
+/* TriggeringMessage */
+typedef long	 TriggeringMessage_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_TriggeringMessage_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_TriggeringMessage;
+extern const asn_INTEGER_specifics_t asn_SPC_TriggeringMessage_specs_1;
+asn_struct_free_f TriggeringMessage_free;
+asn_struct_print_f TriggeringMessage_print;
+asn_constr_check_f TriggeringMessage_constraint;
+ber_type_decoder_f TriggeringMessage_decode_ber;
+der_type_encoder_f TriggeringMessage_encode_der;
+xer_type_decoder_f TriggeringMessage_decode_xer;
+xer_type_encoder_f TriggeringMessage_encode_xer;
+oer_type_decoder_f TriggeringMessage_decode_oer;
+oer_type_encoder_f TriggeringMessage_encode_oer;
+per_type_decoder_f TriggeringMessage_decode_uper;
+per_type_encoder_f TriggeringMessage_encode_uper;
+per_type_decoder_f TriggeringMessage_decode_aper;
+per_type_encoder_f TriggeringMessage_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TriggeringMessage_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/TypeOfError.h b/e2ap/headers/TypeOfError.h
new file mode 100644
index 0000000..aec2d63
--- /dev/null
+++ b/e2ap/headers/TypeOfError.h
@@ -0,0 +1,56 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_TypeOfError_H_
+#define	_TypeOfError_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeEnumerated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum TypeOfError {
+	TypeOfError_not_understood	= 0,
+	TypeOfError_missing	= 1
+	/*
+	 * Enumeration is extensible
+	 */
+} e_TypeOfError;
+
+/* TypeOfError */
+typedef long	 TypeOfError_t;
+
+/* Implementation */
+extern asn_per_constraints_t asn_PER_type_TypeOfError_constr_1;
+extern asn_TYPE_descriptor_t asn_DEF_TypeOfError;
+extern const asn_INTEGER_specifics_t asn_SPC_TypeOfError_specs_1;
+asn_struct_free_f TypeOfError_free;
+asn_struct_print_f TypeOfError_print;
+asn_constr_check_f TypeOfError_constraint;
+ber_type_decoder_f TypeOfError_decode_ber;
+der_type_encoder_f TypeOfError_encode_der;
+xer_type_decoder_f TypeOfError_decode_xer;
+xer_type_encoder_f TypeOfError_encode_xer;
+oer_type_decoder_f TypeOfError_decode_oer;
+oer_type_encoder_f TypeOfError_encode_oer;
+per_type_decoder_f TypeOfError_decode_uper;
+per_type_encoder_f TypeOfError_encode_uper;
+per_type_decoder_f TypeOfError_decode_aper;
+per_type_encoder_f TypeOfError_encode_aper;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TypeOfError_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/UnsuccessfulOutcome.h b/e2ap/headers/UnsuccessfulOutcome.h
new file mode 100644
index 0000000..baf8838
--- /dev/null
+++ b/e2ap/headers/UnsuccessfulOutcome.h
@@ -0,0 +1,89 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#ifndef	_UnsuccessfulOutcome_H_
+#define	_UnsuccessfulOutcome_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "ProcedureCode.h"
+#include "Criticality.h"
+#include <ANY.h>
+#include <asn_ioc.h>
+#include "RICsubscriptionRequest.h"
+#include "RICsubscriptionResponse.h"
+#include "RICsubscriptionFailure.h"
+#include "RICsubscriptionDeleteRequest.h"
+#include "RICsubscriptionDeleteResponse.h"
+#include "RICsubscriptionDeleteFailure.h"
+#include "RICserviceUpdate.h"
+#include "RICserviceUpdateAcknowledge.h"
+#include "RICserviceUpdateFailure.h"
+#include "RICcontrolRequest.h"
+#include "RICcontrolAcknowledge.h"
+#include "RICcontrolFailure.h"
+#include "E2setupRequest.h"
+#include "E2setupResponse.h"
+#include "E2setupFailure.h"
+#include "ResetRequest.h"
+#include "ResetResponse.h"
+#include "RICindication.h"
+#include "RICserviceQuery.h"
+#include "ErrorIndication.h"
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum UnsuccessfulOutcome__value_PR {
+	UnsuccessfulOutcome__value_PR_NOTHING,	/* No components present */
+	UnsuccessfulOutcome__value_PR_RICsubscriptionFailure,
+	UnsuccessfulOutcome__value_PR_RICsubscriptionDeleteFailure,
+	UnsuccessfulOutcome__value_PR_RICserviceUpdateFailure,
+	UnsuccessfulOutcome__value_PR_RICcontrolFailure,
+	UnsuccessfulOutcome__value_PR_E2setupFailure
+} UnsuccessfulOutcome__value_PR;
+
+/* UnsuccessfulOutcome */
+typedef struct UnsuccessfulOutcome {
+	ProcedureCode_t	 procedureCode;
+	Criticality_t	 criticality;
+	struct UnsuccessfulOutcome__value {
+		UnsuccessfulOutcome__value_PR present;
+		union UnsuccessfulOutcome__value_u {
+			RICsubscriptionFailure_t	 RICsubscriptionFailure;
+			RICsubscriptionDeleteFailure_t	 RICsubscriptionDeleteFailure;
+			RICserviceUpdateFailure_t	 RICserviceUpdateFailure;
+			RICcontrolFailure_t	 RICcontrolFailure;
+			E2setupFailure_t	 E2setupFailure;
+		} choice;
+		
+		/* Context for parsing across buffer boundaries */
+		asn_struct_ctx_t _asn_ctx;
+	} value;
+	
+	/* Context for parsing across buffer boundaries */
+	asn_struct_ctx_t _asn_ctx;
+} UnsuccessfulOutcome_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_UnsuccessfulOutcome;
+extern asn_SEQUENCE_specifics_t asn_SPC_UnsuccessfulOutcome_specs_1;
+extern asn_TYPE_member_t asn_MBR_UnsuccessfulOutcome_1[3];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _UnsuccessfulOutcome_H_ */
+#include <asn_internal.h>
diff --git a/e2ap/headers/asn_SEQUENCE_OF.h b/e2ap/headers/asn_SEQUENCE_OF.h
new file mode 100644
index 0000000..e35bc44
--- /dev/null
+++ b/e2ap/headers/asn_SEQUENCE_OF.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_SEQUENCE_OF_H
+#define	ASN_SEQUENCE_OF_H
+
+#include <asn_SET_OF.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * SEQUENCE OF is the same as SET OF with a tiny difference:
+ * the delete operation preserves the initial order of elements
+ * and thus MAY operate in non-constant time.
+ */
+#define	A_SEQUENCE_OF(type)	A_SET_OF(type)
+
+#define	ASN_SEQUENCE_ADD(headptr, ptr)		\
+	asn_sequence_add((headptr), (ptr))
+
+/***********************************************
+ * Implementation of the SEQUENCE OF structure.
+ */
+
+#define	asn_sequence_add	asn_set_add
+#define	asn_sequence_empty	asn_set_empty
+
+/*
+ * Delete the element from the set by its number (base 0).
+ * This is NOT a constant-time operation.
+ * The order of elements is preserved.
+ * If _do_free is given AND the (*free) is initialized, the element
+ * will be freed using the custom (*free) function as well.
+ */
+void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free);
+
+/*
+ * Cope with different conversions requirements to/from void in C and C++.
+ * This is mostly useful for support library.
+ */
+typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_;
+#define _A_SEQUENCE_FROM_VOID(ptr)	((asn_anonymous_sequence_ *)(ptr))
+#define _A_CSEQUENCE_FROM_VOID(ptr) 	((const asn_anonymous_sequence_ *)(ptr))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_SEQUENCE_OF_H */
diff --git a/e2ap/headers/asn_SET_OF.h b/e2ap/headers/asn_SET_OF.h
new file mode 100644
index 0000000..882e1a4
--- /dev/null
+++ b/e2ap/headers/asn_SET_OF.h
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_SET_OF_H
+#define	ASN_SET_OF_H
+
+#ifdef __cplusplus
+#define A_SET_OF(type)                   \
+    struct {                             \
+        type **array;                    \
+        int count; /* Meaningful size */ \
+        int size;  /* Allocated size */  \
+        void (*free)(decltype(*array));  \
+    }
+#else   /* C */
+#define A_SET_OF(type)                   \
+    struct {                             \
+        type **array;                    \
+        int count; /* Meaningful size */ \
+        int size;  /* Allocated size */  \
+        void (*free)(type *);    \
+    }
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define	ASN_SET_ADD(headptr, ptr)		\
+	asn_set_add((headptr), (ptr))
+
+/*******************************************
+ * Implementation of the SET OF structure.
+ */
+
+/*
+ * Add another structure into the set by its pointer.
+ * RETURN VALUES:
+ * 0 for success and -1/errno for failure.
+ */
+int  asn_set_add(void *asn_set_of_x, void *ptr);
+
+/*
+ * Delete the element from the set by its number (base 0).
+ * This is a constant-time operation. The order of elements before the
+ * deleted ones is guaranteed, the order of elements after the deleted
+ * one is NOT guaranteed.
+ * If _do_free is given AND the (*free) is initialized, the element
+ * will be freed using the custom (*free) function as well.
+ */
+void asn_set_del(void *asn_set_of_x, int number, int _do_free);
+
+/*
+ * Empty the contents of the set. Will free the elements, if (*free) is given.
+ * Will NOT free the set itself.
+ */
+void asn_set_empty(void *asn_set_of_x);
+
+/*
+ * Cope with different conversions requirements to/from void in C and C++.
+ * This is mostly useful for support library.
+ */
+typedef A_SET_OF(void) asn_anonymous_set_;
+#define _A_SET_FROM_VOID(ptr)		((asn_anonymous_set_ *)(ptr))
+#define _A_CSET_FROM_VOID(ptr)		((const asn_anonymous_set_ *)(ptr))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_SET_OF_H */
diff --git a/e2ap/headers/asn_application.h b/e2ap/headers/asn_application.h
new file mode 100644
index 0000000..034f646
--- /dev/null
+++ b/e2ap/headers/asn_application.h
@@ -0,0 +1,171 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Application-level ASN.1 callbacks.
+ */
+#ifndef	ASN_APPLICATION_H
+#define	ASN_APPLICATION_H
+
+#include "asn_system.h"		/* for platform-dependent types */
+#include "asn_codecs.h"		/* for ASN.1 codecs specifics */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * A selection of ASN.1 Transfer Syntaxes to use with generalized
+ * encoders and decoders declared further in this .h file.
+ */
+enum asn_transfer_syntax {
+    /* Avoid appearance of a default transfer syntax. */
+    ATS_INVALID = 0,
+    /* Plaintext output (not conforming to any standard), for debugging. */
+    ATS_NONSTANDARD_PLAINTEXT,
+    /* Returns a randomly generated structure. */
+    ATS_RANDOM,
+    /*
+     * X.690:
+     * BER: Basic Encoding Rules.
+     * DER: Distinguished Encoding Rules.
+     * CER: Canonical Encoding Rules.
+     * DER and CER are more strict variants of BER.
+     */
+    ATS_BER,
+    ATS_DER,
+    ATS_CER, /* Only decoding is supported */
+    /*
+     * X.696:
+     * OER: Octet Encoding Rules.
+     * CANONICAL-OER is a more strict variant of BASIC-OER.
+     */
+    ATS_BASIC_OER,
+    ATS_CANONICAL_OER,
+    /*
+     * X.691:
+     * PER: Packed Encoding Rules.
+     * CANONICAL-PER is a more strict variant of BASIC-PER.
+     * NOTE: Produces or consumes a complete encoding (X.691 (08/2015) #11.1).
+     */
+    ATS_UNALIGNED_BASIC_PER,
+    ATS_UNALIGNED_CANONICAL_PER,
+    ATS_ALIGNED_BASIC_PER,
+    ATS_ALIGNED_CANONICAL_PER,
+    /*
+     * X.693:
+     * XER: XML Encoding Rules.
+     * CANONICAL-XER is a more strict variant of BASIC-XER.
+     */
+    ATS_BASIC_XER,
+    ATS_CANONICAL_XER
+};
+
+/*
+ * A generic encoder for any supported transfer syntax.
+ * RETURN VALUES:
+ * The (.encoded) field of the return value is REDEFINED to mean the following:
+ * >=0: The computed size of the encoded data. Can exceed the (buffer_size).
+ *  -1: Error encoding the structure. See the error code in (errno):
+ *      EINVAL: Incorrect parameters to the function, such as NULLs.
+ *      ENOENT: Encoding transfer syntax is not defined (for this type).
+ *      EBADF:  The structure has invalid form or content constraint failed.
+ *      The (.failed_type) and (.structure_ptr) MIGHT be set to the appropriate
+ *      values at the place of failure, if at all possible.
+ * WARNING: The (.encoded) field of the return value can exceed the buffer_size.
+ * This is similar to snprintf(3) contract which might return values
+ * greater than the buffer size.
+ */
+asn_enc_rval_t asn_encode_to_buffer(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode, void *buffer, size_t buffer_size);
+
+/*
+ * A variant of asn_encode_to_buffer() with automatically allocated buffer.
+ * RETURN VALUES:
+ * On success, returns a newly allocated (.buffer) containing the whole message.
+ * The message size is returned in (.result.encoded).
+ * On failure:
+ *  (.buffer) is NULL,
+ *  (.result.encoded) as in asn_encode_to_buffer(),
+ *  The errno codes as in asn_encode_to_buffer(), plus the following:
+ *      ENOMEM: Memory allocation failed due to system or internal limits.
+ * The user is responsible for freeing the (.buffer).
+ */
+typedef struct asn_encode_to_new_buffer_result_s {
+    void *buffer;   /* NULL if failed to encode. */
+    asn_enc_rval_t result;
+} asn_encode_to_new_buffer_result_t;
+asn_encode_to_new_buffer_result_t asn_encode_to_new_buffer(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode);
+
+
+/*
+ * Generic type of an application-defined callback to return various
+ * types of data to the application.
+ * EXPECTED RETURN VALUES:
+ *  -1: Failed to consume bytes. Abort the mission.
+ * Non-negative return values indicate success, and ignored.
+ */
+typedef int(asn_app_consume_bytes_f)(const void *buffer, size_t size,
+                                     void *application_specific_key);
+
+
+/*
+ * A generic encoder for any supported transfer syntax.
+ * Returns the comprehensive encoding result descriptor (see asn_codecs.h).
+ * RETURN VALUES:
+ * The negative (.encoded) field of the return values is accompanied with the
+ * following error codes (errno):
+ *      EINVAL: Incorrect parameters to the function, such as NULLs.
+ *      ENOENT: Encoding transfer syntax is not defined (for this type).
+ *      EBADF:  The structure has invalid form or content constraint failed.
+ *      EIO:    The (callback) has returned negative value during encoding.
+ */
+asn_enc_rval_t asn_encode(
+    const asn_codec_ctx_t *opt_codec_parameters, /* See asn_codecs.h */
+    enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_encode,
+    const void *structure_to_encode,
+    asn_app_consume_bytes_f *callback, void *callback_key);
+
+
+/*
+ * A generic decoder for any supported transfer syntax.
+ */
+asn_dec_rval_t asn_decode(
+    const asn_codec_ctx_t *opt_codec_parameters, enum asn_transfer_syntax,
+    const struct asn_TYPE_descriptor_s *type_to_decode,
+    void **structure_ptr, /* Pointer to a target structure's pointer */
+    const void *buffer,   /* Data to be decoded */
+    size_t size           /* Size of that buffer */
+);
+
+
+/*
+ * A callback of this type is called whenever constraint validation fails
+ * on some ASN.1 type. See "constraints.h" for more details on constraint
+ * validation.
+ * This callback specifies a descriptor of the ASN.1 type which failed
+ * the constraint check, as well as human readable message on what
+ * particular constraint has failed.
+ */
+typedef void (asn_app_constraint_failed_f)(void *application_specific_key,
+	const struct asn_TYPE_descriptor_s *type_descriptor_which_failed,
+	const void *structure_which_failed_ptr,
+	const char *error_message_format, ...) CC_PRINTFLIKE(4, 5);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#include "constr_TYPE.h"	/* for asn_TYPE_descriptor_t */
+
+#endif	/* ASN_APPLICATION_H */
diff --git a/e2ap/headers/asn_bit_data.h b/e2ap/headers/asn_bit_data.h
new file mode 100644
index 0000000..59de7af
--- /dev/null
+++ b/e2ap/headers/asn_bit_data.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_BIT_DATA
+#define	ASN_BIT_DATA
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This structure describes a position inside an incoming PER bit stream.
+ */
+typedef struct asn_bit_data_s {
+  const uint8_t *buffer;  /* Pointer to the octet stream */
+         size_t  nboff;   /* Bit offset to the meaningful bit */
+         size_t  nbits;   /* Number of bits in the stream */
+         size_t  moved;   /* Number of bits moved through this bit stream */
+  int (*refill)(struct asn_bit_data_s *);
+  void *refill_key;
+} asn_bit_data_t;
+
+/*
+ * Create a contiguous non-refillable bit data structure.
+ * Can be freed by FREEMEM().
+ */
+asn_bit_data_t *asn_bit_data_new_contiguous(const void *data, size_t size_bits);
+
+/*
+ * Extract a small number of bits (<= 31) from the specified PER data pointer.
+ * This function returns -1 if the specified number of bits could not be
+ * extracted due to EOD or other conditions.
+ */
+int32_t asn_get_few_bits(asn_bit_data_t *, int get_nbits);
+
+/* Undo the immediately preceeding "get_few_bits" operation */
+void asn_get_undo(asn_bit_data_t *, int get_nbits);
+
+/*
+ * Extract a large number of bits from the specified PER data pointer.
+ * This function returns -1 if the specified number of bits could not be
+ * extracted due to EOD or other conditions.
+ */
+int asn_get_many_bits(asn_bit_data_t *, uint8_t *dst, int right_align,
+			int get_nbits);
+
+/* Non-thread-safe debugging function, don't use it */
+char *asn_bit_data_string(asn_bit_data_t *);
+
+/*
+ * This structure supports forming bit output.
+ */
+typedef struct asn_bit_outp_s {
+	uint8_t *buffer;	/* Pointer into the (tmpspace) */
+	size_t nboff;		/* Bit offset to the meaningful bit */
+	size_t nbits;		/* Number of bits left in (tmpspace) */
+	uint8_t tmpspace[32];	/* Preliminary storage to hold data */
+	int (*output)(const void *data, size_t size, void *op_key);
+	void *op_key;		/* Key for (output) data callback */
+	size_t flushed_bytes;	/* Bytes already flushed through (output) */
+} asn_bit_outp_t;
+
+/* Output a small number of bits (<= 31) */
+int asn_put_few_bits(asn_bit_outp_t *, uint32_t bits, int obits);
+
+/* Output a large number of bits */
+int asn_put_many_bits(asn_bit_outp_t *, const uint8_t *src, int put_nbits);
+
+/*
+ * Flush whole bytes (0 or more) through (outper) member.
+ * The least significant bits which are not used are guaranteed to be set to 0.
+ * Returns -1 if callback returns -1. Otherwise, 0.
+ */
+int asn_put_aligned_flush(asn_bit_outp_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_BIT_DATA */
diff --git a/e2ap/headers/asn_codecs.h b/e2ap/headers/asn_codecs.h
new file mode 100644
index 0000000..e75c270
--- /dev/null
+++ b/e2ap/headers/asn_codecs.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_CODECS_H
+#define	ASN_CODECS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * This structure defines a set of parameters that may be passed
+ * to every ASN.1 encoder or decoder function.
+ * WARNING: if max_stack_size member is set, and you are calling the
+ *   function pointers of the asn_TYPE_descriptor_t directly,
+ *   this structure must be ALLOCATED ON THE STACK!
+ *   If you can't always satisfy this requirement, use ber_decode(),
+ *   xer_decode() and uper_decode() functions instead.
+ */
+typedef struct asn_codec_ctx_s {
+	/*
+	 * Limit the decoder routines to use no (much) more stack than a given
+	 * number of bytes. Most of decoders are stack-based, and this
+	 * would protect against stack overflows if the number of nested
+	 * encodings is high.
+	 * The OCTET STRING, BIT STRING and ANY BER decoders are heap-based,
+	 * and are safe from this kind of overflow.
+	 * A value from getrlimit(RLIMIT_STACK) may be used to initialize
+	 * this variable. Be careful in multithreaded environments, as the
+	 * stack size is rather limited.
+	 */
+	size_t  max_stack_size; /* 0 disables stack bounds checking */
+} asn_codec_ctx_t;
+
+/*
+ * Type of the return value of the encoding functions (der_encode, xer_encode).
+ */
+typedef struct asn_enc_rval_s {
+	/*
+	 * Number of bytes encoded.
+	 * -1 indicates failure to encode the structure.
+	 * In this case, the members below this one are meaningful.
+	 */
+	ssize_t encoded;
+
+	/*
+	 * Members meaningful when (encoded == -1), for post mortem analysis.
+	 */
+
+	/* Type which cannot be encoded */
+	const struct asn_TYPE_descriptor_s *failed_type;
+
+	/* Pointer to the structure of that type */
+	const void *structure_ptr;
+} asn_enc_rval_t;
+#define	ASN__ENCODE_FAILED do {					\
+	asn_enc_rval_t tmp_error;				\
+	tmp_error.encoded = -1;					\
+	tmp_error.failed_type = td;				\
+	tmp_error.structure_ptr = sptr;				\
+	ASN_DEBUG("Failed to encode element %s", td ? td->name : "");	\
+	return tmp_error;					\
+} while(0)
+#define	ASN__ENCODED_OK(rval) do {				\
+	rval.structure_ptr = 0;					\
+	rval.failed_type = 0;					\
+	return rval;						\
+} while(0)
+
+/*
+ * Type of the return value of the decoding functions (ber_decode, xer_decode)
+ * 
+ * Please note that the number of consumed bytes is ALWAYS meaningful,
+ * even if code==RC_FAIL. This is to indicate the number of successfully
+ * decoded bytes, hence providing a possibility to fail with more diagnostics
+ * (i.e., print the offending remainder of the buffer).
+ */
+enum asn_dec_rval_code_e {
+	RC_OK,		/* Decoded successfully */
+	RC_WMORE,	/* More data expected, call again */
+	RC_FAIL		/* Failure to decode data */
+};
+typedef struct asn_dec_rval_s {
+	enum asn_dec_rval_code_e code;	/* Result code */
+	size_t consumed;		/* Number of bytes consumed */
+} asn_dec_rval_t;
+#define	ASN__DECODE_FAILED do {					\
+	asn_dec_rval_t tmp_error;				\
+	tmp_error.code = RC_FAIL;				\
+	tmp_error.consumed = 0;					\
+	ASN_DEBUG("Failed to decode element %s", td ? td->name : "");	\
+	return tmp_error;					\
+} while(0)
+#define	ASN__DECODE_STARVED do {				\
+	asn_dec_rval_t tmp_error;				\
+	tmp_error.code = RC_WMORE;				\
+	tmp_error.consumed = 0;					\
+	return tmp_error;					\
+} while(0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_CODECS_H */
diff --git a/e2ap/headers/asn_codecs_prim.h b/e2ap/headers/asn_codecs_prim.h
new file mode 100644
index 0000000..fbc5576
--- /dev/null
+++ b/e2ap/headers/asn_codecs_prim.h
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_CODECS_PRIM_H
+#define	ASN_CODECS_PRIM_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct ASN__PRIMITIVE_TYPE_s {
+    uint8_t *buf;   /* Buffer with consecutive primitive encoding bytes */
+    size_t size;    /* Size of the buffer */
+} ASN__PRIMITIVE_TYPE_t;	/* Do not use this type directly! */
+
+asn_struct_free_f ASN__PRIMITIVE_TYPE_free;
+ber_type_decoder_f ber_decode_primitive;
+der_type_encoder_f der_encode_primitive;
+
+/*
+ * A callback specification for the xer_decode_primitive() function below.
+ */
+enum xer_pbd_rval {
+    XPBD_SYSTEM_FAILURE,  /* System failure (memory shortage, etc) */
+    XPBD_DECODER_LIMIT,   /* Hit some decoder limitation or deficiency */
+    XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */
+    XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */
+    XPBD_BODY_CONSUMED    /* Body is recognized and consumed */
+};
+typedef enum xer_pbd_rval(xer_primitive_body_decoder_f)(
+    const asn_TYPE_descriptor_t *td, void *struct_ptr, const void *chunk_buf,
+    size_t chunk_size);
+
+/*
+ * Specific function to decode simple primitive types.
+ * Also see xer_decode_general() in xer_decoder.h
+ */
+asn_dec_rval_t xer_decode_primitive(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+    size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size,
+    xer_primitive_body_decoder_f *prim_body_decoder);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_CODECS_PRIM_H */
diff --git a/e2ap/headers/asn_constant.h b/e2ap/headers/asn_constant.h
new file mode 100644
index 0000000..a6f348c
--- /dev/null
+++ b/e2ap/headers/asn_constant.h
@@ -0,0 +1,22 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ */
+
+#ifndef _ASN_CONSTANT_H
+#define _ASN_CONSTANT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define maxProtocolIEs (65535)
+#define maxnoofErrors (256)
+#define maxofRANfunctionID (256)
+#define maxofRICactionID (16)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ASN_CONSTANT_H */
diff --git a/e2ap/headers/asn_internal.h b/e2ap/headers/asn_internal.h
new file mode 100644
index 0000000..c4105ad
--- /dev/null
+++ b/e2ap/headers/asn_internal.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Declarations internally useful for the ASN.1 support code.
+ */
+#ifndef	ASN_INTERNAL_H
+#define	ASN_INTERNAL_H
+#define __EXTENSIONS__          /* for Sun */
+
+#include "asn_application.h"	/* Application-visible API */
+
+#ifndef	__NO_ASSERT_H__		/* Include assert.h only for internal use. */
+#include <assert.h>		/* for assert() macro */
+#endif
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/* Environment version might be used to avoid running with the old library */
+#define	ASN1C_ENVIRONMENT_VERSION	923	/* Compile-time version */
+int get_asn1c_environment_version(void);	/* Run-time version */
+
+#define	CALLOC(nmemb, size)	calloc(nmemb, size)
+#define	MALLOC(size)		malloc(size)
+#define	REALLOC(oldptr, size)	realloc(oldptr, size)
+#define	FREEMEM(ptr)		free(ptr)
+
+#define	asn_debug_indent	0
+#define ASN_DEBUG_INDENT_ADD(i) do{}while(0)
+
+#ifdef  EMIT_ASN_DEBUG
+#warning "Use ASN_EMIT_DEBUG instead of EMIT_ASN_DEBUG"
+#define ASN_EMIT_DEBUG  EMIT_ASN_DEBUG
+#endif
+
+/*
+ * A macro for debugging the ASN.1 internals.
+ * You may enable or override it.
+ */
+#ifndef	ASN_DEBUG	/* If debugging code is not defined elsewhere... */
+#if	ASN_EMIT_DEBUG == 1	/* And it was asked to emit this code... */
+#if !defined(BELL_LABS) /* Bell Labs */
+  //#if __STDC_VERSION__ >= 199901L
+#ifdef	ASN_THREAD_SAFE
+/* Thread safety requires sacrifice in output indentation:
+ * Retain empty definition of ASN_DEBUG_INDENT_ADD. */
+#else	/* !ASN_THREAD_SAFE */
+#undef  ASN_DEBUG_INDENT_ADD
+#undef  asn_debug_indent
+int asn_debug_indent;
+#define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0)
+#endif	/* ASN_THREAD_SAFE */
+#if defined(BELL_LABS) /* Bell Labs version */
+extern int logAsn1c(const char *filename, int linenumber, const char *format, ...);  
+#define	ASN_DEBUG(fmt, args...)	do {		        \
+    (void) logAsn1c(__FILE__, __LINE__, fmt, ##args);	\
+  } while(0)
+#else  
+#define	ASN_DEBUG(fmt, args...)	do {			\
+		int adi = asn_debug_indent;		\
+		while(adi--) fprintf(stderr, " ");	\
+		fprintf(stderr, fmt, ##args);		\
+		fprintf(stderr, " (%s:%d)\n",		\
+			__FILE__, __LINE__);		\
+	} while(0)
+#endif /* BELL_LABS */  
+#else	/* !C99 */
+void CC_PRINTFLIKE(1, 2) ASN_DEBUG_f(const char *fmt, ...);
+#define	ASN_DEBUG	ASN_DEBUG_f
+#endif	/* C99 */
+#else	/* ASN_EMIT_DEBUG != 1 */
+#if __STDC_VERSION__ >= 199901L
+#define ASN_DEBUG(...) do{}while(0)
+#else   /* not C99 */
+static void CC_PRINTFLIKE(1, 2) ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
+#endif  /* C99 or better */
+#endif	/* ASN_EMIT_DEBUG */
+#endif	/* ASN_DEBUG */
+
+/*
+ * Print to a callback.
+ * The callback is expected to return negative values on error.
+ * 0 and positive values are treated as success.
+ * RETURN VALUES:
+ *  -1: Failed to format or invoke the callback.
+ *  >0: Size of the data that got delivered to the callback.
+ */
+ssize_t CC_PRINTFLIKE(3, 4)
+asn__format_to_callback(
+    int (*callback)(const void *, size_t, void *key), void *key,
+    const char *fmt, ...);
+
+/*
+ * Invoke the application-supplied callback and fail, if something is wrong.
+ */
+#define ASN__E_cbc(buf, size) (cb((buf), (size), app_key) < 0)
+#define ASN__E_CALLBACK(size, foo) \
+    do {                           \
+        if(foo) goto cb_failed;    \
+        er.encoded += (size);      \
+    } while(0)
+#define ASN__CALLBACK(buf, size) ASN__E_CALLBACK(size, ASN__E_cbc(buf, size))
+#define ASN__CALLBACK2(buf1, size1, buf2, size2) \
+    ASN__E_CALLBACK((size1) + (size2),           \
+                    ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2))
+#define ASN__CALLBACK3(buf1, size1, buf2, size2, buf3, size3)          \
+    ASN__E_CALLBACK((size1) + (size2) + (size3),                       \
+                    ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2) \
+                        || ASN__E_cbc(buf3, size3))
+
+#define ASN__TEXT_INDENT(nl, level)                                          \
+    do {                                                                     \
+        int tmp_level = (level);                                             \
+        int tmp_nl = ((nl) != 0);                                            \
+        int tmp_i;                                                           \
+        if(tmp_nl) ASN__CALLBACK("\n", 1);                                   \
+        if(tmp_level < 0) tmp_level = 0;                                     \
+        for(tmp_i = 0; tmp_i < tmp_level; tmp_i++) ASN__CALLBACK("    ", 4); \
+    } while(0)
+
+#define	_i_INDENT(nl)	do {                        \
+        int tmp_i;                                  \
+        if((nl) && cb("\n", 1, app_key) < 0)        \
+            return -1;                              \
+        for(tmp_i = 0; tmp_i < ilevel; tmp_i++)     \
+            if(cb("    ", 4, app_key) < 0)          \
+                return -1;                          \
+    } while(0)
+
+/*
+ * Check stack against overflow, if limit is set.
+ */
+#define	ASN__DEFAULT_STACK_MAX	(30000)
+static int CC_NOTUSED
+ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
+	if(ctx && ctx->max_stack_size) {
+
+		/* ctx MUST be allocated on the stack */
+		ptrdiff_t usedstack = ((const char *)ctx - (const char *)&ctx);
+		if(usedstack > 0) usedstack = -usedstack; /* grows up! */
+
+		/* double negative required to avoid int wrap-around */
+		if(usedstack < -(ptrdiff_t)ctx->max_stack_size) {
+			ASN_DEBUG("Stack limit %ld reached",
+				(long)ctx->max_stack_size);
+			return -1;
+		}
+	}
+	return 0;
+}
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* ASN_INTERNAL_H */
diff --git a/e2ap/headers/asn_ioc.h b/e2ap/headers/asn_ioc.h
new file mode 100644
index 0000000..7de210e
--- /dev/null
+++ b/e2ap/headers/asn_ioc.h
@@ -0,0 +1,51 @@
+/*
+ * Run-time support for Information Object Classes.
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_IOC_H
+#define	ASN_IOC_H
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;
+struct asn_ioc_cell_s;
+
+/*
+ * X.681, #13
+ */
+typedef struct asn_ioc_set_s {
+    size_t rows_count;
+    size_t columns_count;
+    const struct asn_ioc_cell_s *rows;
+} asn_ioc_set_t;
+
+
+typedef struct asn_ioc_cell_s {
+    const char *field_name; /* Is equal to corresponding column_name */
+    enum {
+        aioc__undefined = 0,
+        aioc__value,
+        aioc__type,
+        aioc__open_type,
+    } cell_kind;
+    struct asn_TYPE_descriptor_s *type_descriptor;
+    const void *value_sptr;
+    struct {
+        size_t types_count;
+        struct {
+            unsigned choice_position;
+        } *types;
+    } open_type;
+} asn_ioc_cell_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN_IOC_H */
diff --git a/e2ap/headers/asn_random_fill.h b/e2ap/headers/asn_random_fill.h
new file mode 100644
index 0000000..47f9b8a
--- /dev/null
+++ b/e2ap/headers/asn_random_fill.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN_RANDOM_FILL
+#define	ASN_RANDOM_FILL
+
+/* Forward declarations */
+struct asn_TYPE_descriptor_s;
+struct asn_encoding_constraints_s;
+
+/*
+ * Initialize a structure with random data according to the type specification
+ * and optional member constraints.
+ * ARGUMENTS:
+ *  (max_length)        - See (approx_max_length_limit).
+ *  (memb_constraints)  - Member constraints, if exist.
+ *                        The type can be constrained differently according
+ *                        to PER and OER specifications, so we find a value
+ *                        at the intersection of these constraints.
+ * In case the return differs from ARFILL_OK, the (struct_ptr) contents
+ * and (current_length) value remain in their original state.
+ */
+typedef struct asn_random_fill_result_s {
+    enum {
+        ARFILL_FAILED = -1, /* System error (memory?) */
+        ARFILL_OK = 0,      /* Initialization succeeded */
+        ARFILL_SKIPPED = 1  /* Not done due to (length?) constraint */
+    } code;
+    size_t length; /* Approximate number of bytes created. */
+} asn_random_fill_result_t;
+typedef asn_random_fill_result_t(asn_random_fill_f)(
+    const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+    const struct asn_encoding_constraints_s *memb_constraints,
+    size_t max_length);
+
+/*
+ * Returns 0 if the structure was properly initialized, -1 otherwise.
+ * The (approx_max_length_limit) specifies the approximate limit of the
+ * resulting structure in units closely resembling bytes. The actual result
+ * might be several times larger or smaller than the length limit.
+ */
+int asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+                    size_t approx_max_length_limit);
+
+/*
+ * Returns a random number between min and max.
+ */
+intmax_t asn_random_between(intmax_t min, intmax_t max);
+
+#endif	/* ASN_RANDOM_FILL */
diff --git a/e2ap/headers/asn_system.h b/e2ap/headers/asn_system.h
new file mode 100644
index 0000000..cc5cead
--- /dev/null
+++ b/e2ap/headers/asn_system.h
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Miscellaneous system-dependent types.
+ */
+#ifndef	ASN_SYSTEM_H
+#define	ASN_SYSTEM_H
+
+#ifdef	HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE 1
+#endif
+
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE /* for snprintf() on some linux systems  */
+#endif
+
+#include <stdio.h>	/* For snprintf(3) */
+#include <stdlib.h>	/* For *alloc(3) */
+#include <string.h>	/* For memcpy(3) */
+#include <sys/types.h>	/* For size_t */
+#include <limits.h>	/* For LONG_MAX */
+#include <stdarg.h>	/* For va_start */
+#include <stddef.h>	/* for offsetof and ptrdiff_t */
+
+#ifdef	_WIN32
+
+#include <malloc.h>
+#define	 snprintf	_snprintf
+#define	 vsnprintf	_vsnprintf
+
+/* To avoid linking with ws2_32.lib, here's the definition of ntohl() */
+#define sys_ntohl(l)	((((l) << 24)  & 0xff000000)	\
+			| (((l) << 8) & 0xff0000)	\
+			| (((l) >> 8)  & 0xff00)	\
+			| ((l >> 24) & 0xff))
+
+#ifdef _MSC_VER			/* MSVS.Net */
+#ifndef __cplusplus
+#define inline __inline
+#endif
+#ifndef	ASSUMESTDTYPES	/* Standard types have been defined elsewhere */
+#define	ssize_t		SSIZE_T
+#if _MSC_VER < 1600
+typedef	char		int8_t;
+typedef	short		int16_t;
+typedef	int		int32_t;
+typedef	unsigned char	uint8_t;
+typedef	unsigned short	uint16_t;
+typedef	unsigned int	uint32_t;
+#else /* _MSC_VER >= 1600 */
+#include <stdint.h>
+#endif /* _MSC_VER < 1600 */
+#endif	/* ASSUMESTDTYPES */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <float.h>
+#define isnan _isnan
+#define finite _finite
+#define copysign _copysign
+#ifdef WIN32	//MCHECK
+	#define	ilogb	ilogb
+#else
+	#define ilogb _logb
+#endif
+#else	/* !_MSC_VER */
+#include <stdint.h>
+#endif	/* _MSC_VER */
+
+#else	/* !_WIN32 */
+
+#if defined(__vxworks)
+#include <types/vxTypes.h>
+#else	/* !defined(__vxworks) */
+
+#include <inttypes.h>	/* C99 specifies this file */
+#include <netinet/in.h> /* for ntohl() */
+#define	sys_ntohl(foo)	ntohl(foo)
+#endif	/* defined(__vxworks) */
+
+#endif	/* _WIN32 */
+
+#if	__GNUC__ >= 3 || defined(__clang__)
+#define CC_ATTRIBUTE(attr)    __attribute__((attr))
+#else
+#define CC_ATTRIBUTE(attr)
+#endif
+#define CC_PRINTFLIKE(fmt, var)     CC_ATTRIBUTE(format(printf, fmt, var))
+#define	CC_NOTUSED                  CC_ATTRIBUTE(unused)
+#ifndef CC_ATTR_NO_SANITIZE
+#define CC_ATTR_NO_SANITIZE(what)   CC_ATTRIBUTE(no_sanitize(what))
+#endif
+
+/* Figure out if thread safety is requested */
+#if !defined(ASN_THREAD_SAFE) && (defined(THREAD_SAFE) || defined(_REENTRANT))
+#define	ASN_THREAD_SAFE
+#endif	/* Thread safety */
+
+#ifndef	offsetof	/* If not defined by <stddef.h> */
+#define	offsetof(s, m)	((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0))
+#endif	/* offsetof */
+
+#ifndef	MIN		/* Suitable for comparing primitive types (integers) */
+#if defined(__GNUC__)
+#define	MIN(a,b)	({ __typeof a _a = a; __typeof b _b = b;	\
+	((_a)<(_b)?(_a):(_b)); })
+#else	/* !__GNUC__ */
+#define	MIN(a,b)	((a)<(b)?(a):(b))	/* Unsafe variant */
+#endif /* __GNUC__ */
+#endif	/* MIN */
+
+#if __STDC_VERSION__ >= 199901L
+#ifndef SIZE_MAX
+#define SIZE_MAX   ((~((size_t)0)) >> 1)
+#endif
+
+#ifndef RSIZE_MAX   /* C11, Annex K */
+#define RSIZE_MAX   (SIZE_MAX >> 1)
+#endif
+#ifndef RSSIZE_MAX   /* Halve signed size even further than unsigned */
+#define RSSIZE_MAX   ((ssize_t)(RSIZE_MAX >> 1))
+#endif
+#else   /* Old compiler */
+#undef  SIZE_MAX
+#undef  RSIZE_MAX
+#undef  RSSIZE_MAX
+#define SIZE_MAX   ((~((size_t)0)) >> 1)
+#define RSIZE_MAX   (SIZE_MAX >> 1)
+#define RSSIZE_MAX   ((ssize_t)(RSIZE_MAX >> 1))
+#endif
+
+#if __STDC_VERSION__ >= 199901L
+#define ASN_PRI_SIZE "zu"
+#define ASN_PRI_SSIZE "zd"
+#define ASN_PRIuMAX PRIuMAX
+#define ASN_PRIdMAX PRIdMAX
+#else
+#define ASN_PRI_SIZE "lu"
+#define ASN_PRI_SSIZE "ld"
+#if LLONG_MAX > LONG_MAX
+#define ASN_PRIuMAX "llu"
+#define ASN_PRIdMAX "lld"
+#else
+#define ASN_PRIuMAX "lu"
+#define ASN_PRIdMAX "ld"
+#endif
+#endif
+
+#endif	/* ASN_SYSTEM_H */
diff --git a/e2ap/headers/ber_decoder.h b/e2ap/headers/ber_decoder.h
new file mode 100644
index 0000000..1ac2a5e
--- /dev/null
+++ b/e2ap/headers/ber_decoder.h
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_DECODER_H_
+#define	_BER_DECODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_codec_ctx_s;		/* Forward declaration */
+
+/*
+ * The BER decoder of any type.
+ * This function may be invoked directly from the application.
+ * Decodes BER, DER and CER data (DER and CER are different subsets of BER).
+ *
+ * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding
+ * which is compliant with ber_decode().
+ */
+asn_dec_rval_t ber_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of that buffer */
+);
+
+/*
+ * Type of generic function which decodes the byte stream into the structure.
+ */
+typedef asn_dec_rval_t(ber_type_decoder_f)(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
+    const void *buf_ptr, size_t size, int tag_mode);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Check that all tags correspond to the type definition (as given in head).
+ * On return, last_length would contain either a non-negative length of the
+ * value part of the last TLV, or the negative number of expected
+ * "end of content" sequences. The number may only be negative if the
+ * head->last_tag_form is non-zero.
+ */
+asn_dec_rval_t ber_check_tags(
+    const struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    asn_struct_ctx_t *opt_ctx, /* saved decoding context */
+    const void *ptr, size_t size,
+    int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+    int last_tag_form, /* {-1,0:1}: any, primitive, constr */
+    ber_tlv_len_t *last_length, int *opt_tlv_form /* optional tag form */
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_DECODER_H_ */
diff --git a/e2ap/headers/ber_tlv_length.h b/e2ap/headers/ber_tlv_length.h
new file mode 100644
index 0000000..d1e4d48
--- /dev/null
+++ b/e2ap/headers/ber_tlv_length.h
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_TLV_LENGTH_H_
+#define	_BER_TLV_LENGTH_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef ssize_t ber_tlv_len_t;
+
+/*
+ * This function tries to fetch the length of the BER TLV value and place it
+ * in *len_r.
+ * RETURN VALUES:
+ *	 0:	More data expected than bufptr contains.
+ *	-1:	Fatal error deciphering length.
+ *	>0:	Number of bytes used from bufptr.
+ * On return with >0, len_r is constrained as -1..MAX, where -1 mean
+ * that the value is of indefinite length.
+ */
+ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
+	ber_tlv_len_t *len_r);
+
+/*
+ * This function expects bufptr to be positioned over L in TLV.
+ * It returns number of bytes occupied by L and V together, suitable
+ * for skipping. The function properly handles indefinite length.
+ * RETURN VALUES:
+ * 	Standard {-1,0,>0} convention.
+ */
+ssize_t ber_skip_length(
+	const struct asn_codec_ctx_s *opt_codec_ctx,	/* optional context */
+	int _is_constructed, const void *bufptr, size_t size);
+
+/*
+ * This function serializes the length (L from TLV) in DER format.
+ * It always returns number of bytes necessary to represent the length,
+ * it is a caller's responsibility to check the return value
+ * against the supplied buffer's size.
+ */
+size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_TLV_LENGTH_H_ */
diff --git a/e2ap/headers/ber_tlv_tag.h b/e2ap/headers/ber_tlv_tag.h
new file mode 100644
index 0000000..ce227ad
--- /dev/null
+++ b/e2ap/headers/ber_tlv_tag.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_BER_TLV_TAG_H_
+#define	_BER_TLV_TAG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum asn_tag_class {
+	ASN_TAG_CLASS_UNIVERSAL		= 0,	/* 0b00 */
+	ASN_TAG_CLASS_APPLICATION	= 1,	/* 0b01 */
+	ASN_TAG_CLASS_CONTEXT		= 2,	/* 0b10 */
+	ASN_TAG_CLASS_PRIVATE		= 3	/* 0b11 */
+};
+typedef unsigned ber_tlv_tag_t;	/* BER TAG from Tag-Length-Value */
+
+/*
+ * Tag class is encoded together with tag value for optimization purposes.
+ */
+#define	BER_TAG_CLASS(tag)	((tag) & 0x3)
+#define	BER_TAG_VALUE(tag)	((tag) >> 2)
+#define	BER_TLV_CONSTRUCTED(tagptr)	(((*(const uint8_t *)tagptr)&0x20)?1:0)
+
+#define	BER_TAGS_EQUAL(tag1, tag2)	((tag1) == (tag2))
+
+/*
+ * Several functions for printing the TAG in the canonical form
+ * (i.e. "[PRIVATE 0]").
+ * Return values correspond to their libc counterparts (if any).
+ */
+ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen);
+ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *);
+char *ber_tlv_tag_string(ber_tlv_tag_t tag);
+
+
+/*
+ * This function tries to fetch the tag from the input stream.
+ * RETURN VALUES:
+ * 	 0:	More data expected than bufptr contains.
+ * 	-1:	Fatal error deciphering tag.
+ *	>0:	Number of bytes used from bufptr. tag_r will contain the tag.
+ */
+ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r);
+
+/*
+ * This function serializes the tag (T from TLV) in BER format.
+ * It always returns number of bytes necessary to represent the tag,
+ * it is a caller's responsibility to check the return value
+ * against the supplied buffer's size.
+ */
+size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _BER_TLV_TAG_H_ */
diff --git a/e2ap/headers/constr_CHOICE.h b/e2ap/headers/constr_CHOICE.h
new file mode 100644
index 0000000..a1999ed
--- /dev/null
+++ b/e2ap/headers/constr_CHOICE.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_CHOICE_H_
+#define	_CONSTR_CHOICE_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_CHOICE_specifics_s {
+	/*
+	 * Target structure description.
+	 */
+	unsigned struct_size;       /* Size of the target structure. */
+	unsigned ctx_offset;        /* Offset of the asn_codec_ctx_t member */
+	unsigned pres_offset;       /* Identifier of the present member */
+	unsigned pres_size;         /* Size of the identifier (enum) */
+
+	/*
+	 * Tags to members mapping table.
+	 */
+	const asn_TYPE_tag2member_t *tag2el;
+	unsigned tag2el_count;
+
+	/* Canonical ordering of CHOICE elements, for PER */
+	const unsigned *to_canonical_order;
+	const unsigned *from_canonical_order;
+
+	/*
+	 * Extensions-related stuff.
+	 */
+	signed ext_start; /* First member of extensions, or -1 */
+} asn_CHOICE_specifics_t;
+
+/*
+ * A set specialized functions dealing with the CHOICE type.
+ */
+asn_struct_free_f CHOICE_free;
+asn_struct_print_f CHOICE_print;
+asn_struct_compare_f CHOICE_compare;
+asn_constr_check_f CHOICE_constraint;
+ber_type_decoder_f CHOICE_decode_ber;
+der_type_encoder_f CHOICE_encode_der;
+xer_type_decoder_f CHOICE_decode_xer;
+xer_type_encoder_f CHOICE_encode_xer;
+oer_type_decoder_f CHOICE_decode_oer;
+oer_type_encoder_f CHOICE_encode_oer;
+per_type_decoder_f CHOICE_decode_uper;
+per_type_encoder_f CHOICE_encode_uper;
+per_type_decoder_f CHOICE_decode_aper;
+per_type_encoder_f CHOICE_encode_aper;
+asn_outmost_tag_f CHOICE_outmost_tag;
+asn_random_fill_f CHOICE_random_fill;
+extern asn_TYPE_operation_t asn_OP_CHOICE;
+
+/*
+ * Return the 1-based choice variant presence index.
+ * Returns 0 in case of error.
+ */
+unsigned CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td,
+                                     const void *structure_ptr);
+
+/*
+ * Sets or resets the 1-based choice variant presence index.
+ * In case a previous index is not zero, the currently selected structure
+ * member is freed and zeroed-out first.
+ * Returns 0 on success and -1 on error.
+ */
+int CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td,
+                                void *structure_ptr, unsigned present);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_CHOICE_H_ */
diff --git a/e2ap/headers/constr_SEQUENCE.h b/e2ap/headers/constr_SEQUENCE.h
new file mode 100644
index 0000000..a22ed3a
--- /dev/null
+++ b/e2ap/headers/constr_SEQUENCE.h
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_SEQUENCE_H_
+#define	_CONSTR_SEQUENCE_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_SEQUENCE_specifics_s {
+	/*
+	 * Target structure description.
+	 */
+	unsigned struct_size;	/* Size of the target structure. */
+	unsigned ctx_offset;	/* Offset of the asn_struct_ctx_t member */
+
+	/*
+	 * Tags to members mapping table (sorted).
+	 */
+	const asn_TYPE_tag2member_t *tag2el;
+	unsigned tag2el_count;
+
+	/*
+	 * Optional members of the extensions root (roms) or additions (aoms).
+	 * Meaningful for PER.
+	 */
+	const int *oms;         /* Optional MemberS */
+	unsigned roms_count;    /* Root optional members count */
+	unsigned aoms_count;    /* Additions optional members count */
+
+	/*
+	 * Description of an extensions group.
+	 * Root components are clustered at the beginning of the structure,
+	 * whereas extensions are clustered at the end. -1 means not extensible.
+	 */
+	signed first_extension;       /* First extension addition */
+} asn_SEQUENCE_specifics_t;
+
+
+/*
+ * A set specialized functions dealing with the SEQUENCE type.
+ */
+asn_struct_free_f SEQUENCE_free;
+asn_struct_print_f SEQUENCE_print;
+asn_struct_compare_f SEQUENCE_compare;
+asn_constr_check_f SEQUENCE_constraint;
+ber_type_decoder_f SEQUENCE_decode_ber;
+der_type_encoder_f SEQUENCE_encode_der;
+xer_type_decoder_f SEQUENCE_decode_xer;
+xer_type_encoder_f SEQUENCE_encode_xer;
+oer_type_decoder_f SEQUENCE_decode_oer;
+oer_type_encoder_f SEQUENCE_encode_oer;
+per_type_decoder_f SEQUENCE_decode_uper;
+per_type_encoder_f SEQUENCE_encode_uper;
+per_type_decoder_f SEQUENCE_decode_aper;
+per_type_encoder_f SEQUENCE_encode_aper;
+asn_random_fill_f  SEQUENCE_random_fill;
+extern asn_TYPE_operation_t asn_OP_SEQUENCE;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_SEQUENCE_H_ */
diff --git a/e2ap/headers/constr_SEQUENCE_OF.h b/e2ap/headers/constr_SEQUENCE_OF.h
new file mode 100644
index 0000000..6857f0f
--- /dev/null
+++ b/e2ap/headers/constr_SEQUENCE_OF.h
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_CONSTR_SEQUENCE_OF_H_
+#define	_CONSTR_SEQUENCE_OF_H_
+
+#include <asn_application.h>
+#include <constr_SET_OF.h>		/* Implemented using SET OF */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * A set specialized functions dealing with the SEQUENCE OF type.
+ * Generally implemented using SET OF.
+ */
+asn_struct_compare_f SEQUENCE_OF_compare;
+der_type_encoder_f SEQUENCE_OF_encode_der;
+xer_type_encoder_f SEQUENCE_OF_encode_xer;
+per_type_encoder_f SEQUENCE_OF_encode_uper;
+per_type_encoder_f SEQUENCE_OF_encode_aper;
+extern asn_TYPE_operation_t asn_OP_SEQUENCE_OF;
+
+#define	SEQUENCE_OF_free	SET_OF_free
+#define	SEQUENCE_OF_print	SET_OF_print
+#define	SEQUENCE_OF_constraint	SET_OF_constraint
+#define	SEQUENCE_OF_decode_ber	SET_OF_decode_ber
+#define	SEQUENCE_OF_decode_xer	SET_OF_decode_xer
+#define	SEQUENCE_OF_decode_oer  SET_OF_decode_oer
+#define	SEQUENCE_OF_encode_oer  SET_OF_encode_oer
+#define	SEQUENCE_OF_decode_uper	SET_OF_decode_uper
+#define	SEQUENCE_OF_decode_aper	SET_OF_decode_aper
+#define	SEQUENCE_OF_random_fill SET_OF_random_fill
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_SET_OF_H_ */
diff --git a/e2ap/headers/constr_SET_OF.h b/e2ap/headers/constr_SET_OF.h
new file mode 100644
index 0000000..7681062
--- /dev/null
+++ b/e2ap/headers/constr_SET_OF.h
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	CONSTR_SET_OF_H
+#define	CONSTR_SET_OF_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct asn_SET_OF_specifics_s {
+    /*
+     * Target structure description.
+     */
+    unsigned struct_size;       /* Size of the target structure. */
+    unsigned ctx_offset;        /* Offset of the asn_struct_ctx_t member */
+
+    /* XER-specific stuff */
+    int as_XMLValueList; /* The member type must be encoded like this */
+} asn_SET_OF_specifics_t;
+
+/*
+ * A set specialized functions dealing with the SET OF type.
+ */
+asn_struct_free_f SET_OF_free;
+asn_struct_print_f SET_OF_print;
+asn_struct_compare_f SET_OF_compare;
+asn_constr_check_f SET_OF_constraint;
+ber_type_decoder_f SET_OF_decode_ber;
+der_type_encoder_f SET_OF_encode_der;
+xer_type_decoder_f SET_OF_decode_xer;
+xer_type_encoder_f SET_OF_encode_xer;
+oer_type_decoder_f SET_OF_decode_oer;
+oer_type_encoder_f SET_OF_encode_oer;
+per_type_decoder_f SET_OF_decode_uper;
+per_type_encoder_f SET_OF_encode_uper;
+per_type_decoder_f SET_OF_decode_aper;
+per_type_encoder_f SET_OF_encode_aper;
+asn_random_fill_f  SET_OF_random_fill;
+extern asn_TYPE_operation_t asn_OP_SET_OF;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* CONSTR_SET_OF_H */
diff --git a/e2ap/headers/constr_TYPE.h b/e2ap/headers/constr_TYPE.h
new file mode 100644
index 0000000..d80dea5
--- /dev/null
+++ b/e2ap/headers/constr_TYPE.h
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * This file contains the declaration structure called "ASN.1 Type Definition",
+ * which holds all information necessary for encoding and decoding routines.
+ * This structure even contains pointer to these encoding and decoding routines
+ * for each defined ASN.1 type.
+ */
+#ifndef	_CONSTR_TYPE_H_
+#define	_CONSTR_TYPE_H_
+
+#include <ber_tlv_length.h>
+#include <ber_tlv_tag.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_TYPE_member_s;	/* Forward declaration */
+
+/*
+ * This type provides the context information for various ASN.1 routines,
+ * primarily ones doing decoding. A member _asn_ctx of this type must be
+ * included into certain target language's structures, such as compound types.
+ */
+typedef struct asn_struct_ctx_s {
+	short phase;		/* Decoding phase */
+	short step;		/* Elementary step of a phase */
+	int context;		/* Other context information */
+	void *ptr;		/* Decoder-specific stuff (stack elements) */
+	ber_tlv_len_t left;	/* Number of bytes left, -1 for indefinite */
+} asn_struct_ctx_t;
+
+#include <ber_decoder.h>	/* Basic Encoding Rules decoder */
+#include <der_encoder.h>	/* Distinguished Encoding Rules encoder */
+#include <xer_decoder.h>	/* Decoder of XER (XML, text) */
+#include <xer_encoder.h>	/* Encoder into XER (XML, text) */
+#include <per_decoder.h>	/* Packet Encoding Rules decoder */
+#include <per_encoder.h>	/* Packet Encoding Rules encoder */
+#include <constraints.h>	/* Subtype constraints support */
+#include <asn_random_fill.h>	/* Random structures support */
+
+#ifdef  ASN_DISABLE_OER_SUPPORT
+typedef void (oer_type_decoder_f)(void);
+typedef void (oer_type_encoder_f)(void);
+typedef void asn_oer_constraints_t;
+#else
+#include <oer_decoder.h>	/* Octet Encoding Rules encoder */
+#include <oer_encoder.h>	/* Octet Encoding Rules encoder */
+#endif
+
+/*
+ * Free the structure according to its specification.
+ * Use one of ASN_STRUCT_{FREE,RESET,CONTENTS_ONLY} macros instead.
+ * Do not use directly.
+ */
+enum asn_struct_free_method {
+    ASFM_FREE_EVERYTHING,   /* free(struct_ptr) and underlying members */
+    ASFM_FREE_UNDERLYING,   /* free underlying members */
+    ASFM_FREE_UNDERLYING_AND_RESET   /* FREE_UNDERLYING + memset(0) */
+};
+typedef void (asn_struct_free_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		void *struct_ptr, enum asn_struct_free_method);
+
+/*
+ * Free the structure including freeing the memory pointed to by ptr itself.
+ */
+#define ASN_STRUCT_FREE(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_EVERYTHING)
+
+/*
+ * Free the memory used by the members of the structure without freeing the
+ * the structure pointer itself.
+ * ZERO-OUT the structure to the safe clean state.
+ * (Retaining the pointer may be useful in case the structure is allocated
+ *  statically or arranged on the stack, yet its elements are dynamic.)
+ */
+#define ASN_STRUCT_RESET(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING_AND_RESET)
+
+/*
+ * Free memory used by the members of the structure without freeing
+ * the structure pointer itself.
+ * (Retaining the pointer may be useful in case the structure is allocated
+ *  statically or arranged on the stack, yet its elements are dynamic.)
+ * AVOID using it in the application code;
+ * Use a safer ASN_STRUCT_RESET() instead.
+ */
+#define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \
+    (asn_DEF).op->free_struct(&(asn_DEF), (ptr), ASFM_FREE_UNDERLYING)
+
+/*
+ * Print the structure according to its specification.
+ */
+typedef int(asn_struct_print_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr,
+    int level, /* Indentation level */
+    asn_app_consume_bytes_f *callback, void *app_key);
+
+/*
+ * Compare two structs between each other.
+ * Returns <0 if struct_A is "smaller" than struct_B, >0 if "greater",
+ * and =0 if "equal to", for some type-specific, stable definition of
+ * "smaller", "greater" and "equal to".
+ */
+typedef int (asn_struct_compare_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		const void *struct_A,
+		const void *struct_B);
+
+/*
+ * Return the outmost tag of the type.
+ * If the type is untagged CHOICE, the dynamic operation is performed.
+ * NOTE: This function pointer type is only useful internally.
+ * Do not use it in your application.
+ */
+typedef ber_tlv_tag_t (asn_outmost_tag_f)(
+		const struct asn_TYPE_descriptor_s *type_descriptor,
+		const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag);
+/* The instance of the above function type; used internally. */
+asn_outmost_tag_f asn_TYPE_outmost_tag;
+
+/*
+ * Fetch the desired type of the Open Type based on the
+ * Information Object Set driven constraints.
+ */
+typedef struct asn_type_selector_result_s {
+    const struct asn_TYPE_descriptor_s *type_descriptor; /* Type encoded. */
+    unsigned presence_index; /* Associated choice variant. */
+} asn_type_selector_result_t;
+typedef asn_type_selector_result_t(asn_type_selector_f)(
+    const struct asn_TYPE_descriptor_s *parent_type_descriptor,
+    const void *parent_structure_ptr);
+
+/*
+ * Generalized functions for dealing with the speciic type.
+ * May be directly invoked by applications.
+ */
+typedef struct asn_TYPE_operation_s {
+    asn_struct_free_f *free_struct;     /* Free the structure */
+    asn_struct_print_f *print_struct;   /* Human readable output */
+    asn_struct_compare_f *compare_struct; /* Compare two structures */
+    ber_type_decoder_f *ber_decoder;      /* Generic BER decoder */
+    der_type_encoder_f *der_encoder;      /* Canonical DER encoder */
+    xer_type_decoder_f *xer_decoder;      /* Generic XER decoder */
+    xer_type_encoder_f *xer_encoder;      /* [Canonical] XER encoder */
+    oer_type_decoder_f *oer_decoder;      /* Generic OER decoder */
+    oer_type_encoder_f *oer_encoder;      /* Canonical OER encoder */
+    per_type_decoder_f *uper_decoder;     /* Unaligned PER decoder */
+    per_type_encoder_f *uper_encoder;     /* Unaligned PER encoder */
+    per_type_decoder_f *aper_decoder;     /* Aligned PER decoder */
+    per_type_encoder_f *aper_encoder;     /* Aligned PER encoder */
+    asn_random_fill_f *random_fill;       /* Initialize with a random value */
+    asn_outmost_tag_f *outmost_tag;       /* <optional, internal> */
+} asn_TYPE_operation_t;
+
+/*
+ * A constraints tuple specifying both the OER and PER constraints.
+ */
+typedef struct asn_encoding_constraints_s {
+    const struct asn_oer_constraints_s *oer_constraints;
+    const struct asn_per_constraints_s *per_constraints;
+    asn_constr_check_f *general_constraints;
+} asn_encoding_constraints_t;
+
+/*
+ * The definitive description of the destination language's structure.
+ */
+typedef struct asn_TYPE_descriptor_s {
+    const char *name;       /* A name of the ASN.1 type. "" in some cases. */
+    const char *xml_tag;    /* Name used in XML tag */
+
+    /*
+     * Generalized functions for dealing with the specific type.
+     * May be directly invoked by applications.
+     */
+    asn_TYPE_operation_t *op;
+
+    /***********************************************************************
+     * Internally useful members. Not to be used by applications directly. *
+     **********************************************************************/
+
+    /*
+     * Tags that are expected to occur.
+     */
+    const ber_tlv_tag_t *tags;      /* Effective tags sequence for this type */
+    unsigned tags_count;            /* Number of tags which are expected */
+    const ber_tlv_tag_t *all_tags;  /* Every tag for BER/containment */
+    unsigned all_tags_count;        /* Number of tags */
+
+    /* OER, PER, and general constraints */
+    asn_encoding_constraints_t encoding_constraints;
+
+    /*
+     * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE).
+     */
+    struct asn_TYPE_member_s *elements;
+    unsigned elements_count;
+
+    /*
+     * Additional information describing the type, used by appropriate
+     * functions above.
+     */
+    const void *specifics;
+} asn_TYPE_descriptor_t;
+
+/*
+ * This type describes an element of the constructed type,
+ * i.e. SEQUENCE, SET, CHOICE, etc.
+ */
+  enum asn_TYPE_flags_e {
+    ATF_NOFLAGS,
+    ATF_POINTER = 0x01,   /* Represented by the pointer */
+    ATF_OPEN_TYPE = 0x02, /* Open Type */
+    ATF_ANY_TYPE = 0x04   /* ANY type (deprecated!) */
+  };
+typedef struct asn_TYPE_member_s {
+    enum asn_TYPE_flags_e flags; /* Element's presentation flags */
+    unsigned optional;      /* Following optional members, including current */
+    unsigned memb_offset;   /* Offset of the element */
+    ber_tlv_tag_t tag;      /* Outmost (most immediate) tag */
+    int tag_mode;           /* IMPLICIT/no/EXPLICIT tag at current level */
+    asn_TYPE_descriptor_t *type;            /* Member type descriptor */
+    asn_type_selector_f *type_selector;     /* IoS runtime type selector */
+    asn_encoding_constraints_t encoding_constraints;
+    int (*default_value_cmp)(const void *sptr); /* Compare DEFAULT <value> */
+    int (*default_value_set)(void **sptr);      /* Set DEFAULT <value> */
+    const char *name; /* ASN.1 identifier of the element */
+} asn_TYPE_member_t;
+
+/*
+ * BER tag to element number mapping.
+ */
+typedef struct asn_TYPE_tag2member_s {
+    ber_tlv_tag_t el_tag;   /* Outmost tag of the member */
+    unsigned el_no;         /* Index of the associated member, base 0 */
+    int toff_first;         /* First occurence of the el_tag, relative */
+    int toff_last;          /* Last occurence of the el_tag, relative */
+} asn_TYPE_tag2member_t;
+
+/*
+ * This function prints out the contents of the target language's structure
+ * (struct_ptr) into the file pointer (stream) in human readable form.
+ * RETURN VALUES:
+ * 	 0: The structure is printed.
+ * 	-1: Problem dumping the structure.
+ * (See also xer_fprint() in xer_encoder.h)
+ */
+int asn_fprint(FILE *stream, /* Destination stream descriptor */
+               const asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */
+               const void *struct_ptr);         /* Structure to be printed */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _CONSTR_TYPE_H_ */
diff --git a/e2ap/headers/constraints.h b/e2ap/headers/constraints.h
new file mode 100644
index 0000000..0bd86a9
--- /dev/null
+++ b/e2ap/headers/constraints.h
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	ASN1_CONSTRAINTS_VALIDATOR_H
+#define	ASN1_CONSTRAINTS_VALIDATOR_H
+
+#include <asn_system.h>		/* Platform-dependent types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;		/* Forward declaration */
+
+/*
+ * Validate the structure according to the ASN.1 constraints.
+ * If errbuf and errlen are given, they shall be pointing to the appropriate
+ * buffer space and its length before calling this function. Alternatively,
+ * they could be passed as NULL's. If constraints validation fails,
+ * errlen will contain the actual number of bytes taken from the errbuf
+ * to encode an error message (properly 0-terminated).
+ * 
+ * RETURN VALUES:
+ * This function returns 0 in case all ASN.1 constraints are met
+ * and -1 if one or more constraints were failed.
+ */
+int asn_check_constraints(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Target language's structure */
+    char *errbuf,           /* Returned error description */
+    size_t *errlen          /* Length of the error description */
+);
+
+
+/*
+ * Generic type for constraint checking callback,
+ * associated with every type descriptor.
+ */
+typedef int(asn_constr_check_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr,
+    asn_app_constraint_failed_f *optional_callback, /* Log the error */
+    void *optional_app_key /* Opaque key passed to a callback */
+);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+asn_constr_check_f asn_generic_no_constraint;	/* No constraint whatsoever */
+asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */
+
+/*
+ * Invoke the callback with a complete error message.
+ */
+#define	ASN__CTFAIL	if(ctfailcb) ctfailcb
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ASN1_CONSTRAINTS_VALIDATOR_H */
diff --git a/e2ap/headers/der_encoder.h b/e2ap/headers/der_encoder.h
new file mode 100644
index 0000000..e93944e
--- /dev/null
+++ b/e2ap/headers/der_encoder.h
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_DER_ENCODER_H_
+#define	_DER_ENCODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The DER encoder of any type. May be invoked by the application.
+ * Produces DER- and BER-compliant encoding. (DER is a subset of BER).
+ *
+ * NOTE: Use the ber_decode() function (ber_decoder.h) to decode data
+ * produced by der_encode().
+ */
+asn_enc_rval_t der_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/* A variant of der_encode() which encodes data into the pre-allocated buffer */
+asn_enc_rval_t der_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (maximum) */
+);
+
+/*
+ * Type of the generic DER encoder.
+ */
+typedef asn_enc_rval_t(der_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    int tag_mode,           /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+    ber_tlv_tag_t tag, asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key /* Arbitrary callback argument */
+);
+
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Write out leading TL[v] sequence according to the type definition.
+ */
+ssize_t der_write_tags(const struct asn_TYPE_descriptor_s *type_descriptor,
+                       size_t struct_length,
+                       int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+                       int last_tag_form, /* {0,!0}: prim, constructed */
+                       ber_tlv_tag_t tag,
+                       asn_app_consume_bytes_f *consume_bytes_cb,
+                       void *app_key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _DER_ENCODER_H_ */
diff --git a/e2ap/headers/oer_decoder.h b/e2ap/headers/oer_decoder.h
new file mode 100644
index 0000000..40992e9
--- /dev/null
+++ b/e2ap/headers/oer_decoder.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_DECODER_H
+#define	OER_DECODER_H
+
+#include <asn_application.h>
+#include <oer_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+struct asn_codec_ctx_s;		/* Forward declaration */
+
+/*
+ * The Octet Encoding Rules (OER, X.696 08/2015) decoder for any given type.
+ * This function may be invoked directly by the application.
+ * Parses CANONICAL-OER and BASIC-OER.
+ */
+asn_dec_rval_t oer_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
+	const struct asn_TYPE_descriptor_s *type_descriptor,
+	void **struct_ptr,	/* Pointer to a target structure's pointer */
+	const void *buffer,	/* Data to be decoded */
+	size_t size		/* Size of that buffer */
+	);
+
+/*
+ * Type of generic function which decodes the byte stream into the structure.
+ */
+typedef asn_dec_rval_t(oer_type_decoder_f)(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    void **struct_ptr,
+    const void *buf_ptr,
+    size_t size);
+
+/*
+ * Swallow the Open Type (X.696 (08/2015), #30) into /dev/null.
+ * RETURN VALUES:
+ *      -1:     Fatal error deciphering length.
+ *       0:     More data expected than bufptr contains.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_open_type_skip(const void *bufptr, size_t size);
+
+/*
+ * Read the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                          const struct asn_TYPE_descriptor_s *td,
+                          const asn_oer_constraints_t *constraints,
+                          void **struct_ptr, const void *bufptr, size_t size);
+
+/*
+ * Length-prefixed buffer decoding for primitive types.
+ */
+oer_type_decoder_f oer_decode_primitive;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_DECODER_H */
diff --git a/e2ap/headers/oer_encoder.h b/e2ap/headers/oer_encoder.h
new file mode 100644
index 0000000..6a7b681
--- /dev/null
+++ b/e2ap/headers/oer_encoder.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_ENCODER_H
+#define	OER_ENCODER_H
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The Octet Encoding Rules (OER, X.696 08/2015) encoder for any type.
+ * This function may be invoked directly by the application.
+ * Produces CANONICAL-OER output compatible with CANONICAL-OER
+ * and BASIC-OER decoders.
+ */
+asn_enc_rval_t oer_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/* A variant of oer_encode() which encodes data into the pre-allocated buffer */
+asn_enc_rval_t oer_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (maximum) */
+);
+
+/*
+ * Type of the generic OER encoder.
+ */
+typedef asn_enc_rval_t(oer_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_oer_constraints_t *constraints,
+    const void *struct_ptr,                    /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+/*
+ * Write out the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *  -1: Fatal error encoding the type.
+ *  >0: Number of bytes serialized.
+ */
+ssize_t oer_open_type_put(const struct asn_TYPE_descriptor_s *td,
+                          const asn_oer_constraints_t *constraints,
+                          const void *struct_ptr,
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key);
+
+
+/*
+ * Length-prefixed buffer encoding for primitive types.
+ */
+oer_type_encoder_f oer_encode_primitive;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_ENCODER_H */
diff --git a/e2ap/headers/oer_support.h b/e2ap/headers/oer_support.h
new file mode 100644
index 0000000..dbc9b5f
--- /dev/null
+++ b/e2ap/headers/oer_support.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	OER_SUPPORT_H
+#define	OER_SUPPORT_H
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Pre-computed OER constraints.
+ */
+typedef struct asn_oer_constraint_number_s {
+    unsigned width;    /* ±8,4,2,1 fixed bytes */
+    unsigned positive; /* 1 for unsigned number, 0 for signed */
+} asn_oer_constraint_number_t;
+typedef struct asn_oer_constraints_s {
+    asn_oer_constraint_number_t value;
+    ssize_t size;    /* -1 (no constraint) or >= 0 */
+} asn_oer_constraints_t;
+
+
+/*
+ * Fetch the length determinant (X.696 (08/2015), #8.6) into *len_r.
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t oer_fetch_length(const void *bufptr, size_t size, size_t *len_r);
+
+/*
+ * Serialize OER length. Returns the number of bytes serialized
+ * or -1 if a given callback returned with negative result.
+ */
+ssize_t oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb, void *app_key);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* OER_SUPPORT_H */
diff --git a/e2ap/headers/per_decoder.h b/e2ap/headers/per_decoder.h
new file mode 100644
index 0000000..eea474a
--- /dev/null
+++ b/e2ap/headers/per_decoder.h
@@ -0,0 +1,82 @@
+/*-
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_DECODER_H_
+#define	_PER_DECODER_H_
+
+#include <asn_application.h>
+#include <per_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * Unaligned PER decoder of a "complete encoding" as per X.691 (08/2015) #11.1.
+ * On success, this call always returns (.consumed >= 1), as per #11.1.3.
+ */
+asn_dec_rval_t uper_decode_complete(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of data buffer */
+);
+
+/*
+ * Unaligned PER decoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This call returns the number of BITS read from the stream. Beware.
+ */
+asn_dec_rval_t uper_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size,        /* Size of the input data buffer, in bytes */
+    int skip_bits,      /* Number of unused leading bits, 0..7 */
+    int unused_bits     /* Number of unused tailing bits, 0..7 */
+);
+
+/*
+ * Aligned PER decoder of a "complete encoding" as per X.691#10.1.
+ * On success, this call always returns (.consumed >= 1), in BITS, as per X.691#10.1.3.
+ */
+asn_dec_rval_t aper_decode_complete(
+       const struct asn_codec_ctx_s *opt_codec_ctx,
+       const struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
+       void **struct_ptr,	/* Pointer to a target structure's pointer */
+       const void *buffer,	/* Data to be decoded */
+       size_t size		/* Size of data buffer */
+									);
+
+/*
+ * Aligned PER decoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This call returns the number of BITS read from the stream. Beware.
+ */
+asn_dec_rval_t aper_decode(
+      const struct asn_codec_ctx_s *opt_codec_ctx,
+      const struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
+      void **struct_ptr,	/* Pointer to a target structure's pointer */
+      const void *buffer,	/* Data to be decoded */
+      size_t size,		/* Size of data buffer */
+      int skip_bits,		/* Number of unused leading bits, 0..7 */
+      int unused_bits		/* Number of unused tailing bits, 0..7 */
+      );
+
+/*
+ * Type of the type-specific PER decoder function.
+ */
+typedef asn_dec_rval_t(per_type_decoder_f)(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints, void **struct_ptr,
+    asn_per_data_t *per_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_DECODER_H_ */
diff --git a/e2ap/headers/per_encoder.h b/e2ap/headers/per_encoder.h
new file mode 100644
index 0000000..b615ef0
--- /dev/null
+++ b/e2ap/headers/per_encoder.h
@@ -0,0 +1,93 @@
+/*-
+ * Copyright (c) 2006-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_ENCODER_H_
+#define	_PER_ENCODER_H_
+
+#include <asn_application.h>
+#include <per_support.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * Unaligned PER encoder of any ASN.1 type. May be invoked by the application.
+ * WARNING: This function returns the number of encoded bits in the .encoded
+ * field of the return value. Use the following formula to convert to bytes:
+ * 	bytes = ((.encoded + 7) / 8)
+ */
+asn_enc_rval_t uper_encode(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,                    /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+asn_enc_rval_t aper_encode(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,                     /* Structure to be encoded */
+    asn_app_consume_bytes_f *consume_bytes_cb,  /* Data collector */
+    void *app_key                               /* Arbitrary callback argument */
+);
+
+/*
+ * A variant of uper_encode() which encodes data into the existing buffer
+ * WARNING: This function returns the number of encoded bits in the .encoded
+ * field of the return value.
+ */
+asn_enc_rval_t uper_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void *buffer,           /* Pre-allocated buffer */
+    size_t buffer_size      /* Initial buffer size (max) */
+);
+
+asn_enc_rval_t aper_encode_to_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr,  /* Structure to be encoded */
+    void *buffer,            /* Pre-allocated buffer */
+    size_t buffer_size       /* Initial buffer size (max) */
+);
+/*
+ * A variant of uper_encode_to_buffer() which allocates buffer itself.
+ * Returns the number of bytes in the buffer or -1 in case of failure.
+ * WARNING: This function produces a "Production of the complete encoding",
+ * with length of at least one octet. Contrast this to precise bit-packing
+ * encoding of uper_encode() and uper_encode_to_buffer().
+ */
+ssize_t uper_encode_to_new_buffer(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints,
+    const void *struct_ptr, /* Structure to be encoded */
+    void **buffer_r         /* Buffer allocated and returned */
+);
+
+ssize_t
+aper_encode_to_new_buffer(
+    const struct asn_TYPE_descriptor_s *td,
+    const asn_per_constraints_t *constraints,
+    const void *sptr,
+    void **buffer_r
+);
+
+/*
+ * Type of the generic PER encoder function.
+ */
+typedef asn_enc_rval_t(per_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const asn_per_constraints_t *constraints, const void *struct_ptr,
+    asn_per_outp_t *per_output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_ENCODER_H_ */
diff --git a/e2ap/headers/per_opentype.h b/e2ap/headers/per_opentype.h
new file mode 100644
index 0000000..1493b2d
--- /dev/null
+++ b/e2ap/headers/per_opentype.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2007-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_OPENTYPE_H_
+#define	_PER_OPENTYPE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+asn_dec_rval_t uper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *td,
+                                  const asn_per_constraints_t *constraints,
+                                  void **sptr, asn_per_data_t *pd);
+
+int uper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx,
+                        asn_per_data_t *pd);
+
+/*
+ * X.691 (2015/08), #11.2
+ * Returns -1 if error is encountered. 0 if all OK.
+ */
+int uper_open_type_put(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po);
+
+asn_dec_rval_t aper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                                  const asn_TYPE_descriptor_t *td,
+                                  const asn_per_constraints_t *constraints,
+                                  void **sptr, asn_per_data_t *pd);
+
+
+int aper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd);
+
+int aper_open_type_put(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_OPENTYPE_H_ */
diff --git a/e2ap/headers/per_support.h b/e2ap/headers/per_support.h
new file mode 100644
index 0000000..23079c9
--- /dev/null
+++ b/e2ap/headers/per_support.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_PER_SUPPORT_H_
+#define	_PER_SUPPORT_H_
+
+#include <asn_system.h>		/* Platform-specific types */
+#include <asn_bit_data.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Pre-computed PER constraints.
+ */
+typedef struct asn_per_constraint_s {
+	enum asn_per_constraint_flags {
+		APC_UNCONSTRAINED	= 0x0,	/* No PER visible constraints */
+		APC_SEMI_CONSTRAINED	= 0x1,	/* Constrained at "lb" */
+		APC_CONSTRAINED		= 0x2,	/* Fully constrained */
+		APC_EXTENSIBLE		= 0x4	/* May have extension */
+	} flags;
+	int  range_bits;		/* Full number of bits in the range */
+	int  effective_bits;		/* Effective bits */
+	long lower_bound;		/* "lb" value */
+	long upper_bound;		/* "ub" value */
+} asn_per_constraint_t;
+typedef struct asn_per_constraints_s {
+	asn_per_constraint_t value;
+	asn_per_constraint_t size;
+	int (*value2code)(unsigned int value);
+	int (*code2value)(unsigned int code);
+} asn_per_constraints_t;
+
+/* Temporary compatibility layer. Will get removed. */
+typedef struct asn_bit_data_s asn_per_data_t;
+#define per_get_few_bits(data, bits)   asn_get_few_bits(data, bits)
+#define per_get_undo(data, bits)   asn_get_undo(data, bits)
+#define per_get_many_bits(data, dst, align, bits) \
+    asn_get_many_bits(data, dst, align, bits)
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Get the length "n" from the Unaligned PER stream.
+ */
+ssize_t uper_get_length(asn_per_data_t *pd, int effective_bound_bits,
+                        size_t lower_bound, int *repeat);
+
+ssize_t aper_get_length(asn_per_data_t *pd, int range,
+                        int effective_bound_bits, int *repeat);
+
+/*
+ * Get the normally small length "n".
+ */
+ssize_t uper_get_nslength(asn_per_data_t *pd);
+ssize_t aper_get_nslength(asn_per_data_t *pd);
+
+/*
+ * Get the normally small non-negative whole number.
+ */
+ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
+ssize_t aper_get_nsnnwn(asn_per_data_t *pd, int range);
+
+/* X.691-2008/11, #11.5.6 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits);
+
+
+/* Temporary compatibility layer. Will get removed. */
+typedef struct asn_bit_outp_s asn_per_outp_t;
+#define per_put_few_bits(out, bits, obits) asn_put_few_bits(out, bits, obits)
+#define per_put_many_bits(out, src, nbits) asn_put_many_bits(out, src, nbits)
+#define per_put_aligned_flush(out) asn_put_aligned_flush(out)
+
+
+/*
+ * Rebase the given value as an offset into the range specified by the
+ * lower bound (lb) and upper bound (ub).
+ * RETURN VALUES:
+ *  -1: Conversion failed due to range problems.
+ *   0: Conversion was successful.
+ */
+int per_long_range_rebase(long v, long lb, long ub, unsigned long *output);
+/* The inverse operation: restores the value by the offset and its bounds. */
+int per_long_range_unrebase(unsigned long inp, long lb, long ub, long *outp);
+
+/* X.691-2008/11, #11.5 */
+int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits);
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Put the length "whole_length" to the Unaligned PER stream.
+ * If (opt_need_eom) is given, it will be set to 1 if final 0-length is needed.
+ * In that case, invoke uper_put_length(po, 0, 0) after encoding the last block.
+ * This function returns the number of units which may be flushed
+ * in the next units saving iteration.
+ */
+ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length,
+                        int *opt_need_eom);
+
+ssize_t aper_put_length(asn_per_outp_t *po, int range, size_t length);
+
+/* Align the current bit position to octet bundary */
+int aper_put_align(asn_per_outp_t *po);
+int32_t aper_get_align(asn_per_data_t *pd);
+
+/*
+ * Put the normally small length "n" to the Unaligned PER stream.
+ * Returns 0 or -1.
+ */
+int uper_put_nslength(asn_per_outp_t *po, size_t length);
+
+int aper_put_nslength(asn_per_outp_t *po, size_t length);
+
+/*
+ * Put the normally small non-negative whole number.
+ */
+int uper_put_nsnnwn(asn_per_outp_t *po, int n);
+
+int aper_put_nsnnwn(asn_per_outp_t *po, int range, int number);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _PER_SUPPORT_H_ */
diff --git a/e2ap/headers/xer_decoder.h b/e2ap/headers/xer_decoder.h
new file mode 100644
index 0000000..b951c41
--- /dev/null
+++ b/e2ap/headers/xer_decoder.h
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_DECODER_H_
+#define	_XER_DECODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/*
+ * The XER decoder of any ASN.1 type. May be invoked by the application.
+ * Decodes CANONICAL-XER and BASIC-XER.
+ */
+asn_dec_rval_t xer_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of data buffer */
+);
+
+/*
+ * Type of the type-specific XER decoder function.
+ */
+typedef asn_dec_rval_t(xer_type_decoder_f)(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
+    const char *opt_mname, /* Member name */
+    const void *buf_ptr, size_t size);
+
+/*******************************
+ * INTERNALLY USEFUL FUNCTIONS *
+ *******************************/
+
+/*
+ * Generalized function for decoding the primitive values.
+ * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8
+ * and others. This function should not be used by applications, as its API
+ * is subject to changes.
+ */
+asn_dec_rval_t xer_decode_general(
+    const asn_codec_ctx_t *opt_codec_ctx,
+    asn_struct_ctx_t *ctx, /* Type decoder context */
+    void *struct_key,      /* Treated as opaque pointer */
+    const char *xml_tag,   /* Expected XML tag name */
+    const void *buf_ptr, size_t size,
+    int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf,
+                                      size_t chunk_size),
+    ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf,
+                             size_t chunk_size, int have_more));
+
+
+/*
+ * Fetch the next XER (XML) token from the stream.
+ * The function returns the number of bytes occupied by the chunk type,
+ * returned in the _ch_type. The _ch_type is only set (and valid) when
+ * the return value is >= 0.
+ */
+  typedef enum pxer_chunk_type {
+	PXER_WMORE,     /* Chunk type is not clear, more data expected. */
+	PXER_TAG,	    /* Complete XER tag */
+	PXER_TEXT,	    /* Plain text between XER tags */
+	PXER_COMMENT	/* A comment, may be part of */
+  } pxer_chunk_type_e;
+ssize_t xer_next_token(int *stateContext,
+	const void *buffer, size_t size, pxer_chunk_type_e *_ch_type);
+
+/*
+ * This function checks the buffer against the tag name is expected to occur.
+ */
+  typedef enum xer_check_tag {
+	XCT_BROKEN	= 0,	/* The tag is broken */
+	XCT_OPENING	= 1,	/* This is the <opening> tag */
+	XCT_CLOSING	= 2,	/* This is the </closing> tag */
+	XCT_BOTH	= 3,	/* This is the <modified/> tag */
+	XCT__UNK__MASK	= 4,	/* Mask of everything unexpected */
+	XCT_UNKNOWN_OP	= 5,	/* Unexpected <opening> tag */
+	XCT_UNKNOWN_CL	= 6,	/* Unexpected </closing> tag */
+	XCT_UNKNOWN_BO	= 7	/* Unexpected <modified/> tag */
+  } xer_check_tag_e;
+xer_check_tag_e xer_check_tag(const void *buf_ptr, int size,
+		const char *need_tag);
+
+/*
+ * Get the number of bytes consisting entirely of XER whitespace characters.
+ * RETURN VALUES:
+ * >=0:	Number of whitespace characters in the string.
+ */
+size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size);
+
+/*
+ * Skip the series of anticipated extensions.
+ */
+int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_DECODER_H_ */
diff --git a/e2ap/headers/xer_encoder.h b/e2ap/headers/xer_encoder.h
new file mode 100644
index 0000000..9d75922
--- /dev/null
+++ b/e2ap/headers/xer_encoder.h
@@ -0,0 +1,83 @@
+/*-
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_ENCODER_H_
+#define	_XER_ENCODER_H_
+
+#include <asn_application.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct asn_TYPE_descriptor_s;	/* Forward declaration */
+
+/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */
+enum xer_encoder_flags_e {
+	/* Mode of encoding */
+	XER_F_BASIC	= 0x01,	/* BASIC-XER (pretty-printing) */
+	XER_F_CANONICAL	= 0x02	/* Canonical XER (strict rules) */
+};
+
+/*
+ * The XER encoder of any type. May be invoked by the application.
+ * Produces CANONICAL-XER and BASIC-XER depending on the (xer_flags).
+ */
+asn_enc_rval_t xer_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
+                          const void *struct_ptr, /* Structure to be encoded */
+                          enum xer_encoder_flags_e xer_flags,
+                          asn_app_consume_bytes_f *consume_bytes_cb,
+                          void *app_key /* Arbitrary callback argument */
+);
+
+/*
+ * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC)
+ * output into the chosen file pointer.
+ * RETURN VALUES:
+ * 	 0: The structure is printed.
+ * 	-1: Problem printing the structure.
+ * WARNING: No sensible errno value is returned.
+ */
+int xer_fprint(FILE *stream, const struct asn_TYPE_descriptor_s *td,
+               const void *struct_ptr);
+
+/*
+ * A helper function that uses XER encoding/decoding to verify that:
+ * - Both structures encode into the same BASIC XER.
+ * - Both resulting XER byte streams can be decoded back.
+ * - Both decoded structures encode into the same BASIC XER (round-trip).
+ * All of this verifies equivalence between structures and a round-trip.
+ * ARGUMENTS:
+ *  (opt_debug_stream)  - If specified, prints ongoing details.
+ */
+enum xer_equivalence_e {
+    XEQ_SUCCESS,          /* The only completely positive return value */
+    XEQ_FAILURE,          /* General failure */
+    XEQ_ENCODE1_FAILED,   /* First sructure XER encoding failed */
+    XEQ_ENCODE2_FAILED,   /* Second structure XER encoding failed */
+    XEQ_DIFFERENT,        /* Structures encoded into different XER */
+    XEQ_DECODE_FAILED,    /* Decode of the XER data failed */
+    XEQ_ROUND_TRIP_FAILED /* Bad round-trip */
+};
+enum xer_equivalence_e xer_equivalent(
+    const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct1,
+    const void *struct2, FILE *opt_debug_stream);
+
+/*
+ * Type of the generic XER encoder.
+ */
+typedef asn_enc_rval_t(xer_type_encoder_f)(
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    const void *struct_ptr, /* Structure to be encoded */
+    int ilevel,             /* Level of indentation */
+    enum xer_encoder_flags_e xer_flags,
+    asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
+    void *app_key                              /* Arbitrary callback argument */
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_ENCODER_H_ */
diff --git a/e2ap/headers/xer_support.h b/e2ap/headers/xer_support.h
new file mode 100644
index 0000000..c3a36e7
--- /dev/null
+++ b/e2ap/headers/xer_support.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com.
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef	_XER_SUPPORT_H_
+#define	_XER_SUPPORT_H_
+
+#include <asn_system.h>		/* Platform-specific types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Types of data transferred to the application.
+ */
+typedef enum {
+	PXML_TEXT,	/* Plain text between XML tags. */
+	PXML_TAG,	/* A tag, starting with '<'. */
+	PXML_COMMENT,	/* An XML comment, including "<!--" and "-->". */
+	/* 
+	 * The following chunk types are reported if the chunk
+	 * terminates the specified XML element.
+	 */
+	PXML_TAG_END,		/* Tag ended */
+	PXML_COMMENT_END	/* Comment ended */
+} pxml_chunk_type_e;
+
+/*
+ * Callback function that is called by the parser when parsed data is
+ * available. The _opaque is the pointer to a field containing opaque user 
+ * data specified in pxml_create() call. The chunk type is _type and the text 
+ * data is the piece of buffer identified by _bufid (as supplied to
+ * pxml_feed() call) starting at offset _offset and of _size bytes size. 
+ * The chunk is NOT '\0'-terminated.
+ */
+typedef int (pxml_callback_f)(pxml_chunk_type_e _type,
+	const void *_chunk_data, size_t _chunk_size, void *_key);
+
+/*
+ * Parse the given buffer as it were a chunk of XML data.
+ * Invoke the specified callback each time the meaninful data is found.
+ * This function returns number of bytes consumed from the bufer.
+ * It will always be lesser than or equal to the specified _size.
+ * The next invocation of this function must account the difference.
+ */
+ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size,
+	pxml_callback_f *cb, void *_key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _XER_SUPPORT_H_ */
diff --git a/e2ap/lib/ANY.c b/e2ap/lib/ANY.c
new file mode 100644
index 0000000..0b81557
--- /dev/null
+++ b/e2ap/lib/ANY.c
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <ANY.h>
+#include <errno.h>
+
+asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = {
+	sizeof(ANY_t),
+	offsetof(ANY_t, _asn_ctx),
+	ASN_OSUBV_ANY
+};
+asn_TYPE_operation_t asn_OP_ANY = {
+	OCTET_STRING_free,
+	OCTET_STRING_print,
+	OCTET_STRING_compare,
+	OCTET_STRING_decode_ber,
+	OCTET_STRING_encode_der,
+	OCTET_STRING_decode_xer_hex,
+	ANY_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	0,
+	0,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0, 0, 0, 0,
+#else
+	ANY_decode_uper,
+	ANY_encode_uper,
+	ANY_decode_aper,
+	ANY_encode_aper,
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+	0,	/* Random fill is not defined for ANY type */
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_ANY = {
+	"ANY",
+	"ANY",
+	&asn_OP_ANY,
+	0, 0, 0, 0,
+	{ 0, 0, asn_generic_no_constraint },	/* No constraints */
+	0, 0,	/* No members */
+	&asn_SPC_ANY_specs,
+};
+
+#undef RETURN
+#define RETURN(_code)                       \
+    do {                                    \
+        asn_dec_rval_t tmprval;             \
+        tmprval.code = _code;               \
+        tmprval.consumed = consumed_myself; \
+        return tmprval;                     \
+    } while(0)
+
+asn_enc_rval_t
+ANY_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+               enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+               void *app_key) {
+    if(flags & XER_F_CANONICAL) {
+		/*
+		 * Canonical XER-encoding of ANY type is not supported.
+		 */
+		ASN__ENCODE_FAILED;
+	}
+
+	/* Dump as binary */
+	return OCTET_STRING_encode_xer(td, sptr, ilevel, flags, cb, app_key);
+}
+
+struct _callback_arg {
+	uint8_t *buffer;
+	size_t offset;
+	size_t size;
+};
+
+static int ANY__consume_bytes(const void *buffer, size_t size, void *key);
+
+int
+ANY_fromType(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
+	struct _callback_arg arg;
+	asn_enc_rval_t erval = {0,0,0};
+
+	if(!st || !td) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(!sptr) {
+		if(st->buf) FREEMEM(st->buf);
+		st->size = 0;
+		return 0;
+	}
+
+	arg.offset = arg.size = 0;
+	arg.buffer = 0;
+
+	erval = der_encode(td, sptr, ANY__consume_bytes, &arg);
+	if(erval.encoded == -1) {
+		if(arg.buffer) FREEMEM(arg.buffer);
+		return -1;
+	}
+	assert((size_t)erval.encoded == arg.offset);
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = arg.buffer;
+	st->size = arg.offset;
+
+	return 0;
+}
+
+int
+ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
+	uint8_t *buffer = NULL;
+	ssize_t erval;
+
+	if(!st || !td) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(!sptr) {
+		if(st->buf) FREEMEM(st->buf);
+		st->size = 0;
+		return 0;
+	}
+
+	erval = aper_encode_to_new_buffer(td, td->encoding_constraints.per_constraints, sptr, (void**)&buffer);
+
+	if(erval == -1) {
+		if(buffer) FREEMEM(buffer);
+		return -1;
+	}
+	assert((size_t)erval > 0);
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buffer;
+	st->size = erval;
+
+	return 0;
+}
+
+ANY_t *
+ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
+	ANY_t tmp;
+	ANY_t *st;
+
+	if(!td || !sptr) {
+		errno = EINVAL;
+		return 0;
+	}
+
+	memset(&tmp, 0, sizeof(tmp));
+
+	if(ANY_fromType(&tmp, td, sptr)) return 0;
+
+	st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
+	if(st) {
+		*st = tmp;
+		return st;
+	} else {
+		FREEMEM(tmp.buf);
+		return 0;
+	}
+}
+
+ANY_t *
+ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
+	ANY_t tmp;
+	ANY_t *st;
+
+	if(!td || !sptr) {
+		errno = EINVAL;
+		return 0;
+	}
+
+	memset(&tmp, 0, sizeof(tmp));
+
+	if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
+
+	st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
+	if(st) {
+		*st = tmp;
+		return st;
+	} else {
+		FREEMEM(tmp.buf);
+		return 0;
+	}
+}
+
+int
+ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
+	asn_dec_rval_t rval;
+	void *newst = 0;
+
+	if(!st || !td || !struct_ptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(st->buf == 0) {
+		/* Nothing to convert, make it empty. */
+		*struct_ptr = (void *)0;
+		return 0;
+	}
+
+	rval = ber_decode(0, td, (void **)&newst, st->buf, st->size);
+	if(rval.code == RC_OK) {
+		*struct_ptr = newst;
+		return 0;
+	} else {
+		/* Remove possibly partially decoded data. */
+		ASN_STRUCT_FREE(*td, newst);
+		return -1;
+	}
+}
+
+int
+ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
+	asn_dec_rval_t rval;
+	void *newst = 0;
+
+	if(!st || !td || !struct_ptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	if(st->buf == 0) {
+		/* Nothing to convert, make it empty. */
+		*struct_ptr = (void *)0;
+		return 0;
+	}
+
+	rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
+	if(rval.code == RC_OK) {
+		*struct_ptr = newst;
+		return 0;
+	} else {
+		/* Remove possibly partially decoded data. */
+		ASN_STRUCT_FREE(*td, newst);
+		return -1;
+	}
+}
+
+static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
+	struct _callback_arg *arg = (struct _callback_arg *)key;
+
+	if((arg->offset + size) >= arg->size) {
+		size_t nsize = (arg->size ? arg->size << 2 : 16) + size;
+		void *p = REALLOC(arg->buffer, nsize);
+		if(!p) return -1;
+		arg->buffer = (uint8_t *)p;
+		arg->size = nsize;
+	}
+
+	memcpy(arg->buffer + arg->offset, buffer, size);
+	arg->offset += size;
+	assert(arg->offset < arg->size);
+
+	return 0;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                const asn_TYPE_descriptor_t *td,
+                const asn_per_constraints_t *constraints, void **sptr,
+                asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_ANY_specs;
+    size_t consumed_myself = 0;
+    int repeat;
+    ANY_t *st = (ANY_t *)*sptr;
+
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    /*
+     * Allocate the structure.
+     */
+    if(!st) {
+        st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) RETURN(RC_FAIL);
+    }
+
+    ASN_DEBUG("UPER Decoding ANY type");
+
+    st->size = 0;
+    do {
+        ssize_t raw_len;
+        ssize_t len_bytes;
+        ssize_t len_bits;
+        void *p;
+        int ret;
+
+        /* Get the PER length */
+        raw_len = uper_get_length(pd, -1, 0, &repeat);
+        if(raw_len < 0) RETURN(RC_WMORE);
+        if(raw_len == 0 && st->buf) break;
+
+        ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
+                  repeat ? "repeat" : "once", td->name);
+        len_bytes = raw_len;
+        len_bits = len_bytes * 8;
+
+        p = REALLOC(st->buf, st->size + len_bytes + 1);
+        if(!p) RETURN(RC_FAIL);
+        st->buf = (uint8_t *)p;
+
+        ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
+        if(ret < 0) RETURN(RC_WMORE);
+        consumed_myself += len_bits;
+        st->size += len_bytes;
+    } while(repeat);
+    st->buf[st->size] = 0; /* nul-terminate */
+
+    RETURN(RC_OK);
+}
+
+asn_enc_rval_t
+ANY_encode_uper(const asn_TYPE_descriptor_t *td,
+                const asn_per_constraints_t *constraints, const void *sptr,
+                asn_per_outp_t *po) {
+    const ANY_t *st = (const ANY_t *)sptr;
+    asn_enc_rval_t er = {0, 0, 0};
+    const uint8_t *buf;
+    size_t size;
+    int ret;
+
+    (void)constraints;
+
+    if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
+
+    buf = st->buf;
+    size = st->size;
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size, &need_eom);
+        if(may_save < 0) ASN__ENCODE_FAILED;
+
+        ret = per_put_many_bits(po, buf, may_save * 8);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += may_save;
+        size -= may_save;
+        assert(!(may_save & 0x07) || !size);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size);
+
+    ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+ANY_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                const asn_TYPE_descriptor_t *td,
+                const asn_per_constraints_t *constraints, void **sptr,
+                asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_ANY_specs;
+    size_t consumed_myself = 0;
+    int repeat;
+    ANY_t *st = (ANY_t *)*sptr;
+
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    /*
+     * Allocate the structure.
+     */
+    if(!st) {
+        st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) RETURN(RC_FAIL);
+    }
+
+    ASN_DEBUG("APER Decoding ANY type");
+
+    st->size = 0;
+    do {
+        ssize_t raw_len;
+        ssize_t len_bytes;
+        ssize_t len_bits;
+        void *p;
+        int ret;
+
+        /* Get the PER length */
+        raw_len = aper_get_length(pd, -1, 0, &repeat);
+        if(raw_len < 0) RETURN(RC_WMORE);
+        if(raw_len == 0 && st->buf) break;
+
+        ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
+                  repeat ? "repeat" : "once", td->name);
+        len_bytes = raw_len;
+        len_bits = len_bytes * 8;
+
+        p = REALLOC(st->buf, st->size + len_bytes + 1);
+        if(!p) RETURN(RC_FAIL);
+        st->buf = (uint8_t *)p;
+
+        ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
+        if(ret < 0) RETURN(RC_WMORE);
+        consumed_myself += len_bits;
+        st->size += len_bytes;
+    } while(repeat);
+    st->buf[st->size] = 0; /* nul-terminate */
+
+    RETURN(RC_OK);
+}
+
+asn_enc_rval_t
+ANY_encode_aper(const asn_TYPE_descriptor_t *td,
+                const asn_per_constraints_t *constraints, const void *sptr,
+                asn_per_outp_t *po) {
+    const ANY_t *st = (const ANY_t *)sptr;
+    asn_enc_rval_t er = {0, 0, 0};
+    const uint8_t *buf;
+    size_t size;
+    int ret;
+
+    (void)constraints;
+
+    if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
+
+    buf = st->buf;
+    size = st->size;
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size, &need_eom);
+        if(may_save < 0) ASN__ENCODE_FAILED;
+
+        ret = per_put_many_bits(po, buf, may_save * 8);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += may_save;
+        size -= may_save;
+        assert(!(may_save & 0x07) || !size);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size);
+
+    ASN__ENCODED_OK(er);
+}
+#endif /* ASN_DISABLE_PER_SUPPORT */
+
diff --git a/e2ap/lib/BIT_STRING.c b/e2ap/lib/BIT_STRING.c
new file mode 100644
index 0000000..e8d7354
--- /dev/null
+++ b/e2ap/lib/BIT_STRING.c
@@ -0,0 +1,656 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <BIT_STRING.h>
+#include <asn_internal.h>
+
+/*
+ * BIT STRING basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
+};
+asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
+	sizeof(BIT_STRING_t),
+	offsetof(BIT_STRING_t, _asn_ctx),
+	ASN_OSUBV_BIT
+};
+asn_TYPE_operation_t asn_OP_BIT_STRING = {
+	OCTET_STRING_free,         /* Implemented in terms of OCTET STRING */
+	BIT_STRING_print,
+	BIT_STRING_compare,
+	OCTET_STRING_decode_ber,   /* Implemented in terms of OCTET STRING */
+	OCTET_STRING_encode_der,   /* Implemented in terms of OCTET STRING */
+	OCTET_STRING_decode_xer_binary,
+	BIT_STRING_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	BIT_STRING_decode_oer,
+	BIT_STRING_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	BIT_STRING_decode_uper,	/* Unaligned PER decoder */
+	BIT_STRING_encode_uper,	/* Unaligned PER encoder */
+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+	BIT_STRING_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
+	"BIT STRING",
+	"BIT_STRING",
+	&asn_OP_BIT_STRING,
+	asn_DEF_BIT_STRING_tags,
+	sizeof(asn_DEF_BIT_STRING_tags)
+	  / sizeof(asn_DEF_BIT_STRING_tags[0]),
+	asn_DEF_BIT_STRING_tags,	/* Same as above */
+	sizeof(asn_DEF_BIT_STRING_tags)
+	  / sizeof(asn_DEF_BIT_STRING_tags[0]),
+	{ 0, 0, BIT_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_BIT_STRING_specs
+};
+
+/*
+ * BIT STRING generic constraint.
+ */
+int
+BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                      asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+
+	if(st && st->buf) {
+		if((st->size == 0 && st->bits_unused)
+		|| st->bits_unused < 0 || st->bits_unused > 7) {
+			ASN__CTFAIL(app_key, td, sptr,
+				"%s: invalid padding byte (%s:%d)",
+				td->name, __FILE__, __LINE__);
+			return -1;
+		}
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	return 0;
+}
+
+static const char *_bit_pattern[16] = {
+	"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
+	"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"
+};
+
+asn_enc_rval_t
+BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                      int ilevel, enum xer_encoder_flags_e flags,
+                      asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_enc_rval_t er = {0, 0, 0};
+	char scratch[128];
+	char *p = scratch;
+	char *scend = scratch + (sizeof(scratch) - 10);
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	int xcan = (flags & XER_F_CANONICAL);
+	uint8_t *buf;
+	uint8_t *end;
+
+	if(!st || !st->buf)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	buf = st->buf;
+	end = buf + st->size - 1;	/* Last byte is special */
+
+	/*
+	 * Binary dump
+	 */
+	for(; buf < end; buf++) {
+		int v = *buf;
+		int nline = xcan?0:(((buf - st->buf) % 8) == 0);
+		if(p >= scend || nline) {
+			ASN__CALLBACK(scratch, p - scratch);
+			p = scratch;
+			if(nline) ASN__TEXT_INDENT(1, ilevel);
+		}
+		memcpy(p + 0, _bit_pattern[v >> 4], 4);
+		memcpy(p + 4, _bit_pattern[v & 0x0f], 4);
+		p += 8;
+	}
+
+	if(!xcan && ((buf - st->buf) % 8) == 0)
+		ASN__TEXT_INDENT(1, ilevel);
+	ASN__CALLBACK(scratch, p - scratch);
+	p = scratch;
+
+	if(buf == end) {
+		int v = *buf;
+		int ubits = st->bits_unused;
+		int i;
+		for(i = 7; i >= ubits; i--)
+			*p++ = (v & (1 << i)) ? 0x31 : 0x30;
+		ASN__CALLBACK(scratch, p - scratch);
+	}
+
+	if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+
+/*
+ * BIT STRING specific contents printer.
+ */
+int
+BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                 asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	char scratch[64];
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	uint8_t *buf;
+	uint8_t *end;
+	char *p = scratch;
+
+	(void)td;	/* Unused argument */
+
+	if(!st || !st->buf)
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	ilevel++;
+	buf = st->buf;
+	end = buf + st->size;
+
+	/*
+	 * Hexadecimal dump.
+	 */
+	for(; buf < end; buf++) {
+		if((buf - st->buf) % 16 == 0 && (st->size > 16)
+				&& buf != st->buf) {
+			_i_INDENT(1);
+			/* Dump the string */
+			if(cb(scratch, p - scratch, app_key) < 0) return -1;
+			p = scratch;
+		}
+		*p++ = h2c[*buf >> 4];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x20;
+	}
+
+	if(p > scratch) {
+		p--;	/* Eat the tailing space */
+
+		if((st->size > 16)) {
+			_i_INDENT(1);
+		}
+
+		/* Dump the incomplete 16-bytes row */
+		if(cb(scratch, p - scratch, app_key) < 0)
+			return -1;
+	}
+
+    if(st->bits_unused) {
+        int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
+                           st->bits_unused, st->bits_unused == 1 ? "" : "s");
+        assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
+        if(ret > 0 && ret < (ssize_t)sizeof(scratch)
+           && cb(scratch, ret, app_key) < 0)
+            return -1;
+    }
+
+	return 0;
+}
+
+/*
+ * Non-destructively remove the trailing 0-bits from the given bit string.
+ */
+static const BIT_STRING_t *
+BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) {
+    const uint8_t *b;
+    union {
+        const uint8_t *c_buf;
+        uint8_t *nc_buf;
+    } unconst;
+
+    if(st->size == 0) {
+        assert(st->bits_unused == 0);
+        return st;
+    } else {
+        for(b = &st->buf[st->size - 1]; b > st->buf && *b == 0; b--) {
+            ;
+        }
+        /* b points to the last byte which may contain data */
+        if(*b) {
+            int unused = 7;
+            uint8_t v = *b;
+            v &= -(int8_t)v;
+            if(v & 0x0F) unused -= 4;
+            if(v & 0x33) unused -= 2;
+            if(v & 0x55) unused -= 1;
+            tmp->size = b-st->buf + 1;
+            tmp->bits_unused = unused;
+        } else {
+            tmp->size = b-st->buf;
+            tmp->bits_unused = 0;
+        }
+
+        assert(b >= st->buf);
+    }
+
+    unconst.c_buf = st->buf;
+    tmp->buf = unconst.nc_buf;
+    return tmp;
+}
+
+/*
+ * Lexicographically compare the common prefix of both strings,
+ * and if it is the same return -1 for the smallest string.
+ */
+int
+BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                   const void *bptr) {
+    /*
+     * Remove information about trailing bits, since
+     * X.680 (08/2015) #22.7 "ensure that different semantics are not"
+     * "associated with [values that differ only in] the trailing 0 bits."
+     */
+    BIT_STRING_t compact_a, compact_b;
+    const BIT_STRING_t *a = BIT_STRING__compactify(aptr, &compact_a);
+    const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b);
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics;
+
+    assert(specs && specs->subvariant == ASN_OSUBV_BIT);
+
+    if(a && b) {
+        size_t common_prefix_size = a->size <= b->size ? a->size : b->size;
+        int ret = memcmp(a->buf, b->buf, common_prefix_size);
+        if(ret == 0) {
+            /* Figure out which string with equal prefixes is longer. */
+            if(a->size < b->size) {
+                return -1;
+            } else if(a->size > b->size) {
+                return 1;
+            } else {
+                /* Figure out how many unused bits */
+                if(a->bits_unused > b->bits_unused) {
+                    return -1;
+                } else if(a->bits_unused < b->bits_unused) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+        } else {
+            return ret;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+#undef  RETURN
+#define RETURN(_code)                       \
+    do {                                    \
+        asn_dec_rval_t tmprval;             \
+        tmprval.code = _code;               \
+        tmprval.consumed = consumed_myself; \
+        return tmprval;                     \
+    } while(0)
+
+static asn_per_constraint_t asn_DEF_BIT_STRING_constraint_size = {
+    APC_SEMI_CONSTRAINED, -1, -1, 0, 0};
+
+asn_dec_rval_t
+BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                       const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints, void **sptr,
+                       asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_BIT_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		csiz = &pc->size;
+	} else {
+		csiz = &asn_DEF_BIT_STRING_constraint_size;
+	}
+
+	if(specs->subvariant != ASN_OSUBV_BIT) {
+		ASN_DEBUG("Subvariant %d is not BIT OSUBV_BIT", specs->subvariant);
+		RETURN(RC_FAIL);
+    }
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_BIT_STRING_constraint_size;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+        st->size = (csiz->upper_bound + 7) >> 3;
+        st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+        ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound);
+        ret = per_get_many_bits(pd, st->buf, 0, csiz->upper_bound);
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += csiz->upper_bound;
+		st->buf[st->size] = 0;
+        st->bits_unused = (8 - (csiz->upper_bound & 0x7)) & 0x7;
+        RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		ssize_t len_bits;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
+		                          &repeat);
+		if(raw_len < 0) RETURN(RC_WMORE);
+        if(raw_len == 0 && st->buf) break;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+        len_bits = raw_len;
+        len_bytes = (len_bits + 7) >> 3;
+        if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7);
+        /* len_bits be multiple of 16K if repeat is set */
+        p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+        ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
+        if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+BIT_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
+                       const asn_per_constraints_t *constraints,
+                       const void *sptr, asn_per_outp_t *po) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_BIT_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *csiz;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	BIT_STRING_t compact_bstr;  /* Do not modify this directly! */
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;		/* Lies not within extension root */
+	size_t size_in_bits;
+	const uint8_t *buf;
+	int ret;
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(specs->subvariant == ASN_OSUBV_BIT) {
+        if((st->size == 0 && st->bits_unused) || (st->bits_unused & ~7))
+            ASN__ENCODE_FAILED;
+    } else {
+		ASN__ENCODE_FAILED;
+    }
+
+	if(pc) {
+        csiz = &pc->size;
+    } else {
+		csiz = &asn_DEF_BIT_STRING_constraint_size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+    /* Figure out the size without the trailing bits */
+    st = BIT_STRING__compactify(st, &compact_bstr);
+    size_in_bits = 8 * st->size - st->bits_unused;
+
+    ASN_DEBUG(
+        "Encoding %s into %" ASN_PRI_SIZE " bits"
+        " (%ld..%ld, effective %d)%s",
+        td->name, size_in_bits, csiz->lower_bound, csiz->upper_bound,
+        csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+    /* Figure out whether size lies within PER visible constraint */
+
+    if(csiz->effective_bits >= 0) {
+        if((ssize_t)size_in_bits > csiz->upper_bound) {
+            if(ct_extensible) {
+                csiz = &asn_DEF_BIT_STRING_constraint_size;
+                inext = 1;
+            } else {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    } else {
+        inext = 0;
+    }
+
+    if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+    if(csiz->effective_bits >= 0 && !inext) {
+        int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
+        ASN_DEBUG(
+            "Encoding %" ASN_PRI_SIZE " bytes (%ld), length (in %d bits) trailer %d; actual "
+            "value %" ASN_PRI_SSIZE "",
+            st->size, size_in_bits - csiz->lower_bound, csiz->effective_bits,
+            add_trailer,
+            add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound);
+        ret = per_put_few_bits(
+            po, add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound,
+            csiz->effective_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        ret = per_put_many_bits(po, st->buf, size_in_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        if(add_trailer) {
+            static const uint8_t zeros[16];
+            size_t trailing_zero_bits = csiz->lower_bound - size_in_bits;
+            while(trailing_zero_bits > 0) {
+                if(trailing_zero_bits > 8 * sizeof(zeros)) {
+                    ret = per_put_many_bits(po, zeros, 8 * sizeof(zeros));
+                    trailing_zero_bits -= 8 * sizeof(zeros);
+                } else {
+                    ret = per_put_many_bits(po, zeros, trailing_zero_bits);
+                    trailing_zero_bits = 0;
+                }
+                if(ret) ASN__ENCODE_FAILED;
+            }
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
+
+    buf = st->buf;
+    do {
+        int need_eom = 0;
+        ssize_t maySave = uper_put_length(po, size_in_bits, &need_eom);
+        if(maySave < 0) ASN__ENCODE_FAILED;
+
+        ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "", maySave, size_in_bits);
+
+        ret = per_put_many_bits(po, buf, maySave);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += maySave >> 3;
+        size_in_bits -= maySave;
+        assert(!(maySave & 0x07) || !size_in_bits);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size_in_bits);
+
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+asn_random_fill_result_t
+BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                       const asn_encoding_constraints_t *constraints,
+                       size_t max_length) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_BIT_STRING_specs;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    static unsigned lengths[] = {0,     1,     2,     3,     4,     8,
+                                 126,   127,   128,   16383, 16384, 16385,
+                                 65534, 65535, 65536, 65537};
+    uint8_t *buf;
+    uint8_t *bend;
+    uint8_t *b;
+    size_t rnd_bits, rnd_len;
+    BIT_STRING_t *st;
+
+    if(max_length == 0) return result_skipped;
+
+    switch(specs->subvariant) {
+    case ASN_OSUBV_ANY:
+        return result_failed;
+    case ASN_OSUBV_BIT:
+        break;
+    default:
+        break;
+    }
+
+    /* Figure out how far we should go */
+    rnd_bits = lengths[asn_random_between(
+        0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_CONSTRAINED) {
+            long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
+                                             ? pc->upper_bound
+                                             : (ssize_t)max_length;
+            if(max_length < (size_t)pc->lower_bound) {
+                return result_skipped;
+            }
+            if(pc->flags & APC_EXTENSIBLE) {
+                switch(asn_random_between(0, 5)) {
+                case 0:
+                    if(pc->lower_bound > 0) {
+                        rnd_bits = pc->lower_bound - 1;
+                        break;
+                    }
+                    /* Fall through */
+                case 1:
+                    rnd_bits = pc->upper_bound + 1;
+                    break;
+                case 2:
+                    /* Keep rnd_bits from the table */
+                    if(rnd_bits < max_length) {
+                        break;
+                    }
+                    /* Fall through */
+                default:
+                    rnd_bits = asn_random_between(pc->lower_bound,
+                                                  suggested_upper_bound);
+                }
+            } else {
+                rnd_bits =
+                    asn_random_between(pc->lower_bound, suggested_upper_bound);
+            }
+        } else {
+            rnd_bits = asn_random_between(0, max_length - 1);
+        }
+    } else if(rnd_bits >= max_length) {
+        rnd_bits = asn_random_between(0, max_length - 1);
+    }
+
+    rnd_len = (rnd_bits + 7) / 8;
+    buf = CALLOC(1, rnd_len + 1);
+    if(!buf) return result_failed;
+
+    bend = &buf[rnd_len];
+
+    for(b = buf; b < bend; b++) {
+        *(uint8_t *)b = asn_random_between(0, 255);
+    }
+    *b = 0; /* Zero-terminate just in case. */
+
+    if(*sptr) {
+        st = *sptr;
+        FREEMEM(st->buf);
+    } else {
+        st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) {
+            FREEMEM(buf);
+            return result_failed;
+        }
+    }
+
+    st->buf = buf;
+    st->size = rnd_len;
+    st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
+    if(st->bits_unused) {
+        assert(st->size > 0);
+        st->buf[st->size-1] &= 0xff << st->bits_unused;
+    }
+
+    result_ok.length = st->size;
+    return result_ok;
+}
diff --git a/e2ap/lib/BIT_STRING_oer.c b/e2ap/lib/BIT_STRING_oer.c
new file mode 100644
index 0000000..aff5075
--- /dev/null
+++ b/e2ap/lib/BIT_STRING_oer.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <BIT_STRING.h>
+#include <errno.h>
+
+asn_dec_rval_t
+BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                      const asn_TYPE_descriptor_t *td,
+                      const asn_oer_constraints_t *constraints, void **sptr,
+                      const void *ptr, size_t size) {
+    BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+
+    (void)opt_codec_ctx;
+
+    if(!st) {
+        st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        expected_length = (ct_size + 7) >> 3;
+        st->bits_unused = (8 - (ct_size & 7)) & 7;
+    } else {
+        /*
+         * X.696 (08/2015) #13.3.1
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
+        if(len_len > 0) {
+            ptr = (const char *)ptr + len_len;
+            size -= len_len;
+        } else if(len_len == 0) {
+            ASN__DECODE_STARVED;
+        } else if(len_len < 0) {
+            ASN__DECODE_FAILED;
+        }
+
+        if(expected_length < 1) {
+            ASN__DECODE_FAILED;
+        } else if(expected_length > size) {
+            ASN__DECODE_STARVED;
+        }
+
+        st->bits_unused = ((const uint8_t *)ptr)[0];
+        if(st->bits_unused & ~7) {
+            ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name);
+            ASN__DECODE_FAILED;
+        }
+        ptr = (const char *)ptr + 1;
+        size--;
+        expected_length--;
+        rval.consumed = len_len + 1;
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+        if(expected_length > 0) {
+            buf[expected_length - 1] &= (0xff << st->bits_unused);
+        }
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
+                      const asn_oer_constraints_t *constraints,
+                      const void *sptr, asn_app_consume_bytes_f *cb,
+                      void *app_key) {
+    const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+    asn_enc_rval_t erval = {0, 0, 0};
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    size_t trailing_zeros = 0;
+    int fix_last_byte = 0;
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    if(st->bits_unused & ~7) {
+        ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range",
+                  st->bits_unused);
+        ASN__ENCODE_FAILED;
+    }
+    if(st->bits_unused && !(st->size && st->buf)) {
+        ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name,
+                  st->bits_unused);
+        ASN__ENCODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        size_t ct_bytes = (ct_size + 7) >> 3;
+        if(st->size > ct_bytes) {
+            ASN_DEBUG("More bits in BIT STRING %s (%" ASN_PRI_SSIZE ") than constrained %" ASN_PRI_SSIZE "",
+                      td->name, 8 * st->size - st->bits_unused, ct_size);
+            ASN__ENCODE_FAILED;
+        }
+        trailing_zeros = ct_bytes - st->size;   /* Allow larger constraint */
+    } else {
+        uint8_t ub = st->bits_unused & 7;
+        ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key);
+        if(len_len < 0) ASN__ENCODE_FAILED;
+        if(cb(&ub, 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        erval.encoded += len_len + 1;
+    }
+
+    if(st->bits_unused) {
+        if(st->buf[st->size - 1] & (0xff << st->bits_unused)) {
+            fix_last_byte = 1;
+        }
+    }
+
+    if(cb(st->buf, st->size - fix_last_byte, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    if(fix_last_byte) {
+        uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused);
+        if(cb(&b, 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+    erval.encoded += st->size;
+
+    if(trailing_zeros) {
+        static uint8_t zeros[16];
+        while(trailing_zeros > 0) {
+            int ret;
+            if(trailing_zeros < sizeof(zeros)) {
+                ret = cb(zeros, trailing_zeros, app_key);
+                erval.encoded += trailing_zeros;
+            } else {
+                ret = cb(zeros, sizeof(zeros), app_key);
+                erval.encoded += sizeof(zeros);
+            }
+            if(ret < 0) ASN__ENCODE_FAILED;
+        }
+    }
+
+    return erval;
+}
+
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/Cause.c b/e2ap/lib/Cause.c
new file mode 100644
index 0000000..bdb51be
--- /dev/null
+++ b/e2ap/lib/Cause.c
@@ -0,0 +1,95 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "Cause.h"
+
+static asn_oer_constraints_t asn_OER_type_Cause_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_Cause_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  4 }	/* (0..4,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_Cause_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.ricRequest),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseRIC,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.ricService),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseRICservice,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricService"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.transport),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseTransport,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"transport"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.protocol),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseProtocol,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocol"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.misc),
+		(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CauseMisc,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"misc"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_Cause_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* misc */
+};
+asn_CHOICE_specifics_t asn_SPC_Cause_specs_1 = {
+	sizeof(struct Cause),
+	offsetof(struct Cause, _asn_ctx),
+	offsetof(struct Cause, present),
+	sizeof(((struct Cause *)0)->present),
+	asn_MAP_Cause_tag2el_1,
+	5,	/* Count of tags in the map */
+	0, 0,
+	5	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_Cause = {
+	"Cause",
+	"Cause",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_Cause_constr_1, &asn_PER_type_Cause_constr_1, CHOICE_constraint },
+	asn_MBR_Cause_1,
+	5,	/* Elements count */
+	&asn_SPC_Cause_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseMisc.c b/e2ap/lib/CauseMisc.c
new file mode 100644
index 0000000..e09c0b1
--- /dev/null
+++ b/e2ap/lib/CauseMisc.c
@@ -0,0 +1,62 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseMisc.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseMisc_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseMisc_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }	/* (0..3,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseMisc_value2enum_1[] = {
+	{ 0,	27,	"control-processing-overload" },
+	{ 1,	16,	"hardware-failure" },
+	{ 2,	15,	"om-intervention" },
+	{ 3,	11,	"unspecified" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseMisc_enum2value_1[] = {
+	0,	/* control-processing-overload(0) */
+	1,	/* hardware-failure(1) */
+	2,	/* om-intervention(2) */
+	3	/* unspecified(3) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseMisc_specs_1 = {
+	asn_MAP_CauseMisc_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseMisc_enum2value_1,	/* N => "tag"; sorted by N */
+	4,	/* Number of elements in the maps */
+	5,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseMisc_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseMisc = {
+	"CauseMisc",
+	"CauseMisc",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseMisc_tags_1,
+	sizeof(asn_DEF_CauseMisc_tags_1)
+		/sizeof(asn_DEF_CauseMisc_tags_1[0]), /* 1 */
+	asn_DEF_CauseMisc_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseMisc_tags_1)
+		/sizeof(asn_DEF_CauseMisc_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseMisc_constr_1, &asn_PER_type_CauseMisc_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseMisc_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseProtocol.c b/e2ap/lib/CauseProtocol.c
new file mode 100644
index 0000000..66bb383
--- /dev/null
+++ b/e2ap/lib/CauseProtocol.c
@@ -0,0 +1,68 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseProtocol.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseProtocol_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseProtocol_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  6 }	/* (0..6,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseProtocol_value2enum_1[] = {
+	{ 0,	21,	"transfer-syntax-error" },
+	{ 1,	28,	"abstract-syntax-error-reject" },
+	{ 2,	39,	"abstract-syntax-error-ignore-and-notify" },
+	{ 3,	42,	"message-not-compatible-with-receiver-state" },
+	{ 4,	14,	"semantic-error" },
+	{ 5,	49,	"abstract-syntax-error-falsely-constructed-message" },
+	{ 6,	11,	"unspecified" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseProtocol_enum2value_1[] = {
+	5,	/* abstract-syntax-error-falsely-constructed-message(5) */
+	2,	/* abstract-syntax-error-ignore-and-notify(2) */
+	1,	/* abstract-syntax-error-reject(1) */
+	3,	/* message-not-compatible-with-receiver-state(3) */
+	4,	/* semantic-error(4) */
+	0,	/* transfer-syntax-error(0) */
+	6	/* unspecified(6) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseProtocol_specs_1 = {
+	asn_MAP_CauseProtocol_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseProtocol_enum2value_1,	/* N => "tag"; sorted by N */
+	7,	/* Number of elements in the maps */
+	8,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseProtocol_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseProtocol = {
+	"CauseProtocol",
+	"CauseProtocol",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseProtocol_tags_1,
+	sizeof(asn_DEF_CauseProtocol_tags_1)
+		/sizeof(asn_DEF_CauseProtocol_tags_1[0]), /* 1 */
+	asn_DEF_CauseProtocol_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseProtocol_tags_1)
+		/sizeof(asn_DEF_CauseProtocol_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseProtocol_constr_1, &asn_PER_type_CauseProtocol_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseProtocol_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseRIC.c b/e2ap/lib/CauseRIC.c
new file mode 100644
index 0000000..7d94696
--- /dev/null
+++ b/e2ap/lib/CauseRIC.c
@@ -0,0 +1,76 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseRIC.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseRIC_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseRIC_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  10 }	/* (0..10,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseRIC_value2enum_1[] = {
+	{ 0,	23,	"ran-function-id-Invalid" },
+	{ 1,	20,	"action-not-supported" },
+	{ 2,	17,	"excessive-actions" },
+	{ 3,	16,	"duplicate-action" },
+	{ 4,	15,	"duplicate-event" },
+	{ 5,	23,	"function-resource-limit" },
+	{ 6,	18,	"request-id-unknown" },
+	{ 7,	46,	"inconsistent-action-subsequent-action-sequence" },
+	{ 8,	23,	"control-message-invalid" },
+	{ 9,	23,	"call-process-id-invalid" },
+	{ 10,	11,	"unspecified" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseRIC_enum2value_1[] = {
+	1,	/* action-not-supported(1) */
+	9,	/* call-process-id-invalid(9) */
+	8,	/* control-message-invalid(8) */
+	3,	/* duplicate-action(3) */
+	4,	/* duplicate-event(4) */
+	2,	/* excessive-actions(2) */
+	5,	/* function-resource-limit(5) */
+	7,	/* inconsistent-action-subsequent-action-sequence(7) */
+	0,	/* ran-function-id-Invalid(0) */
+	6,	/* request-id-unknown(6) */
+	10	/* unspecified(10) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseRIC_specs_1 = {
+	asn_MAP_CauseRIC_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseRIC_enum2value_1,	/* N => "tag"; sorted by N */
+	11,	/* Number of elements in the maps */
+	12,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseRIC_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseRIC = {
+	"CauseRIC",
+	"CauseRIC",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseRIC_tags_1,
+	sizeof(asn_DEF_CauseRIC_tags_1)
+		/sizeof(asn_DEF_CauseRIC_tags_1[0]), /* 1 */
+	asn_DEF_CauseRIC_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseRIC_tags_1)
+		/sizeof(asn_DEF_CauseRIC_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseRIC_constr_1, &asn_PER_type_CauseRIC_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseRIC_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseRICservice.c b/e2ap/lib/CauseRICservice.c
new file mode 100644
index 0000000..c2cbccb
--- /dev/null
+++ b/e2ap/lib/CauseRICservice.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseRICservice.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseRICservice_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseRICservice_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  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_CauseRICservice_value2enum_1[] = {
+	{ 0,	21,	"function-not-required" },
+	{ 1,	19,	"excessive-functions" },
+	{ 2,	18,	"ric-resource-limit" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseRICservice_enum2value_1[] = {
+	1,	/* excessive-functions(1) */
+	0,	/* function-not-required(0) */
+	2	/* ric-resource-limit(2) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseRICservice_specs_1 = {
+	asn_MAP_CauseRICservice_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseRICservice_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseRICservice_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseRICservice = {
+	"CauseRICservice",
+	"CauseRICservice",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseRICservice_tags_1,
+	sizeof(asn_DEF_CauseRICservice_tags_1)
+		/sizeof(asn_DEF_CauseRICservice_tags_1[0]), /* 1 */
+	asn_DEF_CauseRICservice_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseRICservice_tags_1)
+		/sizeof(asn_DEF_CauseRICservice_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseRICservice_constr_1, &asn_PER_type_CauseRICservice_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseRICservice_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CauseTransport.c b/e2ap/lib/CauseTransport.c
new file mode 100644
index 0000000..a0a5f38
--- /dev/null
+++ b/e2ap/lib/CauseTransport.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CauseTransport.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_CauseTransport_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_CauseTransport_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_CauseTransport_value2enum_1[] = {
+	{ 0,	11,	"unspecified" },
+	{ 1,	30,	"transport-resource-unavailable" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_CauseTransport_enum2value_1[] = {
+	1,	/* transport-resource-unavailable(1) */
+	0	/* unspecified(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_CauseTransport_specs_1 = {
+	asn_MAP_CauseTransport_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_CauseTransport_enum2value_1,	/* N => "tag"; sorted by N */
+	2,	/* Number of elements in the maps */
+	3,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_CauseTransport_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_CauseTransport = {
+	"CauseTransport",
+	"CauseTransport",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_CauseTransport_tags_1,
+	sizeof(asn_DEF_CauseTransport_tags_1)
+		/sizeof(asn_DEF_CauseTransport_tags_1[0]), /* 1 */
+	asn_DEF_CauseTransport_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CauseTransport_tags_1)
+		/sizeof(asn_DEF_CauseTransport_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CauseTransport_constr_1, &asn_PER_type_CauseTransport_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_CauseTransport_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/Criticality.c b/e2ap/lib/Criticality.c
new file mode 100644
index 0000000..9bfe1ca
--- /dev/null
+++ b/e2ap/lib/Criticality.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "Criticality.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_Criticality_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_Criticality_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_Criticality_value2enum_1[] = {
+	{ 0,	6,	"reject" },
+	{ 1,	6,	"ignore" },
+	{ 2,	6,	"notify" }
+};
+static const unsigned int asn_MAP_Criticality_enum2value_1[] = {
+	1,	/* ignore(1) */
+	2,	/* notify(2) */
+	0	/* reject(0) */
+};
+const asn_INTEGER_specifics_t asn_SPC_Criticality_specs_1 = {
+	asn_MAP_Criticality_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_Criticality_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_Criticality_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Criticality = {
+	"Criticality",
+	"Criticality",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_Criticality_tags_1,
+	sizeof(asn_DEF_Criticality_tags_1)
+		/sizeof(asn_DEF_Criticality_tags_1[0]), /* 1 */
+	asn_DEF_Criticality_tags_1,	/* Same as above */
+	sizeof(asn_DEF_Criticality_tags_1)
+		/sizeof(asn_DEF_Criticality_tags_1[0]), /* 1 */
+	{ &asn_OER_type_Criticality_constr_1, &asn_PER_type_Criticality_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_Criticality_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CriticalityDiagnostics-IE-Item.c b/e2ap/lib/CriticalityDiagnostics-IE-Item.c
new file mode 100644
index 0000000..d950a0c
--- /dev/null
+++ b/e2ap/lib/CriticalityDiagnostics-IE-Item.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CriticalityDiagnostics-IE-Item.h"
+
+asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, iECriticality),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"iECriticality"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, iE_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"iE-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, typeOfError),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_TypeOfError,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"typeOfError"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_CriticalityDiagnostics_IE_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* iECriticality */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* iE-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* typeOfError */
+};
+asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_IE_Item_specs_1 = {
+	sizeof(struct CriticalityDiagnostics_IE_Item),
+	offsetof(struct CriticalityDiagnostics_IE_Item, _asn_ctx),
+	asn_MAP_CriticalityDiagnostics_IE_Item_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_Item = {
+	"CriticalityDiagnostics-IE-Item",
+	"CriticalityDiagnostics-IE-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_CriticalityDiagnostics_IE_Item_tags_1,
+	sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[0]), /* 1 */
+	asn_DEF_CriticalityDiagnostics_IE_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_CriticalityDiagnostics_IE_Item_1,
+	3,	/* Elements count */
+	&asn_SPC_CriticalityDiagnostics_IE_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CriticalityDiagnostics-IE-List.c b/e2ap/lib/CriticalityDiagnostics-IE-List.c
new file mode 100644
index 0000000..29ae2dd
--- /dev/null
+++ b/e2ap/lib/CriticalityDiagnostics-IE-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CriticalityDiagnostics-IE-List.h"
+
+#include "CriticalityDiagnostics-IE-Item.h"
+static asn_oer_constraints_t asn_OER_type_CriticalityDiagnostics_IE_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..256)) */};
+asn_per_constraints_t asn_PER_type_CriticalityDiagnostics_IE_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 8,  8,  1,  256 }	/* (SIZE(1..256)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics_IE_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_IE_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_CriticalityDiagnostics_IE_List_specs_1 = {
+	sizeof(struct CriticalityDiagnostics_IE_List),
+	offsetof(struct CriticalityDiagnostics_IE_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_List = {
+	"CriticalityDiagnostics-IE-List",
+	"CriticalityDiagnostics-IE-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_CriticalityDiagnostics_IE_List_tags_1,
+	sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1[0]), /* 1 */
+	asn_DEF_CriticalityDiagnostics_IE_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_CriticalityDiagnostics_IE_List_constr_1, &asn_PER_type_CriticalityDiagnostics_IE_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_CriticalityDiagnostics_IE_List_1,
+	1,	/* Single element */
+	&asn_SPC_CriticalityDiagnostics_IE_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/CriticalityDiagnostics.c b/e2ap/lib/CriticalityDiagnostics.c
new file mode 100644
index 0000000..c07926c
--- /dev/null
+++ b/e2ap/lib/CriticalityDiagnostics.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "CriticalityDiagnostics.h"
+
+#include "RICrequestID.h"
+#include "CriticalityDiagnostics-IE-List.h"
+asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_1[] = {
+	{ ATF_POINTER, 5, offsetof(struct CriticalityDiagnostics, procedureCode),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProcedureCode,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"procedureCode"
+		},
+	{ ATF_POINTER, 4, offsetof(struct CriticalityDiagnostics, triggeringMessage),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_TriggeringMessage,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"triggeringMessage"
+		},
+	{ ATF_POINTER, 3, offsetof(struct CriticalityDiagnostics, procedureCriticality),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"procedureCriticality"
+		},
+	{ ATF_POINTER, 2, offsetof(struct CriticalityDiagnostics, ricRequestorID),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricRequestorID"
+		},
+	{ ATF_POINTER, 1, offsetof(struct CriticalityDiagnostics, iEsCriticalityDiagnostics),
+		(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_CriticalityDiagnostics_IE_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"iEsCriticalityDiagnostics"
+		},
+};
+static const int asn_MAP_CriticalityDiagnostics_oms_1[] = { 0, 1, 2, 3, 4 };
+static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_CriticalityDiagnostics_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* triggeringMessage */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* procedureCriticality */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ricRequestorID */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* iEsCriticalityDiagnostics */
+};
+asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_specs_1 = {
+	sizeof(struct CriticalityDiagnostics),
+	offsetof(struct CriticalityDiagnostics, _asn_ctx),
+	asn_MAP_CriticalityDiagnostics_tag2el_1,
+	5,	/* Count of tags in the map */
+	asn_MAP_CriticalityDiagnostics_oms_1,	/* Optional members */
+	5, 0,	/* Root/Additions */
+	5,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics = {
+	"CriticalityDiagnostics",
+	"CriticalityDiagnostics",
+	&asn_OP_SEQUENCE,
+	asn_DEF_CriticalityDiagnostics_tags_1,
+	sizeof(asn_DEF_CriticalityDiagnostics_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_tags_1[0]), /* 1 */
+	asn_DEF_CriticalityDiagnostics_tags_1,	/* Same as above */
+	sizeof(asn_DEF_CriticalityDiagnostics_tags_1)
+		/sizeof(asn_DEF_CriticalityDiagnostics_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_CriticalityDiagnostics_1,
+	5,	/* Elements count */
+	&asn_SPC_CriticalityDiagnostics_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/E2AP-PDU.c b/e2ap/lib/E2AP-PDU.c
new file mode 100644
index 0000000..c8386c2
--- /dev/null
+++ b/e2ap/lib/E2AP-PDU.c
@@ -0,0 +1,78 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "E2AP-PDU.h"
+
+#include "InitiatingMessage.h"
+#include "SuccessfulOutcome.h"
+#include "UnsuccessfulOutcome.h"
+static asn_oer_constraints_t asn_OER_type_E2AP_PDU_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_type_E2AP_PDU_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_E2AP_PDU_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.initiatingMessage),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_InitiatingMessage,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"initiatingMessage"
+		},
+	{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.successfulOutcome),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_SuccessfulOutcome,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"successfulOutcome"
+		},
+	{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.unsuccessfulOutcome),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_UnsuccessfulOutcome,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"unsuccessfulOutcome"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2AP_PDU_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* initiatingMessage */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* successfulOutcome */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* unsuccessfulOutcome */
+};
+static asn_CHOICE_specifics_t asn_SPC_E2AP_PDU_specs_1 = {
+	sizeof(struct E2AP_PDU),
+	offsetof(struct E2AP_PDU, _asn_ctx),
+	offsetof(struct E2AP_PDU, present),
+	sizeof(((struct E2AP_PDU *)0)->present),
+	asn_MAP_E2AP_PDU_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0,
+	3	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_E2AP_PDU = {
+	"E2AP-PDU",
+	"E2AP-PDU",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_E2AP_PDU_constr_1, &asn_PER_type_E2AP_PDU_constr_1, CHOICE_constraint },
+	asn_MBR_E2AP_PDU_1,
+	3,	/* Elements count */
+	&asn_SPC_E2AP_PDU_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/E2setupFailure.c b/e2ap/lib/E2setupFailure.c
new file mode 100644
index 0000000..1b0bd35
--- /dev/null
+++ b/e2ap/lib/E2setupFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "E2setupFailure.h"
+
+static asn_TYPE_member_t asn_MBR_E2setupFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P13,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2setupFailure_specs_1 = {
+	sizeof(struct E2setupFailure),
+	offsetof(struct E2setupFailure, _asn_ctx),
+	asn_MAP_E2setupFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupFailure = {
+	"E2setupFailure",
+	"E2setupFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupFailure_tags_1,
+	sizeof(asn_DEF_E2setupFailure_tags_1)
+		/sizeof(asn_DEF_E2setupFailure_tags_1[0]), /* 1 */
+	asn_DEF_E2setupFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2setupFailure_tags_1)
+		/sizeof(asn_DEF_E2setupFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_E2setupFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/E2setupRequest.c b/e2ap/lib/E2setupRequest.c
new file mode 100644
index 0000000..92fd09b
--- /dev/null
+++ b/e2ap/lib/E2setupRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "E2setupRequest.h"
+
+static asn_TYPE_member_t asn_MBR_E2setupRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P11,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2setupRequest_specs_1 = {
+	sizeof(struct E2setupRequest),
+	offsetof(struct E2setupRequest, _asn_ctx),
+	asn_MAP_E2setupRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupRequest = {
+	"E2setupRequest",
+	"E2setupRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupRequest_tags_1,
+	sizeof(asn_DEF_E2setupRequest_tags_1)
+		/sizeof(asn_DEF_E2setupRequest_tags_1[0]), /* 1 */
+	asn_DEF_E2setupRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2setupRequest_tags_1)
+		/sizeof(asn_DEF_E2setupRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_E2setupRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/E2setupResponse.c b/e2ap/lib/E2setupResponse.c
new file mode 100644
index 0000000..b08bc06
--- /dev/null
+++ b/e2ap/lib/E2setupResponse.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "E2setupResponse.h"
+
+static asn_TYPE_member_t asn_MBR_E2setupResponse_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponse, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P12,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupResponse_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_E2setupResponse_specs_1 = {
+	sizeof(struct E2setupResponse),
+	offsetof(struct E2setupResponse, _asn_ctx),
+	asn_MAP_E2setupResponse_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupResponse = {
+	"E2setupResponse",
+	"E2setupResponse",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupResponse_tags_1,
+	sizeof(asn_DEF_E2setupResponse_tags_1)
+		/sizeof(asn_DEF_E2setupResponse_tags_1[0]), /* 1 */
+	asn_DEF_E2setupResponse_tags_1,	/* Same as above */
+	sizeof(asn_DEF_E2setupResponse_tags_1)
+		/sizeof(asn_DEF_E2setupResponse_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupResponse_1,
+	1,	/* Elements count */
+	&asn_SPC_E2setupResponse_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ENB-ID-Choice.c b/e2ap/lib/ENB-ID-Choice.c
new file mode 100644
index 0000000..b95e5eb
--- /dev/null
+++ b/e2ap/lib/ENB-ID-Choice.c
@@ -0,0 +1,192 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ENB-ID-Choice.h"
+
+static int
+memb_enb_ID_macro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 20)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_enb_ID_shortmacro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 18)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_enb_ID_longmacro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 21)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_enb_ID_macro_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	20	/* (SIZE(20..20)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_macro_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  20,  20 }	/* (SIZE(20..20)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	18	/* (SIZE(18..18)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  18,  18 }	/* (SIZE(18..18)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	21	/* (SIZE(21..21)) */};
+static asn_per_constraints_t asn_PER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  21,  21 }	/* (SIZE(21..21)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }	/* (0..2,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENB_ID_Choice_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_macro),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_macro_constr_2, &asn_PER_memb_enb_ID_macro_constr_2,  memb_enb_ID_macro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-macro"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_shortmacro),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_shortmacro_constr_3, &asn_PER_memb_enb_ID_shortmacro_constr_3,  memb_enb_ID_shortmacro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-shortmacro"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_longmacro),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_enb_ID_longmacro_constr_4, &asn_PER_memb_enb_ID_longmacro_constr_4,  memb_enb_ID_longmacro_constraint_1 },
+		0, 0, /* No default value */
+		"enb-ID-longmacro"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_Choice_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* enb-ID-macro */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* enb-ID-shortmacro */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* enb-ID-longmacro */
+};
+asn_CHOICE_specifics_t asn_SPC_ENB_ID_Choice_specs_1 = {
+	sizeof(struct ENB_ID_Choice),
+	offsetof(struct ENB_ID_Choice, _asn_ctx),
+	offsetof(struct ENB_ID_Choice, present),
+	sizeof(((struct ENB_ID_Choice *)0)->present),
+	asn_MAP_ENB_ID_Choice_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0,
+	3	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENB_ID_Choice = {
+	"ENB-ID-Choice",
+	"ENB-ID-Choice",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENB_ID_Choice_constr_1, &asn_PER_type_ENB_ID_Choice_constr_1, CHOICE_constraint },
+	asn_MBR_ENB_ID_Choice_1,
+	3,	/* Elements count */
+	&asn_SPC_ENB_ID_Choice_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ENB-ID.c b/e2ap/lib/ENB-ID.c
new file mode 100644
index 0000000..96b8cb5
--- /dev/null
+++ b/e2ap/lib/ENB-ID.c
@@ -0,0 +1,241 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ENB-ID.h"
+
+static int
+memb_macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 20)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_home_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 28)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_short_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 18)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_long_Macro_eNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 21)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_macro_eNB_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	20	/* (SIZE(20..20)) */};
+static asn_per_constraints_t asn_PER_memb_macro_eNB_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  20,  20 }	/* (SIZE(20..20)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_home_eNB_ID_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	28	/* (SIZE(28..28)) */};
+static asn_per_constraints_t asn_PER_memb_home_eNB_ID_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  28,  28 }	/* (SIZE(28..28)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_short_Macro_eNB_ID_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	18	/* (SIZE(18..18)) */};
+static asn_per_constraints_t asn_PER_memb_short_Macro_eNB_ID_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  18,  18 }	/* (SIZE(18..18)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_long_Macro_eNB_ID_constr_6 CC_NOTUSED = {
+	{ 0, 0 },
+	21	/* (SIZE(21..21)) */};
+static asn_per_constraints_t asn_PER_memb_long_Macro_eNB_ID_constr_6 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  21,  21 }	/* (SIZE(21..21)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENB_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENB_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_macro_eNB_ID_constr_2, &asn_PER_memb_macro_eNB_ID_constr_2,  memb_macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"macro-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.home_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_home_eNB_ID_constr_3, &asn_PER_memb_home_eNB_ID_constr_3,  memb_home_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"home-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.short_Macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_short_Macro_eNB_ID_constr_5, &asn_PER_memb_short_Macro_eNB_ID_constr_5,  memb_short_Macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"short-Macro-eNB-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ENB_ID, choice.long_Macro_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_long_Macro_eNB_ID_constr_6, &asn_PER_memb_long_Macro_eNB_ID_constr_6,  memb_long_Macro_eNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"long-Macro-eNB-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* macro-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* home-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* short-Macro-eNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* long-Macro-eNB-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_ENB_ID_specs_1 = {
+	sizeof(struct ENB_ID),
+	offsetof(struct ENB_ID, _asn_ctx),
+	offsetof(struct ENB_ID, present),
+	sizeof(((struct ENB_ID *)0)->present),
+	asn_MAP_ENB_ID_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0,
+	2	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENB_ID = {
+	"ENB-ID",
+	"ENB-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENB_ID_constr_1, &asn_PER_type_ENB_ID_constr_1, CHOICE_constraint },
+	asn_MBR_ENB_ID_1,
+	4,	/* Elements count */
+	&asn_SPC_ENB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ENGNB-ID.c b/e2ap/lib/ENGNB-ID.c
new file mode 100644
index 0000000..4bfdbd8
--- /dev/null
+++ b/e2ap/lib/ENGNB-ID.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ENGNB-ID.h"
+
+static int
+memb_gNB_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size >= 22 && size <= 32)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_gNB_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(22..32)) */};
+static asn_per_constraints_t asn_PER_memb_gNB_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  22,  32 }	/* (SIZE(22..32)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ENGNB_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_ENGNB_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ENGNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ENGNB_ID, choice.gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_gNB_ID_constr_2, &asn_PER_memb_gNB_ID_constr_2,  memb_gNB_ID_constraint_1 },
+		0, 0, /* No default value */
+		"gNB-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_ENGNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gNB-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_ENGNB_ID_specs_1 = {
+	sizeof(struct ENGNB_ID),
+	offsetof(struct ENGNB_ID, _asn_ctx),
+	offsetof(struct ENGNB_ID, present),
+	sizeof(((struct ENGNB_ID *)0)->present),
+	asn_MAP_ENGNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_ENGNB_ID = {
+	"ENGNB-ID",
+	"ENGNB-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_ENGNB_ID_constr_1, &asn_PER_type_ENGNB_ID_constr_1, CHOICE_constraint },
+	asn_MBR_ENGNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_ENGNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ErrorIndication.c b/e2ap/lib/ErrorIndication.c
new file mode 100644
index 0000000..a47c6e0
--- /dev/null
+++ b/e2ap/lib/ErrorIndication.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ErrorIndication.h"
+
+static asn_TYPE_member_t asn_MBR_ErrorIndication_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P10,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ErrorIndication_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ErrorIndication_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ErrorIndication_specs_1 = {
+	sizeof(struct ErrorIndication),
+	offsetof(struct ErrorIndication, _asn_ctx),
+	asn_MAP_ErrorIndication_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ErrorIndication = {
+	"ErrorIndication",
+	"ErrorIndication",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ErrorIndication_tags_1,
+	sizeof(asn_DEF_ErrorIndication_tags_1)
+		/sizeof(asn_DEF_ErrorIndication_tags_1[0]), /* 1 */
+	asn_DEF_ErrorIndication_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ErrorIndication_tags_1)
+		/sizeof(asn_DEF_ErrorIndication_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ErrorIndication_1,
+	1,	/* Elements count */
+	&asn_SPC_ErrorIndication_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GNB-CU-UP-ID.c b/e2ap/lib/GNB-CU-UP-ID.c
new file mode 100644
index 0000000..8f960e2
--- /dev/null
+++ b/e2ap/lib/GNB-CU-UP-ID.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GNB-CU-UP-ID.h"
+
+int
+GNB_CU_UP_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 68719476735)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_GNB_CU_UP_ID_constr_1 CC_NOTUSED = {
+	{ 8, 1 }	/* (0..68719476735) */,
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_CU_UP_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 36, -1,  0,  68719476735 }	/* (0..68719476735) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_GNB_CU_UP_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_CU_UP_ID = {
+	"GNB-CU-UP-ID",
+	"GNB-CU-UP-ID",
+	&asn_OP_INTEGER,
+	asn_DEF_GNB_CU_UP_ID_tags_1,
+	sizeof(asn_DEF_GNB_CU_UP_ID_tags_1)
+		/sizeof(asn_DEF_GNB_CU_UP_ID_tags_1[0]), /* 1 */
+	asn_DEF_GNB_CU_UP_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GNB_CU_UP_ID_tags_1)
+		/sizeof(asn_DEF_GNB_CU_UP_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_GNB_CU_UP_ID_constr_1, &asn_PER_type_GNB_CU_UP_ID_constr_1, GNB_CU_UP_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/GNB-DU-ID.c b/e2ap/lib/GNB-DU-ID.c
new file mode 100644
index 0000000..6c0940d
--- /dev/null
+++ b/e2ap/lib/GNB-DU-ID.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GNB-DU-ID.h"
+
+int
+GNB_DU_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(asn_INTEGER2long(st, &value)) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value too large (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if((value >= 0 && value <= 68719476735)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using INTEGER,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_GNB_DU_ID_constr_1 CC_NOTUSED = {
+	{ 8, 1 }	/* (0..68719476735) */,
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_DU_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 36, -1,  0,  68719476735 }	/* (0..68719476735) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_GNB_DU_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_DU_ID = {
+	"GNB-DU-ID",
+	"GNB-DU-ID",
+	&asn_OP_INTEGER,
+	asn_DEF_GNB_DU_ID_tags_1,
+	sizeof(asn_DEF_GNB_DU_ID_tags_1)
+		/sizeof(asn_DEF_GNB_DU_ID_tags_1[0]), /* 1 */
+	asn_DEF_GNB_DU_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GNB_DU_ID_tags_1)
+		/sizeof(asn_DEF_GNB_DU_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_GNB_DU_ID_constr_1, &asn_PER_type_GNB_DU_ID_constr_1, GNB_DU_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/GNB-ID-Choice.c b/e2ap/lib/GNB-ID-Choice.c
new file mode 100644
index 0000000..085a942
--- /dev/null
+++ b/e2ap/lib/GNB-ID-Choice.c
@@ -0,0 +1,94 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GNB-ID-Choice.h"
+
+static int
+memb_gnb_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size >= 22 && size <= 32)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_gnb_ID_constr_2 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(22..32)) */};
+static asn_per_constraints_t asn_PER_memb_gnb_ID_constr_2 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  22,  32 }	/* (SIZE(22..32)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_GNB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_GNB_ID_Choice_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  0,  0,  0,  0 }	/* (0..0,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GNB_ID_Choice_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GNB_ID_Choice, choice.gnb_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_gnb_ID_constr_2, &asn_PER_memb_gnb_ID_constr_2,  memb_gnb_ID_constraint_1 },
+		0, 0, /* No default value */
+		"gnb-ID"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_GNB_ID_Choice_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gnb-ID */
+};
+asn_CHOICE_specifics_t asn_SPC_GNB_ID_Choice_specs_1 = {
+	sizeof(struct GNB_ID_Choice),
+	offsetof(struct GNB_ID_Choice, _asn_ctx),
+	offsetof(struct GNB_ID_Choice, present),
+	sizeof(((struct GNB_ID_Choice *)0)->present),
+	asn_MAP_GNB_ID_Choice_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0,
+	1	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_GNB_ID_Choice = {
+	"GNB-ID-Choice",
+	"GNB-ID-Choice",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_GNB_ID_Choice_constr_1, &asn_PER_type_GNB_ID_Choice_constr_1, CHOICE_constraint },
+	asn_MBR_GNB_ID_Choice_1,
+	1,	/* Elements count */
+	&asn_SPC_GNB_ID_Choice_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-ID.c b/e2ap/lib/GlobalE2node-ID.c
new file mode 100644
index 0000000..13a8295
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-ID.c
@@ -0,0 +1,89 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-ID.h"
+
+#include "GlobalE2node-gNB-ID.h"
+#include "GlobalE2node-en-gNB-ID.h"
+#include "GlobalE2node-ng-eNB-ID.h"
+#include "GlobalE2node-eNB-ID.h"
+static asn_oer_constraints_t asn_OER_type_GlobalE2node_ID_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_GlobalE2node_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }	/* (0..3,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GlobalE2node_ID_1[] = {
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.gNB),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_gNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.en_gNB),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_en_gNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"en-gNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.ng_eNB),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_ng_eNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ng-eNB"
+		},
+	{ ATF_POINTER, 0, offsetof(struct GlobalE2node_ID, choice.eNB),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalE2node_eNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eNB"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* en-gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ng-eNB */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* eNB */
+};
+asn_CHOICE_specifics_t asn_SPC_GlobalE2node_ID_specs_1 = {
+	sizeof(struct GlobalE2node_ID),
+	offsetof(struct GlobalE2node_ID, _asn_ctx),
+	offsetof(struct GlobalE2node_ID, present),
+	sizeof(((struct GlobalE2node_ID *)0)->present),
+	asn_MAP_GlobalE2node_ID_tag2el_1,
+	4,	/* Count of tags in the map */
+	0, 0,
+	4	/* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ID = {
+	"GlobalE2node-ID",
+	"GlobalE2node-ID",
+	&asn_OP_CHOICE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ &asn_OER_type_GlobalE2node_ID_constr_1, &asn_PER_type_GlobalE2node_ID_constr_1, CHOICE_constraint },
+	asn_MBR_GlobalE2node_ID_1,
+	4,	/* Elements count */
+	&asn_SPC_GlobalE2node_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-eNB-ID.c b/e2ap/lib/GlobalE2node-eNB-ID.c
new file mode 100644
index 0000000..7cb93f1
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-eNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-eNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_eNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_eNB_ID, global_eNB_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 */
+		"global-eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_eNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_eNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_eNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_eNB_ID),
+	offsetof(struct GlobalE2node_eNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_eNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_eNB_ID = {
+	"GlobalE2node-eNB-ID",
+	"GlobalE2node-eNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_eNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_eNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_eNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_eNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_eNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-en-gNB-ID.c b/e2ap/lib/GlobalE2node-en-gNB-ID.c
new file mode 100644
index 0000000..6444325
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-en-gNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-en-gNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_en_gNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_en_gNB_ID, global_gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalenGNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-gNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_en_gNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_en_gNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-gNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_en_gNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_en_gNB_ID),
+	offsetof(struct GlobalE2node_en_gNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_en_gNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_en_gNB_ID = {
+	"GlobalE2node-en-gNB-ID",
+	"GlobalE2node-en-gNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_en_gNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_en_gNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_en_gNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_en_gNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_en_gNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-gNB-ID.c b/e2ap/lib/GlobalE2node-gNB-ID.c
new file mode 100644
index 0000000..31bf024
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-gNB-ID.c
@@ -0,0 +1,72 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-gNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_gNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_gNB_ID, global_gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalgNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-gNB-ID"
+		},
+	{ ATF_POINTER, 2, offsetof(struct GlobalE2node_gNB_ID, gNB_CU_UP_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GNB_CU_UP_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-CU-UP-ID"
+		},
+	{ ATF_POINTER, 1, offsetof(struct GlobalE2node_gNB_ID, gNB_DU_ID),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GNB_DU_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-DU-ID"
+		},
+};
+static const int asn_MAP_GlobalE2node_gNB_ID_oms_1[] = { 1, 2 };
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_gNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_gNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* global-gNB-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gNB-CU-UP-ID */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* gNB-DU-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_gNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_gNB_ID),
+	offsetof(struct GlobalE2node_gNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_gNB_ID_tag2el_1,
+	3,	/* Count of tags in the map */
+	asn_MAP_GlobalE2node_gNB_ID_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_gNB_ID = {
+	"GlobalE2node-gNB-ID",
+	"GlobalE2node-gNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_gNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_gNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_gNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_gNB_ID_1,
+	3,	/* Elements count */
+	&asn_SPC_GlobalE2node_gNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalE2node-ng-eNB-ID.c b/e2ap/lib/GlobalE2node-ng-eNB-ID.c
new file mode 100644
index 0000000..b3bb491
--- /dev/null
+++ b/e2ap/lib/GlobalE2node-ng-eNB-ID.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalE2node-ng-eNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalE2node_ng_eNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalE2node_ng_eNB_ID, global_ng_eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_GlobalngeNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"global-ng-eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalE2node_ng_eNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* global-ng-eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalE2node_ng_eNB_ID_specs_1 = {
+	sizeof(struct GlobalE2node_ng_eNB_ID),
+	offsetof(struct GlobalE2node_ng_eNB_ID, _asn_ctx),
+	asn_MAP_GlobalE2node_ng_eNB_ID_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_GlobalE2node_ng_eNB_ID = {
+	"GlobalE2node-ng-eNB-ID",
+	"GlobalE2node-ng-eNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalE2node_ng_eNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalE2node_ng_eNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalE2node_ng_eNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalE2node_ng_eNB_ID_1,
+	1,	/* Elements count */
+	&asn_SPC_GlobalE2node_ng_eNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalENB-ID.c b/e2ap/lib/GlobalENB-ID.c
new file mode 100644
index 0000000..9c34820
--- /dev/null
+++ b/e2ap/lib/GlobalENB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalENB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalENB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalENB_ID, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalENB_ID, eNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"eNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalENB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalENB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* eNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalENB_ID_specs_1 = {
+	sizeof(struct GlobalENB_ID),
+	offsetof(struct GlobalENB_ID, _asn_ctx),
+	asn_MAP_GlobalENB_ID_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_GlobalENB_ID = {
+	"GlobalENB-ID",
+	"GlobalENB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalENB_ID_tags_1,
+	sizeof(asn_DEF_GlobalENB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalENB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalENB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalENB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalENB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalENB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalENB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalRIC-ID.c b/e2ap/lib/GlobalRIC-ID.c
new file mode 100644
index 0000000..c027c79
--- /dev/null
+++ b/e2ap/lib/GlobalRIC-ID.c
@@ -0,0 +1,99 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalRIC-ID.h"
+
+static int
+memb_ric_ID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	if(st->size > 0) {
+		/* Size in bits */
+		size = 8 * st->size - (st->bits_unused & 0x07);
+	} else {
+		size = 0;
+	}
+	
+	if((size == 20)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_ric_ID_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	20	/* (SIZE(20..20)) */};
+static asn_per_constraints_t asn_PER_memb_ric_ID_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  20,  20 }	/* (SIZE(20..20)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_GlobalRIC_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalRIC_ID, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalRIC_ID, ric_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_BIT_STRING,
+		0,
+		{ &asn_OER_memb_ric_ID_constr_3, &asn_PER_memb_ric_ID_constr_3,  memb_ric_ID_constraint_1 },
+		0, 0, /* No default value */
+		"ric-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalRIC_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalRIC_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ric-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalRIC_ID_specs_1 = {
+	sizeof(struct GlobalRIC_ID),
+	offsetof(struct GlobalRIC_ID, _asn_ctx),
+	asn_MAP_GlobalRIC_ID_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_GlobalRIC_ID = {
+	"GlobalRIC-ID",
+	"GlobalRIC-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalRIC_ID_tags_1,
+	sizeof(asn_DEF_GlobalRIC_ID_tags_1)
+		/sizeof(asn_DEF_GlobalRIC_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalRIC_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalRIC_ID_tags_1)
+		/sizeof(asn_DEF_GlobalRIC_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalRIC_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalRIC_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalenGNB-ID.c b/e2ap/lib/GlobalenGNB-ID.c
new file mode 100644
index 0000000..2599aae
--- /dev/null
+++ b/e2ap/lib/GlobalenGNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalenGNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalenGNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalenGNB_ID, pLMN_Identity),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"pLMN-Identity"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalenGNB_ID, gNB_ID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENGNB_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gNB-ID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalenGNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalenGNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMN-Identity */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* gNB-ID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalenGNB_ID_specs_1 = {
+	sizeof(struct GlobalenGNB_ID),
+	offsetof(struct GlobalenGNB_ID, _asn_ctx),
+	asn_MAP_GlobalenGNB_ID_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_GlobalenGNB_ID = {
+	"GlobalenGNB-ID",
+	"GlobalenGNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalenGNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalenGNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalenGNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalenGNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalenGNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalenGNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalenGNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalenGNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalgNB-ID.c b/e2ap/lib/GlobalgNB-ID.c
new file mode 100644
index 0000000..2150089
--- /dev/null
+++ b/e2ap/lib/GlobalgNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalgNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalgNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalgNB_ID, plmn_id),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"plmn-id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalgNB_ID, gnb_id),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_GNB_ID_Choice,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"gnb-id"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalgNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalgNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plmn-id */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* gnb-id */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalgNB_ID_specs_1 = {
+	sizeof(struct GlobalgNB_ID),
+	offsetof(struct GlobalgNB_ID, _asn_ctx),
+	asn_MAP_GlobalgNB_ID_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_GlobalgNB_ID = {
+	"GlobalgNB-ID",
+	"GlobalgNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalgNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalgNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalgNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalgNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalgNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalgNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalgNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalgNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/GlobalngeNB-ID.c b/e2ap/lib/GlobalngeNB-ID.c
new file mode 100644
index 0000000..97d1f41
--- /dev/null
+++ b/e2ap/lib/GlobalngeNB-ID.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "GlobalngeNB-ID.h"
+
+asn_TYPE_member_t asn_MBR_GlobalngeNB_ID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalngeNB_ID, plmn_id),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_PLMN_Identity,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"plmn-id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct GlobalngeNB_ID, enb_id),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_ENB_ID_Choice,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"enb-id"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_GlobalngeNB_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_GlobalngeNB_ID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plmn-id */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* enb-id */
+};
+asn_SEQUENCE_specifics_t asn_SPC_GlobalngeNB_ID_specs_1 = {
+	sizeof(struct GlobalngeNB_ID),
+	offsetof(struct GlobalngeNB_ID, _asn_ctx),
+	asn_MAP_GlobalngeNB_ID_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_GlobalngeNB_ID = {
+	"GlobalngeNB-ID",
+	"GlobalngeNB-ID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_GlobalngeNB_ID_tags_1,
+	sizeof(asn_DEF_GlobalngeNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalngeNB_ID_tags_1[0]), /* 1 */
+	asn_DEF_GlobalngeNB_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_GlobalngeNB_ID_tags_1)
+		/sizeof(asn_DEF_GlobalngeNB_ID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_GlobalngeNB_ID_1,
+	2,	/* Elements count */
+	&asn_SPC_GlobalngeNB_ID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/INTEGER.c b/e2ap/lib/INTEGER.c
new file mode 100644
index 0000000..2a2f4d7
--- /dev/null
+++ b/e2ap/lib/INTEGER.c
@@ -0,0 +1,1735 @@
+/*-
+ * Copyright (c) 2003-2014 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <INTEGER.h>
+#include <asn_codecs_prim.h>	/* Encoder and decoder of a primitive type */
+#include <errno.h>
+
+/*
+ * INTEGER basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_INTEGER_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_operation_t asn_OP_INTEGER = {
+	INTEGER_free,
+	INTEGER_print,
+	INTEGER_compare,
+	ber_decode_primitive,
+	INTEGER_encode_der,
+	INTEGER_decode_xer,
+	INTEGER_encode_xer,
+#ifdef  ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	INTEGER_decode_oer,     /* OER decoder */
+	INTEGER_encode_oer,     /* Canonical OER encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	INTEGER_decode_uper,	/* Unaligned PER decoder */
+	INTEGER_encode_uper,	/* Unaligned PER encoder */
+	INTEGER_decode_aper,	/* Aligned PER decoder */
+	INTEGER_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	INTEGER_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_INTEGER = {
+	"INTEGER",
+	"INTEGER",
+	&asn_OP_INTEGER,
+	asn_DEF_INTEGER_tags,
+	sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
+	asn_DEF_INTEGER_tags,	/* Same as above */
+	sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+/*
+ * Encode INTEGER type using DER.
+ */
+asn_enc_rval_t
+INTEGER_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                   void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+    asn_enc_rval_t rval;
+    INTEGER_t effective_integer;
+
+	ASN_DEBUG("%s %s as INTEGER (tm=%d)",
+		cb?"Encoding":"Estimating", td->name, tag_mode);
+
+	/*
+	 * Canonicalize integer in the buffer.
+	 * (Remove too long sign extension, remove some first 0x00 bytes)
+	 */
+	if(st->buf) {
+		uint8_t *buf = st->buf;
+		uint8_t *end1 = buf + st->size - 1;
+		int shift;
+
+		/* Compute the number of superfluous leading bytes */
+		for(; buf < end1; buf++) {
+			/*
+			 * If the contents octets of an integer value encoding
+			 * consist of more than one octet, then the bits of the
+			 * first octet and bit 8 of the second octet:
+			 * a) shall not all be ones; and
+			 * b) shall not all be zero.
+			 */
+			switch(*buf) {
+			case 0x00: if((buf[1] & 0x80) == 0)
+					continue;
+				break;
+			case 0xff: if((buf[1] & 0x80))
+					continue;
+				break;
+			}
+			break;
+		}
+
+		/* Remove leading superfluous bytes from the integer */
+		shift = buf - st->buf;
+		if(shift) {
+            union {
+                const uint8_t *c_buf;
+                uint8_t *nc_buf;
+            } unconst;
+            unconst.c_buf = st->buf;
+            effective_integer.buf = unconst.nc_buf + shift;
+            effective_integer.size = st->size - shift;
+
+            st = &effective_integer;
+        }
+    }
+
+    rval = der_encode_primitive(td, st, tag_mode, tag, cb, app_key);
+    if(rval.structure_ptr == &effective_integer) {
+        rval.structure_ptr = sptr;
+    }
+    return rval;
+}
+
+static const asn_INTEGER_enum_map_t *INTEGER_map_enum2value(
+    const asn_INTEGER_specifics_t *specs, const char *lstart,
+    const char *lstop);
+
+/*
+ * INTEGER specific human-readable output.
+ */
+static ssize_t
+INTEGER__dump(const asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_bytes_f *cb, void *app_key, int plainOrXER) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+	char scratch[32];
+	uint8_t *buf = st->buf;
+	uint8_t *buf_end = st->buf + st->size;
+	intmax_t value;
+	ssize_t wrote = 0;
+	char *p;
+	int ret;
+
+	if(specs && specs->field_unsigned)
+		ret = asn_INTEGER2umax(st, (uintmax_t *)&value);
+	else
+		ret = asn_INTEGER2imax(st, &value);
+
+	/* Simple case: the integer size is small */
+	if(ret == 0) {
+		const asn_INTEGER_enum_map_t *el;
+		el = (value >= 0 || !specs || !specs->field_unsigned)
+			? INTEGER_map_value2enum(specs, value) : 0;
+		if(el) {
+			if(plainOrXER == 0)
+				return asn__format_to_callback(cb, app_key,
+					"%" ASN_PRIdMAX " (%s)", value, el->enum_name);
+			else
+				return asn__format_to_callback(cb, app_key,
+					"<%s/>", el->enum_name);
+		} else if(plainOrXER && specs && specs->strict_enumeration) {
+			ASN_DEBUG("ASN.1 forbids dealing with "
+				"unknown value of ENUMERATED type");
+			errno = EPERM;
+			return -1;
+		} else {
+            return asn__format_to_callback(cb, app_key,
+                                           (specs && specs->field_unsigned)
+                                               ? "%" ASN_PRIuMAX
+                                               : "%" ASN_PRIdMAX,
+                                           value);
+        }
+	} else if(plainOrXER && specs && specs->strict_enumeration) {
+		/*
+		 * Here and earlier, we cannot encode the ENUMERATED values
+		 * if there is no corresponding identifier.
+		 */
+		ASN_DEBUG("ASN.1 forbids dealing with "
+			"unknown value of ENUMERATED type");
+		errno = EPERM;
+		return -1;
+	}
+
+	/* Output in the long xx:yy:zz... format */
+	/* TODO: replace with generic algorithm (Knuth TAOCP Vol 2, 4.3.1) */
+	for(p = scratch; buf < buf_end; buf++) {
+		const char * const h2c = "0123456789ABCDEF";
+		if((p - scratch) >= (ssize_t)(sizeof(scratch) - 4)) {
+			/* Flush buffer */
+			if(cb(scratch, p - scratch, app_key) < 0)
+				return -1;
+			wrote += p - scratch;
+			p = scratch;
+		}
+		*p++ = h2c[*buf >> 4];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x3a;	/* ":" */
+	}
+	if(p != scratch)
+		p--;	/* Remove the last ":" */
+
+	wrote += p - scratch;
+	return (cb(scratch, p - scratch, app_key) < 0) ? -1 : wrote;
+}
+
+/*
+ * INTEGER specific human-readable output.
+ */
+int
+INTEGER_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+              asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+	ssize_t ret;
+
+	(void)ilevel;
+
+	if(!st || !st->buf)
+		ret = cb("<absent>", 8, app_key);
+	else
+		ret = INTEGER__dump(td, st, cb, app_key, 0);
+
+	return (ret < 0) ? -1 : 0;
+}
+
+struct e2v_key {
+	const char *start;
+	const char *stop;
+	const asn_INTEGER_enum_map_t *vemap;
+	const unsigned int *evmap;
+};
+static int
+INTEGER__compar_enum2value(const void *kp, const void *am) {
+	const struct e2v_key *key = (const struct e2v_key *)kp;
+	const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
+	const char *ptr, *end, *name;
+
+	/* Remap the element (sort by different criterion) */
+	el = key->vemap + key->evmap[el - key->vemap];
+
+	/* Compare strings */
+	for(ptr = key->start, end = key->stop, name = el->enum_name;
+			ptr < end; ptr++, name++) {
+		if(*ptr != *name || !*name)
+			return *(const unsigned char *)ptr
+				- *(const unsigned char *)name;
+	}
+	return name[0] ? -1 : 0;
+}
+
+static const asn_INTEGER_enum_map_t *
+INTEGER_map_enum2value(const asn_INTEGER_specifics_t *specs, const char *lstart,
+                       const char *lstop) {
+    const asn_INTEGER_enum_map_t *el_found;
+	int count = specs ? specs->map_count : 0;
+	struct e2v_key key;
+	const char *lp;
+
+	if(!count) return NULL;
+
+	/* Guaranteed: assert(lstart < lstop); */
+	/* Figure out the tag name */
+	for(lstart++, lp = lstart; lp < lstop; lp++) {
+		switch(*lp) {
+		case 9: case 10: case 11: case 12: case 13: case 32: /* WSP */
+		case 0x2f: /* '/' */ case 0x3e: /* '>' */
+			break;
+		default:
+			continue;
+		}
+		break;
+	}
+	if(lp == lstop) return NULL;	/* No tag found */
+	lstop = lp;
+
+	key.start = lstart;
+	key.stop = lstop;
+	key.vemap = specs->value2enum;
+	key.evmap = specs->enum2value;
+	el_found = (asn_INTEGER_enum_map_t *)bsearch(&key,
+		specs->value2enum, count, sizeof(specs->value2enum[0]),
+		INTEGER__compar_enum2value);
+	if(el_found) {
+		/* Remap enum2value into value2enum */
+		el_found = key.vemap + key.evmap[el_found - key.vemap];
+	}
+	return el_found;
+}
+
+static int
+INTEGER__compar_value2enum(const void *kp, const void *am) {
+	long a = *(const long *)kp;
+	const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
+	long b = el->nat_value;
+	if(a < b) return -1;
+	else if(a == b) return 0;
+	else return 1;
+}
+
+const asn_INTEGER_enum_map_t *
+INTEGER_map_value2enum(const asn_INTEGER_specifics_t *specs, long value) {
+	int count = specs ? specs->map_count : 0;
+	if(!count) return 0;
+	return (asn_INTEGER_enum_map_t *)bsearch(&value, specs->value2enum,
+		count, sizeof(specs->value2enum[0]),
+		INTEGER__compar_value2enum);
+}
+
+static int
+INTEGER_st_prealloc(INTEGER_t *st, int min_size) {
+	void *p = MALLOC(min_size + 1);
+	if(p) {
+		void *b = st->buf;
+		st->size = 0;
+		st->buf = p;
+		FREEMEM(b);
+		return 0;
+	} else {
+		return -1;
+	}
+}
+
+/*
+ * Decode the chunk of XML text encoding INTEGER.
+ */
+static enum xer_pbd_rval
+INTEGER__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
+                         const void *chunk_buf, size_t chunk_size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    INTEGER_t *st = (INTEGER_t *)sptr;
+	intmax_t dec_value;
+	intmax_t hex_value = 0;
+	const char *lp;
+	const char *lstart = (const char *)chunk_buf;
+	const char *lstop = lstart + chunk_size;
+	enum {
+		ST_LEADSPACE,
+		ST_SKIPSPHEX,
+		ST_WAITDIGITS,
+		ST_DIGITS,
+		ST_DIGITS_TRAILSPACE,
+		ST_HEXDIGIT1,
+		ST_HEXDIGIT2,
+		ST_HEXDIGITS_TRAILSPACE,
+		ST_HEXCOLON,
+		ST_END_ENUM,
+		ST_UNEXPECTED
+	} state = ST_LEADSPACE;
+	const char *dec_value_start = 0; /* INVARIANT: always !0 in ST_DIGITS */
+	const char *dec_value_end = 0;
+
+	if(chunk_size)
+		ASN_DEBUG("INTEGER body %ld 0x%2x..0x%2x",
+			(long)chunk_size, *lstart, lstop[-1]);
+
+	if(INTEGER_st_prealloc(st, (chunk_size/3) + 1))
+		return XPBD_SYSTEM_FAILURE;
+
+	/*
+	 * We may have received a tag here. It will be processed inline.
+	 * Use strtoul()-like code and serialize the result.
+	 */
+	for(lp = lstart; lp < lstop; lp++) {
+		int lv = *lp;
+		switch(lv) {
+		case 0x09: case 0x0a: case 0x0d: case 0x20:
+			switch(state) {
+			case ST_LEADSPACE:
+			case ST_DIGITS_TRAILSPACE:
+			case ST_HEXDIGITS_TRAILSPACE:
+			case ST_SKIPSPHEX:
+				continue;
+			case ST_DIGITS:
+				dec_value_end = lp;
+				state = ST_DIGITS_TRAILSPACE;
+				continue;
+			case ST_HEXCOLON:
+				state = ST_HEXDIGITS_TRAILSPACE;
+				continue;
+			default:
+				break;
+			}
+			break;
+		case 0x2d:	/* '-' */
+			if(state == ST_LEADSPACE) {
+				dec_value = 0;
+				dec_value_start = lp;
+				state = ST_WAITDIGITS;
+				continue;
+			}
+			break;
+		case 0x2b:	/* '+' */
+			if(state == ST_LEADSPACE) {
+				dec_value = 0;
+				dec_value_start = lp;
+				state = ST_WAITDIGITS;
+				continue;
+			}
+			break;
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39:
+			switch(state) {
+			case ST_DIGITS: continue;
+			case ST_SKIPSPHEX:	/* Fall through */
+			case ST_HEXDIGIT1:
+				hex_value = (lv - 0x30) << 4;
+				state = ST_HEXDIGIT2;
+				continue;
+			case ST_HEXDIGIT2:
+				hex_value += (lv - 0x30);
+				state = ST_HEXCOLON;
+				st->buf[st->size++] = (uint8_t)hex_value;
+				continue;
+			case ST_HEXCOLON:
+				return XPBD_BROKEN_ENCODING;
+			case ST_LEADSPACE:
+				dec_value = 0;
+				dec_value_start = lp;
+				/* FALL THROUGH */
+			case ST_WAITDIGITS:
+				state = ST_DIGITS;
+				continue;
+			default:
+				break;
+			}
+			break;
+		case 0x3c:	/* '<', start of XML encoded enumeration */
+			if(state == ST_LEADSPACE) {
+				const asn_INTEGER_enum_map_t *el;
+				el = INTEGER_map_enum2value(
+					(const asn_INTEGER_specifics_t *)
+					td->specifics, lstart, lstop);
+				if(el) {
+					ASN_DEBUG("Found \"%s\" => %ld",
+						el->enum_name, el->nat_value);
+					dec_value = el->nat_value;
+					state = ST_END_ENUM;
+					lp = lstop - 1;
+					continue;
+				}
+				ASN_DEBUG("Unknown identifier for INTEGER");
+			}
+			return XPBD_BROKEN_ENCODING;
+		case 0x3a:	/* ':' */
+			if(state == ST_HEXCOLON) {
+				/* This colon is expected */
+				state = ST_HEXDIGIT1;
+				continue;
+			} else if(state == ST_DIGITS) {
+				/* The colon here means that we have
+				 * decoded the first two hexadecimal
+				 * places as a decimal value.
+				 * Switch decoding mode. */
+				ASN_DEBUG("INTEGER re-evaluate as hex form");
+				state = ST_SKIPSPHEX;
+				dec_value_start = 0;
+				lp = lstart - 1;
+				continue;
+			} else {
+				ASN_DEBUG("state %d at %ld", state, (long)(lp - lstart));
+				break;
+			}
+		/* [A-Fa-f] */
+		case 0x41:case 0x42:case 0x43:case 0x44:case 0x45:case 0x46:
+		case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:case 0x66:
+			switch(state) {
+			case ST_SKIPSPHEX:
+			case ST_LEADSPACE: /* Fall through */
+			case ST_HEXDIGIT1:
+				hex_value = lv - ((lv < 0x61) ? 0x41 : 0x61);
+				hex_value += 10;
+				hex_value <<= 4;
+				state = ST_HEXDIGIT2;
+				continue;
+			case ST_HEXDIGIT2:
+				hex_value += lv - ((lv < 0x61) ? 0x41 : 0x61);
+				hex_value += 10;
+				st->buf[st->size++] = (uint8_t)hex_value;
+				state = ST_HEXCOLON;
+				continue;
+			case ST_DIGITS:
+				ASN_DEBUG("INTEGER re-evaluate as hex form");
+				state = ST_SKIPSPHEX;
+				dec_value_start = 0;
+				lp = lstart - 1;
+				continue;
+			default:
+				break;
+			}
+			break;
+		}
+
+		/* Found extra non-numeric stuff */
+		ASN_DEBUG("INTEGER :: Found non-numeric 0x%2x at %ld",
+			lv, (long)(lp - lstart));
+		state = ST_UNEXPECTED;
+		break;
+	}
+
+	switch(state) {
+	case ST_END_ENUM:
+		/* Got a complete and valid enumeration encoded as a tag. */
+		break;
+	case ST_DIGITS:
+		dec_value_end = lstop;
+		/* FALL THROUGH */
+	case ST_DIGITS_TRAILSPACE:
+		/* The last symbol encountered was a digit. */
+        switch(asn_strtoimax_lim(dec_value_start, &dec_value_end, &dec_value)) {
+        case ASN_STRTOX_OK:
+            if(specs && specs->field_unsigned && (uintmax_t) dec_value <= ULONG_MAX) {
+                break;
+            } else if(dec_value >= LONG_MIN && dec_value <= LONG_MAX) {
+                break;
+            } else {
+                /*
+                 * We model INTEGER on long for XER,
+                 * to avoid rewriting all the tests at once.
+                 */
+                ASN_DEBUG("INTEGER exceeds long range");
+            }
+            /* Fall through */
+        case ASN_STRTOX_ERROR_RANGE:
+            ASN_DEBUG("INTEGER decode %s hit range limit", td->name);
+            return XPBD_DECODER_LIMIT;
+		case ASN_STRTOX_ERROR_INVAL:
+		case ASN_STRTOX_EXPECT_MORE:
+		case ASN_STRTOX_EXTRA_DATA:
+			return XPBD_BROKEN_ENCODING;
+		}
+		break;
+	case ST_HEXCOLON:
+	case ST_HEXDIGITS_TRAILSPACE:
+		st->buf[st->size] = 0;	/* Just in case termination */
+		return XPBD_BODY_CONSUMED;
+	case ST_HEXDIGIT1:
+	case ST_HEXDIGIT2:
+	case ST_SKIPSPHEX:
+		return XPBD_BROKEN_ENCODING;
+	case ST_LEADSPACE:
+		/* Content not found */
+		return XPBD_NOT_BODY_IGNORE;
+	case ST_WAITDIGITS:
+	case ST_UNEXPECTED:
+		ASN_DEBUG("INTEGER: No useful digits (state %d)", state);
+		return XPBD_BROKEN_ENCODING;	/* No digits */
+	}
+
+	/*
+	 * Convert the result of parsing of enumeration or a straight
+	 * decimal value into a BER representation.
+	 */
+	if(asn_imax2INTEGER(st, dec_value)) {
+                ASN_DEBUG("INTEGER decode %s conversion failed", td->name);
+		return XPBD_SYSTEM_FAILURE;
+        }
+
+	return XPBD_BODY_CONSUMED;
+}
+
+asn_dec_rval_t
+INTEGER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void **sptr,
+                   const char *opt_mname, const void *buf_ptr, size_t size) {
+    return xer_decode_primitive(opt_codec_ctx, td,
+		sptr, sizeof(INTEGER_t), opt_mname,
+		buf_ptr, size, INTEGER__xer_body_decode);
+}
+
+asn_enc_rval_t
+INTEGER_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int ilevel, enum xer_encoder_flags_e flags,
+                   asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = (const INTEGER_t *)sptr;
+	asn_enc_rval_t er = {0,0,0};
+
+	(void)ilevel;
+	(void)flags;
+	
+	if(!st || !st->buf)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = INTEGER__dump(td, st, cb, app_key, 1);
+	if(er.encoded < 0) ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#ifndef	ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, void **sptr,
+                    asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = { RC_OK, 0 };
+	INTEGER_t *st = (INTEGER_t *)*sptr;
+	const asn_per_constraint_t *ct;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(!st) {
+		st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	FREEMEM(st->buf);
+	st->buf = 0;
+	st->size = 0;
+	if(ct) {
+		if(ct->flags & APC_SEMI_CONSTRAINED) {
+			st->buf = (uint8_t *)CALLOC(1, 2);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = 1;
+		} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
+			size_t size = (ct->range_bits + 7) >> 3;
+			st->buf = (uint8_t *)MALLOC(1 + size + 1);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = size;
+		}
+	}
+
+	/* X.691-2008/11, #13.2.2, constrained whole number */
+	if(ct && ct->flags != APC_UNCONSTRAINED) {
+		/* #11.5.6 */
+		ASN_DEBUG("Integer with range %d bits", ct->range_bits);
+		if(ct->range_bits >= 0) {
+			if((size_t)ct->range_bits > 8 * sizeof(unsigned long))
+				ASN__DECODE_FAILED;
+
+			if(specs && specs->field_unsigned) {
+				unsigned long uvalue = 0;
+				if(uper_get_constrained_whole_number(pd,
+					&uvalue, ct->range_bits))
+					ASN__DECODE_STARVED;
+				ASN_DEBUG("Got value %lu + low %ld",
+					uvalue, ct->lower_bound);
+				uvalue += ct->lower_bound;
+				if(asn_ulong2INTEGER(st, uvalue))
+					ASN__DECODE_FAILED;
+			} else {
+				unsigned long uvalue = 0;
+				long svalue;
+				if(uper_get_constrained_whole_number(pd,
+					&uvalue, ct->range_bits))
+					ASN__DECODE_STARVED;
+				ASN_DEBUG("Got value %lu + low %ld",
+					uvalue, ct->lower_bound);
+                if(per_long_range_unrebase(uvalue, ct->lower_bound,
+                                           ct->upper_bound, &svalue)
+                   || asn_long2INTEGER(st, svalue)) {
+                    ASN__DECODE_FAILED;
+                }
+			}
+			return rval;
+		}
+	} else {
+		ASN_DEBUG("Decoding unconstrained integer %s", td->name);
+	}
+
+	/* X.691, #12.2.3, #12.2.4 */
+	do {
+		ssize_t len = 0;
+		void *p = NULL;
+		int ret = 0;
+
+		/* Get the PER length */
+		len = uper_get_length(pd, -1, 0, &repeat);
+		if(len < 0) ASN__DECODE_STARVED;
+
+		p = REALLOC(st->buf, st->size + len + 1);
+		if(!p) ASN__DECODE_FAILED;
+		st->buf = (uint8_t *)p;
+
+		ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
+		if(ret < 0) ASN__DECODE_STARVED;
+		st->size += len;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* JIC */
+
+	/* #12.2.3 */
+	if(ct && ct->lower_bound) {
+		/*
+		 * TODO: replace by in-place arithmetics.
+		 */
+		long value = 0;
+		if(asn_INTEGER2long(st, &value))
+			ASN__DECODE_FAILED;
+		if(asn_imax2INTEGER(st, value + ct->lower_bound))
+			ASN__DECODE_FAILED;
+	}
+
+	return rval;
+}
+
+asn_enc_rval_t
+INTEGER_encode_uper(const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, const void *sptr,
+                    asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs =
+        	(const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	const uint8_t *buf;
+	const uint8_t *end;
+	const asn_per_constraint_t *ct;
+	long value = 0;
+
+	if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	er.encoded = 0;
+
+	if(ct) {
+		int inext = 0;
+		if(specs && specs->field_unsigned) {
+			unsigned long uval;
+			if(asn_INTEGER2ulong(st, &uval))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(uval < (unsigned long)ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(uval < (unsigned long)ct->lower_bound
+				|| uval > (unsigned long)ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%" ASN_PRI_SIZE ") lb %lu ub %lu %s",
+				uval, st->buf[0], st->size,
+				ct->lower_bound, ct->upper_bound,
+				inext ? "ext" : "fix");
+			value = uval;
+		} else {
+			if(asn_INTEGER2long(st, &value))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(value < ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(value < ct->lower_bound
+				|| value > ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %ld (%02x/%" ASN_PRI_SIZE ") lb %ld ub %ld %s",
+				value, st->buf[0], st->size,
+				ct->lower_bound, ct->upper_bound,
+				inext ? "ext" : "fix");
+		}
+		if(ct->flags & APC_EXTENSIBLE) {
+			if(per_put_few_bits(po, inext, 1))
+				ASN__ENCODE_FAILED;
+			if(inext) ct = 0;
+		} else if(inext) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+
+	/* X.691-11/2008, #13.2.2, test if constrained whole number */
+	if(ct && ct->range_bits >= 0) {
+        unsigned long v;
+		/* #11.5.6 -> #11.3 */
+		ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
+			value, value - ct->lower_bound, ct->range_bits);
+	if(specs && specs->field_unsigned) {
+		if (  ((unsigned long)ct->lower_bound > (unsigned long)(ct->upper_bound)
+		   || ((unsigned long)value < (unsigned long)ct->lower_bound))
+		   || ((unsigned long)value > (unsigned long)ct->upper_bound)
+		) {
+			ASN_DEBUG("Value %lu to-be-encoded is outside the bounds [%lu, %lu]!",
+				value, ct->lower_bound, ct->upper_bound);
+			ASN__ENCODE_FAILED;
+		}
+ 		v = (unsigned long)value - (unsigned long)ct->lower_bound;
+ 	} else {
+ 		if(per_long_range_rebase(value, ct->lower_bound, ct->upper_bound, &v)) {
+ 			ASN__ENCODE_FAILED;
+ 		}
+	}
+        if(uper_put_constrained_whole_number_u(po, v, ct->range_bits))
+		ASN__ENCODE_FAILED;
+	ASN__ENCODED_OK(er);
+	}
+
+	if(ct && ct->lower_bound) {
+		ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
+		/* TODO: adjust lower bound */
+		ASN__ENCODE_FAILED;
+	}
+
+	for(buf = st->buf, end = st->buf + st->size; buf < end;) {
+        int need_eom = 0;
+        ssize_t mayEncode = uper_put_length(po, end - buf, &need_eom);
+        if(mayEncode < 0)
+			ASN__ENCODE_FAILED;
+		if(per_put_many_bits(po, buf, 8 * mayEncode))
+			ASN__ENCODE_FAILED;
+		buf += mayEncode;
+        if(need_eom && uper_put_length(po, 0, 0)) ASN__ENCODE_FAILED;
+    }
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	INTEGER_t *st = (INTEGER_t *)*sptr;
+	const asn_per_constraint_t *ct;
+	int repeat;
+
+	(void)opt_codec_ctx;
+
+	if(!st) {
+		st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	FREEMEM(st->buf);
+	st->buf = 0;
+	st->size = 0;
+	if(ct) {
+		if(ct->flags & APC_SEMI_CONSTRAINED) {
+			st->buf = (uint8_t *)CALLOC(1, 2);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = 1;
+		} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
+			size_t size = (ct->range_bits + 7) >> 3;
+			st->buf = (uint8_t *)MALLOC(1 + size + 1);
+			if(!st->buf) ASN__DECODE_FAILED;
+			st->size = size;
+		}
+	}
+
+	/* X.691, #12.2.2 */
+	if(ct && ct->flags != APC_UNCONSTRAINED) {
+		/* #10.5.6 */
+		ASN_DEBUG("Integer with range %d bits", ct->range_bits);
+		if(ct->range_bits >= 0) {
+			if (ct->range_bits > 16) {
+				int max_range_bytes = (ct->range_bits >> 3) +
+				                      (((ct->range_bits % 8) > 0) ? 1 : 0);
+				int length = 0, i;
+				long value = 0;
+
+				for (i = 1; ; i++) {
+					int upper = 1 << i;
+					if (upper >= max_range_bytes)
+						break;
+				}
+				ASN_DEBUG("Can encode %d (%d bytes) in %d bits", ct->range_bits,
+				          max_range_bytes, i);
+
+				if ((length = per_get_few_bits(pd, i)) < 0)
+					ASN__DECODE_FAILED;
+
+				/* X.691 #12.2.6 length determinant + lb (1) */
+				length += 1;
+				ASN_DEBUG("Got length %d", length);
+				if (aper_get_align(pd) != 0)
+					ASN__DECODE_FAILED;
+				while (length--) {
+					int buf = per_get_few_bits(pd, 8);
+					if (buf < 0)
+						ASN__DECODE_FAILED;
+					value += (((long)buf) << (8 * length));
+				}
+
+				value += ct->lower_bound;
+				if((specs && specs->field_unsigned)
+				        ? asn_uint642INTEGER(st, (unsigned long)value)
+				        : asn_int642INTEGER(st, value))
+					ASN__DECODE_FAILED;
+				ASN_DEBUG("Got value %ld + low %ld",
+				          value, ct->lower_bound);
+			} else {
+				long value = 0;
+				if (ct->range_bits < 8) {
+					value = per_get_few_bits(pd, ct->range_bits);
+					if(value < 0) ASN__DECODE_STARVED;
+				} else if (ct->range_bits == 8) {
+					if (aper_get_align(pd) < 0)
+						ASN__DECODE_FAILED;
+					value = per_get_few_bits(pd, ct->range_bits);
+					if(value < 0) ASN__DECODE_STARVED;
+				} else {
+					/* Align */
+					if (aper_get_align(pd) < 0)
+						ASN__DECODE_FAILED;
+					value = per_get_few_bits(pd, 16);
+					if(value < 0) ASN__DECODE_STARVED;
+				}
+				value += ct->lower_bound;
+				if((specs && specs->field_unsigned)
+				        ? asn_ulong2INTEGER(st, value)
+				        : asn_long2INTEGER(st, value))
+					ASN__DECODE_FAILED;
+				ASN_DEBUG("Got value %ld + low %ld",
+				          value, ct->lower_bound);
+			}
+			return rval;
+		} else {
+			ASN__DECODE_FAILED;
+		}
+	} else {
+		ASN_DEBUG("Decoding unconstrained integer %s", td->name);
+	}
+
+	/* X.691, #12.2.3, #12.2.4 */
+	do {
+		ssize_t len;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		len = aper_get_length(pd, -1, -1, &repeat);
+		if(len < 0) ASN__DECODE_STARVED;
+
+		p = REALLOC(st->buf, st->size + len + 1);
+		if(!p) ASN__DECODE_FAILED;
+		st->buf = (uint8_t *)p;
+
+		ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
+		if(ret < 0) ASN__DECODE_STARVED;
+		st->size += len;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* JIC */
+
+	/* #12.2.3 */
+	if(ct && ct->lower_bound) {
+		/*
+		 * TODO: replace by in-place arithmetics.
+		 */
+		long value;
+		if(asn_INTEGER2long(st, &value))
+			ASN__DECODE_FAILED;
+		if(asn_long2INTEGER(st, value + ct->lower_bound))
+			ASN__DECODE_FAILED;
+	}
+
+	return rval;
+}
+
+asn_enc_rval_t
+INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
+                    const asn_per_constraints_t *constraints,
+                    const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	const INTEGER_t *st = (const INTEGER_t *)sptr;
+	const uint8_t *buf;
+	const uint8_t *end;
+	const asn_per_constraint_t *ct;
+	long value = 0;
+
+	if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+	if(!constraints) constraints = td->encoding_constraints.per_constraints;
+	ct = constraints ? &constraints->value : 0;
+
+	er.encoded = 0;
+
+	if(ct) {
+		int inext = 0;
+		if(specs && specs->field_unsigned) {
+			unsigned long uval;
+			if(asn_INTEGER2ulong(st, &uval))
+				ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(uval < (unsigned long)ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(uval < (unsigned long)ct->lower_bound
+				        || uval > (unsigned long)ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
+			          uval, st->buf[0], st->size,
+			          ct->lower_bound, ct->upper_bound,
+			          inext ? "ext" : "fix");
+			value = uval;
+		} else {
+			if(asn_INTEGER2long(st, &value)) ASN__ENCODE_FAILED;
+			/* Check proper range */
+			if(ct->flags & APC_SEMI_CONSTRAINED) {
+				if(value < ct->lower_bound)
+					inext = 1;
+			} else if(ct->range_bits >= 0) {
+				if(value < ct->lower_bound
+				        || value > ct->upper_bound)
+					inext = 1;
+			}
+			ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
+			          value, st->buf[0], st->size,
+			          ct->lower_bound, ct->upper_bound,
+			          inext ? "ext" : "fix");
+		}
+		if(ct->flags & APC_EXTENSIBLE) {
+			if(per_put_few_bits(po, inext, 1))
+				ASN__ENCODE_FAILED;
+			if(inext) ct = 0;
+		} else if(inext) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+	/* X.691, #12.2.2 */
+	if(ct && ct->range_bits >= 0) {
+		unsigned long v;
+
+		/* #10.5.6 */
+		ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
+		          value, value - ct->lower_bound, ct->range_bits);
+
+		v = value - ct->lower_bound;
+
+		/* #12 <= 8 -> alignment ? */
+		if (ct->range_bits < 8) {
+			if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
+				ASN__ENCODE_FAILED;
+		} else if (ct->range_bits == 8) {
+			if(aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
+				ASN__ENCODE_FAILED;
+		} else if (ct->range_bits <= 16) {
+			/* Consume the bytes to align on octet */
+			if(aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			if(per_put_few_bits(po, 0x0000 | v,
+			                    16))
+				ASN__ENCODE_FAILED;
+		} else {
+			/* TODO: extend to >64 bits */
+			int64_t v64 = v;
+			int i, j;
+			int max_range_bytes = (ct->range_bits >> 3) +
+			                      (((ct->range_bits % 8) > 0) ? 1 : 0);
+
+			for (i = 1; ; i++) {
+				int upper = 1 << i;
+				if (upper >= max_range_bytes)
+					break;
+			}
+
+			for (j = sizeof(int64_t) -1; j != 0; j--) {
+				int64_t val;
+				val = v64 >> (j * 8);
+				if (val != 0)
+					break;
+			}
+
+			/* Putting length in the minimum number of bits ex: 5 = 3bits */
+			if (per_put_few_bits(po, j, i))
+				ASN__ENCODE_FAILED;
+
+			/* Consume the bits to align on octet */
+			if (aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+			/* Put the value */
+			for (i = 0; i <= j; i++) {
+				if(per_put_few_bits(po, (v64 >> (8 * (j - i))) & 0xff, 8))
+					ASN__ENCODE_FAILED;
+			}
+		}
+		ASN__ENCODED_OK(er);
+	}
+
+	if(ct && ct->lower_bound) {
+		ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
+		/* TODO: adjust lower bound */
+		ASN__ENCODE_FAILED;
+	}
+
+	for(buf = st->buf, end = st->buf + st->size; buf < end;) {
+		ssize_t mayEncode = aper_put_length(po, -1, end - buf);
+		if(mayEncode < 0)
+			ASN__ENCODE_FAILED;
+		if(per_put_many_bits(po, buf, 8 * mayEncode))
+			ASN__ENCODE_FAILED;
+		buf += mayEncode;
+	}
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+
+static intmax_t
+asn__integer_convert(const uint8_t *b, const uint8_t *end) {
+    uintmax_t value;
+
+    /* Perform the sign initialization */
+    /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
+    if((*b >> 7)) {
+        value = (uintmax_t)(-1);
+    } else {
+        value = 0;
+    }
+
+    /* Conversion engine */
+    for(; b < end; b++) {
+        value = (value << 8) | *b;
+    }
+
+    return value;
+}
+
+int
+asn_INTEGER2imax(const INTEGER_t *iptr, intmax_t *lptr) {
+	uint8_t *b, *end;
+	size_t size;
+
+	/* Sanity checking */
+	if(!iptr || !iptr->buf || !lptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	/* Cache the begin/end of the buffer */
+	b = iptr->buf;	/* Start of the INTEGER buffer */
+	size = iptr->size;
+	end = b + size;	/* Where to stop */
+
+	if(size > sizeof(intmax_t)) {
+		uint8_t *end1 = end - 1;
+		/*
+		 * Slightly more advanced processing,
+		 * able to process INTEGERs with >sizeof(intmax_t) bytes
+		 * when the actual value is small, e.g. for intmax_t == int32_t
+		 * (0x0000000000abcdef INTEGER would yield a fine 0x00abcdef int32_t)
+		 */
+		/* Skip out the insignificant leading bytes */
+		for(; b < end1; b++) {
+			switch(*b) {
+				case 0x00: if((b[1] & 0x80) == 0) continue; break;
+				case 0xff: if((b[1] & 0x80) != 0) continue; break;
+			}
+			break;
+		}
+
+		size = end - b;
+		if(size > sizeof(intmax_t)) {
+			/* Still cannot fit the sizeof(intmax_t) */
+			errno = ERANGE;
+			return -1;
+		}
+	}
+
+	/* Shortcut processing of a corner case */
+	if(end == b) {
+		*lptr = 0;
+		return 0;
+	}
+
+	*lptr = asn__integer_convert(b, end);
+	return 0;
+}
+
+/* FIXME: negative INTEGER values are silently interpreted as large unsigned ones. */
+int
+asn_INTEGER2umax(const INTEGER_t *iptr, uintmax_t *lptr) {
+	uint8_t *b, *end;
+	uintmax_t value;
+	size_t size;
+
+	if(!iptr || !iptr->buf || !lptr) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	b = iptr->buf;
+	size = iptr->size;
+	end = b + size;
+
+	/* If all extra leading bytes are zeroes, ignore them */
+	for(; size > sizeof(value); b++, size--) {
+		if(*b) {
+			/* Value won't fit into uintmax_t */
+			errno = ERANGE;
+			return -1;
+		}
+	}
+
+	/* Conversion engine */
+	for(value = 0; b < end; b++)
+		value = (value << 8) | *b;
+
+	*lptr = value;
+	return 0;
+}
+
+int
+asn_umax2INTEGER(INTEGER_t *st, uintmax_t value) {
+    uint8_t *buf;
+    uint8_t *end;
+    uint8_t *b;
+    int shr;
+
+    if(value <= ((~(uintmax_t)0) >> 1)) {
+        return asn_imax2INTEGER(st, value);
+    }
+
+    buf = (uint8_t *)MALLOC(1 + sizeof(value));
+    if(!buf) return -1;
+
+    end = buf + (sizeof(value) + 1);
+    buf[0] = 0; /* INTEGERs are signed. 0-byte indicates positive. */
+    for(b = buf + 1, shr = (sizeof(value) - 1) * 8; b < end; shr -= 8, b++)
+        *b = (uint8_t)(value >> shr);
+
+    if(st->buf) FREEMEM(st->buf);
+    st->buf = buf;
+    st->size = 1 + sizeof(value);
+
+	return 0;
+}
+
+int
+asn_imax2INTEGER(INTEGER_t *st, intmax_t value) {
+	uint8_t *buf, *bp;
+	uint8_t *p;
+	uint8_t *pstart;
+	uint8_t *pend1;
+	int littleEndian = 1;	/* Run-time detection */
+	int add;
+
+	if(!st) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	buf = (uint8_t *)(long *)MALLOC(sizeof(value));
+	if(!buf) return -1;
+
+	if(*(char *)&littleEndian) {
+		pstart = (uint8_t *)&value + sizeof(value) - 1;
+		pend1 = (uint8_t *)&value;
+		add = -1;
+	} else {
+		pstart = (uint8_t *)&value;
+		pend1 = pstart + sizeof(value) - 1;
+		add = 1;
+	}
+
+	/*
+	 * If the contents octet consists of more than one octet,
+	 * then bits of the first octet and bit 8 of the second octet:
+	 * a) shall not all be ones; and
+	 * b) shall not all be zero.
+	 */
+	for(p = pstart; p != pend1; p += add) {
+		switch(*p) {
+		case 0x00: if((*(p+add) & 0x80) == 0)
+				continue;
+			break;
+		case 0xff: if((*(p+add) & 0x80))
+				continue;
+			break;
+		}
+		break;
+	}
+	/* Copy the integer body */
+	for(bp = buf, pend1 += add; p != pend1; p += add)
+		*bp++ = *p;
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = bp - buf;
+
+	return 0;
+}
+
+int
+asn_INTEGER2long(const INTEGER_t *iptr, long *l) {
+    intmax_t v;
+    if(asn_INTEGER2imax(iptr, &v) == 0) {
+        if(v < LONG_MIN || v > LONG_MAX) {
+            errno = ERANGE;
+            return -1;
+        }
+        *l = v;
+        return 0;
+    } else {
+        return -1;
+    }
+}
+
+int
+asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *l) {
+    uintmax_t v;
+    if(asn_INTEGER2umax(iptr, &v) == 0) {
+        if(v > ULONG_MAX) {
+            errno = ERANGE;
+            return -1;
+        }
+        *l = v;
+        return 0;
+    } else {
+        return -1;
+    }
+}
+
+int
+asn_long2INTEGER(INTEGER_t *st, long value) {
+    return asn_imax2INTEGER(st, value);
+}
+
+int
+asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
+    return asn_imax2INTEGER(st, value);
+}
+
+
+int
+asn_uint642INTEGER(INTEGER_t *st, uint64_t value) {
+	uint8_t *buf;
+	uint8_t *end;
+	uint8_t *b;
+	int shr;
+
+	if(value <= INT64_MAX)
+		return asn_int642INTEGER(st, value);
+
+	buf = (uint8_t *)MALLOC(1 + sizeof(value));
+	if(!buf) return -1;
+
+	end = buf + (sizeof(value) + 1);
+	buf[0] = 0;
+	for(b = buf + 1, shr = (sizeof(value)-1)*8; b < end; shr -= 8, b++)
+		*b = (uint8_t)(value >> shr);
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = 1 + sizeof(value);
+
+	return 0;
+}
+
+int
+asn_int642INTEGER(INTEGER_t *st, int64_t value) {
+	uint8_t *buf, *bp;
+	uint8_t *p;
+	uint8_t *pstart;
+	uint8_t *pend1;
+	int littleEndian = 1;	/* Run-time detection */
+	int add;
+
+	if(!st) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	buf = (uint8_t *)MALLOC(sizeof(value));
+	if(!buf) return -1;
+
+	if(*(char *)&littleEndian) {
+		pstart = (uint8_t *)&value + sizeof(value) - 1;
+		pend1 = (uint8_t *)&value;
+		add = -1;
+	} else {
+		pstart = (uint8_t *)&value;
+		pend1 = pstart + sizeof(value) - 1;
+		add = 1;
+	}
+
+	/*
+	 * If the contents octet consists of more than one octet,
+	 * then bits of the first octet and bit 8 of the second octet:
+	 * a) shall not all be ones; and
+	 * b) shall not all be zero.
+	 */
+	for(p = pstart; p != pend1; p += add) {
+		switch(*p) {
+		case 0x00: if((*(p+add) & 0x80) == 0)
+				continue;
+			break;
+		case 0xff: if((*(p+add) & 0x80))
+				continue;
+			break;
+		}
+		break;
+	}
+	/* Copy the integer body */
+	for(pstart = p, bp = buf, pend1 += add; p != pend1; p += add)
+		*bp++ = *p;
+
+	if(st->buf) FREEMEM(st->buf);
+	st->buf = buf;
+	st->size = bp - buf;
+
+	return 0;
+}
+
+/*
+ * Parse the number in the given string until the given *end position,
+ * returning the position after the last parsed character back using the
+ * same (*end) pointer.
+ * WARNING: This behavior is different from the standard strtol/strtoimax(3).
+ */
+enum asn_strtox_result_e
+asn_strtoimax_lim(const char *str, const char **end, intmax_t *intp) {
+	int sign = 1;
+	intmax_t value;
+
+#define ASN1_INTMAX_MAX ((~(uintmax_t)0) >> 1)
+    const intmax_t upper_boundary = ASN1_INTMAX_MAX / 10;
+	intmax_t last_digit_max = ASN1_INTMAX_MAX % 10;
+#undef  ASN1_INTMAX_MAX
+
+	if(str >= *end) return ASN_STRTOX_ERROR_INVAL;
+
+	switch(*str) {
+	case '-':
+		last_digit_max++;
+		sign = -1;
+		/* FALL THROUGH */
+	case '+':
+		str++;
+		if(str >= *end) {
+			*end = str;
+			return ASN_STRTOX_EXPECT_MORE;
+		}
+	}
+
+	for(value = 0; str < (*end); str++) {
+		switch(*str) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: {
+			int d = *str - '0';
+			if(value < upper_boundary) {
+				value = value * 10 + d;
+			} else if(value == upper_boundary) {
+				if(d <= last_digit_max) {
+					if(sign > 0) {
+						value = value * 10 + d;
+					} else {
+						sign = 1;
+						value = -value * 10 - d;
+					}
+				} else {
+					*end = str;
+					return ASN_STRTOX_ERROR_RANGE;
+				}
+			} else {
+				*end = str;
+				return ASN_STRTOX_ERROR_RANGE;
+			}
+		    }
+		    continue;
+		default:
+		    *end = str;
+		    *intp = sign * value;
+		    return ASN_STRTOX_EXTRA_DATA;
+		}
+	}
+
+	*end = str;
+	*intp = sign * value;
+	return ASN_STRTOX_OK;
+}
+
+/*
+ * Parse the number in the given string until the given *end position,
+ * returning the position after the last parsed character back using the
+ * same (*end) pointer.
+ * WARNING: This behavior is different from the standard strtoul/strtoumax(3).
+ */
+enum asn_strtox_result_e
+asn_strtoumax_lim(const char *str, const char **end, uintmax_t *uintp) {
+	uintmax_t value;
+
+#define ASN1_UINTMAX_MAX ((~(uintmax_t)0))
+    const uintmax_t upper_boundary = ASN1_UINTMAX_MAX / 10;
+    uintmax_t last_digit_max = ASN1_UINTMAX_MAX % 10;
+#undef ASN1_UINTMAX_MAX
+
+    if(str >= *end) return ASN_STRTOX_ERROR_INVAL;
+
+	switch(*str) {
+	case '-':
+        return ASN_STRTOX_ERROR_INVAL;
+	case '+':
+		str++;
+		if(str >= *end) {
+			*end = str;
+			return ASN_STRTOX_EXPECT_MORE;
+		}
+	}
+
+	for(value = 0; str < (*end); str++) {
+		switch(*str) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: {
+			unsigned int d = *str - '0';
+			if(value < upper_boundary) {
+				value = value * 10 + d;
+			} else if(value == upper_boundary) {
+				if(d <= last_digit_max) {
+                    value = value * 10 + d;
+                } else {
+					*end = str;
+					return ASN_STRTOX_ERROR_RANGE;
+				}
+			} else {
+				*end = str;
+				return ASN_STRTOX_ERROR_RANGE;
+			}
+		    }
+		    continue;
+		default:
+		    *end = str;
+		    *uintp = value;
+		    return ASN_STRTOX_EXTRA_DATA;
+		}
+	}
+
+	*end = str;
+	*uintp = value;
+	return ASN_STRTOX_OK;
+}
+
+enum asn_strtox_result_e
+asn_strtol_lim(const char *str, const char **end, long *lp) {
+    intmax_t value;
+    switch(asn_strtoimax_lim(str, end, &value)) {
+    case ASN_STRTOX_ERROR_RANGE:
+        return ASN_STRTOX_ERROR_RANGE;
+    case ASN_STRTOX_ERROR_INVAL:
+        return ASN_STRTOX_ERROR_INVAL;
+    case ASN_STRTOX_EXPECT_MORE:
+        return ASN_STRTOX_EXPECT_MORE;
+    case ASN_STRTOX_OK:
+        if(value >= LONG_MIN && value <= LONG_MAX) {
+            *lp = value;
+            return ASN_STRTOX_OK;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    case ASN_STRTOX_EXTRA_DATA:
+        if(value >= LONG_MIN && value <= LONG_MAX) {
+            *lp = value;
+            return ASN_STRTOX_EXTRA_DATA;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    }
+
+    assert(!"Unreachable");
+    return ASN_STRTOX_ERROR_INVAL;
+}
+
+enum asn_strtox_result_e
+asn_strtoul_lim(const char *str, const char **end, unsigned long *ulp) {
+    uintmax_t value;
+    switch(asn_strtoumax_lim(str, end, &value)) {
+    case ASN_STRTOX_ERROR_RANGE:
+        return ASN_STRTOX_ERROR_RANGE;
+    case ASN_STRTOX_ERROR_INVAL:
+        return ASN_STRTOX_ERROR_INVAL;
+    case ASN_STRTOX_EXPECT_MORE:
+        return ASN_STRTOX_EXPECT_MORE;
+    case ASN_STRTOX_OK:
+        if(value <= ULONG_MAX) {
+            *ulp = value;
+            return ASN_STRTOX_OK;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    case ASN_STRTOX_EXTRA_DATA:
+        if(value <= ULONG_MAX) {
+            *ulp = value;
+            return ASN_STRTOX_EXTRA_DATA;
+        } else {
+            return ASN_STRTOX_ERROR_RANGE;
+        }
+    }
+
+    assert(!"Unreachable");
+    return ASN_STRTOX_ERROR_INVAL;
+}
+
+int
+INTEGER_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                     const void *bptr) {
+    const INTEGER_t *a = aptr;
+    const INTEGER_t *b = bptr;
+
+    (void)td;
+
+    if(a && b) {
+        if(a->size && b->size) {
+            int sign_a = (a->buf[0] & 0x80) ? -1 : 1;
+            int sign_b = (b->buf[0] & 0x80) ? -1 : 1;
+
+            if(sign_a < sign_b) return -1;
+            if(sign_a > sign_b) return 1;
+
+            /* The shortest integer wins, unless comparing negatives */
+            if(a->size < b->size) {
+                return -1 * sign_a;
+            } else if(a->size > b->size) {
+                return 1 * sign_b;
+            }
+
+            return sign_a * memcmp(a->buf, b->buf, a->size);
+        } else if(a->size) {
+            int sign = (a->buf[0] & 0x80) ? -1 : 1;
+            return (1) * sign;
+        } else if(b->size) {
+            int sign = (a->buf[0] & 0x80) ? -1 : 1;
+            return (-1) * sign;
+        } else {
+            return 0;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+
+}
+
+asn_random_fill_result_t
+INTEGER_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                    const asn_encoding_constraints_t *constraints,
+                    size_t max_length) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    INTEGER_t *st = *sptr;
+    const asn_INTEGER_enum_map_t *emap;
+    size_t emap_len;
+    intmax_t value;
+    int find_inside_map;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (INTEGER_t *)CALLOC(1, sizeof(*st));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    if(specs) {
+        emap = specs->value2enum;
+        emap_len = specs->map_count;
+        if(specs->strict_enumeration) {
+            find_inside_map = emap_len > 0;
+        } else {
+            find_inside_map = emap_len ? asn_random_between(0, 1) : 0;
+        }
+    } else {
+        emap = 0;
+        emap_len = 0;
+        find_inside_map = 0;
+    }
+
+    if(find_inside_map) {
+        assert(emap_len > 0);
+        value = emap[asn_random_between(0, emap_len - 1)].nat_value;
+    } else {
+        const asn_per_constraints_t *ct;
+
+        static const long variants[] = {
+            -65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384,
+            -16383, -257,   -256,   -255,   -254,   -129,   -128,   -127,
+            -126,   -1,     0,      1,      126,    127,    128,    129,
+            254,    255,    256,    257,    16383,  16384,  16385,  32767,
+            32768,  32769,  65534,  65535,  65536,  65537};
+        if(specs && specs->field_unsigned) {
+            assert(variants[18] == 0);
+            value = variants[asn_random_between(
+                18, sizeof(variants) / sizeof(variants[0]) - 1)];
+        } else {
+            value = variants[asn_random_between(
+                0, sizeof(variants) / sizeof(variants[0]) - 1)];
+        }
+
+        if(!constraints) constraints = &td->encoding_constraints;
+        ct = constraints ? constraints->per_constraints : 0;
+        if(ct && (ct->value.flags & APC_CONSTRAINED)) {
+            if(value < ct->value.lower_bound || value > ct->value.upper_bound) {
+                value = asn_random_between(ct->value.lower_bound,
+                                           ct->value.upper_bound);
+            }
+        }
+    }
+
+    if(asn_imax2INTEGER(st, value)) {
+        if(st == *sptr) {
+            ASN_STRUCT_RESET(*td, st);
+        } else {
+            ASN_STRUCT_FREE(*td, st);
+        }
+        return result_failed;
+    } else {
+        *sptr = st;
+        result_ok.length = st->size;
+        return result_ok;
+    }
+}
diff --git a/e2ap/lib/INTEGER_oer.c b/e2ap/lib/INTEGER_oer.c
new file mode 100644
index 0000000..110689b
--- /dev/null
+++ b/e2ap/lib/INTEGER_oer.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <INTEGER.h>
+#include <errno.h>
+
+asn_dec_rval_t
+INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_oer_constraints_t *constraints, void **sptr,
+                   const void *ptr, size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    INTEGER_t *st = (INTEGER_t *)*sptr;
+    struct asn_oer_constraint_number_s ct = {0, 0};
+    size_t req_bytes;
+
+    (void)opt_codec_ctx;
+    (void)specs;
+
+    if(!st) {
+        st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    FREEMEM(st->buf);
+    st->buf = 0;
+    st->size = 0;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints) ct = constraints->value;
+
+    if(ct.width) {
+        req_bytes = ct.width;
+    } else {
+        /* No lower bound and no upper bound, effectively */
+
+        ssize_t consumed = oer_fetch_length(ptr, size, &req_bytes);
+        if(consumed == 0) {
+            ASN__DECODE_STARVED;
+        } else if(consumed == -1) {
+            ASN__DECODE_FAILED;
+        }
+        rval.consumed += consumed;
+        ptr = (const char *)ptr + consumed;
+        size -= consumed;
+    }
+
+    if(req_bytes > size) {
+        ASN__DECODE_STARVED;
+    }
+
+    if(ct.positive) {
+        /* X.969 08/2015 10.2(a) */
+        unsigned msb;   /* Most significant bit */
+        size_t useful_size;
+
+        /* Check most significant bit */
+        msb = *(const uint8_t *)ptr >> 7; /* yields 0 or 1 */
+        useful_size = msb + req_bytes;
+        st->buf = (uint8_t *)MALLOC(useful_size + 1);
+        if(!st->buf) {
+            ASN__DECODE_FAILED;
+        }
+
+        /*
+         * Record a large unsigned in a way not to confuse it
+         * with signed value.
+         */
+        st->buf[0] = '\0';
+        memcpy(st->buf + msb, ptr, req_bytes);
+        st->buf[useful_size] = '\0';    /* Just in case, 0-terminate */
+        st->size = useful_size;
+
+        rval.consumed += req_bytes;
+        return rval;
+    } else {
+        /* X.969 08/2015 10.2(b) */
+        st->buf = (uint8_t *)MALLOC(req_bytes + 1);
+        if(!st->buf) {
+            ASN__DECODE_FAILED;
+        }
+
+        memcpy(st->buf, ptr, req_bytes);
+        st->buf[req_bytes] = '\0'; /* Just in case, 0-terminate */
+        st->size = req_bytes;
+
+        rval.consumed += req_bytes;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+INTEGER_encode_oer(const asn_TYPE_descriptor_t *td,
+                   const asn_oer_constraints_t *constraints, const void *sptr,
+                   asn_app_consume_bytes_f *cb, void *app_key) {
+    const INTEGER_t *st = sptr;
+    asn_enc_rval_t er = {0,0,0};
+    struct asn_oer_constraint_number_s ct = {0, 0};
+    const uint8_t *buf;
+    const uint8_t *end;
+    size_t useful_bytes;
+    size_t req_bytes = 0;
+    int sign = 0;
+
+    if(!st || st->size == 0) ASN__ENCODE_FAILED;
+
+    if(!constraints) constraints = td->encoding_constraints.oer_constraints;
+    if(constraints) ct = constraints->value;
+
+    er.encoded = 0;
+
+    buf = st->buf;
+    end = buf + st->size;
+
+    sign = (buf && buf < end) ? buf[0] & 0x80 : 0;
+
+    /* Ignore 9 leading zeroes or ones */
+    if(ct.positive) {
+        if(sign) {
+            /* The value given is a signed value. Can't proceed. */
+            ASN__ENCODE_FAILED;
+        }
+        /* Remove leading zeros. */
+        for(; buf + 1 < end; buf++) {
+            if(buf[0] != 0x0) break;
+        }
+    } else {
+        for(; buf + 1 < end; buf++) {
+            if(buf[0] == 0x0 && (buf[1] & 0x80) == 0) {
+                continue;
+            } else if(buf[0] == 0xff && (buf[1] & 0x80) != 0) {
+                continue;
+            }
+            break;
+        }
+    }
+
+    useful_bytes = end - buf;
+    if(ct.width) {
+        req_bytes = ct.width;
+    } else {
+        ssize_t r = oer_serialize_length(useful_bytes, cb, app_key);
+        if(r < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        er.encoded += r;
+        req_bytes = useful_bytes;
+    }
+
+    if(req_bytes < useful_bytes) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded += req_bytes;
+
+    for(; req_bytes > useful_bytes; req_bytes--) {
+        if(cb(sign?"\xff":"\0", 1, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+    if(cb(buf, useful_bytes, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/InitiatingMessage.c b/e2ap/lib/InitiatingMessage.c
new file mode 100644
index 0000000..6a6bfdb
--- /dev/null
+++ b/e2ap/lib/InitiatingMessage.c
@@ -0,0 +1,398 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "InitiatingMessage.h"
+
+static const long asn_VAL_1_id_RICsubscription = 8;
+static const long asn_VAL_1_reject = 0;
+static const long asn_VAL_2_id_RICsubscriptionDelete = 9;
+static const long asn_VAL_2_reject = 0;
+static const long asn_VAL_3_id_RICserviceUpdate = 7;
+static const long asn_VAL_3_reject = 0;
+static const long asn_VAL_4_id_RICcontrol = 4;
+static const long asn_VAL_4_reject = 0;
+static const long asn_VAL_5_id_E2setup = 1;
+static const long asn_VAL_5_reject = 0;
+static const long asn_VAL_6_id_Reset = 3;
+static const long asn_VAL_6_reject = 0;
+static const long asn_VAL_7_id_RICindication = 5;
+static const long asn_VAL_7_ignore = 1;
+static const long asn_VAL_8_id_RICserviceQuery = 6;
+static const long asn_VAL_8_ignore = 1;
+static const long asn_VAL_9_id_ErrorIndication = 2;
+static const long asn_VAL_9_ignore = 1;
+static const asn_ioc_cell_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_1_id_RICsubscription },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionDeleteRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_2_id_RICsubscriptionDelete },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceUpdate },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_3_id_RICserviceUpdate },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICcontrolRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_4_id_RICcontrol },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_E2setupRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_E2setupResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2setupFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_5_id_E2setup },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ResetRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_ResetResponse },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_6_id_Reset },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICindication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_7_id_RICindication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceQuery },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_8_id_RICserviceQuery },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ErrorIndication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_9_id_ErrorIndication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore }
+};
+static const asn_ioc_set_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1[] = {
+	{ 9, 5, asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows }
+};
+static int
+memb_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_InitiatingMessage_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 4; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct InitiatingMessage, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_InitiatingMessage_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 0; /* &InitiatingMessage */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct InitiatingMessage, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_oer_constraints_t asn_OER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_value_4[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICsubscriptionRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICsubscriptionDeleteRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionDeleteRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICserviceUpdate),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdate,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICserviceUpdate"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICcontrolRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.E2setupRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"E2setupRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.ResetRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResetRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ResetRequest"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICindication),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICindication,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindication"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.RICserviceQuery),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceQuery,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICserviceQuery"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage__value, choice.ErrorIndication),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ErrorIndication,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ErrorIndication"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 8 }, /* RICsubscriptionRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 7 }, /* RICsubscriptionDeleteRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 6 }, /* RICserviceUpdate */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 5 }, /* RICcontrolRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 4 }, /* E2setupRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 5, -5, 3 }, /* ResetRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 6, -6, 2 }, /* RICindication */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 7, -7, 1 }, /* RICserviceQuery */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 8, -8, 0 } /* ErrorIndication */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
+	sizeof(struct InitiatingMessage__value),
+	offsetof(struct InitiatingMessage__value, _asn_ctx),
+	offsetof(struct InitiatingMessage__value, present),
+	sizeof(((struct InitiatingMessage__value *)0)->present),
+	asn_MAP_value_tag2el_4,
+	9,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_4 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_4,
+	9,	/* Elements count */
+	&asn_SPC_value_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_InitiatingMessage_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage, procedureCode),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProcedureCode,
+		0,
+		{ &asn_OER_memb_procedureCode_constr_2, &asn_PER_memb_procedureCode_constr_2,  memb_procedureCode_constraint_1 },
+		0, 0, /* No default value */
+		"procedureCode"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage, criticality),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		select_InitiatingMessage_criticality_type,
+		{ &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct InitiatingMessage, value),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_value_4,
+		select_InitiatingMessage_value_type,
+		{ &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_InitiatingMessage_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_InitiatingMessage_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
+};
+asn_SEQUENCE_specifics_t asn_SPC_InitiatingMessage_specs_1 = {
+	sizeof(struct InitiatingMessage),
+	offsetof(struct InitiatingMessage, _asn_ctx),
+	asn_MAP_InitiatingMessage_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_InitiatingMessage = {
+	"InitiatingMessage",
+	"InitiatingMessage",
+	&asn_OP_SEQUENCE,
+	asn_DEF_InitiatingMessage_tags_1,
+	sizeof(asn_DEF_InitiatingMessage_tags_1)
+		/sizeof(asn_DEF_InitiatingMessage_tags_1[0]), /* 1 */
+	asn_DEF_InitiatingMessage_tags_1,	/* Same as above */
+	sizeof(asn_DEF_InitiatingMessage_tags_1)
+		/sizeof(asn_DEF_InitiatingMessage_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_InitiatingMessage_1,
+	3,	/* Elements count */
+	&asn_SPC_InitiatingMessage_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/NativeEnumerated.c b/e2ap/lib/NativeEnumerated.c
new file mode 100644
index 0000000..50ffb1d
--- /dev/null
+++ b/e2ap/lib/NativeEnumerated.c
@@ -0,0 +1,367 @@
+/*-
+ * Copyright (c) 2004, 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Read the NativeInteger.h for the explanation wrt. differences between
+ * INTEGER and NativeInteger.
+ * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
+ * implementation deals with the standard (machine-specific) representation
+ * of them instead of using the platform-independent buffer.
+ */
+#include <asn_internal.h>
+#include <NativeEnumerated.h>
+
+/*
+ * NativeEnumerated basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_operation_t asn_OP_NativeEnumerated = {
+	NativeInteger_free,
+	NativeInteger_print,
+	NativeInteger_compare,
+	NativeInteger_decode_ber,
+	NativeInteger_encode_der,
+	NativeInteger_decode_xer,
+	NativeEnumerated_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	NativeEnumerated_decode_oer,
+	NativeEnumerated_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	NativeEnumerated_decode_uper,
+	NativeEnumerated_encode_uper,
+	NativeEnumerated_decode_aper,
+	NativeEnumerated_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	NativeEnumerated_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
+	"ENUMERATED",			/* The ASN.1 type is still ENUMERATED */
+	"ENUMERATED",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_NativeEnumerated_tags,
+	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
+	asn_DEF_NativeEnumerated_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+asn_enc_rval_t
+NativeEnumerated_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                            int ilevel, enum xer_encoder_flags_e flags,
+                            asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_enc_rval_t er = {0,0,0};
+    const long *native = (const long *)sptr;
+    const asn_INTEGER_enum_map_t *el;
+
+    (void)ilevel;
+    (void)flags;
+
+    if(!native) ASN__ENCODE_FAILED;
+
+    el = INTEGER_map_value2enum(specs, *native);
+    if(el) {
+        er.encoded =
+            asn__format_to_callback(cb, app_key, "<%s/>", el->enum_name);
+        if(er.encoded < 0) ASN__ENCODE_FAILED;
+        ASN__ENCODED_OK(er);
+    } else {
+        ASN_DEBUG(
+            "ASN.1 forbids dealing with "
+            "unknown value of ENUMERATED type");
+        ASN__ENCODE_FAILED;
+    }
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             void **sptr, asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs = td->specifics;
+    asn_dec_rval_t rval = { RC_OK, 0 };
+	long *native = (long *)*sptr;
+	const asn_per_constraint_t *ct = NULL;
+	long value;
+
+	(void)opt_codec_ctx;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__DECODE_FAILED;	/* Mandatory! */
+	if(!specs) ASN__DECODE_FAILED;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value >= (specs->extension
+			? specs->extension - 1 : specs->map_count))
+			ASN__DECODE_FAILED;
+	} else {
+		if(!specs->extension)
+			ASN__DECODE_FAILED;
+		/*
+		 * X.691, #10.6: normally small non-negative whole number;
+		 */
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->extension - 1;
+		if(value >= specs->map_count)
+			ASN__DECODE_FAILED;
+	}
+
+	*native = specs->value2enum[value].nat_value;
+	ASN_DEBUG("Decoded %s = %ld", td->name, *native);
+
+	return rval;
+}
+
+static int
+NativeEnumerated__compar_value2enum(const void *ap, const void *bp) {
+	const asn_INTEGER_enum_map_t *a = ap;
+	const asn_INTEGER_enum_map_t *b = bp;
+	if(a->nat_value == b->nat_value)
+		return 0;
+	if(a->nat_value < b->nat_value)
+		return -1;
+	return 1;
+}
+
+asn_enc_rval_t
+NativeEnumerated_encode_uper(const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native, value;
+	const asn_per_constraint_t *ct = NULL;
+	int inext = 0;
+	asn_INTEGER_enum_map_t key;
+	const asn_INTEGER_enum_map_t *kf;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	if(!specs) ASN__ENCODE_FAILED;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__ENCODE_FAILED;	/* Mandatory! */
+
+	ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
+
+	er.encoded = 0;
+
+	native = *(const long *)sptr;
+
+	key.nat_value = native;
+	kf = bsearch(&key, specs->value2enum, specs->map_count,
+		sizeof(key), NativeEnumerated__compar_value2enum);
+	if(!kf) {
+		ASN_DEBUG("No element corresponds to %ld", native);
+		ASN__ENCODE_FAILED;
+	}
+	value = kf - specs->value2enum;
+
+	if(ct && ct->range_bits >= 0) {
+		int cmpWith = specs->extension
+				? specs->extension - 1 : specs->map_count;
+		if(value >= cmpWith)
+			inext = 1;
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+		if(inext) ct = 0;
+	} else if(inext) {
+		ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		if(per_put_few_bits(po, value, ct->range_bits))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	if(!specs->extension)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * X.691, #10.6: normally small non-negative whole number;
+	 */
+	ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
+		value, specs->extension, inext,
+		value - (inext ? (specs->extension - 1) : 0));
+	if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             void **sptr, asn_per_data_t *pd) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	long *native = (long *)*sptr;
+	const asn_per_constraint_t *ct = NULL;
+	long value;
+
+	(void)opt_codec_ctx;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__DECODE_FAILED;	/* Mandatory! */
+	if(!specs) ASN__DECODE_FAILED;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) ASN__DECODE_STARVED;
+		if(inext) ct = 0;
+	}
+
+	/* Deal with APER padding */
+	if(ct && ct->upper_bound >= 255) {
+		int padding = 0;
+		padding = (8 - (pd->moved % 8)) % 8;
+		ASN_DEBUG("For NativeEnumerated %s,offset= %lu Padding bits = %d", td->name, pd->moved, padding);
+		ASN_DEBUG("For NativeEnumerated %s, upper bound = %lu", td->name, ct->upper_bound);
+		if(padding > 0)
+			per_get_few_bits(pd, padding);
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value >= (specs->extension
+		             ? specs->extension - 1 : specs->map_count))
+			ASN__DECODE_FAILED;
+	} else {
+		if(!specs->extension)
+			ASN__DECODE_FAILED;
+		/*
+		 * X.691, #10.6: normally small non-negative whole number;
+		 */
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->extension - 1;
+		if(value >= specs->map_count)
+			ASN__DECODE_FAILED;
+	}
+
+	*native = specs->value2enum[value].nat_value;
+	ASN_DEBUG("Decoded %s = %ld", td->name, *native);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeEnumerated_encode_aper(const asn_TYPE_descriptor_t *td,
+                             const asn_per_constraints_t *constraints,
+                             const void *sptr, asn_per_outp_t *po) {
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native, value;
+	const asn_per_constraint_t *ct = NULL;
+	int inext = 0;
+	asn_INTEGER_enum_map_t key;
+	asn_INTEGER_enum_map_t *kf;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	if(!specs) ASN__ENCODE_FAILED;
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ASN__ENCODE_FAILED;        /* Mandatory! */
+
+	ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
+
+	er.encoded = 0;
+
+	native = *(const long *)sptr;
+	if(native < 0) ASN__ENCODE_FAILED;
+
+	key.nat_value = native;
+	kf = bsearch(&key, specs->value2enum, specs->map_count,
+	             sizeof(key), NativeEnumerated__compar_value2enum);
+	if(!kf) {
+		ASN_DEBUG("No element corresponds to %ld", native);
+		ASN__ENCODE_FAILED;
+	}
+	value = kf - specs->value2enum;
+
+	if(ct && ct->range_bits >= 0) {
+		int cmpWith = specs->extension
+		              ? specs->extension - 1 : specs->map_count;
+		if(value >= cmpWith)
+			inext = 1;
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+		if(inext) ct = 0;
+	} else if(inext) {
+		ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		if(per_put_few_bits(po, value, ct->range_bits))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	if(!specs->extension)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * X.691, #10.6: normally small non-negative whole number;
+	 */
+	ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
+	          value, specs->extension, inext,
+	          value - (inext ? (specs->extension - 1) : 0));
+	if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
diff --git a/e2ap/lib/NativeEnumerated_oer.c b/e2ap/lib/NativeEnumerated_oer.c
new file mode 100644
index 0000000..ee3c189
--- /dev/null
+++ b/e2ap/lib/NativeEnumerated_oer.c
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <NativeEnumerated.h>
+#include <errno.h>
+
+static long
+asn__nativeenumerated_convert(const uint8_t *b, const uint8_t *end) {
+    unsigned long value;
+
+    /* Perform the sign initialization */
+    /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
+    if((*b >> 7)) {
+        value = (unsigned long)(-1);
+    } else {
+        value = 0;
+    }
+
+    /* Conversion engine */
+    for(; b < end; b++) {
+        value = (value << 8) | *b;
+    }
+
+    return value;
+}
+
+asn_dec_rval_t
+NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                            const asn_TYPE_descriptor_t *td,
+                            const asn_oer_constraints_t *constraints,
+                            void **nint_ptr, const void *ptr, size_t size) {
+    asn_dec_rval_t rval = {RC_OK, 0};
+    long *native = (long *)*nint_ptr;
+    const uint8_t *b = ptr;
+
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    if(size < 1) {
+        ASN__DECODE_STARVED;
+    }
+
+    if((*b & 0x80) == 0) {
+        /*
+         * X.696 (08/2015) #11.2 Short form for Enumerated.
+         */
+        if(!native) {
+            native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+            if(!native) ASN__DECODE_FAILED;
+        }
+
+        *native = *b;
+        rval.consumed = 1;
+    } else {
+        /*
+         * X.696 (08/2015) #11.4 Long form for Enumerated.
+         */
+        size_t length = *b & 0x7f;
+        const uint8_t *bend;
+        long value;
+
+        if(length < 1 || length > sizeof(*native)) {
+            ASN__DECODE_FAILED;
+        }
+        if((1 + length) > size) {
+            ASN__DECODE_STARVED;
+        }
+        b++;
+        bend = b + length;
+
+        value = asn__nativeenumerated_convert(b, bend);
+        if(value < 0) {
+            const asn_INTEGER_specifics_t *specs =
+                (const asn_INTEGER_specifics_t *)td->specifics;
+            if(specs && specs->field_unsigned) {
+                ASN__DECODE_FAILED;
+            }
+        }
+
+        if(!native) {
+            native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+            if(!native) ASN__DECODE_FAILED;
+        }
+
+        *native = value;
+
+        rval.consumed = (1 + length);
+    }
+
+    return rval;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+NativeEnumerated_encode_oer(const asn_TYPE_descriptor_t *td,
+                            const asn_oer_constraints_t *constraints,
+                            const void *sptr, asn_app_consume_bytes_f *cb,
+                            void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    long native;
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+
+    if(native >= 0 && native <= 127) {
+        /* #11.2 Short form */
+        uint8_t b = native;
+        er.encoded = 1;
+        if(cb(&b, er.encoded, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    } else {
+        /* #11.2 Long form */
+        uint8_t buf[1 + sizeof(native)];
+        uint8_t *b = &buf[sizeof(native)];  /* Last addressable */
+        long final_pattern = -1 * (native < 0);
+
+        for(;;) {
+            *b-- = native;
+            native >>= 8;
+            if(native == final_pattern) {
+                if(final_pattern) {
+                    if((b[1] & 0x80)) break;
+                } else {
+                    if(!(b[1] & 0x80)) break;
+                }
+            }
+        }
+        *b = 0x80 | (&buf[sizeof(native)] - b);
+        er.encoded = 1 + (&buf[sizeof(native)] - b);
+        if(cb(b, er.encoded, app_key) < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/NativeInteger.c b/e2ap/lib/NativeInteger.c
new file mode 100644
index 0000000..316e872
--- /dev/null
+++ b/e2ap/lib/NativeInteger.c
@@ -0,0 +1,550 @@
+/*-
+ * Copyright (c) 2004, 2005, 2006 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+/*
+ * Read the NativeInteger.h for the explanation wrt. differences between
+ * INTEGER and NativeInteger.
+ * Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
+ * implementation deals with the standard (machine-specific) representation
+ * of them instead of using the platform-independent buffer.
+ */
+#include <asn_internal.h>
+#include <NativeInteger.h>
+
+/*
+ * NativeInteger basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_operation_t asn_OP_NativeInteger = {
+	NativeInteger_free,
+	NativeInteger_print,
+	NativeInteger_compare,
+	NativeInteger_decode_ber,
+	NativeInteger_encode_der,
+	NativeInteger_decode_xer,
+	NativeInteger_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	NativeInteger_decode_oer,	/* OER decoder */
+	NativeInteger_encode_oer,	/* Canonical OER encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	NativeInteger_decode_uper,	/* Unaligned PER decoder */
+	NativeInteger_encode_uper,	/* Unaligned PER encoder */
+	NativeInteger_decode_aper,	/* Aligned PER decoder */
+	NativeInteger_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	NativeInteger_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
+	"INTEGER",			/* The ASN.1 type is still INTEGER */
+	"INTEGER",
+	&asn_OP_NativeInteger,
+	asn_DEF_NativeInteger_tags,
+	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
+	asn_DEF_NativeInteger_tags,	/* Same as above */
+	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
+/*
+ * Decode INTEGER type.
+ */
+asn_dec_rval_t
+NativeInteger_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td, void **nint_ptr,
+                         const void *buf_ptr, size_t size, int tag_mode) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    long *native = (long *)*nint_ptr;
+	asn_dec_rval_t rval;
+	ber_tlv_len_t length;
+
+	/*
+	 * If the structure is not there, allocate it.
+	 */
+	if(native == NULL) {
+		native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+		if(native == NULL) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+			return rval;
+		}
+	}
+
+	ASN_DEBUG("Decoding %s as INTEGER (tm=%d)",
+		td->name, tag_mode);
+
+	/*
+	 * Check tags.
+	 */
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
+	if(rval.code != RC_OK)
+		return rval;
+
+	ASN_DEBUG("%s length is %d bytes", td->name, (int)length);
+
+	/*
+	 * Make sure we have this length.
+	 */
+	buf_ptr = ((const char *)buf_ptr) + rval.consumed;
+	size -= rval.consumed;
+	if(length > (ber_tlv_len_t)size) {
+		rval.code = RC_WMORE;
+		rval.consumed = 0;
+		return rval;
+	}
+
+	/*
+	 * ASN.1 encoded INTEGER: buf_ptr, length
+	 * Fill the native, at the same time checking for overflow.
+	 * If overflow occured, return with RC_FAIL.
+	 */
+	{
+		INTEGER_t tmp;
+		union {
+			const void *constbuf;
+			void *nonconstbuf;
+		} unconst_buf;
+		long l;
+
+		unconst_buf.constbuf = buf_ptr;
+		tmp.buf = (uint8_t *)unconst_buf.nonconstbuf;
+		tmp.size = length;
+
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */
+			: asn_INTEGER2long(&tmp, &l)) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+			return rval;
+		}
+
+		*native = l;
+	}
+
+	rval.code = RC_OK;
+	rval.consumed += length;
+
+	ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)",
+		(long)rval.consumed, (long)length, td->name, (long)*native);
+
+	return rval;
+}
+
+/*
+ * Encode the NativeInteger using the standard INTEGER type DER encoder.
+ */
+asn_enc_rval_t
+NativeInteger_encode_der(const asn_TYPE_descriptor_t *sd, const void *ptr,
+                         int tag_mode, ber_tlv_tag_t tag,
+                         asn_app_consume_bytes_f *cb, void *app_key) {
+	unsigned long native = *(const unsigned long *)ptr; /* Disable sign ext. */
+	asn_enc_rval_t erval = {0,0,0};
+	INTEGER_t tmp;
+
+#ifdef	WORDS_BIGENDIAN		/* Opportunistic optimization */
+
+	tmp.buf = (uint8_t *)&native;
+	tmp.size = sizeof(native);
+
+#else	/* Works even if WORDS_BIGENDIAN is not set where should've been */
+	uint8_t buf[sizeof(native)];
+	uint8_t *p;
+
+	/* Prepare a fake INTEGER */
+	for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8)
+		*p = (uint8_t)native;
+
+	tmp.buf = buf;
+	tmp.size = sizeof(buf);
+#endif	/* WORDS_BIGENDIAN */
+	
+	/* Encode fake INTEGER */
+	erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key);
+    if(erval.structure_ptr == &tmp) {
+        erval.structure_ptr = ptr;
+    }
+	return erval;
+}
+
+/*
+ * Decode the chunk of XML text encoding INTEGER.
+ */
+asn_dec_rval_t
+NativeInteger_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td, void **sptr,
+                         const char *opt_mname, const void *buf_ptr,
+                         size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval;
+	INTEGER_t st;
+	void *st_ptr = (void *)&st;
+	long *native = (long *)*sptr;
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&st, 0, sizeof(st));
+	rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, 
+		opt_mname, buf_ptr, size);
+	if(rval.code == RC_OK) {
+		long l;
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */
+			: asn_INTEGER2long(&st, &l)) {
+			rval.code = RC_FAIL;
+			rval.consumed = 0;
+		} else {
+			*native = l;
+		}
+	} else {
+		/*
+		 * Cannot restart from the middle;
+		 * there is no place to save state in the native type.
+		 * Request a continuation from the very beginning.
+		 */
+		rval.consumed = 0;
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st);
+	return rval;
+}
+
+
+asn_enc_rval_t
+NativeInteger_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                         int ilevel, enum xer_encoder_flags_e flags,
+                         asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    char scratch[32];	/* Enough for 64-bit int */
+	asn_enc_rval_t er = {0,0,0};
+	const long *native = (const long *)sptr;
+
+	(void)ilevel;
+	(void)flags;
+
+	if(!native) ASN__ENCODE_FAILED;
+
+	er.encoded = snprintf(scratch, sizeof(scratch),
+			(specs && specs->field_unsigned)
+			? "%lu" : "%ld", *native);
+	if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch)
+		|| cb(scratch, er.encoded, app_key) < 0)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+NativeInteger_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr,
+                          asn_per_data_t *pd) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval;
+	long *native = (long *)*sptr;
+	INTEGER_t tmpint;
+	void *tmpintptr = &tmpint;
+
+	(void)opt_codec_ctx;
+	ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name);
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&tmpint, 0, sizeof tmpint);
+	rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints,
+				   &tmpintptr, pd);
+	if(rval.code == RC_OK) {
+		if((specs&&specs->field_unsigned)
+			? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
+			: asn_INTEGER2long(&tmpint, native))
+			rval.code = RC_FAIL;
+		else
+			ASN_DEBUG("NativeInteger %s got value %ld",
+				td->name, *native);
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeInteger_encode_uper(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, asn_per_outp_t *po) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_enc_rval_t er = {0,0,0};
+	long native;
+	INTEGER_t tmpint;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+
+    ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native);
+
+	memset(&tmpint, 0, sizeof(tmpint));
+	if((specs&&specs->field_unsigned)
+		? asn_ulong2INTEGER(&tmpint, native)
+		: asn_long2INTEGER(&tmpint, native))
+		ASN__ENCODE_FAILED;
+	er = INTEGER_encode_uper(td, constraints, &tmpint, po);
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+	return er;
+}
+
+asn_dec_rval_t
+NativeInteger_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_dec_rval_t rval;
+	long *native = (long *)*sptr;
+	INTEGER_t tmpint;
+	void *tmpintptr = &tmpint;
+
+	(void)opt_codec_ctx;
+	ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name);
+
+	if(!native) {
+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
+		if(!native) ASN__DECODE_FAILED;
+	}
+
+	memset(&tmpint, 0, sizeof tmpint);
+	rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints,
+	                           &tmpintptr, pd);
+	if(rval.code == RC_OK) {
+		if((specs&&specs->field_unsigned)
+		        ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
+		        : asn_INTEGER2long(&tmpint, native))
+			rval.code = RC_FAIL;
+		else
+			ASN_DEBUG("NativeInteger %s got value %ld",
+			          td->name, *native);
+	}
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+
+	return rval;
+}
+
+asn_enc_rval_t
+NativeInteger_encode_aper(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, asn_per_outp_t *po) {
+
+	const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	long native;
+	INTEGER_t tmpint;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	native = *(const long *)sptr;
+
+	ASN_DEBUG("Encoding NativeInteger %s %ld (APER)", td->name, native);
+
+	memset(&tmpint, 0, sizeof(tmpint));
+	if((specs&&specs->field_unsigned)
+	        ? asn_ulong2INTEGER(&tmpint, (unsigned long)native)
+	        : asn_long2INTEGER(&tmpint, native))
+		ASN__ENCODE_FAILED;
+	er = INTEGER_encode_aper(td, constraints, &tmpint, po);
+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+	return er;
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+/*
+ * INTEGER specific human-readable output.
+ */
+int
+NativeInteger_print(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    const long *native = (const long *)sptr;
+    char scratch[32]; /* Enough for 64-bit int */
+    int ret;
+
+    (void)td;       /* Unused argument */
+    (void)ilevel;   /* Unused argument */
+
+    if(native) {
+        long value = *native;
+        ret = snprintf(scratch, sizeof(scratch),
+                       (specs && specs->field_unsigned) ? "%lu" : "%ld", value);
+        assert(ret > 0 && (size_t)ret < sizeof(scratch));
+        if(cb(scratch, ret, app_key) < 0) return -1;
+        if(specs && (value >= 0 || !specs->field_unsigned)) {
+            const asn_INTEGER_enum_map_t *el =
+                INTEGER_map_value2enum(specs, value);
+            if(el) {
+                if(cb(" (", 2, app_key) < 0) return -1;
+                if(cb(el->enum_name, el->enum_len, app_key) < 0) return -1;
+                if(cb(")", 1, app_key) < 0) return -1;
+            }
+        }
+        return 0;
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+NativeInteger_free(const asn_TYPE_descriptor_t *td, void *ptr,
+                   enum asn_struct_free_method method) {
+    if(!td || !ptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)",
+		td->name, method, ptr);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(ptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(ptr, 0, sizeof(long));
+        break;
+    }
+}
+
+int
+NativeInteger_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) {
+    (void)td;
+
+    if(aptr && bptr) {
+        const asn_INTEGER_specifics_t *specs =
+            (const asn_INTEGER_specifics_t *)td->specifics;
+        if(specs && specs->field_unsigned) {
+            const unsigned long *a = aptr;
+            const unsigned long *b = bptr;
+            if(*a < *b) {
+                return -1;
+            } else if(*a > *b) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            const long *a = aptr;
+            const long *b = bptr;
+            if(*a < *b) {
+                return -1;
+            } else if(*a > *b) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    } else if(!aptr) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+asn_random_fill_result_t
+NativeInteger_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                          const asn_encoding_constraints_t *constraints,
+                          size_t max_length) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    long *st = *sptr;
+    const asn_INTEGER_enum_map_t *emap;
+    size_t emap_len;
+    intmax_t value;
+    int find_inside_map;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (long *)CALLOC(1, sizeof(*st));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    if(specs) {
+        emap = specs->value2enum;
+        emap_len = specs->map_count;
+        if(specs->strict_enumeration) {
+            find_inside_map = emap_len > 0;
+        } else {
+            find_inside_map = emap_len ? asn_random_between(0, 1) : 0;
+        }
+    } else {
+        emap = 0;
+        emap_len = 0;
+        find_inside_map = 0;
+    }
+
+    if(find_inside_map) {
+        assert(emap_len > 0);
+        value = emap[asn_random_between(0, emap_len - 1)].nat_value;
+    } else {
+        const asn_per_constraints_t *ct;
+
+        static const long variants[] = {
+            -65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384,
+            -16383, -257,   -256,   -255,   -254,   -129,   -128,   -127,
+            -126,   -1,     0,      1,      126,    127,    128,    129,
+            254,    255,    256,    257,    16383,  16384,  16385,  32767,
+            32768,  32769,  65534,  65535,  65536,  65537};
+        if(specs && specs->field_unsigned) {
+            assert(variants[18] == 0);
+            value = variants[asn_random_between(
+                18, sizeof(variants) / sizeof(variants[0]) - 1)];
+        } else {
+            value = variants[asn_random_between(
+                0, sizeof(variants) / sizeof(variants[0]) - 1)];
+        }
+
+        if(!constraints) constraints = &td->encoding_constraints;
+        ct = constraints ? constraints->per_constraints : 0;
+        if(ct && (ct->value.flags & APC_CONSTRAINED)) {
+            if(value < ct->value.lower_bound || value > ct->value.upper_bound) {
+                value = asn_random_between(ct->value.lower_bound,
+                                           ct->value.upper_bound);
+            }
+        }
+    }
+
+    *sptr = st;
+    *st = value;
+    return result_ok;
+}
diff --git a/e2ap/lib/NativeInteger_oer.c b/e2ap/lib/NativeInteger_oer.c
new file mode 100644
index 0000000..411413a
--- /dev/null
+++ b/e2ap/lib/NativeInteger_oer.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <NativeInteger.h>
+#include <errno.h>
+
+asn_dec_rval_t
+NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_oer_constraints_t *constraints,
+                         void **nint_ptr, const void *ptr, size_t size) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    long *native = (long *)*nint_ptr;
+    INTEGER_t tmpint;
+    INTEGER_t *tmpintptr = &tmpint;
+
+    memset(&tmpint, 0, sizeof(tmpint));
+
+    if(!native) {
+        native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
+        if(!native) ASN__DECODE_FAILED;
+    }
+
+    /*
+     * OPTIMIZATION: Encode directly rather than passing through INTEGER.
+     * Saves a memory allocation.
+     */
+    rval = INTEGER_decode_oer(opt_codec_ctx, td, constraints,
+                              (void **)&tmpintptr, ptr, size);
+    if(rval.code != RC_OK) {
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        return rval;
+    }
+
+    if(specs && specs->field_unsigned) {
+        unsigned long ul;
+        int ok = asn_INTEGER2ulong(&tmpint, &ul) == 0;
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        if(ok) {
+            *native = ul;
+        } else {
+            rval.code = RC_FAIL;
+            return rval;
+        }
+    } else {
+        long l;
+        int ok = asn_INTEGER2long(&tmpint, &l) == 0;
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        if(ok) {
+            *native = l;
+        } else {
+            rval.code = RC_FAIL;
+            return rval;
+        }
+    }
+
+    return rval;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+NativeInteger_encode_oer(const asn_TYPE_descriptor_t *td,
+                         const asn_oer_constraints_t *constraints,
+                         const void *sptr, asn_app_consume_bytes_f *cb,
+                         void *app_key) {
+    const asn_INTEGER_specifics_t *specs =
+        (const asn_INTEGER_specifics_t *)td->specifics;
+    INTEGER_t tmpint;
+    long native;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    native = *(const long *)sptr;
+    memset(&tmpint, 0, sizeof(tmpint));
+
+    ASN_DEBUG("Encoding %s %ld as NativeInteger", td ? td->name : "", native);
+
+    if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native)
+                                        : asn_long2INTEGER(&tmpint, native)) {
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        ASN__ENCODE_FAILED;
+    } else {
+        asn_enc_rval_t er =
+            INTEGER_encode_oer(td, constraints, &tmpint, cb, app_key);
+        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
+        return er;
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/OCTET_STRING.c b/e2ap/lib/OCTET_STRING.c
new file mode 100644
index 0000000..ae34c96
--- /dev/null
+++ b/e2ap/lib/OCTET_STRING.c
@@ -0,0 +1,2411 @@
+/*-
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OCTET_STRING.h>
+#include <BIT_STRING.h>	/* for .bits_unused member */
+#include <errno.h>
+
+/*
+ * OCTET STRING basic type description.
+ */
+static const ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs = {
+	sizeof(OCTET_STRING_t),
+	offsetof(OCTET_STRING_t, _asn_ctx),
+	ASN_OSUBV_STR
+};
+
+asn_TYPE_operation_t asn_OP_OCTET_STRING = {
+	OCTET_STRING_free,
+	OCTET_STRING_print,	/* OCTET STRING generally means a non-ascii sequence */
+	OCTET_STRING_compare,
+	OCTET_STRING_decode_ber,
+	OCTET_STRING_encode_der,
+	OCTET_STRING_decode_xer_hex,
+	OCTET_STRING_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	OCTET_STRING_decode_oer,
+	OCTET_STRING_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef	ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	OCTET_STRING_decode_uper,	/* Unaligned PER decoder */
+	OCTET_STRING_encode_uper,	/* Unaligned PER encoder */
+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	OCTET_STRING_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = {
+	"OCTET STRING",		/* Canonical name */
+	"OCTET_STRING",		/* XML tag name */
+	&asn_OP_OCTET_STRING,
+	asn_DEF_OCTET_STRING_tags,
+	sizeof(asn_DEF_OCTET_STRING_tags)
+	  / sizeof(asn_DEF_OCTET_STRING_tags[0]),
+	asn_DEF_OCTET_STRING_tags,	/* Same as above */
+	sizeof(asn_DEF_OCTET_STRING_tags)
+	  / sizeof(asn_DEF_OCTET_STRING_tags[0]),
+	{ 0, 0, asn_generic_no_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs
+};
+
+#undef	_CH_PHASE
+#undef	NEXT_PHASE
+#undef	PREV_PHASE
+#define	_CH_PHASE(ctx, inc) do {					\
+		if(ctx->phase == 0)					\
+			ctx->context = 0;				\
+		ctx->phase += inc;					\
+	} while(0)
+#define	NEXT_PHASE(ctx)	_CH_PHASE(ctx, +1)
+#define	PREV_PHASE(ctx)	_CH_PHASE(ctx, -1)
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {					\
+		size_t num = (num_bytes);				\
+		buf_ptr = ((const char *)buf_ptr) + num;		\
+		size -= num;						\
+		consumed_myself += num;					\
+	} while(0)
+
+#undef	RETURN
+#define	RETURN(_code)	do {						\
+		asn_dec_rval_t tmprval;					\
+		tmprval.code = _code;					\
+		tmprval.consumed = consumed_myself;			\
+		return tmprval;						\
+	} while(0)
+
+#undef	APPEND
+#define	APPEND(bufptr, bufsize)	do {					\
+		size_t _bs = (bufsize);		/* Append size */	\
+		size_t _ns = ctx->context;	/* Allocated now */	\
+		size_t _es = st->size + _bs;	/* Expected size */	\
+		/* int is really a typeof(st->size): */			\
+		if((int)_es < 0) RETURN(RC_FAIL);			\
+		if(_ns <= _es) {					\
+			void *ptr;					\
+			/* Be nice and round to the memory allocator */	\
+			do { _ns = _ns ? _ns << 1 : 16; }		\
+			    while(_ns <= _es);				\
+			/* int is really a typeof(st->size): */		\
+			if((int)_ns < 0) RETURN(RC_FAIL);		\
+			ptr = REALLOC(st->buf, _ns);			\
+			if(ptr) {					\
+				st->buf = (uint8_t *)ptr;		\
+				ctx->context = _ns;			\
+			} else {					\
+				RETURN(RC_FAIL);			\
+			}						\
+			ASN_DEBUG("Reallocating into %ld", (long)_ns);	\
+		}							\
+		memcpy(st->buf + st->size, bufptr, _bs);		\
+		/* Convenient nul-termination */			\
+		st->buf[_es] = '\0';					\
+		st->size = _es;						\
+	} while(0)
+
+/*
+ * The main reason why ASN.1 is still alive is that too much time and effort
+ * is necessary for learning it more or less adequately, thus creating a gut
+ * necessity to demonstrate that aquired skill everywhere afterwards.
+ * No, I am not going to explain what the following stuff is.
+ */
+struct _stack_el {
+    ber_tlv_len_t left;     /* What's left to read (or -1) */
+    ber_tlv_len_t got;      /* What was actually processed */
+    unsigned cont_level;    /* Depth of subcontainment */
+    int want_nulls;         /* Want null "end of content" octets? */
+    int bits_chopped;       /* Flag in BIT STRING mode */
+    ber_tlv_tag_t tag;      /* For debugging purposes */
+    struct _stack_el *prev;
+    struct _stack_el *next;
+};
+struct _stack {
+	struct _stack_el *tail;
+	struct _stack_el *cur_ptr;
+};
+
+static struct _stack_el *
+OS__add_stack_el(struct _stack *st) {
+	struct _stack_el *nel;
+
+	/*
+	 * Reuse the old stack frame or allocate a new one.
+	 */
+	if(st->cur_ptr && st->cur_ptr->next) {
+		nel = st->cur_ptr->next;
+		nel->bits_chopped = 0;
+		nel->got = 0;
+		/* Retain the nel->cont_level, it's correct. */
+	} else {
+		nel = (struct _stack_el *)CALLOC(1, sizeof(struct _stack_el));
+		if(nel == NULL)
+			return NULL;
+
+		if(st->tail) {
+			/* Increase a subcontainment depth */
+			nel->cont_level = st->tail->cont_level + 1;
+			st->tail->next = nel;
+		}
+		nel->prev = st->tail;
+		st->tail = nel;
+	}
+
+	st->cur_ptr = nel;
+
+	return nel;
+}
+
+static struct _stack *
+_new_stack(void) {
+	return (struct _stack *)CALLOC(1, sizeof(struct _stack));
+}
+
+/*
+ * Decode OCTET STRING type.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                        const asn_TYPE_descriptor_t *td, void **sptr,
+                        const void *buf_ptr, size_t size, int tag_mode) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	asn_dec_rval_t rval;
+	asn_struct_ctx_t *ctx;
+	ssize_t consumed_myself = 0;
+	struct _stack *stck;		/* Expectations stack structure */
+	struct _stack_el *sel = 0;	/* Stack element */
+	int tlv_constr;
+	enum asn_OS_Subvariant type_variant = specs->subvariant;
+
+	ASN_DEBUG("Decoding %s as %s (frame %ld)",
+		td->name,
+		(type_variant == ASN_OSUBV_STR) ?
+			"OCTET STRING" : "OS-SpecialCase",
+		(long)size);
+
+	/*
+	 * Create the string if does not exist.
+	 */
+	if(st == NULL) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(st == NULL) RETURN(RC_FAIL);
+	}
+
+	/* Restore parsing context */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * Check tags.
+		 */
+		rval = ber_check_tags(opt_codec_ctx, td, ctx,
+			buf_ptr, size, tag_mode, -1,
+			&ctx->left, &tlv_constr);
+		if(rval.code != RC_OK)
+			return rval;
+
+		if(tlv_constr) {
+			/*
+			 * Complex operation, requires stack of expectations.
+			 */
+			ctx->ptr = _new_stack();
+			if(!ctx->ptr) {
+				RETURN(RC_FAIL);
+			}
+		} else {
+			/*
+			 * Jump into stackless primitive decoding.
+			 */
+			_CH_PHASE(ctx, 3);
+			if(type_variant == ASN_OSUBV_ANY && tag_mode != 1)
+				APPEND(buf_ptr, rval.consumed);
+			ADVANCE(rval.consumed);
+			goto phase3;
+		}
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 1:
+	phase1:
+		/*
+		 * Fill the stack with expectations.
+		 */
+		stck = (struct _stack *)ctx->ptr;
+		sel = stck->cur_ptr;
+	  do {
+		ber_tlv_tag_t tlv_tag;
+		ber_tlv_len_t tlv_len;
+		ber_tlv_tag_t expected_tag;
+		ssize_t tl, ll, tlvl;
+				/* This one works even if (sel->left == -1) */
+		size_t Left = ((!sel||(size_t)sel->left >= size)
+					?size:(size_t)sel->left);
+
+
+		ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", (void *)sel,
+			(long)(sel?sel->left:0),
+			(long)(sel?sel->want_nulls:0),
+			(long)(sel?sel->got:0)
+		);
+		if(sel && sel->left <= 0 && sel->want_nulls == 0) {
+			if(sel->prev) {
+				struct _stack_el *prev = sel->prev;
+				if(prev->left != -1) {
+					if(prev->left < sel->got)
+						RETURN(RC_FAIL);
+					prev->left -= sel->got;
+				}
+				prev->got += sel->got;
+				sel = stck->cur_ptr = prev;
+				if(!sel) break;
+				tlv_constr = 1;
+				continue;
+			} else {
+				sel = stck->cur_ptr = 0;
+				break;	/* Nothing to wait */
+			}
+		}
+
+		tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag);
+		ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld",
+			(long)size, (long)Left, sel?"":"!",
+			(long)(sel?sel->left:0),
+			(long)(sel?sel->want_nulls:0),
+			(long)tl);
+		switch(tl) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		tlv_constr = BER_TLV_CONSTRUCTED(buf_ptr);
+
+		ll = ber_fetch_length(tlv_constr,
+				(const char *)buf_ptr + tl,Left - tl,&tlv_len);
+		ASN_DEBUG("Got tag=%s, tc=%d, left=%ld, tl=%ld, len=%ld, ll=%ld",
+			ber_tlv_tag_string(tlv_tag), tlv_constr,
+				(long)Left, (long)tl, (long)tlv_len, (long)ll);
+		switch(ll) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		if(sel && sel->want_nulls
+			&& ((const uint8_t *)buf_ptr)[0] == 0
+			&& ((const uint8_t *)buf_ptr)[1] == 0)
+		{
+
+			ASN_DEBUG("Eat EOC; wn=%d--", sel->want_nulls);
+
+			if(type_variant == ASN_OSUBV_ANY
+			&& (tag_mode != 1 || sel->cont_level))
+				APPEND("\0\0", 2);
+
+			ADVANCE(2);
+			sel->got += 2;
+			if(sel->left != -1) {
+				sel->left -= 2;	/* assert(sel->left >= 2) */
+			}
+
+			sel->want_nulls--;
+			if(sel->want_nulls == 0) {
+				/* Move to the next expectation */
+				sel->left = 0;
+				tlv_constr = 1;
+			}
+
+			continue;
+		}
+
+		/*
+		 * Set up expected tags,
+		 * depending on ASN.1 type being decoded.
+		 */
+		switch(type_variant) {
+		case ASN_OSUBV_BIT:
+			/* X.690: 8.6.4.1, NOTE 2 */
+			/* Fall through */
+		case ASN_OSUBV_STR:
+		default:
+			if(sel) {
+				unsigned level = sel->cont_level;
+				if(level < td->all_tags_count) {
+					expected_tag = td->all_tags[level];
+					break;
+				} else if(td->all_tags_count) {
+					expected_tag = td->all_tags
+						[td->all_tags_count - 1];
+					break;
+				}
+				/* else, Fall through */
+			}
+			/* Fall through */
+		case ASN_OSUBV_ANY:
+			expected_tag = tlv_tag;
+			break;
+		}
+
+
+		if(tlv_tag != expected_tag) {
+			char buf[2][32];
+			ber_tlv_tag_snprint(tlv_tag,
+				buf[0], sizeof(buf[0]));
+			ber_tlv_tag_snprint(td->tags[td->tags_count-1],
+				buf[1], sizeof(buf[1]));
+			ASN_DEBUG("Tag does not match expectation: %s != %s",
+				buf[0], buf[1]);
+			RETURN(RC_FAIL);
+		}
+
+		tlvl = tl + ll;	/* Combined length of T and L encoding */
+		if((tlv_len + tlvl) < 0) {
+			/* tlv_len value is too big */
+			ASN_DEBUG("TLV encoding + length (%ld) is too big",
+				(long)tlv_len);
+			RETURN(RC_FAIL);
+		}
+
+		/*
+		 * Append a new expectation.
+		 */
+		sel = OS__add_stack_el(stck);
+		if(!sel) RETURN(RC_FAIL);
+
+		sel->tag = tlv_tag;
+
+		sel->want_nulls = (tlv_len==-1);
+		if(sel->prev && sel->prev->left != -1) {
+			/* Check that the parent frame is big enough */
+			if(sel->prev->left < tlvl + (tlv_len==-1?0:tlv_len))
+				RETURN(RC_FAIL);
+			if(tlv_len == -1)
+				sel->left = sel->prev->left - tlvl;
+			else
+				sel->left = tlv_len;
+		} else {
+			sel->left = tlv_len;
+		}
+		if(type_variant == ASN_OSUBV_ANY
+		&& (tag_mode != 1 || sel->cont_level))
+			APPEND(buf_ptr, tlvl);
+		sel->got += tlvl;
+		ADVANCE(tlvl);
+
+		ASN_DEBUG("+EXPECT2 got=%ld left=%ld, wn=%d, clvl=%u",
+			(long)sel->got, (long)sel->left,
+			sel->want_nulls, sel->cont_level);
+
+	  } while(tlv_constr);
+		if(sel == NULL) {
+			/* Finished operation, "phase out" */
+			ASN_DEBUG("Phase out");
+			_CH_PHASE(ctx, +3);
+			break;
+		}
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 2:
+		stck = (struct _stack *)ctx->ptr;
+		sel = stck->cur_ptr;
+		ASN_DEBUG("Phase 2: Need %ld bytes, size=%ld, alrg=%ld, wn=%d",
+			(long)sel->left, (long)size, (long)sel->got,
+				sel->want_nulls);
+	    {
+		ber_tlv_len_t len;
+
+		assert(sel->left >= 0);
+
+		len = ((ber_tlv_len_t)size < sel->left)
+				? (ber_tlv_len_t)size : sel->left;
+		if(len > 0) {
+			if(type_variant == ASN_OSUBV_BIT
+			&& sel->bits_chopped == 0) {
+				/* Put the unused-bits-octet away */
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				APPEND(((const char *)buf_ptr+1), (len - 1));
+				sel->bits_chopped = 1;
+			} else {
+				APPEND(buf_ptr, len);
+			}
+			ADVANCE(len);
+			sel->left -= len;
+			sel->got += len;
+		}
+
+		if(sel->left) {
+			ASN_DEBUG("OS left %ld, size = %ld, wn=%d\n",
+				(long)sel->left, (long)size, sel->want_nulls);
+			RETURN(RC_WMORE);
+		}
+
+		PREV_PHASE(ctx);
+		goto phase1;
+	    }
+		break;
+	case 3:
+	phase3:
+		/*
+		 * Primitive form, no stack required.
+		 */
+		assert(ctx->left >= 0);
+
+		if(size < (size_t)ctx->left) {
+			if(!size) RETURN(RC_WMORE);
+			if(type_variant == ASN_OSUBV_BIT && !ctx->context) {
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				ctx->left--;
+				ADVANCE(1);
+			}
+			APPEND(buf_ptr, size);
+			assert(ctx->context > 0);
+			ctx->left -= size;
+			ADVANCE(size);
+			RETURN(RC_WMORE);
+		} else {
+			if(type_variant == ASN_OSUBV_BIT
+			&& !ctx->context && ctx->left) {
+				st->bits_unused = *(const uint8_t *)buf_ptr;
+				ctx->left--;
+				ADVANCE(1);
+			}
+			APPEND(buf_ptr, ctx->left);
+			ADVANCE(ctx->left);
+			ctx->left = 0;
+
+			NEXT_PHASE(ctx);
+		}
+		break;
+	}
+
+	if(sel) {
+		ASN_DEBUG("3sel p=%p, wn=%d, l=%ld, g=%ld, size=%ld",
+			(void *)sel->prev, sel->want_nulls,
+			(long)sel->left, (long)sel->got, (long)size);
+		if(sel->prev || sel->want_nulls > 1 || sel->left > 0) {
+			RETURN(RC_WMORE);
+		}
+	}
+
+	/*
+	 * BIT STRING-specific processing.
+	 */
+	if(type_variant == ASN_OSUBV_BIT) {
+        if(st->size) {
+			if(st->bits_unused < 0 || st->bits_unused > 7) {
+				RETURN(RC_FAIL);
+			}
+			/* Finalize BIT STRING: zero out unused bits. */
+			st->buf[st->size-1] &= 0xff << st->bits_unused;
+		} else {
+			if(st->bits_unused) {
+				RETURN(RC_FAIL);
+			}
+		}
+	}
+
+	ASN_DEBUG("Took %ld bytes to encode %s: [%s]:%ld",
+		(long)consumed_myself, td->name,
+		(type_variant == ASN_OSUBV_STR) ? (char *)st->buf : "<data>",
+		(long)st->size);
+
+
+	RETURN(RC_OK);
+}
+
+/*
+ * Encode OCTET STRING type using DER.
+ */
+asn_enc_rval_t
+OCTET_STRING_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int tag_mode, ber_tlv_tag_t tag,
+                        asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = { 0, 0, 0 };
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	enum asn_OS_Subvariant type_variant = specs->subvariant;
+	int fix_last_byte = 0;
+
+	ASN_DEBUG("%s %s as OCTET STRING",
+		cb?"Estimating":"Encoding", td->name);
+
+	/*
+	 * Write tags.
+	 */
+	if(type_variant != ASN_OSUBV_ANY || tag_mode == 1) {
+		er.encoded = der_write_tags(td,
+				(type_variant == ASN_OSUBV_BIT) + st->size,
+			tag_mode, type_variant == ASN_OSUBV_ANY, tag,
+			cb, app_key);
+		if(er.encoded == -1) {
+			er.failed_type = td;
+			er.structure_ptr = sptr;
+			return er;
+		}
+	} else {
+		/* Disallow: [<tag>] IMPLICIT ANY */
+		assert(type_variant != ASN_OSUBV_ANY || tag_mode != -1);
+		er.encoded = 0;
+	}
+
+	if(!cb) {
+		er.encoded += (type_variant == ASN_OSUBV_BIT) + st->size;
+		ASN__ENCODED_OK(er);
+	}
+
+	/*
+	 * Prepare to deal with the last octet of BIT STRING.
+	 */
+	if(type_variant == ASN_OSUBV_BIT) {
+		uint8_t b = st->bits_unused & 0x07;
+		if(b && st->size) fix_last_byte = 1;
+		ASN__CALLBACK(&b, 1);
+	}
+
+	/* Invoke callback for the main part of the buffer */
+	ASN__CALLBACK(st->buf, st->size - fix_last_byte);
+
+	/* The last octet should be stripped off the unused bits */
+	if(fix_last_byte) {
+		uint8_t b = st->buf[st->size-1] & (0xff << st->bits_unused);
+		ASN__CALLBACK(&b, 1);
+	}
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int ilevel, enum xer_encoder_flags_e flags,
+                        asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	char scratch[16 * 3 + 4];
+	char *p = scratch;
+	uint8_t *buf;
+	uint8_t *end;
+	size_t i;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	/*
+	 * Dump the contents of the buffer in hexadecimal.
+	 */
+	buf = st->buf;
+	end = buf + st->size;
+	if(flags & XER_F_CANONICAL) {
+		char *scend = scratch + (sizeof(scratch) - 2);
+		for(; buf < end; buf++) {
+			if(p >= scend) {
+				ASN__CALLBACK(scratch, p - scratch);
+				p = scratch;
+			}
+			*p++ = h2c[(*buf >> 4) & 0x0F];
+			*p++ = h2c[*buf & 0x0F];
+		}
+
+		ASN__CALLBACK(scratch, p-scratch);	/* Dump the rest */
+	} else {
+		for(i = 0; buf < end; buf++, i++) {
+			if(!(i % 16) && (i || st->size > 16)) {
+				ASN__CALLBACK(scratch, p-scratch);
+				p = scratch;
+				ASN__TEXT_INDENT(1, ilevel);
+			}
+			*p++ = h2c[(*buf >> 4) & 0x0F];
+			*p++ = h2c[*buf & 0x0F];
+			*p++ = 0x20;
+		}
+		if(p - scratch) {
+			p--;	/* Remove the tail space */
+			ASN__CALLBACK(scratch, p-scratch); /* Dump the rest */
+			if(st->size > 16)
+				ASN__TEXT_INDENT(1, ilevel-1);
+		}
+	}
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+static const struct OCTET_STRING__xer_escape_table_s {
+	const char *string;
+	int size;
+} OCTET_STRING__xer_escape_table[] = {
+#define	OSXET(s)	{ s, sizeof(s) - 1 }
+	OSXET("\074\156\165\154\057\076"),	/* <nul/> */
+	OSXET("\074\163\157\150\057\076"),	/* <soh/> */
+	OSXET("\074\163\164\170\057\076"),	/* <stx/> */
+	OSXET("\074\145\164\170\057\076"),	/* <etx/> */
+	OSXET("\074\145\157\164\057\076"),	/* <eot/> */
+	OSXET("\074\145\156\161\057\076"),	/* <enq/> */
+	OSXET("\074\141\143\153\057\076"),	/* <ack/> */
+	OSXET("\074\142\145\154\057\076"),	/* <bel/> */
+	OSXET("\074\142\163\057\076"),		/* <bs/> */
+	OSXET("\011"),				/* \t */
+	OSXET("\012"),				/* \n */
+	OSXET("\074\166\164\057\076"),		/* <vt/> */
+	OSXET("\074\146\146\057\076"),		/* <ff/> */
+	OSXET("\015"),				/* \r */
+	OSXET("\074\163\157\057\076"),		/* <so/> */
+	OSXET("\074\163\151\057\076"),		/* <si/> */
+	OSXET("\074\144\154\145\057\076"),	/* <dle/> */
+	OSXET("\074\144\143\061\057\076"),	/* <de1/> */
+	OSXET("\074\144\143\062\057\076"),	/* <de2/> */
+	OSXET("\074\144\143\063\057\076"),	/* <de3/> */
+	OSXET("\074\144\143\064\057\076"),	/* <de4/> */
+	OSXET("\074\156\141\153\057\076"),	/* <nak/> */
+	OSXET("\074\163\171\156\057\076"),	/* <syn/> */
+	OSXET("\074\145\164\142\057\076"),	/* <etb/> */
+	OSXET("\074\143\141\156\057\076"),	/* <can/> */
+	OSXET("\074\145\155\057\076"),		/* <em/> */
+	OSXET("\074\163\165\142\057\076"),	/* <sub/> */
+	OSXET("\074\145\163\143\057\076"),	/* <esc/> */
+	OSXET("\074\151\163\064\057\076"),	/* <is4/> */
+	OSXET("\074\151\163\063\057\076"),	/* <is3/> */
+	OSXET("\074\151\163\062\057\076"),	/* <is2/> */
+	OSXET("\074\151\163\061\057\076"),	/* <is1/> */
+	{ 0, 0 },	/* " " */
+	{ 0, 0 },	/* ! */
+	{ 0, 0 },	/* \" */
+	{ 0, 0 },	/* # */
+	{ 0, 0 },	/* $ */
+	{ 0, 0 },	/* % */
+	OSXET("\046\141\155\160\073"),	/* &amp; */
+	{ 0, 0 },	/* ' */
+	{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* ()*+,-./ */
+	{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* 01234567 */
+	{0,0},{0,0},{0,0},{0,0},			 /* 89:; */
+	OSXET("\046\154\164\073"),	/* &lt; */
+	{ 0, 0 },	/* = */
+	OSXET("\046\147\164\073"),	/* &gt; */
+};
+
+static int
+OS__check_escaped_control_char(const void *buf, int size) {
+	size_t i;
+	/*
+	 * Inefficient algorithm which translates the escape sequences
+	 * defined above into characters. Returns -1 if not found.
+	 * TODO: replace by a faster algorithm (bsearch(), hash or
+	 * nested table lookups).
+	 */
+	for(i = 0; i < 32 /* Don't spend time on the bottom half */; i++) {
+		const struct OCTET_STRING__xer_escape_table_s *el;
+		el = &OCTET_STRING__xer_escape_table[i];
+		if(el->size == size && memcmp(buf, el->string, size) == 0)
+			return i;
+	}
+	return -1;
+}
+
+static int
+OCTET_STRING__handle_control_chars(void *struct_ptr, const void *chunk_buf, size_t chunk_size) {
+	/*
+	 * This might be one of the escape sequences
+	 * for control characters. Check it out.
+	 * #11.15.5
+	 */
+	int control_char = OS__check_escaped_control_char(chunk_buf,chunk_size);
+	if(control_char >= 0) {
+		OCTET_STRING_t *st = (OCTET_STRING_t *)struct_ptr;
+		void *p = REALLOC(st->buf, st->size + 2);
+		if(p) {
+			st->buf = (uint8_t *)p;
+			st->buf[st->size++] = control_char;
+			st->buf[st->size] = '\0';	/* nul-termination */
+			return 0;
+		}
+	}
+
+	return -1;	/* No, it's not */
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_xer_utf8(const asn_TYPE_descriptor_t *td, const void *sptr,
+                             int ilevel, enum xer_encoder_flags_e flags,
+                             asn_app_consume_bytes_f *cb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	uint8_t *buf, *end;
+	uint8_t *ss;	/* Sequence start */
+	ssize_t encoded_len = 0;
+
+	(void)ilevel;	/* Unused argument */
+	(void)flags;	/* Unused argument */
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	buf = st->buf;
+	end = buf + st->size;
+	for(ss = buf; buf < end; buf++) {
+		unsigned int ch = *buf;
+		int s_len;	/* Special encoding sequence length */
+
+		/*
+		 * Escape certain characters: X.680/11.15
+		 */
+		if(ch < sizeof(OCTET_STRING__xer_escape_table)
+			/sizeof(OCTET_STRING__xer_escape_table[0])
+		&& (s_len = OCTET_STRING__xer_escape_table[ch].size)) {
+			if(((buf - ss) && cb(ss, buf - ss, app_key) < 0)
+			|| cb(OCTET_STRING__xer_escape_table[ch].string, s_len,
+					app_key) < 0)
+				ASN__ENCODE_FAILED;
+			encoded_len += (buf - ss) + s_len;
+			ss = buf + 1;
+		}
+	}
+
+	encoded_len += (buf - ss);
+	if((buf - ss) && cb(ss, buf - ss, app_key) < 0)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = encoded_len;
+	ASN__ENCODED_OK(er);
+}
+
+/*
+ * Convert from hexadecimal format (cstring): "AB CD EF"
+ */
+static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) {
+	OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const char *chunk_stop = (const char *)chunk_buf;
+	const char *p = chunk_stop;
+	const char *pend = p + chunk_size;
+	unsigned int clv = 0;
+	int half = 0;	/* Half bit */
+	uint8_t *buf;
+
+	/* Reallocate buffer according to high cap estimation */
+	size_t new_size = st->size + (chunk_size + 1) / 2;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	/*
+	 * If something like " a b c " appears here, the " a b":3 will be
+	 * converted, and the rest skipped. That is, unless buf_size is greater
+	 * than chunk_size, then it'll be equivalent to "ABC0".
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		switch(ch) {
+		case 0x09: case 0x0a: case 0x0c: case 0x0d:
+		case 0x20:
+			/* Ignore whitespace */
+			continue;
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/
+			clv = (clv << 4) + (ch - 0x30);
+			break;
+		case 0x41: case 0x42: case 0x43:	/* ABC */
+		case 0x44: case 0x45: case 0x46:	/* DEF */
+			clv = (clv << 4) + (ch - 0x41 + 10);
+			break;
+		case 0x61: case 0x62: case 0x63:	/* abc */
+		case 0x64: case 0x65: case 0x66:	/* def */
+			clv = (clv << 4) + (ch - 0x61 + 10);
+			break;
+		default:
+			*buf = 0;	/* JIC */
+			return -1;
+		}
+		if(half++) {
+			half = 0;
+			*buf++ = clv;
+			chunk_stop = p + 1;
+		}
+	}
+
+	/*
+	 * Check partial decoding.
+	 */
+	if(half) {
+		if(have_more) {
+			/*
+			 * Partial specification is fine,
+			 * because no more more PXER_TEXT data is available.
+			 */
+			*buf++ = clv << 4;
+			chunk_stop = p;
+		}
+	} else {
+		chunk_stop = p;
+	}
+
+	st->size = buf - st->buf;	/* Adjust the buffer size */
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return (chunk_stop - (const char *)chunk_buf);	/* Converted size */
+}
+
+/*
+ * Convert from binary format: "00101011101"
+ */
+static ssize_t OCTET_STRING__convert_binary(void *sptr, const void *chunk_buf, size_t chunk_size, int have_more) {
+	BIT_STRING_t *st = (BIT_STRING_t *)sptr;
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+	int bits_unused = st->bits_unused & 0x7;
+	uint8_t *buf;
+
+	/* Reallocate buffer according to high cap estimation */
+	size_t new_size = st->size + (chunk_size + 7) / 8;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	(void)have_more;
+
+	if(bits_unused == 0)
+		bits_unused = 8;
+	else if(st->size)
+		buf--;
+
+	/*
+	 * Convert series of 0 and 1 into the octet string.
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		switch(ch) {
+		case 0x09: case 0x0a: case 0x0c: case 0x0d:
+		case 0x20:
+			/* Ignore whitespace */
+			break;
+		case 0x30:
+		case 0x31:
+			if(bits_unused-- <= 0) {
+				*++buf = 0;	/* Clean the cell */
+				bits_unused = 7;
+			}
+			*buf |= (ch&1) << bits_unused;
+			break;
+		default:
+			st->bits_unused = bits_unused;
+			return -1;
+		}
+	}
+
+	if(bits_unused == 8) {
+		st->size = buf - st->buf;
+		st->bits_unused = 0;
+	} else {
+		st->size = buf - st->buf + 1;
+		st->bits_unused = bits_unused;
+	}
+
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return chunk_size;	/* Converted in full */
+}
+
+/*
+ * Something like strtod(), but with stricter rules.
+ */
+static int
+OS__strtoent(int base, const char *buf, const char *end, int32_t *ret_value) {
+	const int32_t last_unicode_codepoint = 0x10ffff;
+	int32_t val = 0;
+	const char *p;
+
+	for(p = buf; p < end; p++) {
+		int ch = *p;
+
+		switch(ch) {
+		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/
+		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/
+			val = val * base + (ch - 0x30);
+			break;
+		case 0x41: case 0x42: case 0x43:	/* ABC */
+		case 0x44: case 0x45: case 0x46:	/* DEF */
+			val = val * base + (ch - 0x41 + 10);
+			break;
+		case 0x61: case 0x62: case 0x63:	/* abc */
+		case 0x64: case 0x65: case 0x66:	/* def */
+			val = val * base + (ch - 0x61 + 10);
+			break;
+		case 0x3b:	/* ';' */
+			*ret_value = val;
+			return (p - buf) + 1;
+		default:
+			return -1;	/* Character set error */
+		}
+
+		/* Value exceeds the Unicode range. */
+		if(val > last_unicode_codepoint) {
+			return -1;
+		}
+	}
+
+	*ret_value = -1;
+	return (p - buf);
+}
+
+/*
+ * Convert from the plain UTF-8 format, expanding entity references: "2 &lt; 3"
+ */
+static ssize_t
+OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf,
+                              size_t chunk_size, int have_more) {
+    OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+	uint8_t *buf;
+
+	/* Reallocate buffer */
+	size_t new_size = st->size + chunk_size;
+	void *nptr = REALLOC(st->buf, new_size + 1);
+	if(!nptr) return -1;
+	st->buf = (uint8_t *)nptr;
+	buf = st->buf + st->size;
+
+	/*
+	 * Convert series of 0 and 1 into the octet string.
+	 */
+	for(; p < pend; p++) {
+		int ch = *(const unsigned char *)p;
+		int len;	/* Length of the rest of the chunk */
+
+		if(ch != 0x26 /* '&' */) {
+			*buf++ = ch;
+			continue;	/* That was easy... */
+		}
+
+		/*
+		 * Process entity reference.
+		 */
+		len = chunk_size - (p - (const char *)chunk_buf);
+		if(len == 1 /* "&" */) goto want_more;
+		if(p[1] == 0x23 /* '#' */) {
+			const char *pval;	/* Pointer to start of digits */
+			int32_t val = 0;	/* Entity reference value */
+			int base;
+
+			if(len == 2 /* "&#" */) goto want_more;
+			if(p[2] == 0x78 /* 'x' */)
+				pval = p + 3, base = 16;
+			else
+				pval = p + 2, base = 10;
+			len = OS__strtoent(base, pval, p + len, &val);
+			if(len == -1) {
+				/* Invalid charset. Just copy verbatim. */
+				*buf++ = ch;
+				continue;
+			}
+			if(!len || pval[len-1] != 0x3b) goto want_more;
+			assert(val > 0);
+			p += (pval - p) + len - 1; /* Advance past entref */
+
+			if(val < 0x80) {
+				*buf++ = (char)val;
+			} else if(val < 0x800) {
+				*buf++ = 0xc0 | ((val >> 6));
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x10000) {
+				*buf++ = 0xe0 | ((val >> 12));
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x200000) {
+				*buf++ = 0xf0 | ((val >> 18));
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else if(val < 0x4000000) {
+				*buf++ = 0xf8 | ((val >> 24));
+				*buf++ = 0x80 | ((val >> 18) & 0x3f);
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			} else {
+				*buf++ = 0xfc | ((val >> 30) & 0x1);
+				*buf++ = 0x80 | ((val >> 24) & 0x3f);
+				*buf++ = 0x80 | ((val >> 18) & 0x3f);
+				*buf++ = 0x80 | ((val >> 12) & 0x3f);
+				*buf++ = 0x80 | ((val >> 6) & 0x3f);
+				*buf++ = 0x80 | ((val & 0x3f));
+			}
+		} else {
+			/*
+			 * Ugly, limited parsing of &amp; &gt; &lt;
+			 */
+			char *sc = (char *)memchr(p, 0x3b, len > 5 ? 5 : len);
+			if(!sc) goto want_more;
+			if((sc - p) == 4
+				&& p[1] == 0x61	/* 'a' */
+				&& p[2] == 0x6d	/* 'm' */
+				&& p[3] == 0x70	/* 'p' */) {
+				*buf++ = 0x26;
+				p = sc;
+				continue;
+			}
+			if((sc - p) == 3) {
+				if(p[1] == 0x6c) {
+					*buf = 0x3c;	/* '<' */
+				} else if(p[1] == 0x67) {
+					*buf = 0x3e;	/* '>' */
+				} else {
+					/* Unsupported entity reference */
+					*buf++ = ch;
+					continue;
+				}
+				if(p[2] != 0x74) {
+					/* Unsupported entity reference */
+					*buf++ = ch;
+					continue;
+				}
+				buf++;
+				p = sc;
+				continue;
+			}
+			/* Unsupported entity reference */
+			*buf++ = ch;
+		}
+
+		continue;
+	want_more:
+		if(have_more) {
+			/*
+			 * We know that no more data (of the same type)
+			 * is coming. Copy the rest verbatim.
+			 */
+			*buf++ = ch;
+			continue;
+		}
+		chunk_size = (p - (const char *)chunk_buf);
+		/* Processing stalled: need more data */
+		break;
+	}
+
+	st->size = buf - st->buf;
+	assert(st->size <= new_size);
+	st->buf[st->size] = 0;		/* Courtesy termination */
+
+	return chunk_size;	/* Converted in full */
+}
+
+/*
+ * Decode OCTET STRING from the XML element's body.
+ */
+static asn_dec_rval_t
+OCTET_STRING__decode_xer(
+    const asn_codec_ctx_t *opt_codec_ctx, const asn_TYPE_descriptor_t *td,
+    void **sptr, const char *opt_mname, const void *buf_ptr, size_t size,
+    int (*opt_unexpected_tag_decoder)(void *struct_ptr, const void *chunk_buf,
+                                      size_t chunk_size),
+    ssize_t (*body_receiver)(void *struct_ptr, const void *chunk_buf,
+                             size_t chunk_size, int have_more)) {
+    OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+	asn_struct_ctx_t *ctx;		/* Per-structure parser context */
+	asn_dec_rval_t rval;		/* Return value from the decoder */
+	int st_allocated;
+
+	/*
+	 * Create the string if does not exist.
+	 */
+	if(!st) {
+		st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size);
+		*sptr = (void *)st;
+		if(!st) goto sta_failed;
+		st_allocated = 1;
+	} else {
+		st_allocated = 0;
+	}
+	if(!st->buf) {
+		/* This is separate from above section */
+		st->buf = (uint8_t *)CALLOC(1, 1);
+		if(!st->buf) {
+			if(st_allocated) {
+				*sptr = 0;
+				goto stb_failed;
+			} else {
+				goto sta_failed;
+			}
+		}
+	}
+
+	/* Restore parsing context */
+	ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset);
+
+	return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag,
+		buf_ptr, size, opt_unexpected_tag_decoder, body_receiver);
+
+stb_failed:
+	FREEMEM(st);
+sta_failed:
+	rval.code = RC_FAIL;
+	rval.consumed = 0;
+	return rval;
+}
+
+/*
+ * Decode OCTET STRING from the hexadecimal data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_hex(const asn_codec_ctx_t *opt_codec_ctx,
+                            const asn_TYPE_descriptor_t *td, void **sptr,
+                            const char *opt_mname, const void *buf_ptr,
+                            size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size, 0, OCTET_STRING__convert_hexadecimal);
+}
+
+/*
+ * Decode OCTET STRING from the binary (0/1) data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_binary(const asn_codec_ctx_t *opt_codec_ctx,
+                               const asn_TYPE_descriptor_t *td, void **sptr,
+                               const char *opt_mname, const void *buf_ptr,
+                               size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size, 0, OCTET_STRING__convert_binary);
+}
+
+/*
+ * Decode OCTET STRING from the string (ASCII/UTF-8) data.
+ */
+asn_dec_rval_t
+OCTET_STRING_decode_xer_utf8(const asn_codec_ctx_t *opt_codec_ctx,
+                             const asn_TYPE_descriptor_t *td, void **sptr,
+                             const char *opt_mname, const void *buf_ptr,
+                             size_t size) {
+    return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
+		buf_ptr, size,
+		OCTET_STRING__handle_control_chars,
+		OCTET_STRING__convert_entrefs);
+}
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+static int
+OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf,
+		size_t units, unsigned int bpc, unsigned int unit_bits,
+		long lb, long ub, const asn_per_constraints_t *pc) {
+	uint8_t *end = buf + units * bpc;
+
+	ASN_DEBUG("Expanding %d characters into (%ld..%ld):%d",
+		(int)units, lb, ub, unit_bits);
+
+	/* X.691: 27.5.4 */
+	if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) {
+		/* Decode without translation */
+		lb = 0;
+	} else if(pc && pc->code2value) {
+		if(unit_bits > 16)
+			return 1;	/* FATAL: can't have constrained
+					 * UniversalString with more than
+					 * 16 million code points */
+		for(; buf < end; buf += bpc) {
+			int value;
+			int code = per_get_few_bits(po, unit_bits);
+			if(code < 0) return -1;	/* WMORE */
+			value = pc->code2value(code);
+			if(value < 0) {
+				ASN_DEBUG("Code %d (0x%02x) is"
+					" not in map (%ld..%ld)",
+					code, code, lb, ub);
+				return 1;	/* FATAL */
+			}
+			switch(bpc) {
+			case 1: *buf = value; break;
+			case 2: buf[0] = value >> 8; buf[1] = value; break;
+			case 4: buf[0] = value >> 24; buf[1] = value >> 16;
+				buf[2] = value >> 8; buf[3] = value; break;
+			}
+		}
+		return 0;
+	}
+
+	/* Shortcut the no-op copying to the aligned structure */
+	if(lb == 0 && (unit_bits == 8 * bpc)) {
+		return per_get_many_bits(po, buf, 0, unit_bits * units);
+	}
+
+	for(; buf < end; buf += bpc) {
+		int32_t code = per_get_few_bits(po, unit_bits);
+		int32_t ch = code + lb;
+		if(code < 0) return -1;	/* WMORE */
+		if(ch > ub) {
+			ASN_DEBUG("Code %d is out of range (%ld..%ld)",
+				ch, lb, ub);
+			return 1;	/* FATAL */
+		}
+		switch(bpc) {
+		case 1: *buf = ch; break;
+		case 2: buf[0] = ch >> 8; buf[1] = ch; break;
+		case 4: buf[0] = ch >> 24; buf[1] = ch >> 16;
+			buf[2] = ch >> 8; buf[3] = ch; break;
+		}
+	}
+
+	return 0;
+}
+
+static int
+OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
+		size_t units, unsigned int bpc, unsigned int unit_bits,
+		long lb, long ub, const asn_per_constraints_t *pc) {
+	const uint8_t *end = buf + units * bpc;
+
+	ASN_DEBUG("Squeezing %d characters into (%ld..%ld):%d (%d bpc)",
+		(int)units, lb, ub, unit_bits, bpc);
+
+	/* X.691: 27.5.4 */
+	if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) {
+		/* Encode as is */
+		lb = 0;
+	} else if(pc && pc->value2code) {
+		for(; buf < end; buf += bpc) {
+			int code;
+			uint32_t value;
+			switch(bpc) {
+			case 1: value = *(const uint8_t *)buf; break;
+			case 2: value = (buf[0] << 8) | buf[1]; break;
+			case 4: value = (buf[0] << 24) | (buf[1] << 16)
+					| (buf[2] << 8) | buf[3]; break;
+			default: return -1;
+			}
+			code = pc->value2code(value);
+			if(code < 0) {
+				ASN_DEBUG("Character %d (0x%02x) is"
+					" not in map (%ld..%ld)",
+					*buf, *buf, lb, ub);
+				return -1;
+			}
+			if(per_put_few_bits(po, code, unit_bits))
+				return -1;
+		}
+	}
+
+	/* Shortcut the no-op copying to the aligned structure */
+	if(lb == 0 && (unit_bits == 8 * bpc)) {
+		return per_put_many_bits(po, buf, unit_bits * units);
+	}
+
+    for(ub -= lb; buf < end; buf += bpc) {
+        int ch;
+        uint32_t value;
+        switch(bpc) {
+        case 1:
+            value = *(const uint8_t *)buf;
+            break;
+        case 2:
+            value = (buf[0] << 8) | buf[1];
+            break;
+        case 4:
+            value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
+            break;
+        default:
+            return -1;
+        }
+        ch = value - lb;
+        if(ch < 0 || ch > ub) {
+            ASN_DEBUG("Character %d (0x%02x) is out of range (%ld..%ld)", *buf,
+                      value, lb, ub + lb);
+            return -1;
+        }
+        if(per_put_few_bits(po, ch, unit_bits)) return -1;
+    }
+
+    return 0;
+}
+
+static asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = {
+	{ APC_CONSTRAINED, 8, 8, 0, 255 },
+	{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 },
+	0, 0
+};
+
+asn_dec_rval_t
+OCTET_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints, void **sptr,
+                         asn_per_data_t *pd) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+    const asn_per_constraints_t *pc =
+        constraints ? constraints : td->encoding_constraints.per_constraints;
+    const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+	enum {
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+
+	switch(specs->subvariant) {
+	default:
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_BIT:
+		ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
+		RETURN(RC_FAIL);
+		break;
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_CHAR;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		break;
+	}
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_OCTET_STRING_constraints.size;
+			unit_bits = canonical_unit_bits;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+		if(bpc) {
+			st->size = csiz->upper_bound * bpc;
+		} else {
+			st->size = (csiz->upper_bound + 7) >> 3;
+		}
+		st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+		if(bpc) {
+			ASN_DEBUG("Encoding OCTET STRING size %ld",
+				csiz->upper_bound);
+			ret = OCTET_STRING_per_get_characters(pd, st->buf,
+				csiz->upper_bound, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ASN_DEBUG("Encoding BIT STRING size %ld",
+				csiz->upper_bound);
+			ret = per_get_many_bits(pd, st->buf, 0,
+					    unit_bits * csiz->upper_bound);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += unit_bits * csiz->upper_bound;
+		st->buf[st->size] = 0;
+		RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
+		                          &repeat);
+		if(raw_len < 0) RETURN(RC_WMORE);
+		if(raw_len == 0 && st->buf) break;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+        len_bytes = raw_len * bpc;
+		p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+        ret = OCTET_STRING_per_get_characters(pd, &st->buf[st->size], raw_len,
+                                              bpc, unit_bits, cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret > 0) RETURN(RC_FAIL);
+		if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         const void *sptr, asn_per_outp_t *po) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+				: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;		/* Lies not within extension root */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+	size_t size_in_units;
+	const uint8_t *buf;
+	int ret;
+	enum {
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+	switch(specs->subvariant) {
+	default:
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_BIT:
+		ASN__ENCODE_FAILED;
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_CHAR;
+		size_in_units = st->size;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		size_in_units = st->size >> 1;
+		if(st->size & 1) {
+			ASN_DEBUG("%s string size is not modulo 2", td->name);
+			ASN__ENCODE_FAILED;
+		}
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		size_in_units = st->size >> 2;
+		if(st->size & 3) {
+			ASN_DEBUG("%s string size is not modulo 4", td->name);
+			ASN__ENCODE_FAILED;
+		}
+		break;
+	}
+
+	ASN_DEBUG("Encoding %s into %" ASN_PRI_SIZE " units of %d bits"
+		" (%ld..%ld, effective %d)%s",
+		td->name, size_in_units, unit_bits,
+		csiz->lower_bound, csiz->upper_bound,
+		csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+	/* Figure out whether size lies within PER visible constraint */
+
+    if(csiz->effective_bits >= 0) {
+        if((ssize_t)size_in_units < csiz->lower_bound
+           || (ssize_t)size_in_units > csiz->upper_bound) {
+            if(ct_extensible) {
+                csiz = &asn_DEF_OCTET_STRING_constraints.size;
+                unit_bits = canonical_unit_bits;
+                inext = 1;
+            } else {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    } else {
+        inext = 0;
+    }
+
+    if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+    if(csiz->effective_bits >= 0 && !inext) {
+        ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes (%ld), length in %d bits", st->size,
+                  size_in_units - csiz->lower_bound, csiz->effective_bits);
+        ret = per_put_few_bits(po, size_in_units - csiz->lower_bound,
+                               csiz->effective_bits);
+        if(ret) ASN__ENCODE_FAILED;
+        ret = OCTET_STRING_per_put_characters(po, st->buf, size_in_units, bpc,
+                                              unit_bits, cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret) ASN__ENCODE_FAILED;
+        ASN__ENCODED_OK(er);
+    }
+
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
+
+    buf = st->buf;
+    ASN_DEBUG("Encoding %" ASN_PRI_SIZE " in units", size_in_units);
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size_in_units, &need_eom);
+        if(may_save < 0) ASN__ENCODE_FAILED;
+
+        ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "%s", may_save, size_in_units,
+                  need_eom ? ",+EOM" : "");
+
+        ret = OCTET_STRING_per_put_characters(po, buf, may_save, bpc, unit_bits,
+                                              cval->lower_bound,
+                                              cval->upper_bound, pc);
+        if(ret) ASN__ENCODE_FAILED;
+
+        buf += may_save * bpc;
+        size_in_units -= may_save;
+        assert(!(may_save & 0x07) || !size_in_units);
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+    } while(size_in_units);
+
+    ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                         const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         void **sptr, asn_per_data_t *pd) {
+
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+				: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	asn_dec_rval_t rval = { RC_OK, 0 };
+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
+	ssize_t consumed_myself = 0;
+	int repeat;
+	enum {
+		OS__BPC_BIT	= 0,
+		OS__BPC_CHAR	= 1,
+		OS__BPC_U16	= 2,
+		OS__BPC_U32	= 4
+	} bpc;	/* Bytes per character */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+
+	(void)opt_codec_ctx;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+
+	switch(specs->subvariant) {
+	default:
+/* 	case ASN_OSUBV_ANY:
+		ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
+		RETURN(RC_FAIL);
+*/
+	case ASN_OSUBV_BIT:
+		canonical_unit_bits = unit_bits = 1;
+		bpc = OS__BPC_BIT;
+		break;
+	case ASN_OSUBV_ANY:
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+/* 		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+*/
+		bpc = OS__BPC_CHAR;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		break;
+	}
+
+	/*
+	 * Allocate the string.
+	 */
+	if(!st) {
+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+		if(!st) RETURN(RC_FAIL);
+	}
+
+	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
+
+	if(csiz->flags & APC_EXTENSIBLE) {
+		int inext = per_get_few_bits(pd, 1);
+		if(inext < 0) RETURN(RC_WMORE);
+		if(inext) {
+			csiz = &asn_DEF_OCTET_STRING_constraints.size;
+			cval = &asn_DEF_OCTET_STRING_constraints.value;
+			unit_bits = canonical_unit_bits;
+		}
+	}
+
+	if(csiz->effective_bits >= 0) {
+		FREEMEM(st->buf);
+		if(bpc) {
+			st->size = csiz->upper_bound * bpc;
+		} else {
+			st->size = (csiz->upper_bound + 7) >> 3;
+		}
+		st->buf = (uint8_t *)MALLOC(st->size + 1);
+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits == 0) {
+		int ret;
+		if (st->size > 2) { /* X.691 #16 NOTE 1 */
+			if (aper_get_align(pd) < 0)
+				RETURN(RC_FAIL);
+		}
+		if(bpc) {
+			ASN_DEBUG("Decoding OCTET STRING size %ld",
+				csiz->upper_bound);
+			ret = OCTET_STRING_per_get_characters(pd, st->buf,
+				csiz->upper_bound, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ASN_DEBUG("Decoding BIT STRING size %ld",
+				csiz->upper_bound);
+			ret = per_get_many_bits(pd, st->buf, 0,
+					    unit_bits * csiz->upper_bound);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		consumed_myself += unit_bits * csiz->upper_bound;
+		st->buf[st->size] = 0;
+		if(bpc == 0) {
+			int ubs = (csiz->upper_bound & 0x7);
+			st->bits_unused = ubs ? 8 - ubs : 0;
+		}
+		RETURN(RC_OK);
+	}
+
+	st->size = 0;
+	do {
+		ssize_t raw_len;
+		ssize_t len_bytes;
+		ssize_t len_bits;
+		void *p;
+		int ret;
+
+		/* Get the PER length */
+		if (csiz->upper_bound - csiz->lower_bound == 0)
+			/* Indefinite length case */
+			raw_len = aper_get_length(pd, -1, csiz->effective_bits, &repeat);
+		else
+			raw_len = aper_get_length(pd, csiz->upper_bound - csiz->lower_bound + 1, csiz->effective_bits, &repeat);
+		repeat = 0;
+		if(raw_len < 0) RETURN(RC_WMORE);
+		raw_len += csiz->lower_bound;
+
+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
+			(long)csiz->effective_bits, (long)raw_len,
+			repeat ? "repeat" : "once", td->name);
+
+		if (raw_len > 2) { /* X.691 #16 NOTE 1 */
+			if (aper_get_align(pd) < 0)
+				RETURN(RC_FAIL);
+		}
+
+		if(bpc) {
+			len_bytes = raw_len * bpc;
+			len_bits = len_bytes * unit_bits;
+		} else {
+			len_bits = raw_len;
+			len_bytes = (len_bits + 7) >> 3;
+			if(len_bits & 0x7)
+				st->bits_unused = 8 - (len_bits & 0x7);
+			/* len_bits be multiple of 16K if repeat is set */
+		}
+		p = REALLOC(st->buf, st->size + len_bytes + 1);
+		if(!p) RETURN(RC_FAIL);
+		st->buf = (uint8_t *)p;
+
+		if(bpc) {
+			ret = OCTET_STRING_per_get_characters(pd,
+				&st->buf[st->size], raw_len, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+			if(ret > 0) RETURN(RC_FAIL);
+		} else {
+			ret = per_get_many_bits(pd, &st->buf[st->size],
+				0, len_bits);
+		}
+		if(ret < 0) RETURN(RC_WMORE);
+		st->size += len_bytes;
+	} while(repeat);
+	st->buf[st->size] = 0;	/* nul-terminate */
+
+	return rval;
+}
+
+asn_enc_rval_t
+OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
+                         const asn_per_constraints_t *constraints,
+                         const void *sptr, asn_per_outp_t *po) {
+
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+		? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		: &asn_SPC_OCTET_STRING_specs;
+	const asn_per_constraints_t *pc = constraints ? constraints
+	: td->encoding_constraints.per_constraints;
+	const asn_per_constraint_t *cval;
+	const asn_per_constraint_t *csiz;
+	const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
+	asn_enc_rval_t er = { 0, 0, 0 };
+	int inext = 0;          /* Lies not within extension root */
+	unsigned int unit_bits;
+	unsigned int canonical_unit_bits;
+	unsigned int sizeinunits;
+	const uint8_t *buf;
+	int ret;
+	enum {
+		OS__BPC_BIT     = 0,
+		OS__BPC_CHAR    = 1,
+		OS__BPC_U16     = 2,
+		OS__BPC_U32     = 4
+	} bpc;  /* Bytes per character */
+	int ct_extensible;
+
+	if(!st || (!st->buf && st->size))
+		ASN__ENCODE_FAILED;
+
+	if(pc) {
+		cval = &pc->value;
+		csiz = &pc->size;
+	} else {
+		cval = &asn_DEF_OCTET_STRING_constraints.value;
+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
+	}
+	ct_extensible = csiz->flags & APC_EXTENSIBLE;
+
+	switch(specs->subvariant) {
+		default:
+			/*         case ASN_OSUBV_ANY:
+			                 ASN__ENCODE_FAILED;
+			*/
+		case ASN_OSUBV_BIT:
+			canonical_unit_bits = unit_bits = 1;
+			bpc = OS__BPC_BIT;
+			sizeinunits = st->size * 8 - (st->bits_unused & 0x07);
+			ASN_DEBUG("BIT STRING of %d bytes",
+								sizeinunits);
+		break;
+        case ASN_OSUBV_ANY:
+	case ASN_OSUBV_STR:
+		canonical_unit_bits = unit_bits = 8;
+/* 		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = 8;
+*/
+		bpc = OS__BPC_CHAR;
+		sizeinunits = st->size;
+		break;
+	case ASN_OSUBV_U16:
+		canonical_unit_bits = unit_bits = 16;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U16;
+		sizeinunits = st->size / 2;
+		break;
+	case ASN_OSUBV_U32:
+		canonical_unit_bits = unit_bits = 32;
+		if(cval->flags & APC_CONSTRAINED)
+			unit_bits = cval->range_bits;
+		bpc = OS__BPC_U32;
+		sizeinunits = st->size / 4;
+		break;
+	}
+
+	ASN_DEBUG("Encoding %s into %d units of %d bits"
+		" (%ld..%ld, effective %d)%s",
+		td->name, sizeinunits, unit_bits,
+		csiz->lower_bound, csiz->upper_bound,
+		csiz->effective_bits, ct_extensible ? " EXT" : "");
+
+	/* Figure out wheter size lies within PER visible constraint */
+
+	if(csiz->effective_bits >= 0) {
+		if((int)sizeinunits < csiz->lower_bound
+		|| (int)sizeinunits > csiz->upper_bound) {
+			if(ct_extensible) {
+				cval = &asn_DEF_OCTET_STRING_constraints.value;
+				csiz = &asn_DEF_OCTET_STRING_constraints.size;
+				unit_bits = canonical_unit_bits;
+				inext = 1;
+			} else
+				ASN__ENCODE_FAILED;
+		}
+	} else {
+		inext = 0;
+	}
+
+
+	if(ct_extensible) {
+		/* Declare whether length is [not] within extension root */
+		if(per_put_few_bits(po, inext, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/* X.691, #16.5: zero-length encoding */
+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
+	if(csiz->effective_bits >= 0) {
+		ASN_DEBUG("Encoding %lu bytes (%ld), length in %d bits",
+				st->size, sizeinunits - csiz->lower_bound,
+				csiz->effective_bits);
+		if (csiz->effective_bits > 0) {
+		        ret = aper_put_length(po, csiz->upper_bound - csiz->lower_bound + 1, sizeinunits - csiz->lower_bound);
+		        if(ret) ASN__ENCODE_FAILED;
+		}
+		/* EB MOD
+                   AFAIU if lb != ub it is aligned whatever the number of bits */
+		if ((st->size > 2) || (csiz->lower_bound != csiz->upper_bound)) { /* X.691 #16.11 */
+			if (aper_put_align(po) < 0)
+				ASN__ENCODE_FAILED;
+		}
+		if(bpc) {
+			ret = OCTET_STRING_per_put_characters(po, st->buf,
+				sizeinunits, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+		} else {
+			ret = per_put_many_bits(po, st->buf,
+				sizeinunits * unit_bits);
+		}
+		if(ret) ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	ASN_DEBUG("Encoding %lu bytes", st->size);
+
+	if(sizeinunits == 0) {
+		if(aper_put_length(po, -1, 0))
+			ASN__ENCODE_FAILED;
+		ASN__ENCODED_OK(er);
+	}
+
+	buf = st->buf;
+	while(sizeinunits) {
+		ssize_t maySave = aper_put_length(po, -1, sizeinunits);
+
+		if(maySave < 0) ASN__ENCODE_FAILED;
+
+		ASN_DEBUG("Encoding %ld of %ld",
+			(long)maySave, (long)sizeinunits);
+
+		if(bpc) {
+			ret = OCTET_STRING_per_put_characters(po, buf,
+				maySave, bpc, unit_bits,
+				cval->lower_bound, cval->upper_bound, pc);
+		} else {
+			ret = per_put_many_bits(po, buf, maySave * unit_bits);
+		}
+		if(ret) ASN__ENCODE_FAILED;
+
+		if(bpc)
+			buf += maySave * bpc;
+		else
+			buf += maySave >> 3;
+		sizeinunits -= maySave;
+		assert(!(maySave & 0x07) || !sizeinunits);
+	}
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+OCTET_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr,
+                   int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+    const char * const h2c = "0123456789ABCDEF";
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	char scratch[16 * 3 + 4];
+	char *p = scratch;
+	uint8_t *buf;
+	uint8_t *end;
+	size_t i;
+
+	(void)td;	/* Unused argument */
+
+	if(!st || (!st->buf && st->size))
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/*
+	 * Dump the contents of the buffer in hexadecimal.
+	 */
+	buf = st->buf;
+	end = buf + st->size;
+	for(i = 0; buf < end; buf++, i++) {
+		if(!(i % 16) && (i || st->size > 16)) {
+			if(cb(scratch, p - scratch, app_key) < 0)
+				return -1;
+			_i_INDENT(1);
+			p = scratch;
+		}
+		*p++ = h2c[(*buf >> 4) & 0x0F];
+		*p++ = h2c[*buf & 0x0F];
+		*p++ = 0x20;
+	}
+
+	if(p > scratch) {
+		p--;	/* Remove the tail space */
+		if(cb(scratch, p - scratch, app_key) < 0)
+			return -1;
+	}
+
+	return 0;
+}
+
+int
+OCTET_STRING_print_utf8(const asn_TYPE_descriptor_t *td, const void *sptr,
+                        int ilevel, asn_app_consume_bytes_f *cb,
+                        void *app_key) {
+    const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+
+	(void)td;	/* Unused argument */
+	(void)ilevel;	/* Unused argument */
+
+	if(st && (st->buf || !st->size)) {
+		return (cb(st->buf, st->size, app_key) < 0) ? -1 : 0;
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
+                  enum asn_struct_free_method method) {
+	OCTET_STRING_t *st = (OCTET_STRING_t *)sptr;
+	const asn_OCTET_STRING_specifics_t *specs;
+	asn_struct_ctx_t *ctx;
+	struct _stack *stck;
+
+	if(!td || !st)
+		return;
+
+	specs = td->specifics
+		    ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+		    : &asn_SPC_OCTET_STRING_specs;
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	ASN_DEBUG("Freeing %s as OCTET STRING", td->name);
+
+	if(st->buf) {
+		FREEMEM(st->buf);
+		st->buf = 0;
+	}
+
+	/*
+	 * Remove decode-time stack.
+	 */
+	stck = (struct _stack *)ctx->ptr;
+	if(stck) {
+		while(stck->tail) {
+			struct _stack_el *sel = stck->tail;
+			stck->tail = sel->prev;
+			FREEMEM(sel);
+		}
+		FREEMEM(stck);
+	}
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(sptr, 0,
+               td->specifics
+                   ? ((const asn_OCTET_STRING_specifics_t *)(td->specifics))
+                         ->struct_size
+                   : sizeof(OCTET_STRING_t));
+        break;
+    }
+}
+
+/*
+ * Conversion routines.
+ */
+int
+OCTET_STRING_fromBuf(OCTET_STRING_t *st, const char *str, int len) {
+	void *buf;
+
+	if(st == 0 || (str == 0 && len)) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	/*
+	 * Clear the OCTET STRING.
+	 */
+	if(str == NULL) {
+		FREEMEM(st->buf);
+		st->buf = 0;
+		st->size = 0;
+		return 0;
+	}
+
+	/* Determine the original string size, if not explicitly given */
+	if(len < 0)
+		len = strlen(str);
+
+	/* Allocate and fill the memory */
+	buf = MALLOC(len + 1);
+	if(buf == NULL)
+		return -1;
+
+	memcpy(buf, str, len);
+	((uint8_t *)buf)[len] = '\0';	/* Couldn't use memcpy(len+1)! */
+	FREEMEM(st->buf);
+	st->buf = (uint8_t *)buf;
+	st->size = len;
+
+	return 0;
+}
+
+OCTET_STRING_t *
+OCTET_STRING_new_fromBuf(const asn_TYPE_descriptor_t *td, const char *str,
+                         int len) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    OCTET_STRING_t *st;
+
+	st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size);
+	if(st && str && OCTET_STRING_fromBuf(st, str, len)) {
+		FREEMEM(st);
+		st = NULL;
+	}
+
+	return st;
+}
+
+/*
+ * Lexicographically compare the common prefix of both strings,
+ * and if it is the same return -1 for the smallest string.
+ */
+int
+OCTET_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                     const void *bptr) {
+    const asn_OCTET_STRING_specifics_t *specs = td->specifics;
+    const OCTET_STRING_t *a = aptr;
+    const OCTET_STRING_t *b = bptr;
+
+    assert(!specs || specs->subvariant != ASN_OSUBV_BIT);
+
+    if(a && b) {
+        size_t common_prefix_size = a->size <= b->size ? a->size : b->size;
+        int ret = memcmp(a->buf, b->buf, common_prefix_size);
+        if(ret == 0) {
+            /* Figure out which string with equal prefixes is longer. */
+            if(a->size < b->size) {
+                return -1;
+            } else if(a->size > b->size) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            return ret < 0 ? -1 : 1;
+        }
+    } else if(!a && !b) {
+        return 0;
+    } else if(!a) {
+        return -1;
+    } else {
+        return 1;
+    }
+
+}
+
+/*
+ * Biased function for randomizing character values around their limits.
+ */
+static uint32_t
+OCTET_STRING__random_char(unsigned long lb, unsigned long ub) {
+    assert(lb <= ub);
+    switch(asn_random_between(0, 16)) {
+    case 0:
+        if(lb < ub) return lb + 1;
+        /* Fall through */
+    case 1:
+        return lb;
+    case 2:
+        if(lb < ub) return ub - 1;
+        /* Fall through */
+    case 3:
+        return ub;
+    default:
+        return asn_random_between(lb, ub);
+    }
+}
+
+
+size_t
+OCTET_STRING_random_length_constrained(
+    const asn_TYPE_descriptor_t *td,
+    const asn_encoding_constraints_t *constraints, size_t max_length) {
+    const unsigned lengths[] = {0,     1,     2,     3,     4,     8,
+                                126,   127,   128,   16383, 16384, 16385,
+                                65534, 65535, 65536, 65537};
+    size_t rnd_len;
+
+    /* Figure out how far we should go */
+    rnd_len = lengths[asn_random_between(
+        0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_CONSTRAINED) {
+            long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
+                                             ? pc->upper_bound
+                                             : (ssize_t)max_length;
+            if(max_length <= (size_t)pc->lower_bound) {
+                return pc->lower_bound;
+            }
+            if(pc->flags & APC_EXTENSIBLE) {
+                switch(asn_random_between(0, 5)) {
+                case 0:
+                    if(pc->lower_bound > 0) {
+                        rnd_len = pc->lower_bound - 1;
+                        break;
+                    }
+                    /* Fall through */
+                case 1:
+                    rnd_len = pc->upper_bound + 1;
+                    break;
+                case 2:
+                    /* Keep rnd_len from the table */
+                    if(rnd_len <= max_length) {
+                        break;
+                    }
+                    /* Fall through */
+                default:
+                    rnd_len = asn_random_between(pc->lower_bound,
+                                                 suggested_upper_bound);
+                }
+            } else {
+                rnd_len =
+                    asn_random_between(pc->lower_bound, suggested_upper_bound);
+            }
+        } else {
+            rnd_len = asn_random_between(0, max_length);
+        }
+    } else if(rnd_len > max_length) {
+        rnd_len = asn_random_between(0, max_length);
+    }
+
+    return rnd_len;
+}
+
+asn_random_fill_result_t
+OCTET_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                         const asn_encoding_constraints_t *constraints,
+                         size_t max_length) {
+	const asn_OCTET_STRING_specifics_t *specs = td->specifics
+				? (const asn_OCTET_STRING_specifics_t *)td->specifics
+				: &asn_SPC_OCTET_STRING_specs;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    unsigned int unit_bytes = 1;
+    unsigned long clb = 0;  /* Lower bound on char */
+    unsigned long cub = 255;  /* Higher bound on char value */
+    uint8_t *buf;
+    uint8_t *bend;
+    uint8_t *b;
+    size_t rnd_len;
+    OCTET_STRING_t *st;
+
+    if(max_length == 0 && !*sptr) return result_skipped;
+
+    switch(specs->subvariant) {
+    default:
+    case ASN_OSUBV_ANY:
+        return result_failed;
+    case ASN_OSUBV_BIT:
+        /* Handled by BIT_STRING itself. */
+        return result_failed;
+    case ASN_OSUBV_STR:
+        unit_bytes = 1;
+        clb = 0;
+        cub = 255;
+        break;
+    case ASN_OSUBV_U16:
+        unit_bytes = 2;
+        clb = 0;
+        cub = 65535;
+        break;
+    case ASN_OSUBV_U32:
+        unit_bytes = 4;
+        clb = 0;
+        cub = 0x10FFFF;
+        break;
+    }
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->value;
+        if(pc->flags & APC_SEMI_CONSTRAINED) {
+            clb = pc->lower_bound;
+        } else if(pc->flags & APC_CONSTRAINED) {
+            clb = pc->lower_bound;
+            cub = pc->upper_bound;
+        }
+    }
+
+    rnd_len =
+        OCTET_STRING_random_length_constrained(td, constraints, max_length);
+
+    buf = CALLOC(unit_bytes, rnd_len + 1);
+    if(!buf) return result_failed;
+
+    bend = &buf[unit_bytes * rnd_len];
+
+    switch(unit_bytes) {
+    case 1:
+        for(b = buf; b < bend; b += unit_bytes) {
+            *(uint8_t *)b = OCTET_STRING__random_char(clb, cub);
+        }
+        *(uint8_t *)b = 0;
+        break;
+    case 2:
+        for(b = buf; b < bend; b += unit_bytes) {
+            uint32_t code = OCTET_STRING__random_char(clb, cub);
+            b[0] = code >> 8;
+            b[1] = code;
+        }
+        *(uint16_t *)b = 0;
+        break;
+    case 4:
+        for(b = buf; b < bend; b += unit_bytes) {
+            uint32_t code = OCTET_STRING__random_char(clb, cub);
+            b[0] = code >> 24;
+            b[1] = code >> 16;
+            b[2] = code >> 8;
+            b[3] = code;
+        }
+        *(uint32_t *)b = 0;
+        break;
+    }
+
+    if(*sptr) {
+        st = *sptr;
+        FREEMEM(st->buf);
+    } else {
+        st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) {
+            FREEMEM(buf);
+            return result_failed;
+        }
+    }
+
+    st->buf = buf;
+    st->size = unit_bytes * rnd_len;
+
+    result_ok.length = st->size;
+    return result_ok;
+}
diff --git a/e2ap/lib/OCTET_STRING_oer.c b/e2ap/lib/OCTET_STRING_oer.c
new file mode 100644
index 0000000..c16faea
--- /dev/null
+++ b/e2ap/lib/OCTET_STRING_oer.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <OCTET_STRING.h>
+#include <errno.h>
+
+asn_dec_rval_t
+OCTET_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                        const asn_TYPE_descriptor_t *td,
+                        const asn_oer_constraints_t *constraints, void **sptr,
+                        const void *ptr, size_t size) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+
+    size_t unit_bytes;
+    switch(specs->subvariant) {
+    default:
+    case ASN_OSUBV_BIT:
+        ASN_DEBUG("Invalid use of OCTET STRING to decode BIT STRING");
+        ASN__DECODE_FAILED;
+    case ASN_OSUBV_ANY:
+        /* Fall through */
+    case ASN_OSUBV_STR:
+        unit_bytes = 1;
+        break;
+    case ASN_OSUBV_U16:
+        unit_bytes = 2;
+        break;
+    case ASN_OSUBV_U32:
+        unit_bytes = 4;
+        break;
+    }
+
+    (void)opt_codec_ctx;
+
+    if(!st) {
+        st = (OCTET_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+    if(ct_size >= 0) {
+        expected_length = unit_bytes * ct_size;
+    } else {
+        /*
+         * X.696 (08/2015) #27.2
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
+        if(len_len > 0) {
+            rval.consumed = len_len;
+            ptr = (const char *)ptr + len_len;
+            size -= len_len;
+        } else if(len_len == 0) {
+            ASN__DECODE_STARVED;
+        } else if(len_len < 0) {
+            ASN__DECODE_FAILED;
+        }
+
+        if(expected_length % unit_bytes != 0) {
+            ASN_DEBUG(
+                "Data size %" ASN_PRI_SIZE " bytes is not consistent with multiplier %" ASN_PRI_SIZE "",
+                expected_length, unit_bytes);
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+OCTET_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
+                        const asn_oer_constraints_t *constraints,
+                        const void *sptr, asn_app_consume_bytes_f *cb,
+                        void *app_key) {
+    const asn_OCTET_STRING_specifics_t *specs =
+        td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
+                      : &asn_SPC_OCTET_STRING_specs;
+    const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+    const asn_oer_constraints_t *cts =
+        constraints ? constraints : td->encoding_constraints.oer_constraints;
+    ssize_t ct_size = cts ? cts->size : -1;
+    asn_enc_rval_t er = {0, 0, 0};
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("Encoding %s %" ASN_PRI_SIZE " as OCTET STRING", td ? td->name : "", st->size);
+
+    if(ct_size >= 0) {
+        /*
+         * Check that available data matches the constraint
+         */
+        size_t unit_bytes;
+        switch(specs->subvariant) {
+        default:
+        case ASN_OSUBV_BIT:
+            ASN_DEBUG("Invalid use of OCTET STRING to encode BIT STRING");
+            ASN__ENCODE_FAILED;
+        case ASN_OSUBV_ANY:
+            /* Fall through */
+        case ASN_OSUBV_STR:
+            unit_bytes = 1;
+            break;
+        case ASN_OSUBV_U16:
+            unit_bytes = 2;
+            break;
+        case ASN_OSUBV_U32:
+            unit_bytes = 4;
+            break;
+        }
+
+        if(st->size != unit_bytes * (size_t)ct_size) {
+            ASN_DEBUG(
+                "Trying to encode %s (%" ASN_PRI_SIZE " bytes) which doesn't fit SIZE "
+                "constraint (%" ASN_PRI_SIZE ")",
+                td->name, st->size, ct_size);
+            ASN__ENCODE_FAILED;
+        }
+    } else {
+        /*
+         * X.696 (08/2015) #27.2
+         * Encode length determinant as _number of octets_, but only
+         * if upper bound is not equal to lower bound.
+         */
+        ssize_t ret = oer_serialize_length(st->size, cb, app_key);
+        if(ret < 0) {
+            ASN__ENCODE_FAILED;
+        }
+        er.encoded += ret;
+    }
+
+    er.encoded += st->size;
+    if(cb(st->buf, st->size, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    } else {
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/OPEN_TYPE.c b/e2ap/lib/OPEN_TYPE.c
new file mode 100644
index 0000000..a54e99c
--- /dev/null
+++ b/e2ap/lib/OPEN_TYPE.c
@@ -0,0 +1,509 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <per_opentype.h>
+#include <errno.h>
+
+asn_TYPE_operation_t asn_OP_OPEN_TYPE = {
+	OPEN_TYPE_free,
+	OPEN_TYPE_print,
+	OPEN_TYPE_compare,
+	OPEN_TYPE_decode_ber,
+	OPEN_TYPE_encode_der,
+	OPEN_TYPE_decode_xer,
+	OPEN_TYPE_encode_xer,
+#ifdef ASN_DISABLE_OER_SUPPORT
+ 	0, 0,	/* No OER support, use "-gen-OER" to enable */
+#else
+	OPEN_TYPE_decode_oer,
+	OPEN_TYPE_encode_oer,
+#endif
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0, 0, 0, 0,
+#else
+	OPEN_TYPE_decode_uper,
+	OPEN_TYPE_encode_uper,
+	OPEN_TYPE_decode_aper,
+	OPEN_TYPE_encode_aper,
+#endif
+	0,  /* Random fill is not supported for open type */
+	0	/* Use generic outmost tag fetcher */
+};
+
+#undef  ADVANCE
+#define ADVANCE(num_bytes)               \
+    do {                                 \
+        size_t num = num_bytes;          \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+asn_dec_rval_t
+OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  const asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    size_t consumed_myself = 0;
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    ASN_DEBUG("presence %d\n", selected.presence_index);
+
+    rv = selected.type_descriptor->op->ber_decoder(
+        opt_codec_ctx, selected.type_descriptor, &inner_value, ptr, size,
+        elm->tag_mode);
+    ADVANCE(rv.consumed);
+    rv.consumed = 0;
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            rv.code = RC_OK;
+            rv.consumed = consumed_myself;
+            return rv;
+        } else {
+            /* Oh, now a full-blown failure failure */
+        }
+        /* Fall through */
+    case RC_FAIL:
+        rv.consumed = consumed_myself;
+        /* Fall through */
+    case RC_WMORE:
+        break;
+    }
+
+    if(*memb_ptr2) {
+        if(elm->flags & ATF_POINTER) {
+            ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+            *memb_ptr2 = NULL;
+        } else {
+            ASN_STRUCT_RESET(*selected.type_descriptor,
+                                          inner_value);
+        }
+    }
+    return rv;
+}
+
+asn_dec_rval_t
+OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  const asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    size_t consumed_myself = 0;
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    int xer_context = 0;
+    ssize_t ch_size;
+    pxer_chunk_type_e ch_type;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    /*
+     * Confirm wrapper.
+     */
+    for(;;) {
+        ch_size = xer_next_token(&xer_context, ptr, size, &ch_type);
+        if(ch_size < 0) {
+            ASN__DECODE_FAILED;
+        } else {
+            switch(ch_type) {
+            case PXER_WMORE:
+                ASN__DECODE_STARVED;
+            case PXER_COMMENT:
+            case PXER_TEXT:
+                ADVANCE(ch_size);
+                continue;
+            case PXER_TAG:
+                break;
+            }
+            break;
+        }
+    }
+
+    /*
+     * Wrapper value confirmed.
+     */
+    switch(xer_check_tag(ptr, ch_size, elm->name)) {
+    case XCT_OPENING:
+        ADVANCE(ch_size);
+        break;
+    case XCT_BROKEN:
+    default:
+        ASN__DECODE_FAILED;
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = selected.type_descriptor->op->xer_decoder(
+        opt_codec_ctx, selected.type_descriptor, &inner_value, NULL, ptr, size);
+    ADVANCE(rv.consumed);
+    rv.consumed = 0;
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_FAIL:
+        /* Point to a best position where failure occurred */
+        rv.consumed = consumed_myself;
+        /* Fall through */
+    case RC_WMORE:
+        /* Wrt. rv.consumed==0:
+         * In case a genuine RC_WMORE, the whole Open Type decoding
+         * will have to be restarted.
+         */
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+        return rv;
+    }
+
+    /*
+     * Finalize wrapper.
+     */
+    for(;;) {
+        ch_size = xer_next_token(&xer_context, ptr, size, &ch_type);
+        if(ch_size < 0) {
+            ASN__DECODE_FAILED;
+        } else {
+            switch(ch_type) {
+            case PXER_WMORE:
+                ASN__DECODE_STARVED;
+            case PXER_COMMENT:
+            case PXER_TEXT:
+                ADVANCE(ch_size);
+                continue;
+            case PXER_TAG:
+                break;
+            }
+            break;
+        }
+    }
+
+    /*
+     * Wrapper value confirmed.
+     */
+    switch(xer_check_tag(ptr, ch_size, elm->name)) {
+    case XCT_CLOSING:
+        ADVANCE(ch_size);
+        break;
+    case XCT_BROKEN:
+    default:
+        ASN__DECODE_FAILED;
+    }
+
+    rv.consumed += consumed_myself;
+
+    return rv;
+}
+
+
+#ifndef  ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void *sptr,
+                   const asn_TYPE_member_t *elm, asn_per_data_t *pd) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = uper_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                            &inner_value, pd);
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_WMORE:
+    case RC_FAIL:
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+    }
+    return rv;
+}
+
+asn_enc_rval_t
+OPEN_TYPE_encode_uper(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, asn_per_outp_t *po) {
+    const void *memb_ptr;   /* Pointer to the member */
+    asn_TYPE_member_t *elm; /* CHOICE's element */
+    asn_enc_rval_t er = {0,0,0};
+    unsigned present;
+
+    (void)constraints;
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN__ENCODE_FAILED;
+    } else {
+        present--;
+    }
+
+    ASN_DEBUG("Encoding %s OPEN TYPE element %d", td->name, present);
+
+    elm = &td->elements[present];
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+    } else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(uper_open_type_put(elm->type, NULL, memb_ptr, po) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded = 0;
+    ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+OPEN_TYPE_aper_get(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td, void *sptr,
+                   const asn_TYPE_member_t *elm, asn_per_data_t *pd) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    assert(elm->flags == ATF_OPEN_TYPE);
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0)
+           != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    rv = aper_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                            &inner_value, pd);
+    switch(rv.code) {
+    case RC_OK:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            break;
+        } else {
+            rv.code = RC_FAIL;
+        }
+        /* Fall through */
+    case RC_WMORE:
+    case RC_FAIL:
+        if(*memb_ptr2) {
+            if(elm->flags & ATF_POINTER) {
+                ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+                *memb_ptr2 = NULL;
+            } else {
+                ASN_STRUCT_RESET(*selected.type_descriptor,
+                                              inner_value);
+            }
+        }
+    }
+    return rv;
+}
+
+asn_enc_rval_t
+OPEN_TYPE_encode_aper(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, asn_per_outp_t *po) {
+    const void *memb_ptr;   /* Pointer to the member */
+    asn_TYPE_member_t *elm; /* CHOICE's element */
+    asn_enc_rval_t er = {0,0,0};
+    unsigned present;
+
+    (void)constraints;
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN__ENCODE_FAILED;
+    } else {
+        present--;
+    }
+
+    ASN_DEBUG("Encoding %s OPEN TYPE element %d", td->name, present);
+
+    elm = &td->elements[present];
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+    } else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(aper_open_type_put(elm->type, NULL, memb_ptr, po) < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    er.encoded = 0;
+    ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
diff --git a/e2ap/lib/OPEN_TYPE_oer.c b/e2ap/lib/OPEN_TYPE_oer.c
new file mode 100644
index 0000000..dd2f5c6
--- /dev/null
+++ b/e2ap/lib/OPEN_TYPE_oer.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <OPEN_TYPE.h>
+#include <constr_CHOICE.h>
+#include <errno.h>
+
+asn_dec_rval_t
+OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void *sptr,
+                  asn_TYPE_member_t *elm, const void *ptr, size_t size) {
+    asn_type_selector_result_t selected;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *inner_value;
+    asn_dec_rval_t rv;
+    size_t ot_ret;
+
+
+    if(!(elm->flags & ATF_OPEN_TYPE)) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(!elm->type_selector) {
+        ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
+                  td->name, elm->name, elm->type->name);
+        ASN__DECODE_FAILED;
+    }
+
+    selected = elm->type_selector(td, sptr);
+    if(!selected.presence_index) {
+        ASN__DECODE_FAILED;
+    }
+
+    /* Fetch the pointer to this member */
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
+    } else {
+        memb_ptr = (char *)sptr + elm->memb_offset;
+        memb_ptr2 = &memb_ptr;
+    }
+    if(*memb_ptr2 != NULL) {
+        /* Make sure we reset the structure first before encoding */
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2, 0) != 0) {
+            ASN__DECODE_FAILED;
+        }
+    }
+
+    inner_value =
+        (char *)*memb_ptr2
+        + elm->type->elements[selected.presence_index - 1].memb_offset;
+
+    ot_ret = oer_open_type_get(opt_codec_ctx, selected.type_descriptor, NULL,
+                               &inner_value, ptr, size);
+    switch(ot_ret) {
+    default:
+        if(CHOICE_variant_set_presence(elm->type, *memb_ptr2,
+                                       selected.presence_index)
+           == 0) {
+            rv.code = RC_OK;
+            rv.consumed = ot_ret;
+            return rv;
+        } else {
+            /* Oh, now a full-blown failure failure */
+        }
+        /* Fall through */
+    case -1:
+        rv.code = RC_FAIL;
+        rv.consumed = ot_ret;
+        break;
+    case 0:
+        rv.code = RC_WMORE;
+        rv.consumed = 0;
+        break;
+    }
+
+    if(*memb_ptr2) {
+        const asn_CHOICE_specifics_t *specs =
+            selected.type_descriptor->specifics;
+        if(elm->flags & ATF_POINTER) {
+            ASN_STRUCT_FREE(*selected.type_descriptor, inner_value);
+            *memb_ptr2 = NULL;
+        } else {
+            ASN_STRUCT_FREE_CONTENTS_ONLY(*selected.type_descriptor,
+                                          inner_value);
+            memset(*memb_ptr2, 0, specs->struct_size);
+        }
+    }
+    return rv;
+}
diff --git a/e2ap/lib/PLMN-Identity.c b/e2ap/lib/PLMN-Identity.c
new file mode 100644
index 0000000..24f3043
--- /dev/null
+++ b/e2ap/lib/PLMN-Identity.c
@@ -0,0 +1,65 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "PLMN-Identity.h"
+
+int
+PLMN_Identity_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
+	size_t size;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	size = st->size;
+	
+	if((size == 3)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_PLMN_Identity_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	3	/* (SIZE(3..3)) */};
+asn_per_constraints_t asn_PER_type_PLMN_Identity_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 0,  0,  3,  3 }	/* (SIZE(3..3)) */,
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_PLMN_Identity_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_PLMN_Identity = {
+	"PLMN-Identity",
+	"PLMN-Identity",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_PLMN_Identity_tags_1,
+	sizeof(asn_DEF_PLMN_Identity_tags_1)
+		/sizeof(asn_DEF_PLMN_Identity_tags_1[0]), /* 1 */
+	asn_DEF_PLMN_Identity_tags_1,	/* Same as above */
+	sizeof(asn_DEF_PLMN_Identity_tags_1)
+		/sizeof(asn_DEF_PLMN_Identity_tags_1[0]), /* 1 */
+	{ &asn_OER_type_PLMN_Identity_constr_1, &asn_PER_type_PLMN_Identity_constr_1, PLMN_Identity_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/Presence.c b/e2ap/lib/Presence.c
new file mode 100644
index 0000000..c32f9e0
--- /dev/null
+++ b/e2ap/lib/Presence.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "Presence.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_Presence_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_Presence_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_Presence_value2enum_1[] = {
+	{ 0,	8,	"optional" },
+	{ 1,	11,	"conditional" },
+	{ 2,	9,	"mandatory" }
+};
+static const unsigned int asn_MAP_Presence_enum2value_1[] = {
+	1,	/* conditional(1) */
+	2,	/* mandatory(2) */
+	0	/* optional(0) */
+};
+const asn_INTEGER_specifics_t asn_SPC_Presence_specs_1 = {
+	asn_MAP_Presence_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_Presence_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_Presence_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Presence = {
+	"Presence",
+	"Presence",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_Presence_tags_1,
+	sizeof(asn_DEF_Presence_tags_1)
+		/sizeof(asn_DEF_Presence_tags_1[0]), /* 1 */
+	asn_DEF_Presence_tags_1,	/* Same as above */
+	sizeof(asn_DEF_Presence_tags_1)
+		/sizeof(asn_DEF_Presence_tags_1[0]), /* 1 */
+	{ &asn_OER_type_Presence_constr_1, &asn_PER_type_Presence_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_Presence_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ProcedureCode.c b/e2ap/lib/ProcedureCode.c
new file mode 100644
index 0000000..8678080
--- /dev/null
+++ b/e2ap/lib/ProcedureCode.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProcedureCode.h"
+
+int
+ProcedureCode_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_ProcedureCode_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+asn_per_constraints_t asn_PER_type_ProcedureCode_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_ProcedureCode_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProcedureCode = {
+	"ProcedureCode",
+	"ProcedureCode",
+	&asn_OP_NativeInteger,
+	asn_DEF_ProcedureCode_tags_1,
+	sizeof(asn_DEF_ProcedureCode_tags_1)
+		/sizeof(asn_DEF_ProcedureCode_tags_1[0]), /* 1 */
+	asn_DEF_ProcedureCode_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProcedureCode_tags_1)
+		/sizeof(asn_DEF_ProcedureCode_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ProcedureCode_constr_1, &asn_PER_type_ProcedureCode_constr_1, ProcedureCode_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/ProtocolIE-Container.c b/e2ap/lib/ProtocolIE-Container.c
new file mode 100644
index 0000000..05014c6
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-Container.c
@@ -0,0 +1,870 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-Container.h"
+
+#include "ProtocolIE-Field.h"
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P0_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P0_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P1_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P1_constr_3 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P2_constr_5 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P2_constr_5 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P3_constr_7 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P3_constr_7 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P4_constr_9 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P4_constr_9 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P5_constr_11 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P5_constr_11 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P6_constr_13 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P6_constr_13 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P7_constr_15 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P7_constr_15 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P8_constr_17 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P8_constr_17 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P9_constr_19 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P9_constr_19 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P10_constr_21 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P10_constr_21 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P11_constr_23 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P11_constr_23 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P12_constr_25 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P12_constr_25 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P13_constr_27 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P13_constr_27 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P14_constr_29 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P14_constr_29 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P15_constr_31 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P15_constr_31 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P16_constr_33 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P16_constr_33 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P17_constr_35 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P17_constr_35 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P18_constr_37 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P18_constr_37 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_Container_87P19_constr_39 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..65535)) */};
+asn_per_constraints_t asn_PER_type_ProtocolIE_Container_87P19_constr_39 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (SIZE(0..65535)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P0_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionRequest_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P0_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P0_specs_1 = {
+	sizeof(struct ProtocolIE_Container_87P0),
+	offsetof(struct ProtocolIE_Container_87P0, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P0 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P0_tags_1,
+	sizeof(asn_DEF_ProtocolIE_Container_87P0_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P0_tags_1[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P0_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P0_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P0_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P0_constr_1, &asn_PER_type_ProtocolIE_Container_87P0_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P0_1,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P0_specs_1	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P1_3[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionResponse_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P1_tags_3[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P1_specs_3 = {
+	sizeof(struct ProtocolIE_Container_87P1),
+	offsetof(struct ProtocolIE_Container_87P1, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P1 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P1_tags_3,
+	sizeof(asn_DEF_ProtocolIE_Container_87P1_tags_3)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P1_tags_3[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P1_tags_3,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P1_tags_3)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P1_tags_3[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P1_constr_3, &asn_PER_type_ProtocolIE_Container_87P1_constr_3, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P1_3,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P1_specs_3	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P2_5[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionFailure_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P2_tags_5[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P2_specs_5 = {
+	sizeof(struct ProtocolIE_Container_87P2),
+	offsetof(struct ProtocolIE_Container_87P2, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P2 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P2_tags_5,
+	sizeof(asn_DEF_ProtocolIE_Container_87P2_tags_5)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P2_tags_5[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P2_tags_5,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P2_tags_5)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P2_tags_5[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P2_constr_5, &asn_PER_type_ProtocolIE_Container_87P2_constr_5, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P2_5,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P2_specs_5	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P3_7[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteRequest_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P3_tags_7[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P3_specs_7 = {
+	sizeof(struct ProtocolIE_Container_87P3),
+	offsetof(struct ProtocolIE_Container_87P3, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P3 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P3_tags_7,
+	sizeof(asn_DEF_ProtocolIE_Container_87P3_tags_7)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P3_tags_7[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P3_tags_7,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P3_tags_7)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P3_tags_7[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P3_constr_7, &asn_PER_type_ProtocolIE_Container_87P3_constr_7, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P3_7,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P3_specs_7	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P4_9[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteResponse_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P4_tags_9[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P4_specs_9 = {
+	sizeof(struct ProtocolIE_Container_87P4),
+	offsetof(struct ProtocolIE_Container_87P4, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P4 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P4_tags_9,
+	sizeof(asn_DEF_ProtocolIE_Container_87P4_tags_9)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P4_tags_9[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P4_tags_9,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P4_tags_9)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P4_tags_9[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P4_constr_9, &asn_PER_type_ProtocolIE_Container_87P4_constr_9, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P4_9,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P4_specs_9	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P5_11[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteFailure_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P5_tags_11[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P5_specs_11 = {
+	sizeof(struct ProtocolIE_Container_87P5),
+	offsetof(struct ProtocolIE_Container_87P5, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P5 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P5_tags_11,
+	sizeof(asn_DEF_ProtocolIE_Container_87P5_tags_11)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P5_tags_11[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P5_tags_11,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P5_tags_11)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P5_tags_11[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P5_constr_11, &asn_PER_type_ProtocolIE_Container_87P5_constr_11, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P5_11,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P5_specs_11	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P6_13[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICindication_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P6_tags_13[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P6_specs_13 = {
+	sizeof(struct ProtocolIE_Container_87P6),
+	offsetof(struct ProtocolIE_Container_87P6, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P6 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P6_tags_13,
+	sizeof(asn_DEF_ProtocolIE_Container_87P6_tags_13)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P6_tags_13[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P6_tags_13,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P6_tags_13)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P6_tags_13[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P6_constr_13, &asn_PER_type_ProtocolIE_Container_87P6_constr_13, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P6_13,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P6_specs_13	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P7_15[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolRequest_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P7_tags_15[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P7_specs_15 = {
+	sizeof(struct ProtocolIE_Container_87P7),
+	offsetof(struct ProtocolIE_Container_87P7, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P7 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P7_tags_15,
+	sizeof(asn_DEF_ProtocolIE_Container_87P7_tags_15)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P7_tags_15[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P7_tags_15,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P7_tags_15)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P7_tags_15[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P7_constr_15, &asn_PER_type_ProtocolIE_Container_87P7_constr_15, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P7_15,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P7_specs_15	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P8_17[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolAcknowledge_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P8_tags_17[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P8_specs_17 = {
+	sizeof(struct ProtocolIE_Container_87P8),
+	offsetof(struct ProtocolIE_Container_87P8, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P8 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P8_tags_17,
+	sizeof(asn_DEF_ProtocolIE_Container_87P8_tags_17)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P8_tags_17[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P8_tags_17,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P8_tags_17)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P8_tags_17[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P8_constr_17, &asn_PER_type_ProtocolIE_Container_87P8_constr_17, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P8_17,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P8_specs_17	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P9_19[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolFailure_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P9_tags_19[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P9_specs_19 = {
+	sizeof(struct ProtocolIE_Container_87P9),
+	offsetof(struct ProtocolIE_Container_87P9, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P9 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P9_tags_19,
+	sizeof(asn_DEF_ProtocolIE_Container_87P9_tags_19)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P9_tags_19[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P9_tags_19,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P9_tags_19)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P9_tags_19[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P9_constr_19, &asn_PER_type_ProtocolIE_Container_87P9_constr_19, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P9_19,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P9_specs_19	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P10_21[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ErrorIndication_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P10_tags_21[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P10_specs_21 = {
+	sizeof(struct ProtocolIE_Container_87P10),
+	offsetof(struct ProtocolIE_Container_87P10, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P10 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P10_tags_21,
+	sizeof(asn_DEF_ProtocolIE_Container_87P10_tags_21)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P10_tags_21[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P10_tags_21,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P10_tags_21)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P10_tags_21[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P10_constr_21, &asn_PER_type_ProtocolIE_Container_87P10_constr_21, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P10_21,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P10_specs_21	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P11_23[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupRequestIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P11_tags_23[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P11_specs_23 = {
+	sizeof(struct ProtocolIE_Container_87P11),
+	offsetof(struct ProtocolIE_Container_87P11, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P11 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P11_tags_23,
+	sizeof(asn_DEF_ProtocolIE_Container_87P11_tags_23)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P11_tags_23[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P11_tags_23,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P11_tags_23)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P11_tags_23[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P11_constr_23, &asn_PER_type_ProtocolIE_Container_87P11_constr_23, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P11_23,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P11_specs_23	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P12_25[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupResponseIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P12_tags_25[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P12_specs_25 = {
+	sizeof(struct ProtocolIE_Container_87P12),
+	offsetof(struct ProtocolIE_Container_87P12, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P12 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P12_tags_25,
+	sizeof(asn_DEF_ProtocolIE_Container_87P12_tags_25)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P12_tags_25[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P12_tags_25,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P12_tags_25)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P12_tags_25[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P12_constr_25, &asn_PER_type_ProtocolIE_Container_87P12_constr_25, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P12_25,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P12_specs_25	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P13_27[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupFailureIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P13_tags_27[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P13_specs_27 = {
+	sizeof(struct ProtocolIE_Container_87P13),
+	offsetof(struct ProtocolIE_Container_87P13, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P13 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P13_tags_27,
+	sizeof(asn_DEF_ProtocolIE_Container_87P13_tags_27)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P13_tags_27[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P13_tags_27,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P13_tags_27)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P13_tags_27[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P13_constr_27, &asn_PER_type_ProtocolIE_Container_87P13_constr_27, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P13_27,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P13_specs_27	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P14_29[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResetRequestIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P14_tags_29[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P14_specs_29 = {
+	sizeof(struct ProtocolIE_Container_87P14),
+	offsetof(struct ProtocolIE_Container_87P14, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P14 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P14_tags_29,
+	sizeof(asn_DEF_ProtocolIE_Container_87P14_tags_29)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P14_tags_29[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P14_tags_29,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P14_tags_29)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P14_tags_29[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P14_constr_29, &asn_PER_type_ProtocolIE_Container_87P14_constr_29, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P14_29,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P14_specs_29	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P15_31[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResetResponseIEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P15_tags_31[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P15_specs_31 = {
+	sizeof(struct ProtocolIE_Container_87P15),
+	offsetof(struct ProtocolIE_Container_87P15, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P15 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P15_tags_31,
+	sizeof(asn_DEF_ProtocolIE_Container_87P15_tags_31)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P15_tags_31[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P15_tags_31,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P15_tags_31)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P15_tags_31[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P15_constr_31, &asn_PER_type_ProtocolIE_Container_87P15_constr_31, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P15_31,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P15_specs_31	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P16_33[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdate_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P16_tags_33[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P16_specs_33 = {
+	sizeof(struct ProtocolIE_Container_87P16),
+	offsetof(struct ProtocolIE_Container_87P16, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P16 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P16_tags_33,
+	sizeof(asn_DEF_ProtocolIE_Container_87P16_tags_33)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P16_tags_33[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P16_tags_33,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P16_tags_33)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P16_tags_33[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P16_constr_33, &asn_PER_type_ProtocolIE_Container_87P16_constr_33, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P16_33,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P16_specs_33	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P17_35[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdateAcknowledge_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P17_tags_35[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P17_specs_35 = {
+	sizeof(struct ProtocolIE_Container_87P17),
+	offsetof(struct ProtocolIE_Container_87P17, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P17 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P17_tags_35,
+	sizeof(asn_DEF_ProtocolIE_Container_87P17_tags_35)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P17_tags_35[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P17_tags_35,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P17_tags_35)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P17_tags_35[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P17_constr_35, &asn_PER_type_ProtocolIE_Container_87P17_constr_35, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P17_35,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P17_specs_35	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P18_37[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdateFailure_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P18_tags_37[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P18_specs_37 = {
+	sizeof(struct ProtocolIE_Container_87P18),
+	offsetof(struct ProtocolIE_Container_87P18, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P18 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P18_tags_37,
+	sizeof(asn_DEF_ProtocolIE_Container_87P18_tags_37)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P18_tags_37[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P18_tags_37,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P18_tags_37)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P18_tags_37[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P18_constr_37, &asn_PER_type_ProtocolIE_Container_87P18_constr_37, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P18_37,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P18_specs_37	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ProtocolIE_Container_87P19_39[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceQuery_IEs,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_Container_87P19_tags_39[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_ProtocolIE_Container_87P19_specs_39 = {
+	sizeof(struct ProtocolIE_Container_87P19),
+	offsetof(struct ProtocolIE_Container_87P19, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_Container_87P19 = {
+	"ProtocolIE-Container",
+	"ProtocolIE-Container",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_ProtocolIE_Container_87P19_tags_39,
+	sizeof(asn_DEF_ProtocolIE_Container_87P19_tags_39)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P19_tags_39[0]), /* 1 */
+	asn_DEF_ProtocolIE_Container_87P19_tags_39,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_Container_87P19_tags_39)
+		/sizeof(asn_DEF_ProtocolIE_Container_87P19_tags_39[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_Container_87P19_constr_39, &asn_PER_type_ProtocolIE_Container_87P19_constr_39, SEQUENCE_OF_constraint },
+	asn_MBR_ProtocolIE_Container_87P19_39,
+	1,	/* Single element */
+	&asn_SPC_ProtocolIE_Container_87P19_specs_39	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ProtocolIE-ContainerList.c b/e2ap/lib/ProtocolIE-ContainerList.c
new file mode 100644
index 0000000..b43b010
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-ContainerList.c
@@ -0,0 +1,9 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-ContainerList.h"
+
diff --git a/e2ap/lib/ProtocolIE-ContainerPair.c b/e2ap/lib/ProtocolIE-ContainerPair.c
new file mode 100644
index 0000000..0bf1a47
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-ContainerPair.c
@@ -0,0 +1,9 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-ContainerPair.h"
+
diff --git a/e2ap/lib/ProtocolIE-ContainerPairList.c b/e2ap/lib/ProtocolIE-ContainerPairList.c
new file mode 100644
index 0000000..dba4ec4
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-ContainerPairList.c
@@ -0,0 +1,9 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-ContainerPairList.h"
+
diff --git a/e2ap/lib/ProtocolIE-Field.c b/e2ap/lib/ProtocolIE-Field.c
new file mode 100644
index 0000000..80336e8
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-Field.c
@@ -0,0 +1,7398 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-Field.h"
+
+static const long asn_VAL_4_id_RICaction_ToBeSetup_Item = 19;
+static const long asn_VAL_4_ignore = 1;
+static const long asn_VAL_4_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICaction_ToBeSetup_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_4_id_RICaction_ToBeSetup_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_ToBeSetup_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_4_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICaction_ToBeSetup_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RICaction_ToBeSetup_ItemIEs_1_rows }
+};
+static const long asn_VAL_9_id_RICaction_Admitted_Item = 14;
+static const long asn_VAL_9_ignore = 1;
+static const long asn_VAL_9_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICaction_Admitted_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_9_id_RICaction_Admitted_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_Admitted_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_9_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICaction_Admitted_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RICaction_Admitted_ItemIEs_1_rows }
+};
+static const long asn_VAL_10_id_RICaction_NotAdmitted_Item = 16;
+static const long asn_VAL_10_ignore = 1;
+static const long asn_VAL_10_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICaction_NotAdmitted_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_10_id_RICaction_NotAdmitted_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_10_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_NotAdmitted_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_10_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICaction_NotAdmitted_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RICaction_NotAdmitted_ItemIEs_1_rows }
+};
+static const long asn_VAL_64_id_RANfunction_Item = 8;
+static const long asn_VAL_64_ignore = 1;
+static const long asn_VAL_64_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RANfunction_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_64_id_RANfunction_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_64_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RANfunction_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_64_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RANfunction_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RANfunction_ItemIEs_1_rows }
+};
+static const long asn_VAL_65_id_RANfunctionID_Item = 6;
+static const long asn_VAL_65_ignore = 1;
+static const long asn_VAL_65_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RANfunctionID_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_65_id_RANfunctionID_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_65_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_65_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RANfunctionID_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RANfunctionID_ItemIEs_1_rows }
+};
+static const long asn_VAL_68_id_RANfunctionIEcause_Item = 7;
+static const long asn_VAL_68_ignore = 1;
+static const long asn_VAL_68_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RANfunctionIDcause_ItemIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_68_id_RANfunctionIEcause_Item },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_68_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionIDcause_Item },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_68_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RANfunctionIDcause_ItemIEs_1[] = {
+	{ 1, 4, asn_IOS_RANfunctionIDcause_ItemIEs_1_rows }
+};
+static const long asn_VAL_1_id_RICrequestID = 29;
+static const long asn_VAL_1_reject = 0;
+static const long asn_VAL_1_mandatory = 2;
+static const long asn_VAL_2_id_RANfunctionID = 5;
+static const long asn_VAL_2_reject = 0;
+static const long asn_VAL_2_mandatory = 2;
+static const long asn_VAL_3_id_RICsubscriptionDetails = 30;
+static const long asn_VAL_3_reject = 0;
+static const long asn_VAL_3_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionRequest_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_1_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_1_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_2_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_2_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_3_id_RICsubscriptionDetails },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICsubscriptionDetails },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_3_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionRequest_IEs_1[] = {
+	{ 3, 4, asn_IOS_RICsubscriptionRequest_IEs_1_rows }
+};
+static const long asn_VAL_5_id_RICrequestID = 29;
+static const long asn_VAL_5_reject = 0;
+static const long asn_VAL_5_mandatory = 2;
+static const long asn_VAL_6_id_RANfunctionID = 5;
+static const long asn_VAL_6_reject = 0;
+static const long asn_VAL_6_mandatory = 2;
+static const long asn_VAL_7_id_RICactions_Admitted = 17;
+static const long asn_VAL_7_reject = 0;
+static const long asn_VAL_7_mandatory = 2;
+static const long asn_VAL_8_id_RICactions_NotAdmitted = 18;
+static const long asn_VAL_8_reject = 0;
+static const long asn_VAL_8_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionResponse_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_5_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_5_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_6_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_6_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_7_id_RICactions_Admitted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_Admitted_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_7_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_8_id_RICactions_NotAdmitted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_NotAdmitted_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_8_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionResponse_IEs_1[] = {
+	{ 4, 4, asn_IOS_RICsubscriptionResponse_IEs_1_rows }
+};
+static const long asn_VAL_11_id_RICrequestID = 29;
+static const long asn_VAL_11_reject = 0;
+static const long asn_VAL_11_mandatory = 2;
+static const long asn_VAL_12_id_RANfunctionID = 5;
+static const long asn_VAL_12_reject = 0;
+static const long asn_VAL_12_mandatory = 2;
+static const long asn_VAL_13_id_RICactions_NotAdmitted = 18;
+static const long asn_VAL_13_reject = 0;
+static const long asn_VAL_13_mandatory = 2;
+static const long asn_VAL_14_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_14_ignore = 1;
+static const long asn_VAL_14_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionFailure_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_11_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_11_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_11_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_12_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_12_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_12_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_13_id_RICactions_NotAdmitted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_13_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICaction_NotAdmitted_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_13_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_14_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_14_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_14_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionFailure_IEs_1[] = {
+	{ 4, 4, asn_IOS_RICsubscriptionFailure_IEs_1_rows }
+};
+static const long asn_VAL_15_id_RICrequestID = 29;
+static const long asn_VAL_15_reject = 0;
+static const long asn_VAL_15_mandatory = 2;
+static const long asn_VAL_16_id_RANfunctionID = 5;
+static const long asn_VAL_16_reject = 0;
+static const long asn_VAL_16_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionDeleteRequest_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_15_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_15_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_15_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_16_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_16_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_16_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionDeleteRequest_IEs_1[] = {
+	{ 2, 4, asn_IOS_RICsubscriptionDeleteRequest_IEs_1_rows }
+};
+static const long asn_VAL_17_id_RICrequestID = 29;
+static const long asn_VAL_17_reject = 0;
+static const long asn_VAL_17_mandatory = 2;
+static const long asn_VAL_18_id_RANfunctionID = 5;
+static const long asn_VAL_18_reject = 0;
+static const long asn_VAL_18_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionDeleteResponse_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_17_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_17_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_17_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_18_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_18_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_18_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionDeleteResponse_IEs_1[] = {
+	{ 2, 4, asn_IOS_RICsubscriptionDeleteResponse_IEs_1_rows }
+};
+static const long asn_VAL_19_id_RICrequestID = 29;
+static const long asn_VAL_19_reject = 0;
+static const long asn_VAL_19_mandatory = 2;
+static const long asn_VAL_20_id_RANfunctionID = 5;
+static const long asn_VAL_20_reject = 0;
+static const long asn_VAL_20_mandatory = 2;
+static const long asn_VAL_21_id_Cause = 1;
+static const long asn_VAL_21_ignore = 1;
+static const long asn_VAL_21_mandatory = 2;
+static const long asn_VAL_22_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_22_ignore = 1;
+static const long asn_VAL_22_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICsubscriptionDeleteFailure_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_19_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_19_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_19_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_20_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_20_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_20_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_21_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_21_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_21_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_22_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_22_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_22_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICsubscriptionDeleteFailure_IEs_1[] = {
+	{ 4, 4, asn_IOS_RICsubscriptionDeleteFailure_IEs_1_rows }
+};
+static const long asn_VAL_23_id_RICrequestID = 29;
+static const long asn_VAL_23_reject = 0;
+static const long asn_VAL_23_mandatory = 2;
+static const long asn_VAL_24_id_RANfunctionID = 5;
+static const long asn_VAL_24_reject = 0;
+static const long asn_VAL_24_mandatory = 2;
+static const long asn_VAL_25_id_RICactionID = 15;
+static const long asn_VAL_25_reject = 0;
+static const long asn_VAL_25_mandatory = 2;
+static const long asn_VAL_26_id_RICindicationSN = 27;
+static const long asn_VAL_26_reject = 0;
+static const long asn_VAL_26_optional = 0;
+static const long asn_VAL_27_id_RICindicationType = 28;
+static const long asn_VAL_27_reject = 0;
+static const long asn_VAL_27_mandatory = 2;
+static const long asn_VAL_28_id_RICindicationHeader = 25;
+static const long asn_VAL_28_reject = 0;
+static const long asn_VAL_28_mandatory = 2;
+static const long asn_VAL_29_id_RICindicationMessage = 26;
+static const long asn_VAL_29_reject = 0;
+static const long asn_VAL_29_mandatory = 2;
+static const long asn_VAL_30_id_RICcallProcessID = 20;
+static const long asn_VAL_30_reject = 0;
+static const long asn_VAL_30_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICindication_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_23_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_23_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_23_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_24_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_24_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_24_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_25_id_RICactionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_25_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICactionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_25_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_26_id_RICindicationSN },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_26_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICindicationSN },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_26_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_27_id_RICindicationType },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_27_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICindicationType },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_27_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_28_id_RICindicationHeader },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_28_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICindicationHeader },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_28_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_29_id_RICindicationMessage },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_29_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICindicationMessage },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_29_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_30_id_RICcallProcessID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_30_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcallProcessID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_30_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICindication_IEs_1[] = {
+	{ 8, 4, asn_IOS_RICindication_IEs_1_rows }
+};
+static const long asn_VAL_31_id_RICrequestID = 29;
+static const long asn_VAL_31_reject = 0;
+static const long asn_VAL_31_mandatory = 2;
+static const long asn_VAL_32_id_RANfunctionID = 5;
+static const long asn_VAL_32_reject = 0;
+static const long asn_VAL_32_mandatory = 2;
+static const long asn_VAL_33_id_RICcallProcessID = 20;
+static const long asn_VAL_33_reject = 0;
+static const long asn_VAL_33_optional = 0;
+static const long asn_VAL_34_id_RICcontrolHeader = 22;
+static const long asn_VAL_34_reject = 0;
+static const long asn_VAL_34_mandatory = 2;
+static const long asn_VAL_35_id_RICcontrolMessage = 23;
+static const long asn_VAL_35_reject = 0;
+static const long asn_VAL_35_mandatory = 2;
+static const long asn_VAL_36_id_RICcontrolAckRequest = 21;
+static const long asn_VAL_36_reject = 0;
+static const long asn_VAL_36_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICcontrolRequest_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_31_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_31_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_31_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_32_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_32_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_32_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_33_id_RICcallProcessID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_33_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcallProcessID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_33_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_34_id_RICcontrolHeader },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_34_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolHeader },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_34_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_35_id_RICcontrolMessage },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_35_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolMessage },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_35_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_36_id_RICcontrolAckRequest },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_36_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolAckRequest },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_36_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICcontrolRequest_IEs_1[] = {
+	{ 6, 4, asn_IOS_RICcontrolRequest_IEs_1_rows }
+};
+static const long asn_VAL_37_id_RICrequestID = 29;
+static const long asn_VAL_37_reject = 0;
+static const long asn_VAL_37_mandatory = 2;
+static const long asn_VAL_38_id_RANfunctionID = 5;
+static const long asn_VAL_38_reject = 0;
+static const long asn_VAL_38_mandatory = 2;
+static const long asn_VAL_39_id_RICcallProcessID = 20;
+static const long asn_VAL_39_reject = 0;
+static const long asn_VAL_39_optional = 0;
+static const long asn_VAL_40_id_RICcontrolStatus = 24;
+static const long asn_VAL_40_reject = 0;
+static const long asn_VAL_40_mandatory = 2;
+static const long asn_VAL_41_id_RICcontrolOutcome = 32;
+static const long asn_VAL_41_reject = 0;
+static const long asn_VAL_41_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICcontrolAcknowledge_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_37_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_37_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_37_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_38_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_38_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_38_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_39_id_RICcallProcessID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_39_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcallProcessID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_39_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_40_id_RICcontrolStatus },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_40_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolStatus },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_40_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_41_id_RICcontrolOutcome },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_41_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolOutcome },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_41_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICcontrolAcknowledge_IEs_1[] = {
+	{ 5, 4, asn_IOS_RICcontrolAcknowledge_IEs_1_rows }
+};
+static const long asn_VAL_42_id_RICrequestID = 29;
+static const long asn_VAL_42_reject = 0;
+static const long asn_VAL_42_mandatory = 2;
+static const long asn_VAL_43_id_RANfunctionID = 5;
+static const long asn_VAL_43_reject = 0;
+static const long asn_VAL_43_mandatory = 2;
+static const long asn_VAL_44_id_RICcallProcessID = 20;
+static const long asn_VAL_44_reject = 0;
+static const long asn_VAL_44_optional = 0;
+static const long asn_VAL_45_id_Cause = 1;
+static const long asn_VAL_45_ignore = 1;
+static const long asn_VAL_45_mandatory = 2;
+static const long asn_VAL_46_id_RICcontrolOutcome = 32;
+static const long asn_VAL_46_reject = 0;
+static const long asn_VAL_46_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICcontrolFailure_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_42_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_42_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_42_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_43_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_43_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_43_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_44_id_RICcallProcessID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_44_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcallProcessID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_44_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_45_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_45_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_45_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_46_id_RICcontrolOutcome },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_46_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICcontrolOutcome },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_46_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICcontrolFailure_IEs_1[] = {
+	{ 5, 4, asn_IOS_RICcontrolFailure_IEs_1_rows }
+};
+static const long asn_VAL_47_id_RICrequestID = 29;
+static const long asn_VAL_47_reject = 0;
+static const long asn_VAL_47_optional = 0;
+static const long asn_VAL_48_id_RANfunctionID = 5;
+static const long asn_VAL_48_reject = 0;
+static const long asn_VAL_48_optional = 0;
+static const long asn_VAL_49_id_Cause = 1;
+static const long asn_VAL_49_ignore = 1;
+static const long asn_VAL_49_optional = 0;
+static const long asn_VAL_50_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_50_ignore = 1;
+static const long asn_VAL_50_optional = 0;
+static const asn_ioc_cell_t asn_IOS_ErrorIndication_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_47_id_RICrequestID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_47_reject },
+	{ "&Value", aioc__type, &asn_DEF_RICrequestID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_47_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_48_id_RANfunctionID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_48_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_48_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_49_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_49_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_49_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_50_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_50_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_50_optional }
+};
+static const asn_ioc_set_t asn_IOS_ErrorIndication_IEs_1[] = {
+	{ 4, 4, asn_IOS_ErrorIndication_IEs_1_rows }
+};
+static const long asn_VAL_51_id_GlobalE2node_ID = 3;
+static const long asn_VAL_51_reject = 0;
+static const long asn_VAL_51_mandatory = 2;
+static const long asn_VAL_52_id_RANfunctionsAdded = 10;
+static const long asn_VAL_52_reject = 0;
+static const long asn_VAL_52_optional = 0;
+static const asn_ioc_cell_t asn_IOS_E2setupRequestIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_51_id_GlobalE2node_ID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_51_reject },
+	{ "&Value", aioc__type, &asn_DEF_GlobalE2node_ID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_51_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_52_id_RANfunctionsAdded },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_52_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctions_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_52_optional }
+};
+static const asn_ioc_set_t asn_IOS_E2setupRequestIEs_1[] = {
+	{ 2, 4, asn_IOS_E2setupRequestIEs_1_rows }
+};
+static const long asn_VAL_53_id_GlobalRIC_ID = 4;
+static const long asn_VAL_53_reject = 0;
+static const long asn_VAL_53_mandatory = 2;
+static const long asn_VAL_54_id_RANfunctionsAccepted = 9;
+static const long asn_VAL_54_reject = 0;
+static const long asn_VAL_54_optional = 0;
+static const long asn_VAL_55_id_RANfunctionsRejected = 13;
+static const long asn_VAL_55_reject = 0;
+static const long asn_VAL_55_optional = 0;
+static const asn_ioc_cell_t asn_IOS_E2setupResponseIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_53_id_GlobalRIC_ID },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_53_reject },
+	{ "&Value", aioc__type, &asn_DEF_GlobalRIC_ID },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_53_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_54_id_RANfunctionsAccepted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_54_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsID_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_54_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_55_id_RANfunctionsRejected },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_55_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsIDcause_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_55_optional }
+};
+static const asn_ioc_set_t asn_IOS_E2setupResponseIEs_1[] = {
+	{ 3, 4, asn_IOS_E2setupResponseIEs_1_rows }
+};
+static const long asn_VAL_56_id_Cause = 1;
+static const long asn_VAL_56_ignore = 1;
+static const long asn_VAL_56_mandatory = 2;
+static const long asn_VAL_57_id_TimeToWait = 31;
+static const long asn_VAL_57_ignore = 1;
+static const long asn_VAL_57_optional = 0;
+static const long asn_VAL_58_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_58_ignore = 1;
+static const long asn_VAL_58_optional = 0;
+static const asn_ioc_cell_t asn_IOS_E2setupFailureIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_56_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_56_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_56_mandatory },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_57_id_TimeToWait },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_57_ignore },
+	{ "&Value", aioc__type, &asn_DEF_TimeToWait },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_57_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_58_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_58_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_58_optional }
+};
+static const asn_ioc_set_t asn_IOS_E2setupFailureIEs_1[] = {
+	{ 3, 4, asn_IOS_E2setupFailureIEs_1_rows }
+};
+static const long asn_VAL_59_id_Cause = 1;
+static const long asn_VAL_59_ignore = 1;
+static const long asn_VAL_59_mandatory = 2;
+static const asn_ioc_cell_t asn_IOS_ResetRequestIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_59_id_Cause },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_59_ignore },
+	{ "&Value", aioc__type, &asn_DEF_Cause },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_59_mandatory }
+};
+static const asn_ioc_set_t asn_IOS_ResetRequestIEs_1[] = {
+	{ 1, 4, asn_IOS_ResetRequestIEs_1_rows }
+};
+static const long asn_VAL_60_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_60_ignore = 1;
+static const long asn_VAL_60_optional = 0;
+static const asn_ioc_cell_t asn_IOS_ResetResponseIEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_60_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_60_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_60_optional }
+};
+static const asn_ioc_set_t asn_IOS_ResetResponseIEs_1[] = {
+	{ 1, 4, asn_IOS_ResetResponseIEs_1_rows }
+};
+static const long asn_VAL_61_id_RANfunctionsAdded = 10;
+static const long asn_VAL_61_reject = 0;
+static const long asn_VAL_61_optional = 0;
+static const long asn_VAL_62_id_RANfunctionsModified = 12;
+static const long asn_VAL_62_reject = 0;
+static const long asn_VAL_62_optional = 0;
+static const long asn_VAL_63_id_RANfunctionsDeleted = 11;
+static const long asn_VAL_63_reject = 0;
+static const long asn_VAL_63_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICserviceUpdate_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_61_id_RANfunctionsAdded },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_61_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctions_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_61_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_62_id_RANfunctionsModified },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_62_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctions_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_62_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_63_id_RANfunctionsDeleted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_63_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsID_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_63_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICserviceUpdate_IEs_1[] = {
+	{ 3, 4, asn_IOS_RICserviceUpdate_IEs_1_rows }
+};
+static const long asn_VAL_66_id_RANfunctionsAccepted = 9;
+static const long asn_VAL_66_reject = 0;
+static const long asn_VAL_66_optional = 0;
+static const long asn_VAL_67_id_RANfunctionsRejected = 13;
+static const long asn_VAL_67_reject = 0;
+static const long asn_VAL_67_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICserviceUpdateAcknowledge_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_66_id_RANfunctionsAccepted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_66_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsID_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_66_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_67_id_RANfunctionsRejected },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_67_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsIDcause_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_67_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICserviceUpdateAcknowledge_IEs_1[] = {
+	{ 2, 4, asn_IOS_RICserviceUpdateAcknowledge_IEs_1_rows }
+};
+static const long asn_VAL_69_id_RANfunctionsRejected = 13;
+static const long asn_VAL_69_ignore = 1;
+static const long asn_VAL_69_optional = 0;
+static const long asn_VAL_70_id_TimeToWait = 31;
+static const long asn_VAL_70_ignore = 1;
+static const long asn_VAL_70_optional = 0;
+static const long asn_VAL_71_id_CriticalityDiagnostics = 2;
+static const long asn_VAL_71_ignore = 1;
+static const long asn_VAL_71_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICserviceUpdateFailure_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_69_id_RANfunctionsRejected },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_69_ignore },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsIDcause_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_69_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_70_id_TimeToWait },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_70_ignore },
+	{ "&Value", aioc__type, &asn_DEF_TimeToWait },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_70_optional },
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_71_id_CriticalityDiagnostics },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_71_ignore },
+	{ "&Value", aioc__type, &asn_DEF_CriticalityDiagnostics },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_71_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICserviceUpdateFailure_IEs_1[] = {
+	{ 3, 4, asn_IOS_RICserviceUpdateFailure_IEs_1_rows }
+};
+static const long asn_VAL_72_id_RANfunctionsAccepted = 9;
+static const long asn_VAL_72_reject = 0;
+static const long asn_VAL_72_optional = 0;
+static const asn_ioc_cell_t asn_IOS_RICserviceQuery_IEs_1_rows[] = {
+	{ "&id", aioc__value, &asn_DEF_ProtocolIE_ID, &asn_VAL_72_id_RANfunctionsAccepted },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_72_reject },
+	{ "&Value", aioc__type, &asn_DEF_RANfunctionsID_List },
+	{ "&presence", aioc__value, &asn_DEF_Presence, &asn_VAL_72_optional }
+};
+static const asn_ioc_set_t asn_IOS_RICserviceQuery_IEs_1[] = {
+	{ 1, 4, asn_IOS_RICserviceQuery_IEs_1_rows }
+};
+static int
+memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICaction_ToBeSetup_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_ToBeSetup_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_ToBeSetup_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICaction_ToBeSetup_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_ToBeSetup_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_ToBeSetup_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_5(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICaction_Admitted_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_Admitted_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_Admitted_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_5(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICaction_Admitted_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_Admitted_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_Admitted_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_5(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_9(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICaction_NotAdmitted_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_NotAdmitted_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_NotAdmitted_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_9(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICaction_NotAdmitted_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICaction_NotAdmitted_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICaction_NotAdmitted_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_9(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RANfunction_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunction_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunction_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RANfunction_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunction_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunction_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_13(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_17(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RANfunctionID_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunctionID_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunctionID_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_17(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RANfunctionID_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunctionID_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunctionID_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_17(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_21(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RANfunctionIDcause_ItemIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunctionIDcause_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunctionIDcause_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_21(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RANfunctionIDcause_ItemIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RANfunctionIDcause_ItemIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RANfunctionIDcause_ItemIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_21(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_25(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionRequest_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_25(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionRequest_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_25(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_29(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionResponse_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionResponse_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionResponse_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_29(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionResponse_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionResponse_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionResponse_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_29(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_33(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionFailure_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_33(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionFailure_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_33(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_37(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteRequest_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_37(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteRequest_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_37(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_41(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteResponse_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteResponse_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteResponse_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_41(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteResponse_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteResponse_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteResponse_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_41(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_45(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteFailure_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_45(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICsubscriptionDeleteFailure_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICsubscriptionDeleteFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICsubscriptionDeleteFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_45(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_49(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICindication_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICindication_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICindication_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_49(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICindication_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICindication_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICindication_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_49(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_53(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICcontrolRequest_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_53(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICcontrolRequest_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolRequest_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolRequest_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_53(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_57(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICcontrolAcknowledge_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolAcknowledge_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolAcknowledge_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_57(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICcontrolAcknowledge_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolAcknowledge_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolAcknowledge_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_57(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_61(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICcontrolFailure_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_61(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICcontrolFailure_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICcontrolFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICcontrolFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_61(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_65(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_ErrorIndication_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ErrorIndication_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ErrorIndication_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_65(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_ErrorIndication_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ErrorIndication_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ErrorIndication_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_65(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_69(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_E2setupRequestIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupRequestIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupRequestIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_69(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_E2setupRequestIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupRequestIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupRequestIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_69(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_73(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_E2setupResponseIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupResponseIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupResponseIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_73(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_E2setupResponseIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupResponseIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupResponseIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_73(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_77(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_E2setupFailureIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupFailureIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupFailureIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_77(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_E2setupFailureIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2setupFailureIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2setupFailureIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_77(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_81(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_ResetRequestIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ResetRequestIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ResetRequestIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_81(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_ResetRequestIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ResetRequestIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ResetRequestIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_81(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_85(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_ResetResponseIEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ResetResponseIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ResetResponseIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_85(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_ResetResponseIEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_ResetResponseIEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ResetResponseIEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_85(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_89(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdate_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdate_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdate_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_89(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdate_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdate_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdate_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_89(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_93(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdateAcknowledge_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdateAcknowledge_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdateAcknowledge_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_93(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdateAcknowledge_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdateAcknowledge_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdateAcknowledge_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_93(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_97(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdateFailure_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdateFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdateFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_97(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICserviceUpdateFailure_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceUpdateFailure_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceUpdateFailure_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_97(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static int
+memb_id_constraint_101(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_RICserviceQuery_IEs_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceQuery_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 1; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceQuery_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_101(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_RICserviceQuery_IEs_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_RICserviceQuery_IEs_1;
+	size_t constraining_column = 0; /* &id */
+	size_t for_column = 2; /* &Value */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RICserviceQuery_IEs, id));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_101(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_oer_constraints_t asn_OER_memb_id_constr_2 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_6 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_6 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_7 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_7 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_8 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_8 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_10 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_10 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_11 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_11 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_12 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_12 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_14 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_14 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_15 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_15 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_16 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_16 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_18 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_18 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_19 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_19 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_20 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_20 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_22 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_22 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_23 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_23 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_24 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_24 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_26 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_26 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_27 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_27 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_28 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_28 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_30 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_30 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_31 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_31 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_32 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_32 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_34 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_34 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_35 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_35 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_36 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_36 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_38 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_38 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_39 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_39 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_40 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_40 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_42 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_42 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_43 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_43 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_44 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_44 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_46 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_46 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_47 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_47 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_48 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_48 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_50 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_50 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_51 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_51 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_52 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_52 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_54 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_54 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_55 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_55 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_56 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_56 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_58 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_58 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_59 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_59 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_60 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_60 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_62 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_62 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_63 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_63 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_64 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_64 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_66 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_66 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_67 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_67 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_68 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_68 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_70 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_70 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_71 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_71 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_72 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_72 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_74 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_74 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_75 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_75 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_76 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_76 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_78 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_78 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_79 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_79 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_80 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_80 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_82 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_82 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_83 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_83 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_84 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_84 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_86 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_86 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_87 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_87 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_88 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_88 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_90 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_90 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_91 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_91 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_92 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_92 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_94 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_94 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_95 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_95 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_96 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_96 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_98 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_98 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_99 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_99 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_100 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_100 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_id_constr_102 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_id_constr_102 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_103 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_103 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_104 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_104 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_value_4[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_ItemIEs__value, choice.RICaction_ToBeSetup_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_ToBeSetup_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-ToBeSetup-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICaction-ToBeSetup-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
+	sizeof(struct RICaction_ToBeSetup_ItemIEs__value),
+	offsetof(struct RICaction_ToBeSetup_ItemIEs__value, _asn_ctx),
+	offsetof(struct RICaction_ToBeSetup_ItemIEs__value, present),
+	sizeof(((struct RICaction_ToBeSetup_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_4,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_4 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_4,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICaction_ToBeSetup_ItemIEs_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_2, &asn_PER_memb_id_constr_2,  memb_id_constraint_1 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICaction_ToBeSetup_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_4,
+		select_RICaction_ToBeSetup_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_ToBeSetup_ItemIEs_tag2el_1[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1 = {
+	sizeof(struct RICaction_ToBeSetup_ItemIEs),
+	offsetof(struct RICaction_ToBeSetup_ItemIEs, _asn_ctx),
+	asn_MAP_RICaction_ToBeSetup_ItemIEs_tag2el_1,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_ToBeSetup_ItemIEs = {
+	"RICaction-ToBeSetup-ItemIEs",
+	"RICaction-ToBeSetup-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1,
+	sizeof(asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1)
+		/sizeof(asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1)
+		/sizeof(asn_DEF_RICaction_ToBeSetup_ItemIEs_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_ToBeSetup_ItemIEs_1,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_8[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_ItemIEs__value, choice.RICaction_Admitted_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_Admitted_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-Admitted-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_8[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICaction-Admitted-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_8 = {
+	sizeof(struct RICaction_Admitted_ItemIEs__value),
+	offsetof(struct RICaction_Admitted_ItemIEs__value, _asn_ctx),
+	offsetof(struct RICaction_Admitted_ItemIEs__value, present),
+	sizeof(((struct RICaction_Admitted_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_8,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_8 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_8,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_8	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICaction_Admitted_ItemIEs_5[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_6, &asn_PER_memb_id_constr_6,  memb_id_constraint_5 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICaction_Admitted_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_7, &asn_PER_memb_criticality_constr_7,  memb_criticality_constraint_5 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_8,
+		select_RICaction_Admitted_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_8, &asn_PER_memb_value_constr_8,  memb_value_constraint_5 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_Admitted_ItemIEs_tags_5[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_Admitted_ItemIEs_tag2el_5[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_Admitted_ItemIEs_specs_5 = {
+	sizeof(struct RICaction_Admitted_ItemIEs),
+	offsetof(struct RICaction_Admitted_ItemIEs, _asn_ctx),
+	asn_MAP_RICaction_Admitted_ItemIEs_tag2el_5,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_ItemIEs = {
+	"RICaction-Admitted-ItemIEs",
+	"RICaction-Admitted-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_Admitted_ItemIEs_tags_5,
+	sizeof(asn_DEF_RICaction_Admitted_ItemIEs_tags_5)
+		/sizeof(asn_DEF_RICaction_Admitted_ItemIEs_tags_5[0]), /* 1 */
+	asn_DEF_RICaction_Admitted_ItemIEs_tags_5,	/* Same as above */
+	sizeof(asn_DEF_RICaction_Admitted_ItemIEs_tags_5)
+		/sizeof(asn_DEF_RICaction_Admitted_ItemIEs_tags_5[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_Admitted_ItemIEs_5,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_Admitted_ItemIEs_specs_5	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_12[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_ItemIEs__value, choice.RICaction_NotAdmitted_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_NotAdmitted_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-NotAdmitted-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_12[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICaction-NotAdmitted-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_12 = {
+	sizeof(struct RICaction_NotAdmitted_ItemIEs__value),
+	offsetof(struct RICaction_NotAdmitted_ItemIEs__value, _asn_ctx),
+	offsetof(struct RICaction_NotAdmitted_ItemIEs__value, present),
+	sizeof(((struct RICaction_NotAdmitted_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_12,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_12 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_12,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_12	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_ItemIEs_9[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_10, &asn_PER_memb_id_constr_10,  memb_id_constraint_9 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICaction_NotAdmitted_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_11, &asn_PER_memb_criticality_constr_11,  memb_criticality_constraint_9 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_12,
+		select_RICaction_NotAdmitted_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_12, &asn_PER_memb_value_constr_12,  memb_value_constraint_9 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_NotAdmitted_ItemIEs_tag2el_9[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9 = {
+	sizeof(struct RICaction_NotAdmitted_ItemIEs),
+	offsetof(struct RICaction_NotAdmitted_ItemIEs, _asn_ctx),
+	asn_MAP_RICaction_NotAdmitted_ItemIEs_tag2el_9,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_ItemIEs = {
+	"RICaction-NotAdmitted-ItemIEs",
+	"RICaction-NotAdmitted-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9,
+	sizeof(asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9[0]), /* 1 */
+	asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9,	/* Same as above */
+	sizeof(asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_ItemIEs_tags_9[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_NotAdmitted_ItemIEs_9,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_16[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_ItemIEs__value, choice.RANfunction_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunction_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunction-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_16[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RANfunction-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_16 = {
+	sizeof(struct RANfunction_ItemIEs__value),
+	offsetof(struct RANfunction_ItemIEs__value, _asn_ctx),
+	offsetof(struct RANfunction_ItemIEs__value, present),
+	sizeof(((struct RANfunction_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_16,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_16 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_16,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_16	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RANfunction_ItemIEs_13[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_14, &asn_PER_memb_id_constr_14,  memb_id_constraint_13 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RANfunction_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_15, &asn_PER_memb_criticality_constr_15,  memb_criticality_constraint_13 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RANfunction_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_16,
+		select_RANfunction_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_16, &asn_PER_memb_value_constr_16,  memb_value_constraint_13 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunction_ItemIEs_tags_13[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunction_ItemIEs_tag2el_13[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunction_ItemIEs_specs_13 = {
+	sizeof(struct RANfunction_ItemIEs),
+	offsetof(struct RANfunction_ItemIEs, _asn_ctx),
+	asn_MAP_RANfunction_ItemIEs_tag2el_13,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunction_ItemIEs = {
+	"RANfunction-ItemIEs",
+	"RANfunction-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunction_ItemIEs_tags_13,
+	sizeof(asn_DEF_RANfunction_ItemIEs_tags_13)
+		/sizeof(asn_DEF_RANfunction_ItemIEs_tags_13[0]), /* 1 */
+	asn_DEF_RANfunction_ItemIEs_tags_13,	/* Same as above */
+	sizeof(asn_DEF_RANfunction_ItemIEs_tags_13)
+		/sizeof(asn_DEF_RANfunction_ItemIEs_tags_13[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunction_ItemIEs_13,
+	3,	/* Elements count */
+	&asn_SPC_RANfunction_ItemIEs_specs_13	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_20[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_ItemIEs__value, choice.RANfunctionID_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionID_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_20[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RANfunctionID-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_20 = {
+	sizeof(struct RANfunctionID_ItemIEs__value),
+	offsetof(struct RANfunctionID_ItemIEs__value, _asn_ctx),
+	offsetof(struct RANfunctionID_ItemIEs__value, present),
+	sizeof(((struct RANfunctionID_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_20,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_20 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_20,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_20	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RANfunctionID_ItemIEs_17[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_18, &asn_PER_memb_id_constr_18,  memb_id_constraint_17 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RANfunctionID_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_19, &asn_PER_memb_criticality_constr_19,  memb_criticality_constraint_17 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_20,
+		select_RANfunctionID_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_20, &asn_PER_memb_value_constr_20,  memb_value_constraint_17 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionID_ItemIEs_tags_17[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunctionID_ItemIEs_tag2el_17[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunctionID_ItemIEs_specs_17 = {
+	sizeof(struct RANfunctionID_ItemIEs),
+	offsetof(struct RANfunctionID_ItemIEs, _asn_ctx),
+	asn_MAP_RANfunctionID_ItemIEs_tag2el_17,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionID_ItemIEs = {
+	"RANfunctionID-ItemIEs",
+	"RANfunctionID-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunctionID_ItemIEs_tags_17,
+	sizeof(asn_DEF_RANfunctionID_ItemIEs_tags_17)
+		/sizeof(asn_DEF_RANfunctionID_ItemIEs_tags_17[0]), /* 1 */
+	asn_DEF_RANfunctionID_ItemIEs_tags_17,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionID_ItemIEs_tags_17)
+		/sizeof(asn_DEF_RANfunctionID_ItemIEs_tags_17[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionID_ItemIEs_17,
+	3,	/* Elements count */
+	&asn_SPC_RANfunctionID_ItemIEs_specs_17	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_24[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_ItemIEs__value, choice.RANfunctionIDcause_Item),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionIDcause_Item,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionIDcause-Item"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_24[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RANfunctionIDcause-Item */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_24 = {
+	sizeof(struct RANfunctionIDcause_ItemIEs__value),
+	offsetof(struct RANfunctionIDcause_ItemIEs__value, _asn_ctx),
+	offsetof(struct RANfunctionIDcause_ItemIEs__value, present),
+	sizeof(((struct RANfunctionIDcause_ItemIEs__value *)0)->present),
+	asn_MAP_value_tag2el_24,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_24 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_24,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_24	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RANfunctionIDcause_ItemIEs_21[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_ItemIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_22, &asn_PER_memb_id_constr_22,  memb_id_constraint_21 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_ItemIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RANfunctionIDcause_ItemIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_23, &asn_PER_memb_criticality_constr_23,  memb_criticality_constraint_21 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_ItemIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_24,
+		select_RANfunctionIDcause_ItemIEs_value_type,
+		{ &asn_OER_memb_value_constr_24, &asn_PER_memb_value_constr_24,  memb_value_constraint_21 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionIDcause_ItemIEs_tags_21[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunctionIDcause_ItemIEs_tag2el_21[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunctionIDcause_ItemIEs_specs_21 = {
+	sizeof(struct RANfunctionIDcause_ItemIEs),
+	offsetof(struct RANfunctionIDcause_ItemIEs, _asn_ctx),
+	asn_MAP_RANfunctionIDcause_ItemIEs_tag2el_21,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionIDcause_ItemIEs = {
+	"RANfunctionIDcause-ItemIEs",
+	"RANfunctionIDcause-ItemIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunctionIDcause_ItemIEs_tags_21,
+	sizeof(asn_DEF_RANfunctionIDcause_ItemIEs_tags_21)
+		/sizeof(asn_DEF_RANfunctionIDcause_ItemIEs_tags_21[0]), /* 1 */
+	asn_DEF_RANfunctionIDcause_ItemIEs_tags_21,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionIDcause_ItemIEs_tags_21)
+		/sizeof(asn_DEF_RANfunctionIDcause_ItemIEs_tags_21[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionIDcause_ItemIEs_21,
+	3,	/* Elements count */
+	&asn_SPC_RANfunctionIDcause_ItemIEs_specs_21	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_28[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs__value, choice.RICsubscriptionDetails),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDetails,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionDetails"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_28[] = { 1, 0, 2 };
+static const unsigned asn_MAP_value_from_canonical_28[] = { 1, 0, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_28[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 } /* RICsubscriptionDetails */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_28 = {
+	sizeof(struct RICsubscriptionRequest_IEs__value),
+	offsetof(struct RICsubscriptionRequest_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionRequest_IEs__value, present),
+	sizeof(((struct RICsubscriptionRequest_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_28,
+	3,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_28,
+	asn_MAP_value_from_canonical_28,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_28 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_28,
+	3,	/* Elements count */
+	&asn_SPC_value_specs_28	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionRequest_IEs_25[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_26, &asn_PER_memb_id_constr_26,  memb_id_constraint_25 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionRequest_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_27, &asn_PER_memb_criticality_constr_27,  memb_criticality_constraint_25 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_28,
+		select_RICsubscriptionRequest_IEs_value_type,
+		{ &asn_OER_memb_value_constr_28, &asn_PER_memb_value_constr_28,  memb_value_constraint_25 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionRequest_IEs_tags_25[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionRequest_IEs_tag2el_25[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionRequest_IEs_specs_25 = {
+	sizeof(struct RICsubscriptionRequest_IEs),
+	offsetof(struct RICsubscriptionRequest_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionRequest_IEs_tag2el_25,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionRequest_IEs = {
+	"RICsubscriptionRequest-IEs",
+	"RICsubscriptionRequest-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionRequest_IEs_tags_25,
+	sizeof(asn_DEF_RICsubscriptionRequest_IEs_tags_25)
+		/sizeof(asn_DEF_RICsubscriptionRequest_IEs_tags_25[0]), /* 1 */
+	asn_DEF_RICsubscriptionRequest_IEs_tags_25,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionRequest_IEs_tags_25)
+		/sizeof(asn_DEF_RICsubscriptionRequest_IEs_tags_25[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionRequest_IEs_25,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionRequest_IEs_specs_25	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_32[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs__value, choice.RICaction_Admitted_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_Admitted_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-Admitted-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs__value, choice.RICaction_NotAdmitted_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_NotAdmitted_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-NotAdmitted-List"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_32[] = { 1, 0, 2, 3 };
+static const unsigned asn_MAP_value_from_canonical_32[] = { 1, 0, 2, 3 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_32[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 1 }, /* RICaction-Admitted-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -2, 0 } /* RICaction-NotAdmitted-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_32 = {
+	sizeof(struct RICsubscriptionResponse_IEs__value),
+	offsetof(struct RICsubscriptionResponse_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionResponse_IEs__value, present),
+	sizeof(((struct RICsubscriptionResponse_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_32,
+	4,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_32,
+	asn_MAP_value_from_canonical_32,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_32 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_32,
+	4,	/* Elements count */
+	&asn_SPC_value_specs_32	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionResponse_IEs_29[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_30, &asn_PER_memb_id_constr_30,  memb_id_constraint_29 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionResponse_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_31, &asn_PER_memb_criticality_constr_31,  memb_criticality_constraint_29 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_32,
+		select_RICsubscriptionResponse_IEs_value_type,
+		{ &asn_OER_memb_value_constr_32, &asn_PER_memb_value_constr_32,  memb_value_constraint_29 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionResponse_IEs_tags_29[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionResponse_IEs_tag2el_29[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionResponse_IEs_specs_29 = {
+	sizeof(struct RICsubscriptionResponse_IEs),
+	offsetof(struct RICsubscriptionResponse_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionResponse_IEs_tag2el_29,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionResponse_IEs = {
+	"RICsubscriptionResponse-IEs",
+	"RICsubscriptionResponse-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionResponse_IEs_tags_29,
+	sizeof(asn_DEF_RICsubscriptionResponse_IEs_tags_29)
+		/sizeof(asn_DEF_RICsubscriptionResponse_IEs_tags_29[0]), /* 1 */
+	asn_DEF_RICsubscriptionResponse_IEs_tags_29,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionResponse_IEs_tags_29)
+		/sizeof(asn_DEF_RICsubscriptionResponse_IEs_tags_29[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionResponse_IEs_29,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionResponse_IEs_specs_29	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_36[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs__value, choice.RICaction_NotAdmitted_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICaction_NotAdmitted_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICaction-NotAdmitted-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_36[] = { 1, 0, 2, 3 };
+static const unsigned asn_MAP_value_from_canonical_36[] = { 1, 0, 2, 3 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_36[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 1 }, /* RICaction-NotAdmitted-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -2, 0 } /* CriticalityDiagnostics */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_36 = {
+	sizeof(struct RICsubscriptionFailure_IEs__value),
+	offsetof(struct RICsubscriptionFailure_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionFailure_IEs__value, present),
+	sizeof(((struct RICsubscriptionFailure_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_36,
+	4,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_36,
+	asn_MAP_value_from_canonical_36,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_36 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_36,
+	4,	/* Elements count */
+	&asn_SPC_value_specs_36	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionFailure_IEs_33[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_34, &asn_PER_memb_id_constr_34,  memb_id_constraint_33 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionFailure_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_35, &asn_PER_memb_criticality_constr_35,  memb_criticality_constraint_33 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_36,
+		select_RICsubscriptionFailure_IEs_value_type,
+		{ &asn_OER_memb_value_constr_36, &asn_PER_memb_value_constr_36,  memb_value_constraint_33 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionFailure_IEs_tags_33[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionFailure_IEs_tag2el_33[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionFailure_IEs_specs_33 = {
+	sizeof(struct RICsubscriptionFailure_IEs),
+	offsetof(struct RICsubscriptionFailure_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionFailure_IEs_tag2el_33,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionFailure_IEs = {
+	"RICsubscriptionFailure-IEs",
+	"RICsubscriptionFailure-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionFailure_IEs_tags_33,
+	sizeof(asn_DEF_RICsubscriptionFailure_IEs_tags_33)
+		/sizeof(asn_DEF_RICsubscriptionFailure_IEs_tags_33[0]), /* 1 */
+	asn_DEF_RICsubscriptionFailure_IEs_tags_33,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionFailure_IEs_tags_33)
+		/sizeof(asn_DEF_RICsubscriptionFailure_IEs_tags_33[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionFailure_IEs_33,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionFailure_IEs_specs_33	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_40[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_40[] = { 1, 0 };
+static const unsigned asn_MAP_value_from_canonical_40[] = { 1, 0 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_40[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_40 = {
+	sizeof(struct RICsubscriptionDeleteRequest_IEs__value),
+	offsetof(struct RICsubscriptionDeleteRequest_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionDeleteRequest_IEs__value, present),
+	sizeof(((struct RICsubscriptionDeleteRequest_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_40,
+	2,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_40,
+	asn_MAP_value_from_canonical_40,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_40 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_40,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_40	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteRequest_IEs_37[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_38, &asn_PER_memb_id_constr_38,  memb_id_constraint_37 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionDeleteRequest_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_39, &asn_PER_memb_criticality_constr_39,  memb_criticality_constraint_37 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_40,
+		select_RICsubscriptionDeleteRequest_IEs_value_type,
+		{ &asn_OER_memb_value_constr_40, &asn_PER_memb_value_constr_40,  memb_value_constraint_37 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteRequest_IEs_tag2el_37[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteRequest_IEs_specs_37 = {
+	sizeof(struct RICsubscriptionDeleteRequest_IEs),
+	offsetof(struct RICsubscriptionDeleteRequest_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteRequest_IEs_tag2el_37,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteRequest_IEs = {
+	"RICsubscriptionDeleteRequest-IEs",
+	"RICsubscriptionDeleteRequest-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37,
+	sizeof(asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37)
+		/sizeof(asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37)
+		/sizeof(asn_DEF_RICsubscriptionDeleteRequest_IEs_tags_37[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteRequest_IEs_37,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteRequest_IEs_specs_37	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_44[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_44[] = { 1, 0 };
+static const unsigned asn_MAP_value_from_canonical_44[] = { 1, 0 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_44[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_44 = {
+	sizeof(struct RICsubscriptionDeleteResponse_IEs__value),
+	offsetof(struct RICsubscriptionDeleteResponse_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionDeleteResponse_IEs__value, present),
+	sizeof(((struct RICsubscriptionDeleteResponse_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_44,
+	2,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_44,
+	asn_MAP_value_from_canonical_44,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_44 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_44,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_44	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteResponse_IEs_41[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_42, &asn_PER_memb_id_constr_42,  memb_id_constraint_41 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionDeleteResponse_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_43, &asn_PER_memb_criticality_constr_43,  memb_criticality_constraint_41 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_44,
+		select_RICsubscriptionDeleteResponse_IEs_value_type,
+		{ &asn_OER_memb_value_constr_44, &asn_PER_memb_value_constr_44,  memb_value_constraint_41 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteResponse_IEs_tag2el_41[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteResponse_IEs_specs_41 = {
+	sizeof(struct RICsubscriptionDeleteResponse_IEs),
+	offsetof(struct RICsubscriptionDeleteResponse_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteResponse_IEs_tag2el_41,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteResponse_IEs = {
+	"RICsubscriptionDeleteResponse-IEs",
+	"RICsubscriptionDeleteResponse-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41,
+	sizeof(asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41)
+		/sizeof(asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41)
+		/sizeof(asn_DEF_RICsubscriptionDeleteResponse_IEs_tags_41[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteResponse_IEs_41,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteResponse_IEs_specs_41	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_48[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_48[] = { 1, 0, 3, 2 };
+static const unsigned asn_MAP_value_from_canonical_48[] = { 1, 0, 3, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_48[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -1, 0 }, /* CriticalityDiagnostics */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 2, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_48 = {
+	sizeof(struct RICsubscriptionDeleteFailure_IEs__value),
+	offsetof(struct RICsubscriptionDeleteFailure_IEs__value, _asn_ctx),
+	offsetof(struct RICsubscriptionDeleteFailure_IEs__value, present),
+	sizeof(((struct RICsubscriptionDeleteFailure_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_48,
+	8,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_48,
+	asn_MAP_value_from_canonical_48,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_48 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_48,
+	4,	/* Elements count */
+	&asn_SPC_value_specs_48	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteFailure_IEs_45[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_46, &asn_PER_memb_id_constr_46,  memb_id_constraint_45 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICsubscriptionDeleteFailure_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_47, &asn_PER_memb_criticality_constr_47,  memb_criticality_constraint_45 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_48,
+		select_RICsubscriptionDeleteFailure_IEs_value_type,
+		{ &asn_OER_memb_value_constr_48, &asn_PER_memb_value_constr_48,  memb_value_constraint_45 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteFailure_IEs_tag2el_45[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteFailure_IEs_specs_45 = {
+	sizeof(struct RICsubscriptionDeleteFailure_IEs),
+	offsetof(struct RICsubscriptionDeleteFailure_IEs, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteFailure_IEs_tag2el_45,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteFailure_IEs = {
+	"RICsubscriptionDeleteFailure-IEs",
+	"RICsubscriptionDeleteFailure-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45,
+	sizeof(asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45)
+		/sizeof(asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45)
+		/sizeof(asn_DEF_RICsubscriptionDeleteFailure_IEs_tags_45[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteFailure_IEs_45,
+	3,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteFailure_IEs_specs_45	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_52[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICactionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RICactionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICactionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICindicationSN),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RICindicationSN,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindicationSN"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICindicationType),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_RICindicationType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindicationType"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICindicationHeader),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICindicationHeader,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindicationHeader"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICindicationMessage),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICindicationMessage,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICindicationMessage"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs__value, choice.RICcallProcessID),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcallProcessID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcallProcessID"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_52[] = { 1, 2, 3, 5, 6, 7, 4, 0 };
+static const unsigned asn_MAP_value_from_canonical_52[] = { 7, 0, 1, 2, 6, 3, 4, 5 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_52[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 2 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* RICactionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -2, 0 }, /* RICindicationSN */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 5, 0, 2 }, /* RICindicationHeader */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 6, -1, 1 }, /* RICindicationMessage */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 7, -2, 0 }, /* RICcallProcessID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* RICindicationType */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_52 = {
+	sizeof(struct RICindication_IEs__value),
+	offsetof(struct RICindication_IEs__value, _asn_ctx),
+	offsetof(struct RICindication_IEs__value, present),
+	sizeof(((struct RICindication_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_52,
+	8,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_52,
+	asn_MAP_value_from_canonical_52,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_52 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_52,
+	8,	/* Elements count */
+	&asn_SPC_value_specs_52	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICindication_IEs_49[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_50, &asn_PER_memb_id_constr_50,  memb_id_constraint_49 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICindication_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_51, &asn_PER_memb_criticality_constr_51,  memb_criticality_constraint_49 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICindication_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_52,
+		select_RICindication_IEs_value_type,
+		{ &asn_OER_memb_value_constr_52, &asn_PER_memb_value_constr_52,  memb_value_constraint_49 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICindication_IEs_tags_49[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICindication_IEs_tag2el_49[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICindication_IEs_specs_49 = {
+	sizeof(struct RICindication_IEs),
+	offsetof(struct RICindication_IEs, _asn_ctx),
+	asn_MAP_RICindication_IEs_tag2el_49,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICindication_IEs = {
+	"RICindication-IEs",
+	"RICindication-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICindication_IEs_tags_49,
+	sizeof(asn_DEF_RICindication_IEs_tags_49)
+		/sizeof(asn_DEF_RICindication_IEs_tags_49[0]), /* 1 */
+	asn_DEF_RICindication_IEs_tags_49,	/* Same as above */
+	sizeof(asn_DEF_RICindication_IEs_tags_49)
+		/sizeof(asn_DEF_RICindication_IEs_tags_49[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICindication_IEs_49,
+	3,	/* Elements count */
+	&asn_SPC_RICindication_IEs_specs_49	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_56[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICcallProcessID),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcallProcessID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcallProcessID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICcontrolHeader),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcontrolHeader,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolHeader"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICcontrolMessage),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcontrolMessage,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolMessage"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs__value, choice.RICcontrolAckRequest),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_RICcontrolAckRequest,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolAckRequest"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_56[] = { 1, 2, 3, 4, 5, 0 };
+static const unsigned asn_MAP_value_from_canonical_56[] = { 5, 0, 1, 2, 3, 4 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_56[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 2 }, /* RICcallProcessID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 3, -1, 1 }, /* RICcontrolHeader */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 4, -2, 0 }, /* RICcontrolMessage */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 5, 0, 0 }, /* RICcontrolAckRequest */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_56 = {
+	sizeof(struct RICcontrolRequest_IEs__value),
+	offsetof(struct RICcontrolRequest_IEs__value, _asn_ctx),
+	offsetof(struct RICcontrolRequest_IEs__value, present),
+	sizeof(((struct RICcontrolRequest_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_56,
+	6,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_56,
+	asn_MAP_value_from_canonical_56,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_56 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_56,
+	6,	/* Elements count */
+	&asn_SPC_value_specs_56	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICcontrolRequest_IEs_53[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_54, &asn_PER_memb_id_constr_54,  memb_id_constraint_53 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICcontrolRequest_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_55, &asn_PER_memb_criticality_constr_55,  memb_criticality_constraint_53 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_56,
+		select_RICcontrolRequest_IEs_value_type,
+		{ &asn_OER_memb_value_constr_56, &asn_PER_memb_value_constr_56,  memb_value_constraint_53 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolRequest_IEs_tags_53[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolRequest_IEs_tag2el_53[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICcontrolRequest_IEs_specs_53 = {
+	sizeof(struct RICcontrolRequest_IEs),
+	offsetof(struct RICcontrolRequest_IEs, _asn_ctx),
+	asn_MAP_RICcontrolRequest_IEs_tag2el_53,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolRequest_IEs = {
+	"RICcontrolRequest-IEs",
+	"RICcontrolRequest-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolRequest_IEs_tags_53,
+	sizeof(asn_DEF_RICcontrolRequest_IEs_tags_53)
+		/sizeof(asn_DEF_RICcontrolRequest_IEs_tags_53[0]), /* 1 */
+	asn_DEF_RICcontrolRequest_IEs_tags_53,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolRequest_IEs_tags_53)
+		/sizeof(asn_DEF_RICcontrolRequest_IEs_tags_53[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolRequest_IEs_53,
+	3,	/* Elements count */
+	&asn_SPC_RICcontrolRequest_IEs_specs_53	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_60[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RICcallProcessID),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcallProcessID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcallProcessID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RICcontrolStatus),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_RICcontrolStatus,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolStatus"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs__value, choice.RICcontrolOutcome),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcontrolOutcome,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolOutcome"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_60[] = { 1, 2, 4, 3, 0 };
+static const unsigned asn_MAP_value_from_canonical_60[] = { 4, 0, 1, 3, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_60[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 1 }, /* RICcallProcessID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 4, -1, 0 }, /* RICcontrolOutcome */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, 0, 0 }, /* RICcontrolStatus */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RICrequestID */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_60 = {
+	sizeof(struct RICcontrolAcknowledge_IEs__value),
+	offsetof(struct RICcontrolAcknowledge_IEs__value, _asn_ctx),
+	offsetof(struct RICcontrolAcknowledge_IEs__value, present),
+	sizeof(((struct RICcontrolAcknowledge_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_60,
+	5,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_60,
+	asn_MAP_value_from_canonical_60,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_60 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_60,
+	5,	/* Elements count */
+	&asn_SPC_value_specs_60	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICcontrolAcknowledge_IEs_57[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_58, &asn_PER_memb_id_constr_58,  memb_id_constraint_57 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICcontrolAcknowledge_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_59, &asn_PER_memb_criticality_constr_59,  memb_criticality_constraint_57 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_60,
+		select_RICcontrolAcknowledge_IEs_value_type,
+		{ &asn_OER_memb_value_constr_60, &asn_PER_memb_value_constr_60,  memb_value_constraint_57 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolAcknowledge_IEs_tags_57[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolAcknowledge_IEs_tag2el_57[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICcontrolAcknowledge_IEs_specs_57 = {
+	sizeof(struct RICcontrolAcknowledge_IEs),
+	offsetof(struct RICcontrolAcknowledge_IEs, _asn_ctx),
+	asn_MAP_RICcontrolAcknowledge_IEs_tag2el_57,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolAcknowledge_IEs = {
+	"RICcontrolAcknowledge-IEs",
+	"RICcontrolAcknowledge-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolAcknowledge_IEs_tags_57,
+	sizeof(asn_DEF_RICcontrolAcknowledge_IEs_tags_57)
+		/sizeof(asn_DEF_RICcontrolAcknowledge_IEs_tags_57[0]), /* 1 */
+	asn_DEF_RICcontrolAcknowledge_IEs_tags_57,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolAcknowledge_IEs_tags_57)
+		/sizeof(asn_DEF_RICcontrolAcknowledge_IEs_tags_57[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolAcknowledge_IEs_57,
+	3,	/* Elements count */
+	&asn_SPC_RICcontrolAcknowledge_IEs_specs_57	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_64[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.RICcallProcessID),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcallProcessID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcallProcessID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs__value, choice.RICcontrolOutcome),
+		(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
+		0,
+		&asn_DEF_RICcontrolOutcome,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolOutcome"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_64[] = { 1, 2, 4, 0, 3 };
+static const unsigned asn_MAP_value_from_canonical_64[] = { 3, 0, 1, 4, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_64[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 1 }, /* RICcallProcessID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 4, -1, 0 }, /* RICcontrolOutcome */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 3, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 3, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_64 = {
+	sizeof(struct RICcontrolFailure_IEs__value),
+	offsetof(struct RICcontrolFailure_IEs__value, _asn_ctx),
+	offsetof(struct RICcontrolFailure_IEs__value, present),
+	sizeof(((struct RICcontrolFailure_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_64,
+	9,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_64,
+	asn_MAP_value_from_canonical_64,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_64 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_64,
+	5,	/* Elements count */
+	&asn_SPC_value_specs_64	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICcontrolFailure_IEs_61[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_62, &asn_PER_memb_id_constr_62,  memb_id_constraint_61 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICcontrolFailure_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_63, &asn_PER_memb_criticality_constr_63,  memb_criticality_constraint_61 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_64,
+		select_RICcontrolFailure_IEs_value_type,
+		{ &asn_OER_memb_value_constr_64, &asn_PER_memb_value_constr_64,  memb_value_constraint_61 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolFailure_IEs_tags_61[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolFailure_IEs_tag2el_61[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICcontrolFailure_IEs_specs_61 = {
+	sizeof(struct RICcontrolFailure_IEs),
+	offsetof(struct RICcontrolFailure_IEs, _asn_ctx),
+	asn_MAP_RICcontrolFailure_IEs_tag2el_61,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolFailure_IEs = {
+	"RICcontrolFailure-IEs",
+	"RICcontrolFailure-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolFailure_IEs_tags_61,
+	sizeof(asn_DEF_RICcontrolFailure_IEs_tags_61)
+		/sizeof(asn_DEF_RICcontrolFailure_IEs_tags_61[0]), /* 1 */
+	asn_DEF_RICcontrolFailure_IEs_tags_61,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolFailure_IEs_tags_61)
+		/sizeof(asn_DEF_RICcontrolFailure_IEs_tags_61[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolFailure_IEs_61,
+	3,	/* Elements count */
+	&asn_SPC_RICcontrolFailure_IEs_specs_61	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_68[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs__value, choice.RICrequestID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICrequestID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICrequestID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs__value, choice.RANfunctionID),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_68[] = { 1, 0, 3, 2 };
+static const unsigned asn_MAP_value_from_canonical_68[] = { 1, 0, 3, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_68[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* RANfunctionID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RICrequestID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -1, 0 }, /* CriticalityDiagnostics */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 2, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 2, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_68 = {
+	sizeof(struct ErrorIndication_IEs__value),
+	offsetof(struct ErrorIndication_IEs__value, _asn_ctx),
+	offsetof(struct ErrorIndication_IEs__value, present),
+	sizeof(((struct ErrorIndication_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_68,
+	8,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_68,
+	asn_MAP_value_from_canonical_68,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_68 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_68,
+	4,	/* Elements count */
+	&asn_SPC_value_specs_68	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ErrorIndication_IEs_65[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_66, &asn_PER_memb_id_constr_66,  memb_id_constraint_65 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_ErrorIndication_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_67, &asn_PER_memb_criticality_constr_67,  memb_criticality_constraint_65 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ErrorIndication_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_68,
+		select_ErrorIndication_IEs_value_type,
+		{ &asn_OER_memb_value_constr_68, &asn_PER_memb_value_constr_68,  memb_value_constraint_65 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ErrorIndication_IEs_tags_65[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ErrorIndication_IEs_tag2el_65[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ErrorIndication_IEs_specs_65 = {
+	sizeof(struct ErrorIndication_IEs),
+	offsetof(struct ErrorIndication_IEs, _asn_ctx),
+	asn_MAP_ErrorIndication_IEs_tag2el_65,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ErrorIndication_IEs = {
+	"ErrorIndication-IEs",
+	"ErrorIndication-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ErrorIndication_IEs_tags_65,
+	sizeof(asn_DEF_ErrorIndication_IEs_tags_65)
+		/sizeof(asn_DEF_ErrorIndication_IEs_tags_65[0]), /* 1 */
+	asn_DEF_ErrorIndication_IEs_tags_65,	/* Same as above */
+	sizeof(asn_DEF_ErrorIndication_IEs_tags_65)
+		/sizeof(asn_DEF_ErrorIndication_IEs_tags_65[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ErrorIndication_IEs_65,
+	3,	/* Elements count */
+	&asn_SPC_ErrorIndication_IEs_specs_65	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_72[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs__value, choice.GlobalE2node_ID),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_GlobalE2node_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"GlobalE2node-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs__value, choice.RANfunctions_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctions_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctions-List"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_72[] = { 1, 0 };
+static const unsigned asn_MAP_value_from_canonical_72[] = { 1, 0 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_72[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* RANfunctions-List */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* en-gNB */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* ng-eNB */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* eNB */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_72 = {
+	sizeof(struct E2setupRequestIEs__value),
+	offsetof(struct E2setupRequestIEs__value, _asn_ctx),
+	offsetof(struct E2setupRequestIEs__value, present),
+	sizeof(((struct E2setupRequestIEs__value *)0)->present),
+	asn_MAP_value_tag2el_72,
+	5,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_72,
+	asn_MAP_value_from_canonical_72,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_72 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_72,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_72	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2setupRequestIEs_69[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_70, &asn_PER_memb_id_constr_70,  memb_id_constraint_69 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_E2setupRequestIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_71, &asn_PER_memb_criticality_constr_71,  memb_criticality_constraint_69 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct E2setupRequestIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_72,
+		select_E2setupRequestIEs_value_type,
+		{ &asn_OER_memb_value_constr_72, &asn_PER_memb_value_constr_72,  memb_value_constraint_69 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupRequestIEs_tags_69[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupRequestIEs_tag2el_69[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2setupRequestIEs_specs_69 = {
+	sizeof(struct E2setupRequestIEs),
+	offsetof(struct E2setupRequestIEs, _asn_ctx),
+	asn_MAP_E2setupRequestIEs_tag2el_69,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupRequestIEs = {
+	"E2setupRequestIEs",
+	"E2setupRequestIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupRequestIEs_tags_69,
+	sizeof(asn_DEF_E2setupRequestIEs_tags_69)
+		/sizeof(asn_DEF_E2setupRequestIEs_tags_69[0]), /* 1 */
+	asn_DEF_E2setupRequestIEs_tags_69,	/* Same as above */
+	sizeof(asn_DEF_E2setupRequestIEs_tags_69)
+		/sizeof(asn_DEF_E2setupRequestIEs_tags_69[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupRequestIEs_69,
+	3,	/* Elements count */
+	&asn_SPC_E2setupRequestIEs_specs_69	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_76[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs__value, choice.GlobalRIC_ID),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_GlobalRIC_ID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"GlobalRIC-ID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs__value, choice.RANfunctionsID_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsID_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsID-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs__value, choice.RANfunctionsIDcause_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsIDcause_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsIDcause-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_76[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* GlobalRIC-ID */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 1 }, /* RANfunctionsID-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 0 } /* RANfunctionsIDcause-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_76 = {
+	sizeof(struct E2setupResponseIEs__value),
+	offsetof(struct E2setupResponseIEs__value, _asn_ctx),
+	offsetof(struct E2setupResponseIEs__value, present),
+	sizeof(((struct E2setupResponseIEs__value *)0)->present),
+	asn_MAP_value_tag2el_76,
+	3,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_76 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_76,
+	3,	/* Elements count */
+	&asn_SPC_value_specs_76	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2setupResponseIEs_73[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_74, &asn_PER_memb_id_constr_74,  memb_id_constraint_73 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_E2setupResponseIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_75, &asn_PER_memb_criticality_constr_75,  memb_criticality_constraint_73 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct E2setupResponseIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_76,
+		select_E2setupResponseIEs_value_type,
+		{ &asn_OER_memb_value_constr_76, &asn_PER_memb_value_constr_76,  memb_value_constraint_73 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupResponseIEs_tags_73[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupResponseIEs_tag2el_73[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2setupResponseIEs_specs_73 = {
+	sizeof(struct E2setupResponseIEs),
+	offsetof(struct E2setupResponseIEs, _asn_ctx),
+	asn_MAP_E2setupResponseIEs_tag2el_73,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupResponseIEs = {
+	"E2setupResponseIEs",
+	"E2setupResponseIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupResponseIEs_tags_73,
+	sizeof(asn_DEF_E2setupResponseIEs_tags_73)
+		/sizeof(asn_DEF_E2setupResponseIEs_tags_73[0]), /* 1 */
+	asn_DEF_E2setupResponseIEs_tags_73,	/* Same as above */
+	sizeof(asn_DEF_E2setupResponseIEs_tags_73)
+		/sizeof(asn_DEF_E2setupResponseIEs_tags_73[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupResponseIEs_73,
+	3,	/* Elements count */
+	&asn_SPC_E2setupResponseIEs_specs_73	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_80[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs__value, choice.TimeToWait),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_TimeToWait,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"TimeToWait"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_80[] = { 1, 2, 0 };
+static const unsigned asn_MAP_value_from_canonical_80[] = { 2, 0, 1 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_80[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 }, /* TimeToWait */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 }, /* CriticalityDiagnostics */
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_80 = {
+	sizeof(struct E2setupFailureIEs__value),
+	offsetof(struct E2setupFailureIEs__value, _asn_ctx),
+	offsetof(struct E2setupFailureIEs__value, present),
+	sizeof(((struct E2setupFailureIEs__value *)0)->present),
+	asn_MAP_value_tag2el_80,
+	7,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_80,
+	asn_MAP_value_from_canonical_80,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_80 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_80,
+	3,	/* Elements count */
+	&asn_SPC_value_specs_80	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_E2setupFailureIEs_77[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_78, &asn_PER_memb_id_constr_78,  memb_id_constraint_77 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_E2setupFailureIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_79, &asn_PER_memb_criticality_constr_79,  memb_criticality_constraint_77 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct E2setupFailureIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_80,
+		select_E2setupFailureIEs_value_type,
+		{ &asn_OER_memb_value_constr_80, &asn_PER_memb_value_constr_80,  memb_value_constraint_77 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_E2setupFailureIEs_tags_77[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_E2setupFailureIEs_tag2el_77[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_E2setupFailureIEs_specs_77 = {
+	sizeof(struct E2setupFailureIEs),
+	offsetof(struct E2setupFailureIEs, _asn_ctx),
+	asn_MAP_E2setupFailureIEs_tag2el_77,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_E2setupFailureIEs = {
+	"E2setupFailureIEs",
+	"E2setupFailureIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_E2setupFailureIEs_tags_77,
+	sizeof(asn_DEF_E2setupFailureIEs_tags_77)
+		/sizeof(asn_DEF_E2setupFailureIEs_tags_77[0]), /* 1 */
+	asn_DEF_E2setupFailureIEs_tags_77,	/* Same as above */
+	sizeof(asn_DEF_E2setupFailureIEs_tags_77)
+		/sizeof(asn_DEF_E2setupFailureIEs_tags_77[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_E2setupFailureIEs_77,
+	3,	/* Elements count */
+	&asn_SPC_E2setupFailureIEs_specs_77	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_84[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetRequestIEs__value, choice.Cause),
+		-1 /* Ambiguous tag (CHOICE?) */,
+		0,
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"Cause"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_84[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequest */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* ricService */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* transport */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* protocol */
+    { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* misc */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_84 = {
+	sizeof(struct ResetRequestIEs__value),
+	offsetof(struct ResetRequestIEs__value, _asn_ctx),
+	offsetof(struct ResetRequestIEs__value, present),
+	sizeof(((struct ResetRequestIEs__value *)0)->present),
+	asn_MAP_value_tag2el_84,
+	5,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_84 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_84,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_84	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ResetRequestIEs_81[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetRequestIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_82, &asn_PER_memb_id_constr_82,  memb_id_constraint_81 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetRequestIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_ResetRequestIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_83, &asn_PER_memb_criticality_constr_83,  memb_criticality_constraint_81 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ResetRequestIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_84,
+		select_ResetRequestIEs_value_type,
+		{ &asn_OER_memb_value_constr_84, &asn_PER_memb_value_constr_84,  memb_value_constraint_81 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResetRequestIEs_tags_81[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResetRequestIEs_tag2el_81[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ResetRequestIEs_specs_81 = {
+	sizeof(struct ResetRequestIEs),
+	offsetof(struct ResetRequestIEs, _asn_ctx),
+	asn_MAP_ResetRequestIEs_tag2el_81,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResetRequestIEs = {
+	"ResetRequestIEs",
+	"ResetRequestIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResetRequestIEs_tags_81,
+	sizeof(asn_DEF_ResetRequestIEs_tags_81)
+		/sizeof(asn_DEF_ResetRequestIEs_tags_81[0]), /* 1 */
+	asn_DEF_ResetRequestIEs_tags_81,	/* Same as above */
+	sizeof(asn_DEF_ResetRequestIEs_tags_81)
+		/sizeof(asn_DEF_ResetRequestIEs_tags_81[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResetRequestIEs_81,
+	3,	/* Elements count */
+	&asn_SPC_ResetRequestIEs_specs_81	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_88[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetResponseIEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_88[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* CriticalityDiagnostics */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_88 = {
+	sizeof(struct ResetResponseIEs__value),
+	offsetof(struct ResetResponseIEs__value, _asn_ctx),
+	offsetof(struct ResetResponseIEs__value, present),
+	sizeof(((struct ResetResponseIEs__value *)0)->present),
+	asn_MAP_value_tag2el_88,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_88 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_88,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_88	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_ResetResponseIEs_85[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetResponseIEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_86, &asn_PER_memb_id_constr_86,  memb_id_constraint_85 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetResponseIEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_ResetResponseIEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_87, &asn_PER_memb_criticality_constr_87,  memb_criticality_constraint_85 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ResetResponseIEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_88,
+		select_ResetResponseIEs_value_type,
+		{ &asn_OER_memb_value_constr_88, &asn_PER_memb_value_constr_88,  memb_value_constraint_85 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResetResponseIEs_tags_85[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResetResponseIEs_tag2el_85[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_ResetResponseIEs_specs_85 = {
+	sizeof(struct ResetResponseIEs),
+	offsetof(struct ResetResponseIEs, _asn_ctx),
+	asn_MAP_ResetResponseIEs_tag2el_85,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResetResponseIEs = {
+	"ResetResponseIEs",
+	"ResetResponseIEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResetResponseIEs_tags_85,
+	sizeof(asn_DEF_ResetResponseIEs_tags_85)
+		/sizeof(asn_DEF_ResetResponseIEs_tags_85[0]), /* 1 */
+	asn_DEF_ResetResponseIEs_tags_85,	/* Same as above */
+	sizeof(asn_DEF_ResetResponseIEs_tags_85)
+		/sizeof(asn_DEF_ResetResponseIEs_tags_85[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResetResponseIEs_85,
+	3,	/* Elements count */
+	&asn_SPC_ResetResponseIEs_specs_85	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_92[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs__value, choice.RANfunctions_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctions_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctions-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs__value, choice.RANfunctionsID_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsID_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsID-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_92[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RANfunctions-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* RANfunctionsID-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_92 = {
+	sizeof(struct RICserviceUpdate_IEs__value),
+	offsetof(struct RICserviceUpdate_IEs__value, _asn_ctx),
+	offsetof(struct RICserviceUpdate_IEs__value, present),
+	sizeof(((struct RICserviceUpdate_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_92,
+	2,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_92 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_92,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_92	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICserviceUpdate_IEs_89[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_90, &asn_PER_memb_id_constr_90,  memb_id_constraint_89 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICserviceUpdate_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_91, &asn_PER_memb_criticality_constr_91,  memb_criticality_constraint_89 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_92,
+		select_RICserviceUpdate_IEs_value_type,
+		{ &asn_OER_memb_value_constr_92, &asn_PER_memb_value_constr_92,  memb_value_constraint_89 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdate_IEs_tags_89[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdate_IEs_tag2el_89[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdate_IEs_specs_89 = {
+	sizeof(struct RICserviceUpdate_IEs),
+	offsetof(struct RICserviceUpdate_IEs, _asn_ctx),
+	asn_MAP_RICserviceUpdate_IEs_tag2el_89,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdate_IEs = {
+	"RICserviceUpdate-IEs",
+	"RICserviceUpdate-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdate_IEs_tags_89,
+	sizeof(asn_DEF_RICserviceUpdate_IEs_tags_89)
+		/sizeof(asn_DEF_RICserviceUpdate_IEs_tags_89[0]), /* 1 */
+	asn_DEF_RICserviceUpdate_IEs_tags_89,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdate_IEs_tags_89)
+		/sizeof(asn_DEF_RICserviceUpdate_IEs_tags_89[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdate_IEs_89,
+	3,	/* Elements count */
+	&asn_SPC_RICserviceUpdate_IEs_specs_89	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_96[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs__value, choice.RANfunctionsID_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsID_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsID-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs__value, choice.RANfunctionsIDcause_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsIDcause_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsIDcause-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_96[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RANfunctionsID-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* RANfunctionsIDcause-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_96 = {
+	sizeof(struct RICserviceUpdateAcknowledge_IEs__value),
+	offsetof(struct RICserviceUpdateAcknowledge_IEs__value, _asn_ctx),
+	offsetof(struct RICserviceUpdateAcknowledge_IEs__value, present),
+	sizeof(((struct RICserviceUpdateAcknowledge_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_96,
+	2,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_96 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_96,
+	2,	/* Elements count */
+	&asn_SPC_value_specs_96	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICserviceUpdateAcknowledge_IEs_93[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_94, &asn_PER_memb_id_constr_94,  memb_id_constraint_93 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICserviceUpdateAcknowledge_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_95, &asn_PER_memb_criticality_constr_95,  memb_criticality_constraint_93 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_96,
+		select_RICserviceUpdateAcknowledge_IEs_value_type,
+		{ &asn_OER_memb_value_constr_96, &asn_PER_memb_value_constr_96,  memb_value_constraint_93 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdateAcknowledge_IEs_tag2el_93[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateAcknowledge_IEs_specs_93 = {
+	sizeof(struct RICserviceUpdateAcknowledge_IEs),
+	offsetof(struct RICserviceUpdateAcknowledge_IEs, _asn_ctx),
+	asn_MAP_RICserviceUpdateAcknowledge_IEs_tag2el_93,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateAcknowledge_IEs = {
+	"RICserviceUpdateAcknowledge-IEs",
+	"RICserviceUpdateAcknowledge-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93,
+	sizeof(asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93)
+		/sizeof(asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93[0]), /* 1 */
+	asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93)
+		/sizeof(asn_DEF_RICserviceUpdateAcknowledge_IEs_tags_93[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdateAcknowledge_IEs_93,
+	3,	/* Elements count */
+	&asn_SPC_RICserviceUpdateAcknowledge_IEs_specs_93	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_100[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs__value, choice.RANfunctionsIDcause_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsIDcause_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsIDcause-List"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs__value, choice.TimeToWait),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_TimeToWait,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"TimeToWait"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs__value, choice.CriticalityDiagnostics),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_CriticalityDiagnostics,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"CriticalityDiagnostics"
+		},
+};
+static const unsigned asn_MAP_value_to_canonical_100[] = { 1, 0, 2 };
+static const unsigned asn_MAP_value_from_canonical_100[] = { 1, 0, 2 };
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_100[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 }, /* TimeToWait */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* RANfunctionsIDcause-List */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 0 } /* CriticalityDiagnostics */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_100 = {
+	sizeof(struct RICserviceUpdateFailure_IEs__value),
+	offsetof(struct RICserviceUpdateFailure_IEs__value, _asn_ctx),
+	offsetof(struct RICserviceUpdateFailure_IEs__value, present),
+	sizeof(((struct RICserviceUpdateFailure_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_100,
+	3,	/* Count of tags in the map */
+	asn_MAP_value_to_canonical_100,
+	asn_MAP_value_from_canonical_100,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_100 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_100,
+	3,	/* Elements count */
+	&asn_SPC_value_specs_100	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICserviceUpdateFailure_IEs_97[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_98, &asn_PER_memb_id_constr_98,  memb_id_constraint_97 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICserviceUpdateFailure_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_99, &asn_PER_memb_criticality_constr_99,  memb_criticality_constraint_97 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_100,
+		select_RICserviceUpdateFailure_IEs_value_type,
+		{ &asn_OER_memb_value_constr_100, &asn_PER_memb_value_constr_100,  memb_value_constraint_97 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdateFailure_IEs_tags_97[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdateFailure_IEs_tag2el_97[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateFailure_IEs_specs_97 = {
+	sizeof(struct RICserviceUpdateFailure_IEs),
+	offsetof(struct RICserviceUpdateFailure_IEs, _asn_ctx),
+	asn_MAP_RICserviceUpdateFailure_IEs_tag2el_97,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateFailure_IEs = {
+	"RICserviceUpdateFailure-IEs",
+	"RICserviceUpdateFailure-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdateFailure_IEs_tags_97,
+	sizeof(asn_DEF_RICserviceUpdateFailure_IEs_tags_97)
+		/sizeof(asn_DEF_RICserviceUpdateFailure_IEs_tags_97[0]), /* 1 */
+	asn_DEF_RICserviceUpdateFailure_IEs_tags_97,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdateFailure_IEs_tags_97)
+		/sizeof(asn_DEF_RICserviceUpdateFailure_IEs_tags_97[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdateFailure_IEs_97,
+	3,	/* Elements count */
+	&asn_SPC_RICserviceUpdateFailure_IEs_specs_97	/* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_value_104[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery_IEs__value, choice.RANfunctionsID_List),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RANfunctionsID_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RANfunctionsID-List"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_104[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* RANfunctionsID-List */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_104 = {
+	sizeof(struct RICserviceQuery_IEs__value),
+	offsetof(struct RICserviceQuery_IEs__value, _asn_ctx),
+	offsetof(struct RICserviceQuery_IEs__value, present),
+	sizeof(((struct RICserviceQuery_IEs__value *)0)->present),
+	asn_MAP_value_tag2el_104,
+	1,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_104 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_104,
+	1,	/* Elements count */
+	&asn_SPC_value_specs_104	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_RICserviceQuery_IEs_101[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery_IEs, id),
+		(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_ID,
+		0,
+		{ &asn_OER_memb_id_constr_102, &asn_PER_memb_id_constr_102,  memb_id_constraint_101 },
+		0, 0, /* No default value */
+		"id"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery_IEs, criticality),
+		(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+		0,
+		&asn_DEF_Criticality,
+		select_RICserviceQuery_IEs_criticality_type,
+		{ &asn_OER_memb_criticality_constr_103, &asn_PER_memb_criticality_constr_103,  memb_criticality_constraint_101 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery_IEs, value),
+		-1 /* Ambiguous tag (ANY?) */,
+		0,
+		&asn_DEF_value_104,
+		select_RICserviceQuery_IEs_value_type,
+		{ &asn_OER_memb_value_constr_104, &asn_PER_memb_value_constr_104,  memb_value_constraint_101 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceQuery_IEs_tags_101[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceQuery_IEs_tag2el_101[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
+    { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* criticality */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICserviceQuery_IEs_specs_101 = {
+	sizeof(struct RICserviceQuery_IEs),
+	offsetof(struct RICserviceQuery_IEs, _asn_ctx),
+	asn_MAP_RICserviceQuery_IEs_tag2el_101,
+	2,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceQuery_IEs = {
+	"RICserviceQuery-IEs",
+	"RICserviceQuery-IEs",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceQuery_IEs_tags_101,
+	sizeof(asn_DEF_RICserviceQuery_IEs_tags_101)
+		/sizeof(asn_DEF_RICserviceQuery_IEs_tags_101[0]), /* 1 */
+	asn_DEF_RICserviceQuery_IEs_tags_101,	/* Same as above */
+	sizeof(asn_DEF_RICserviceQuery_IEs_tags_101)
+		/sizeof(asn_DEF_RICserviceQuery_IEs_tags_101[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceQuery_IEs_101,
+	3,	/* Elements count */
+	&asn_SPC_RICserviceQuery_IEs_specs_101	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ProtocolIE-FieldPair.c b/e2ap/lib/ProtocolIE-FieldPair.c
new file mode 100644
index 0000000..fa909ca
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-FieldPair.c
@@ -0,0 +1,9 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-FieldPair.h"
+
diff --git a/e2ap/lib/ProtocolIE-ID.c b/e2ap/lib/ProtocolIE-ID.c
new file mode 100644
index 0000000..b0e56de
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-ID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-ID.h"
+
+int
+ProtocolIE_ID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_ProtocolIE_ID_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+asn_per_constraints_t asn_PER_type_ProtocolIE_ID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_ID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_ID = {
+	"ProtocolIE-ID",
+	"ProtocolIE-ID",
+	&asn_OP_NativeInteger,
+	asn_DEF_ProtocolIE_ID_tags_1,
+	sizeof(asn_DEF_ProtocolIE_ID_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_ID_tags_1[0]), /* 1 */
+	asn_DEF_ProtocolIE_ID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_ID_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_ID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_ProtocolIE_ID_constr_1, &asn_PER_type_ProtocolIE_ID_constr_1, ProtocolIE_ID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/ProtocolIE-SingleContainer.c b/e2ap/lib/ProtocolIE-SingleContainer.c
new file mode 100644
index 0000000..5b06b80
--- /dev/null
+++ b/e2ap/lib/ProtocolIE-SingleContainer.c
@@ -0,0 +1,147 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-Containers"
+ * 	found in "E2AP-Containers-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ProtocolIE-SingleContainer.h"
+
+/*
+ * This type is implemented using RICaction_ToBeSetup_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RICaction_Admitted_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RICaction_NotAdmitted_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RANfunction_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RANfunctionID_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+/*
+ * This type is implemented using RANfunctionIDcause_ItemIEs,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P0 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P0_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_ToBeSetup_ItemIEs_1,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_ToBeSetup_ItemIEs_specs_1	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P1 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P1_tags_2[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_Admitted_ItemIEs_5,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_Admitted_ItemIEs_specs_5	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P2 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P2_tags_3[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_NotAdmitted_ItemIEs_9,
+	3,	/* Elements count */
+	&asn_SPC_RICaction_NotAdmitted_ItemIEs_specs_9	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P3 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P3_tags_4[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunction_ItemIEs_13,
+	3,	/* Elements count */
+	&asn_SPC_RANfunction_ItemIEs_specs_13	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P4 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P4_tags_5[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionID_ItemIEs_17,
+	3,	/* Elements count */
+	&asn_SPC_RANfunctionID_ItemIEs_specs_17	/* Additional specs */
+};
+
+static const ber_tlv_tag_t asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_ProtocolIE_SingleContainer_90P5 = {
+	"ProtocolIE-SingleContainer",
+	"ProtocolIE-SingleContainer",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6,
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6[0]), /* 1 */
+	asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6,	/* Same as above */
+	sizeof(asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6)
+		/sizeof(asn_DEF_ProtocolIE_SingleContainer_90P5_tags_6[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionIDcause_ItemIEs_21,
+	3,	/* Elements count */
+	&asn_SPC_RANfunctionIDcause_ItemIEs_specs_21	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunction-Item.c b/e2ap/lib/RANfunction-Item.c
new file mode 100644
index 0000000..f80753b
--- /dev/null
+++ b/e2ap/lib/RANfunction-Item.c
@@ -0,0 +1,70 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunction-Item.h"
+
+asn_TYPE_member_t asn_MBR_RANfunction_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Item, ranFunctionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Item, ranFunctionDefinition),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionDefinition,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionDefinition"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunction_Item, ranFunctionRevision),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionRevision,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionRevision"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunction_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunction_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunctionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ranFunctionDefinition */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ranFunctionRevision */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunction_Item_specs_1 = {
+	sizeof(struct RANfunction_Item),
+	offsetof(struct RANfunction_Item, _asn_ctx),
+	asn_MAP_RANfunction_Item_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	3,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunction_Item = {
+	"RANfunction-Item",
+	"RANfunction-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunction_Item_tags_1,
+	sizeof(asn_DEF_RANfunction_Item_tags_1)
+		/sizeof(asn_DEF_RANfunction_Item_tags_1[0]), /* 1 */
+	asn_DEF_RANfunction_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunction_Item_tags_1)
+		/sizeof(asn_DEF_RANfunction_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunction_Item_1,
+	3,	/* Elements count */
+	&asn_SPC_RANfunction_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionDefinition.c b/e2ap/lib/RANfunctionDefinition.c
new file mode 100644
index 0000000..49c090f
--- /dev/null
+++ b/e2ap/lib/RANfunctionDefinition.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionDefinition.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RANfunctionDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionDefinition = {
+	"RANfunctionDefinition",
+	"RANfunctionDefinition",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RANfunctionDefinition_tags_1,
+	sizeof(asn_DEF_RANfunctionDefinition_tags_1)
+		/sizeof(asn_DEF_RANfunctionDefinition_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionDefinition_tags_1)
+		/sizeof(asn_DEF_RANfunctionDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionID-Item.c b/e2ap/lib/RANfunctionID-Item.c
new file mode 100644
index 0000000..fb2b6fc
--- /dev/null
+++ b/e2ap/lib/RANfunctionID-Item.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionID-Item.h"
+
+asn_TYPE_member_t asn_MBR_RANfunctionID_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_Item, ranFunctionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionID_Item, ranFunctionRevision),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionRevision,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionRevision"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionID_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunctionID_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunctionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ranFunctionRevision */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunctionID_Item_specs_1 = {
+	sizeof(struct RANfunctionID_Item),
+	offsetof(struct RANfunctionID_Item, _asn_ctx),
+	asn_MAP_RANfunctionID_Item_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_RANfunctionID_Item = {
+	"RANfunctionID-Item",
+	"RANfunctionID-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunctionID_Item_tags_1,
+	sizeof(asn_DEF_RANfunctionID_Item_tags_1)
+		/sizeof(asn_DEF_RANfunctionID_Item_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionID_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionID_Item_tags_1)
+		/sizeof(asn_DEF_RANfunctionID_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionID_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_RANfunctionID_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionID.c b/e2ap/lib/RANfunctionID.c
new file mode 100644
index 0000000..d79a9d6
--- /dev/null
+++ b/e2ap/lib/RANfunctionID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionID.h"
+
+int
+RANfunctionID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 4095)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RANfunctionID_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..4095) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RANfunctionID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 12,  12,  0,  4095 }	/* (0..4095) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionID = {
+	"RANfunctionID",
+	"RANfunctionID",
+	&asn_OP_NativeInteger,
+	asn_DEF_RANfunctionID_tags_1,
+	sizeof(asn_DEF_RANfunctionID_tags_1)
+		/sizeof(asn_DEF_RANfunctionID_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionID_tags_1)
+		/sizeof(asn_DEF_RANfunctionID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctionID_constr_1, &asn_PER_type_RANfunctionID_constr_1, RANfunctionID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/RANfunctionIDcause-Item.c b/e2ap/lib/RANfunctionIDcause-Item.c
new file mode 100644
index 0000000..b74eb64
--- /dev/null
+++ b/e2ap/lib/RANfunctionIDcause-Item.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionIDcause-Item.h"
+
+asn_TYPE_member_t asn_MBR_RANfunctionIDcause_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_Item, ranFunctionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RANfunctionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ranFunctionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RANfunctionIDcause_Item, cause),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cause"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionIDcause_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RANfunctionIDcause_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunctionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cause */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RANfunctionIDcause_Item_specs_1 = {
+	sizeof(struct RANfunctionIDcause_Item),
+	offsetof(struct RANfunctionIDcause_Item, _asn_ctx),
+	asn_MAP_RANfunctionIDcause_Item_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_RANfunctionIDcause_Item = {
+	"RANfunctionIDcause-Item",
+	"RANfunctionIDcause-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RANfunctionIDcause_Item_tags_1,
+	sizeof(asn_DEF_RANfunctionIDcause_Item_tags_1)
+		/sizeof(asn_DEF_RANfunctionIDcause_Item_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionIDcause_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionIDcause_Item_tags_1)
+		/sizeof(asn_DEF_RANfunctionIDcause_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RANfunctionIDcause_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_RANfunctionIDcause_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionRevision.c b/e2ap/lib/RANfunctionRevision.c
new file mode 100644
index 0000000..32cc4a5
--- /dev/null
+++ b/e2ap/lib/RANfunctionRevision.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionRevision.h"
+
+int
+RANfunctionRevision_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 4095)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RANfunctionRevision_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..4095) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RANfunctionRevision_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 12,  12,  0,  4095 }	/* (0..4095) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionRevision_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionRevision = {
+	"RANfunctionRevision",
+	"RANfunctionRevision",
+	&asn_OP_NativeInteger,
+	asn_DEF_RANfunctionRevision_tags_1,
+	sizeof(asn_DEF_RANfunctionRevision_tags_1)
+		/sizeof(asn_DEF_RANfunctionRevision_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionRevision_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionRevision_tags_1)
+		/sizeof(asn_DEF_RANfunctionRevision_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctionRevision_constr_1, &asn_PER_type_RANfunctionRevision_constr_1, RANfunctionRevision_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/RANfunctions-List.c b/e2ap/lib/RANfunctions-List.c
new file mode 100644
index 0000000..cf01054
--- /dev/null
+++ b/e2ap/lib/RANfunctions-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctions-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RANfunctions_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..256)) */};
+asn_per_constraints_t asn_PER_type_RANfunctions_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 9,  9,  0,  256 }	/* (SIZE(0..256)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RANfunctions_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P3,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctions_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RANfunctions_List_specs_1 = {
+	sizeof(struct RANfunctions_List),
+	offsetof(struct RANfunctions_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctions_List = {
+	"RANfunctions-List",
+	"RANfunctions-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RANfunctions_List_tags_1,
+	sizeof(asn_DEF_RANfunctions_List_tags_1)
+		/sizeof(asn_DEF_RANfunctions_List_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctions_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctions_List_tags_1)
+		/sizeof(asn_DEF_RANfunctions_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctions_List_constr_1, &asn_PER_type_RANfunctions_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RANfunctions_List_1,
+	1,	/* Single element */
+	&asn_SPC_RANfunctions_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionsID-List.c b/e2ap/lib/RANfunctionsID-List.c
new file mode 100644
index 0000000..b888995
--- /dev/null
+++ b/e2ap/lib/RANfunctionsID-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionsID-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RANfunctionsID_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..256)) */};
+asn_per_constraints_t asn_PER_type_RANfunctionsID_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 9,  9,  0,  256 }	/* (SIZE(0..256)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RANfunctionsID_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P4,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionsID_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RANfunctionsID_List_specs_1 = {
+	sizeof(struct RANfunctionsID_List),
+	offsetof(struct RANfunctionsID_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionsID_List = {
+	"RANfunctionsID-List",
+	"RANfunctionsID-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RANfunctionsID_List_tags_1,
+	sizeof(asn_DEF_RANfunctionsID_List_tags_1)
+		/sizeof(asn_DEF_RANfunctionsID_List_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionsID_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionsID_List_tags_1)
+		/sizeof(asn_DEF_RANfunctionsID_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctionsID_List_constr_1, &asn_PER_type_RANfunctionsID_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RANfunctionsID_List_1,
+	1,	/* Single element */
+	&asn_SPC_RANfunctionsID_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RANfunctionsIDcause-List.c b/e2ap/lib/RANfunctionsIDcause-List.c
new file mode 100644
index 0000000..e1ae0d2
--- /dev/null
+++ b/e2ap/lib/RANfunctionsIDcause-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RANfunctionsIDcause-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RANfunctionsIDcause_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..256)) */};
+asn_per_constraints_t asn_PER_type_RANfunctionsIDcause_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 9,  9,  0,  256 }	/* (SIZE(0..256)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RANfunctionsIDcause_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P5,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RANfunctionsIDcause_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RANfunctionsIDcause_List_specs_1 = {
+	sizeof(struct RANfunctionsIDcause_List),
+	offsetof(struct RANfunctionsIDcause_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RANfunctionsIDcause_List = {
+	"RANfunctionsIDcause-List",
+	"RANfunctionsIDcause-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RANfunctionsIDcause_List_tags_1,
+	sizeof(asn_DEF_RANfunctionsIDcause_List_tags_1)
+		/sizeof(asn_DEF_RANfunctionsIDcause_List_tags_1[0]), /* 1 */
+	asn_DEF_RANfunctionsIDcause_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RANfunctionsIDcause_List_tags_1)
+		/sizeof(asn_DEF_RANfunctionsIDcause_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RANfunctionsIDcause_List_constr_1, &asn_PER_type_RANfunctionsIDcause_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RANfunctionsIDcause_List_1,
+	1,	/* Single element */
+	&asn_SPC_RANfunctionsIDcause_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-Admitted-Item.c b/e2ap/lib/RICaction-Admitted-Item.c
new file mode 100644
index 0000000..27e741d
--- /dev/null
+++ b/e2ap/lib/RICaction-Admitted-Item.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-Admitted-Item.h"
+
+asn_TYPE_member_t asn_MBR_RICaction_Admitted_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_Admitted_Item, ricActionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_Admitted_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_Admitted_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* ricActionID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_Admitted_Item_specs_1 = {
+	sizeof(struct RICaction_Admitted_Item),
+	offsetof(struct RICaction_Admitted_Item, _asn_ctx),
+	asn_MAP_RICaction_Admitted_Item_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_Item = {
+	"RICaction-Admitted-Item",
+	"RICaction-Admitted-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_Admitted_Item_tags_1,
+	sizeof(asn_DEF_RICaction_Admitted_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_Admitted_Item_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_Admitted_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_Admitted_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_Admitted_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_Admitted_Item_1,
+	1,	/* Elements count */
+	&asn_SPC_RICaction_Admitted_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-Admitted-List.c b/e2ap/lib/RICaction-Admitted-List.c
new file mode 100644
index 0000000..e9e8a5b
--- /dev/null
+++ b/e2ap/lib/RICaction-Admitted-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-Admitted-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RICaction_Admitted_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..16)) */};
+asn_per_constraints_t asn_PER_type_RICaction_Admitted_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  16 }	/* (SIZE(1..16)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RICaction_Admitted_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_Admitted_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RICaction_Admitted_List_specs_1 = {
+	sizeof(struct RICaction_Admitted_List),
+	offsetof(struct RICaction_Admitted_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_Admitted_List = {
+	"RICaction-Admitted-List",
+	"RICaction-Admitted-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RICaction_Admitted_List_tags_1,
+	sizeof(asn_DEF_RICaction_Admitted_List_tags_1)
+		/sizeof(asn_DEF_RICaction_Admitted_List_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_Admitted_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_Admitted_List_tags_1)
+		/sizeof(asn_DEF_RICaction_Admitted_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICaction_Admitted_List_constr_1, &asn_PER_type_RICaction_Admitted_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RICaction_Admitted_List_1,
+	1,	/* Single element */
+	&asn_SPC_RICaction_Admitted_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-NotAdmitted-Item.c b/e2ap/lib/RICaction-NotAdmitted-Item.c
new file mode 100644
index 0000000..86212ed
--- /dev/null
+++ b/e2ap/lib/RICaction-NotAdmitted-Item.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-NotAdmitted-Item.h"
+
+asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_Item, ricActionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_NotAdmitted_Item, cause),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_Cause,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"cause"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_NotAdmitted_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_NotAdmitted_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricActionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cause */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_NotAdmitted_Item_specs_1 = {
+	sizeof(struct RICaction_NotAdmitted_Item),
+	offsetof(struct RICaction_NotAdmitted_Item, _asn_ctx),
+	asn_MAP_RICaction_NotAdmitted_Item_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_RICaction_NotAdmitted_Item = {
+	"RICaction-NotAdmitted-Item",
+	"RICaction-NotAdmitted-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_NotAdmitted_Item_tags_1,
+	sizeof(asn_DEF_RICaction_NotAdmitted_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_Item_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_NotAdmitted_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_NotAdmitted_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_NotAdmitted_Item_1,
+	2,	/* Elements count */
+	&asn_SPC_RICaction_NotAdmitted_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-NotAdmitted-List.c b/e2ap/lib/RICaction-NotAdmitted-List.c
new file mode 100644
index 0000000..7c7f6e2
--- /dev/null
+++ b/e2ap/lib/RICaction-NotAdmitted-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-NotAdmitted-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RICaction_NotAdmitted_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(0..16)) */};
+asn_per_constraints_t asn_PER_type_RICaction_NotAdmitted_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 5,  5,  0,  16 }	/* (SIZE(0..16)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RICaction_NotAdmitted_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P2,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICaction_NotAdmitted_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RICaction_NotAdmitted_List_specs_1 = {
+	sizeof(struct RICaction_NotAdmitted_List),
+	offsetof(struct RICaction_NotAdmitted_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_NotAdmitted_List = {
+	"RICaction-NotAdmitted-List",
+	"RICaction-NotAdmitted-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RICaction_NotAdmitted_List_tags_1,
+	sizeof(asn_DEF_RICaction_NotAdmitted_List_tags_1)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_List_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_NotAdmitted_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_NotAdmitted_List_tags_1)
+		/sizeof(asn_DEF_RICaction_NotAdmitted_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICaction_NotAdmitted_List_constr_1, &asn_PER_type_RICaction_NotAdmitted_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RICaction_NotAdmitted_List_1,
+	1,	/* Single element */
+	&asn_SPC_RICaction_NotAdmitted_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICaction-ToBeSetup-Item.c b/e2ap/lib/RICaction-ToBeSetup-Item.c
new file mode 100644
index 0000000..1e78073
--- /dev/null
+++ b/e2ap/lib/RICaction-ToBeSetup-Item.c
@@ -0,0 +1,83 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICaction-ToBeSetup-Item.h"
+
+#include "RICsubsequentAction.h"
+asn_TYPE_member_t asn_MBR_RICaction_ToBeSetup_Item_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_Item, ricActionID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionID,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICaction_ToBeSetup_Item, ricActionType),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionType"
+		},
+	{ ATF_POINTER, 2, offsetof(struct RICaction_ToBeSetup_Item, ricActionDefinition),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactionDefinition,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricActionDefinition"
+		},
+	{ ATF_POINTER, 1, offsetof(struct RICaction_ToBeSetup_Item, ricSubsequentAction),
+		(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICsubsequentAction,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricSubsequentAction"
+		},
+};
+static const int asn_MAP_RICaction_ToBeSetup_Item_oms_1[] = { 2, 3 };
+static const ber_tlv_tag_t asn_DEF_RICaction_ToBeSetup_Item_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICaction_ToBeSetup_Item_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricActionID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ricActionType */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ricActionDefinition */
+    { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* ricSubsequentAction */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICaction_ToBeSetup_Item_specs_1 = {
+	sizeof(struct RICaction_ToBeSetup_Item),
+	offsetof(struct RICaction_ToBeSetup_Item, _asn_ctx),
+	asn_MAP_RICaction_ToBeSetup_Item_tag2el_1,
+	4,	/* Count of tags in the map */
+	asn_MAP_RICaction_ToBeSetup_Item_oms_1,	/* Optional members */
+	2, 0,	/* Root/Additions */
+	4,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICaction_ToBeSetup_Item = {
+	"RICaction-ToBeSetup-Item",
+	"RICaction-ToBeSetup-Item",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICaction_ToBeSetup_Item_tags_1,
+	sizeof(asn_DEF_RICaction_ToBeSetup_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_ToBeSetup_Item_tags_1[0]), /* 1 */
+	asn_DEF_RICaction_ToBeSetup_Item_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICaction_ToBeSetup_Item_tags_1)
+		/sizeof(asn_DEF_RICaction_ToBeSetup_Item_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICaction_ToBeSetup_Item_1,
+	4,	/* Elements count */
+	&asn_SPC_RICaction_ToBeSetup_Item_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICactionDefinition.c b/e2ap/lib/RICactionDefinition.c
new file mode 100644
index 0000000..3f157ba
--- /dev/null
+++ b/e2ap/lib/RICactionDefinition.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICactionDefinition.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICactionDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICactionDefinition = {
+	"RICactionDefinition",
+	"RICactionDefinition",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICactionDefinition_tags_1,
+	sizeof(asn_DEF_RICactionDefinition_tags_1)
+		/sizeof(asn_DEF_RICactionDefinition_tags_1[0]), /* 1 */
+	asn_DEF_RICactionDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICactionDefinition_tags_1)
+		/sizeof(asn_DEF_RICactionDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICactionID.c b/e2ap/lib/RICactionID.c
new file mode 100644
index 0000000..73658f5
--- /dev/null
+++ b/e2ap/lib/RICactionID.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICactionID.h"
+
+int
+RICactionID_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICactionID_constr_1 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RICactionID_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RICactionID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICactionID = {
+	"RICactionID",
+	"RICactionID",
+	&asn_OP_NativeInteger,
+	asn_DEF_RICactionID_tags_1,
+	sizeof(asn_DEF_RICactionID_tags_1)
+		/sizeof(asn_DEF_RICactionID_tags_1[0]), /* 1 */
+	asn_DEF_RICactionID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICactionID_tags_1)
+		/sizeof(asn_DEF_RICactionID_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICactionID_constr_1, &asn_PER_type_RICactionID_constr_1, RICactionID_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/RICactionType.c b/e2ap/lib/RICactionType.c
new file mode 100644
index 0000000..bfd33d5
--- /dev/null
+++ b/e2ap/lib/RICactionType.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICactionType.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICactionType_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICactionType_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  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_RICactionType_value2enum_1[] = {
+	{ 0,	6,	"report" },
+	{ 1,	6,	"insert" },
+	{ 2,	6,	"policy" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICactionType_enum2value_1[] = {
+	1,	/* insert(1) */
+	2,	/* policy(2) */
+	0	/* report(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICactionType_specs_1 = {
+	asn_MAP_RICactionType_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICactionType_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICactionType_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICactionType = {
+	"RICactionType",
+	"RICactionType",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICactionType_tags_1,
+	sizeof(asn_DEF_RICactionType_tags_1)
+		/sizeof(asn_DEF_RICactionType_tags_1[0]), /* 1 */
+	asn_DEF_RICactionType_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICactionType_tags_1)
+		/sizeof(asn_DEF_RICactionType_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICactionType_constr_1, &asn_PER_type_RICactionType_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICactionType_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICactions-ToBeSetup-List.c b/e2ap/lib/RICactions-ToBeSetup-List.c
new file mode 100644
index 0000000..93905c3
--- /dev/null
+++ b/e2ap/lib/RICactions-ToBeSetup-List.c
@@ -0,0 +1,53 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICactions-ToBeSetup-List.h"
+
+#include "ProtocolIE-SingleContainer.h"
+static asn_oer_constraints_t asn_OER_type_RICactions_ToBeSetup_List_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1	/* (SIZE(1..16)) */};
+asn_per_constraints_t asn_PER_type_RICactions_ToBeSetup_List_constr_1 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_CONSTRAINED,	 4,  4,  1,  16 }	/* (SIZE(1..16)) */,
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RICactions_ToBeSetup_List_1[] = {
+	{ ATF_POINTER, 0, 0,
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ProtocolIE_SingleContainer_90P0,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		""
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICactions_ToBeSetup_List_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_SET_OF_specifics_t asn_SPC_RICactions_ToBeSetup_List_specs_1 = {
+	sizeof(struct RICactions_ToBeSetup_List),
+	offsetof(struct RICactions_ToBeSetup_List, _asn_ctx),
+	0,	/* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_RICactions_ToBeSetup_List = {
+	"RICactions-ToBeSetup-List",
+	"RICactions-ToBeSetup-List",
+	&asn_OP_SEQUENCE_OF,
+	asn_DEF_RICactions_ToBeSetup_List_tags_1,
+	sizeof(asn_DEF_RICactions_ToBeSetup_List_tags_1)
+		/sizeof(asn_DEF_RICactions_ToBeSetup_List_tags_1[0]), /* 1 */
+	asn_DEF_RICactions_ToBeSetup_List_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICactions_ToBeSetup_List_tags_1)
+		/sizeof(asn_DEF_RICactions_ToBeSetup_List_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICactions_ToBeSetup_List_constr_1, &asn_PER_type_RICactions_ToBeSetup_List_constr_1, SEQUENCE_OF_constraint },
+	asn_MBR_RICactions_ToBeSetup_List_1,
+	1,	/* Single element */
+	&asn_SPC_RICactions_ToBeSetup_List_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcallProcessID.c b/e2ap/lib/RICcallProcessID.c
new file mode 100644
index 0000000..fd2d0eb
--- /dev/null
+++ b/e2ap/lib/RICcallProcessID.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcallProcessID.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICcallProcessID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcallProcessID = {
+	"RICcallProcessID",
+	"RICcallProcessID",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICcallProcessID_tags_1,
+	sizeof(asn_DEF_RICcallProcessID_tags_1)
+		/sizeof(asn_DEF_RICcallProcessID_tags_1[0]), /* 1 */
+	asn_DEF_RICcallProcessID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcallProcessID_tags_1)
+		/sizeof(asn_DEF_RICcallProcessID_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolAckRequest.c b/e2ap/lib/RICcontrolAckRequest.c
new file mode 100644
index 0000000..1db6bee
--- /dev/null
+++ b/e2ap/lib/RICcontrolAckRequest.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolAckRequest.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICcontrolAckRequest_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICcontrolAckRequest_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  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_RICcontrolAckRequest_value2enum_1[] = {
+	{ 0,	5,	"noAck" },
+	{ 1,	3,	"ack" },
+	{ 2,	4,	"nAck" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICcontrolAckRequest_enum2value_1[] = {
+	1,	/* ack(1) */
+	2,	/* nAck(2) */
+	0	/* noAck(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICcontrolAckRequest_specs_1 = {
+	asn_MAP_RICcontrolAckRequest_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICcontrolAckRequest_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolAckRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolAckRequest = {
+	"RICcontrolAckRequest",
+	"RICcontrolAckRequest",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICcontrolAckRequest_tags_1,
+	sizeof(asn_DEF_RICcontrolAckRequest_tags_1)
+		/sizeof(asn_DEF_RICcontrolAckRequest_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolAckRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolAckRequest_tags_1)
+		/sizeof(asn_DEF_RICcontrolAckRequest_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICcontrolAckRequest_constr_1, &asn_PER_type_RICcontrolAckRequest_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICcontrolAckRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolAcknowledge.c b/e2ap/lib/RICcontrolAcknowledge.c
new file mode 100644
index 0000000..85011b6
--- /dev/null
+++ b/e2ap/lib/RICcontrolAcknowledge.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolAcknowledge.h"
+
+static asn_TYPE_member_t asn_MBR_RICcontrolAcknowledge_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolAcknowledge, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P8,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolAcknowledge_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolAcknowledge_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICcontrolAcknowledge_specs_1 = {
+	sizeof(struct RICcontrolAcknowledge),
+	offsetof(struct RICcontrolAcknowledge, _asn_ctx),
+	asn_MAP_RICcontrolAcknowledge_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolAcknowledge = {
+	"RICcontrolAcknowledge",
+	"RICcontrolAcknowledge",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolAcknowledge_tags_1,
+	sizeof(asn_DEF_RICcontrolAcknowledge_tags_1)
+		/sizeof(asn_DEF_RICcontrolAcknowledge_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolAcknowledge_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolAcknowledge_tags_1)
+		/sizeof(asn_DEF_RICcontrolAcknowledge_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolAcknowledge_1,
+	1,	/* Elements count */
+	&asn_SPC_RICcontrolAcknowledge_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolFailure.c b/e2ap/lib/RICcontrolFailure.c
new file mode 100644
index 0000000..a847f9f
--- /dev/null
+++ b/e2ap/lib/RICcontrolFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolFailure.h"
+
+static asn_TYPE_member_t asn_MBR_RICcontrolFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P9,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICcontrolFailure_specs_1 = {
+	sizeof(struct RICcontrolFailure),
+	offsetof(struct RICcontrolFailure, _asn_ctx),
+	asn_MAP_RICcontrolFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolFailure = {
+	"RICcontrolFailure",
+	"RICcontrolFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolFailure_tags_1,
+	sizeof(asn_DEF_RICcontrolFailure_tags_1)
+		/sizeof(asn_DEF_RICcontrolFailure_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolFailure_tags_1)
+		/sizeof(asn_DEF_RICcontrolFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_RICcontrolFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolHeader.c b/e2ap/lib/RICcontrolHeader.c
new file mode 100644
index 0000000..3accabb
--- /dev/null
+++ b/e2ap/lib/RICcontrolHeader.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolHeader.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICcontrolHeader_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolHeader = {
+	"RICcontrolHeader",
+	"RICcontrolHeader",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICcontrolHeader_tags_1,
+	sizeof(asn_DEF_RICcontrolHeader_tags_1)
+		/sizeof(asn_DEF_RICcontrolHeader_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolHeader_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolHeader_tags_1)
+		/sizeof(asn_DEF_RICcontrolHeader_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolMessage.c b/e2ap/lib/RICcontrolMessage.c
new file mode 100644
index 0000000..d865706
--- /dev/null
+++ b/e2ap/lib/RICcontrolMessage.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolMessage.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICcontrolMessage_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolMessage = {
+	"RICcontrolMessage",
+	"RICcontrolMessage",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICcontrolMessage_tags_1,
+	sizeof(asn_DEF_RICcontrolMessage_tags_1)
+		/sizeof(asn_DEF_RICcontrolMessage_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolMessage_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolMessage_tags_1)
+		/sizeof(asn_DEF_RICcontrolMessage_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolOutcome.c b/e2ap/lib/RICcontrolOutcome.c
new file mode 100644
index 0000000..806038d
--- /dev/null
+++ b/e2ap/lib/RICcontrolOutcome.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolOutcome.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICcontrolOutcome_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolOutcome = {
+	"RICcontrolOutcome",
+	"RICcontrolOutcome",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICcontrolOutcome_tags_1,
+	sizeof(asn_DEF_RICcontrolOutcome_tags_1)
+		/sizeof(asn_DEF_RICcontrolOutcome_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolOutcome_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolOutcome_tags_1)
+		/sizeof(asn_DEF_RICcontrolOutcome_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolRequest.c b/e2ap/lib/RICcontrolRequest.c
new file mode 100644
index 0000000..43a04e2
--- /dev/null
+++ b/e2ap/lib/RICcontrolRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolRequest.h"
+
+static asn_TYPE_member_t asn_MBR_RICcontrolRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICcontrolRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P7,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICcontrolRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICcontrolRequest_specs_1 = {
+	sizeof(struct RICcontrolRequest),
+	offsetof(struct RICcontrolRequest, _asn_ctx),
+	asn_MAP_RICcontrolRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolRequest = {
+	"RICcontrolRequest",
+	"RICcontrolRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICcontrolRequest_tags_1,
+	sizeof(asn_DEF_RICcontrolRequest_tags_1)
+		/sizeof(asn_DEF_RICcontrolRequest_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolRequest_tags_1)
+		/sizeof(asn_DEF_RICcontrolRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICcontrolRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_RICcontrolRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICcontrolStatus.c b/e2ap/lib/RICcontrolStatus.c
new file mode 100644
index 0000000..d2873fc
--- /dev/null
+++ b/e2ap/lib/RICcontrolStatus.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICcontrolStatus.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICcontrolStatus_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICcontrolStatus_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  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_RICcontrolStatus_value2enum_1[] = {
+	{ 0,	7,	"success" },
+	{ 1,	8,	"rejected" },
+	{ 2,	6,	"failed" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICcontrolStatus_enum2value_1[] = {
+	2,	/* failed(2) */
+	1,	/* rejected(1) */
+	0	/* success(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICcontrolStatus_specs_1 = {
+	asn_MAP_RICcontrolStatus_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICcontrolStatus_enum2value_1,	/* N => "tag"; sorted by N */
+	3,	/* Number of elements in the maps */
+	4,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICcontrolStatus_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICcontrolStatus = {
+	"RICcontrolStatus",
+	"RICcontrolStatus",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICcontrolStatus_tags_1,
+	sizeof(asn_DEF_RICcontrolStatus_tags_1)
+		/sizeof(asn_DEF_RICcontrolStatus_tags_1[0]), /* 1 */
+	asn_DEF_RICcontrolStatus_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICcontrolStatus_tags_1)
+		/sizeof(asn_DEF_RICcontrolStatus_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICcontrolStatus_constr_1, &asn_PER_type_RICcontrolStatus_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICcontrolStatus_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICeventTriggerDefinition.c b/e2ap/lib/RICeventTriggerDefinition.c
new file mode 100644
index 0000000..a13ddbd
--- /dev/null
+++ b/e2ap/lib/RICeventTriggerDefinition.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICeventTriggerDefinition.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICeventTriggerDefinition_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICeventTriggerDefinition = {
+	"RICeventTriggerDefinition",
+	"RICeventTriggerDefinition",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICeventTriggerDefinition_tags_1,
+	sizeof(asn_DEF_RICeventTriggerDefinition_tags_1)
+		/sizeof(asn_DEF_RICeventTriggerDefinition_tags_1[0]), /* 1 */
+	asn_DEF_RICeventTriggerDefinition_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICeventTriggerDefinition_tags_1)
+		/sizeof(asn_DEF_RICeventTriggerDefinition_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICindication.c b/e2ap/lib/RICindication.c
new file mode 100644
index 0000000..5c40aa5
--- /dev/null
+++ b/e2ap/lib/RICindication.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindication.h"
+
+static asn_TYPE_member_t asn_MBR_RICindication_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICindication, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P6,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICindication_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICindication_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICindication_specs_1 = {
+	sizeof(struct RICindication),
+	offsetof(struct RICindication, _asn_ctx),
+	asn_MAP_RICindication_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICindication = {
+	"RICindication",
+	"RICindication",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICindication_tags_1,
+	sizeof(asn_DEF_RICindication_tags_1)
+		/sizeof(asn_DEF_RICindication_tags_1[0]), /* 1 */
+	asn_DEF_RICindication_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindication_tags_1)
+		/sizeof(asn_DEF_RICindication_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICindication_1,
+	1,	/* Elements count */
+	&asn_SPC_RICindication_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICindicationHeader.c b/e2ap/lib/RICindicationHeader.c
new file mode 100644
index 0000000..d252382
--- /dev/null
+++ b/e2ap/lib/RICindicationHeader.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindicationHeader.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICindicationHeader_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICindicationHeader = {
+	"RICindicationHeader",
+	"RICindicationHeader",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICindicationHeader_tags_1,
+	sizeof(asn_DEF_RICindicationHeader_tags_1)
+		/sizeof(asn_DEF_RICindicationHeader_tags_1[0]), /* 1 */
+	asn_DEF_RICindicationHeader_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindicationHeader_tags_1)
+		/sizeof(asn_DEF_RICindicationHeader_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICindicationMessage.c b/e2ap/lib/RICindicationMessage.c
new file mode 100644
index 0000000..bd0ac0f
--- /dev/null
+++ b/e2ap/lib/RICindicationMessage.c
@@ -0,0 +1,31 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindicationMessage.h"
+
+/*
+ * This type is implemented using OCTET_STRING,
+ * so here we adjust the DEF accordingly.
+ */
+static const ber_tlv_tag_t asn_DEF_RICindicationMessage_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICindicationMessage = {
+	"RICindicationMessage",
+	"RICindicationMessage",
+	&asn_OP_OCTET_STRING,
+	asn_DEF_RICindicationMessage_tags_1,
+	sizeof(asn_DEF_RICindicationMessage_tags_1)
+		/sizeof(asn_DEF_RICindicationMessage_tags_1[0]), /* 1 */
+	asn_DEF_RICindicationMessage_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindicationMessage_tags_1)
+		/sizeof(asn_DEF_RICindicationMessage_tags_1[0]), /* 1 */
+	{ 0, 0, OCTET_STRING_constraint },
+	0, 0,	/* No members */
+	&asn_SPC_OCTET_STRING_specs	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICindicationSN.c b/e2ap/lib/RICindicationSN.c
new file mode 100644
index 0000000..efd2d48
--- /dev/null
+++ b/e2ap/lib/RICindicationSN.c
@@ -0,0 +1,64 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindicationSN.h"
+
+int
+RICindicationSN_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+/*
+ * This type is implemented using NativeInteger,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICindicationSN_constr_1 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+asn_per_constraints_t asn_PER_type_RICindicationSN_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_RICindicationSN_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICindicationSN = {
+	"RICindicationSN",
+	"RICindicationSN",
+	&asn_OP_NativeInteger,
+	asn_DEF_RICindicationSN_tags_1,
+	sizeof(asn_DEF_RICindicationSN_tags_1)
+		/sizeof(asn_DEF_RICindicationSN_tags_1[0]), /* 1 */
+	asn_DEF_RICindicationSN_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindicationSN_tags_1)
+		/sizeof(asn_DEF_RICindicationSN_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICindicationSN_constr_1, &asn_PER_type_RICindicationSN_constr_1, RICindicationSN_constraint },
+	0, 0,	/* No members */
+	0	/* No specifics */
+};
+
diff --git a/e2ap/lib/RICindicationType.c b/e2ap/lib/RICindicationType.c
new file mode 100644
index 0000000..58935bb
--- /dev/null
+++ b/e2ap/lib/RICindicationType.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICindicationType.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICindicationType_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICindicationType_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICindicationType_value2enum_1[] = {
+	{ 0,	6,	"report" },
+	{ 1,	6,	"insert" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICindicationType_enum2value_1[] = {
+	1,	/* insert(1) */
+	0	/* report(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICindicationType_specs_1 = {
+	asn_MAP_RICindicationType_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICindicationType_enum2value_1,	/* N => "tag"; sorted by N */
+	2,	/* Number of elements in the maps */
+	3,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICindicationType_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICindicationType = {
+	"RICindicationType",
+	"RICindicationType",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICindicationType_tags_1,
+	sizeof(asn_DEF_RICindicationType_tags_1)
+		/sizeof(asn_DEF_RICindicationType_tags_1[0]), /* 1 */
+	asn_DEF_RICindicationType_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICindicationType_tags_1)
+		/sizeof(asn_DEF_RICindicationType_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICindicationType_constr_1, &asn_PER_type_RICindicationType_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICindicationType_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICrequestID.c b/e2ap/lib/RICrequestID.c
new file mode 100644
index 0000000..1422a31
--- /dev/null
+++ b/e2ap/lib/RICrequestID.c
@@ -0,0 +1,126 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICrequestID.h"
+
+static int
+memb_ricRequestorID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static int
+memb_ricInstanceID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 65535)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_oer_constraints_t asn_OER_memb_ricRequestorID_constr_2 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_ricRequestorID_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_ricInstanceID_constr_3 CC_NOTUSED = {
+	{ 2, 1 }	/* (0..65535) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_ricInstanceID_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 16,  16,  0,  65535 }	/* (0..65535) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+asn_TYPE_member_t asn_MBR_RICrequestID_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICrequestID, ricRequestorID),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_ricRequestorID_constr_2, &asn_PER_memb_ricRequestorID_constr_2,  memb_ricRequestorID_constraint_1 },
+		0, 0, /* No default value */
+		"ricRequestorID"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICrequestID, ricInstanceID),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_NativeInteger,
+		0,
+		{ &asn_OER_memb_ricInstanceID_constr_3, &asn_PER_memb_ricInstanceID_constr_3,  memb_ricInstanceID_constraint_1 },
+		0, 0, /* No default value */
+		"ricInstanceID"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICrequestID_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICrequestID_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequestorID */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ricInstanceID */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICrequestID_specs_1 = {
+	sizeof(struct RICrequestID),
+	offsetof(struct RICrequestID, _asn_ctx),
+	asn_MAP_RICrequestID_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_RICrequestID = {
+	"RICrequestID",
+	"RICrequestID",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICrequestID_tags_1,
+	sizeof(asn_DEF_RICrequestID_tags_1)
+		/sizeof(asn_DEF_RICrequestID_tags_1[0]), /* 1 */
+	asn_DEF_RICrequestID_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICrequestID_tags_1)
+		/sizeof(asn_DEF_RICrequestID_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICrequestID_1,
+	2,	/* Elements count */
+	&asn_SPC_RICrequestID_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICserviceQuery.c b/e2ap/lib/RICserviceQuery.c
new file mode 100644
index 0000000..a7d452e
--- /dev/null
+++ b/e2ap/lib/RICserviceQuery.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICserviceQuery.h"
+
+static asn_TYPE_member_t asn_MBR_RICserviceQuery_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceQuery, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P19,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceQuery_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceQuery_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICserviceQuery_specs_1 = {
+	sizeof(struct RICserviceQuery),
+	offsetof(struct RICserviceQuery, _asn_ctx),
+	asn_MAP_RICserviceQuery_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceQuery = {
+	"RICserviceQuery",
+	"RICserviceQuery",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceQuery_tags_1,
+	sizeof(asn_DEF_RICserviceQuery_tags_1)
+		/sizeof(asn_DEF_RICserviceQuery_tags_1[0]), /* 1 */
+	asn_DEF_RICserviceQuery_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICserviceQuery_tags_1)
+		/sizeof(asn_DEF_RICserviceQuery_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceQuery_1,
+	1,	/* Elements count */
+	&asn_SPC_RICserviceQuery_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICserviceUpdate.c b/e2ap/lib/RICserviceUpdate.c
new file mode 100644
index 0000000..a562e2f
--- /dev/null
+++ b/e2ap/lib/RICserviceUpdate.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICserviceUpdate.h"
+
+static asn_TYPE_member_t asn_MBR_RICserviceUpdate_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdate, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P16,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdate_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdate_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdate_specs_1 = {
+	sizeof(struct RICserviceUpdate),
+	offsetof(struct RICserviceUpdate, _asn_ctx),
+	asn_MAP_RICserviceUpdate_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdate = {
+	"RICserviceUpdate",
+	"RICserviceUpdate",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdate_tags_1,
+	sizeof(asn_DEF_RICserviceUpdate_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdate_tags_1[0]), /* 1 */
+	asn_DEF_RICserviceUpdate_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdate_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdate_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdate_1,
+	1,	/* Elements count */
+	&asn_SPC_RICserviceUpdate_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICserviceUpdateAcknowledge.c b/e2ap/lib/RICserviceUpdateAcknowledge.c
new file mode 100644
index 0000000..845acb2
--- /dev/null
+++ b/e2ap/lib/RICserviceUpdateAcknowledge.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICserviceUpdateAcknowledge.h"
+
+static asn_TYPE_member_t asn_MBR_RICserviceUpdateAcknowledge_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateAcknowledge, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P17,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdateAcknowledge_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdateAcknowledge_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateAcknowledge_specs_1 = {
+	sizeof(struct RICserviceUpdateAcknowledge),
+	offsetof(struct RICserviceUpdateAcknowledge, _asn_ctx),
+	asn_MAP_RICserviceUpdateAcknowledge_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateAcknowledge = {
+	"RICserviceUpdateAcknowledge",
+	"RICserviceUpdateAcknowledge",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdateAcknowledge_tags_1,
+	sizeof(asn_DEF_RICserviceUpdateAcknowledge_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdateAcknowledge_tags_1[0]), /* 1 */
+	asn_DEF_RICserviceUpdateAcknowledge_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdateAcknowledge_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdateAcknowledge_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdateAcknowledge_1,
+	1,	/* Elements count */
+	&asn_SPC_RICserviceUpdateAcknowledge_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICserviceUpdateFailure.c b/e2ap/lib/RICserviceUpdateFailure.c
new file mode 100644
index 0000000..f54da69
--- /dev/null
+++ b/e2ap/lib/RICserviceUpdateFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICserviceUpdateFailure.h"
+
+static asn_TYPE_member_t asn_MBR_RICserviceUpdateFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICserviceUpdateFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P18,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICserviceUpdateFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICserviceUpdateFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICserviceUpdateFailure_specs_1 = {
+	sizeof(struct RICserviceUpdateFailure),
+	offsetof(struct RICserviceUpdateFailure, _asn_ctx),
+	asn_MAP_RICserviceUpdateFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICserviceUpdateFailure = {
+	"RICserviceUpdateFailure",
+	"RICserviceUpdateFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICserviceUpdateFailure_tags_1,
+	sizeof(asn_DEF_RICserviceUpdateFailure_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdateFailure_tags_1[0]), /* 1 */
+	asn_DEF_RICserviceUpdateFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICserviceUpdateFailure_tags_1)
+		/sizeof(asn_DEF_RICserviceUpdateFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICserviceUpdateFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_RICserviceUpdateFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionDeleteFailure.c b/e2ap/lib/RICsubscriptionDeleteFailure.c
new file mode 100644
index 0000000..88a9836
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionDeleteFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionDeleteFailure.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P5,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteFailure_specs_1 = {
+	sizeof(struct RICsubscriptionDeleteFailure),
+	offsetof(struct RICsubscriptionDeleteFailure, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteFailure = {
+	"RICsubscriptionDeleteFailure",
+	"RICsubscriptionDeleteFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteFailure_tags_1,
+	sizeof(asn_DEF_RICsubscriptionDeleteFailure_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteFailure_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteFailure_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionDeleteRequest.c b/e2ap/lib/RICsubscriptionDeleteRequest.c
new file mode 100644
index 0000000..627f516
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionDeleteRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionDeleteRequest.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P3,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteRequest_specs_1 = {
+	sizeof(struct RICsubscriptionDeleteRequest),
+	offsetof(struct RICsubscriptionDeleteRequest, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteRequest = {
+	"RICsubscriptionDeleteRequest",
+	"RICsubscriptionDeleteRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteRequest_tags_1,
+	sizeof(asn_DEF_RICsubscriptionDeleteRequest_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteRequest_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteRequest_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionDeleteResponse.c b/e2ap/lib/RICsubscriptionDeleteResponse.c
new file mode 100644
index 0000000..fc0f72d
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionDeleteResponse.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionDeleteResponse.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionDeleteResponse_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDeleteResponse, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P4,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDeleteResponse_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDeleteResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDeleteResponse_specs_1 = {
+	sizeof(struct RICsubscriptionDeleteResponse),
+	offsetof(struct RICsubscriptionDeleteResponse, _asn_ctx),
+	asn_MAP_RICsubscriptionDeleteResponse_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionDeleteResponse = {
+	"RICsubscriptionDeleteResponse",
+	"RICsubscriptionDeleteResponse",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDeleteResponse_tags_1,
+	sizeof(asn_DEF_RICsubscriptionDeleteResponse_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteResponse_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionDeleteResponse_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDeleteResponse_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDeleteResponse_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDeleteResponse_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionDeleteResponse_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionDetails.c b/e2ap/lib/RICsubscriptionDetails.c
new file mode 100644
index 0000000..9033dc2
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionDetails.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionDetails.h"
+
+asn_TYPE_member_t asn_MBR_RICsubscriptionDetails_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDetails, ricEventTriggerDefinition),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICeventTriggerDefinition,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricEventTriggerDefinition"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionDetails, ricAction_ToBeSetup_List),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICactions_ToBeSetup_List,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricAction-ToBeSetup-List"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionDetails_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionDetails_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricEventTriggerDefinition */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ricAction-ToBeSetup-List */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionDetails_specs_1 = {
+	sizeof(struct RICsubscriptionDetails),
+	offsetof(struct RICsubscriptionDetails, _asn_ctx),
+	asn_MAP_RICsubscriptionDetails_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_RICsubscriptionDetails = {
+	"RICsubscriptionDetails",
+	"RICsubscriptionDetails",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionDetails_tags_1,
+	sizeof(asn_DEF_RICsubscriptionDetails_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDetails_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionDetails_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionDetails_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionDetails_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionDetails_1,
+	2,	/* Elements count */
+	&asn_SPC_RICsubscriptionDetails_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionFailure.c b/e2ap/lib/RICsubscriptionFailure.c
new file mode 100644
index 0000000..f765319
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionFailure.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionFailure.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionFailure_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionFailure, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P2,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionFailure_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionFailure_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionFailure_specs_1 = {
+	sizeof(struct RICsubscriptionFailure),
+	offsetof(struct RICsubscriptionFailure, _asn_ctx),
+	asn_MAP_RICsubscriptionFailure_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionFailure = {
+	"RICsubscriptionFailure",
+	"RICsubscriptionFailure",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionFailure_tags_1,
+	sizeof(asn_DEF_RICsubscriptionFailure_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionFailure_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionFailure_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionFailure_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionFailure_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionFailure_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionFailure_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionRequest.c b/e2ap/lib/RICsubscriptionRequest.c
new file mode 100644
index 0000000..46c4fe8
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionRequest.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P0,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionRequest_specs_1 = {
+	sizeof(struct RICsubscriptionRequest),
+	offsetof(struct RICsubscriptionRequest, _asn_ctx),
+	asn_MAP_RICsubscriptionRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionRequest = {
+	"RICsubscriptionRequest",
+	"RICsubscriptionRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionRequest_tags_1,
+	sizeof(asn_DEF_RICsubscriptionRequest_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionRequest_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionRequest_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubscriptionResponse.c b/e2ap/lib/RICsubscriptionResponse.c
new file mode 100644
index 0000000..56c92ae
--- /dev/null
+++ b/e2ap/lib/RICsubscriptionResponse.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubscriptionResponse.h"
+
+static asn_TYPE_member_t asn_MBR_RICsubscriptionResponse_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubscriptionResponse, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P1,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubscriptionResponse_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubscriptionResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_RICsubscriptionResponse_specs_1 = {
+	sizeof(struct RICsubscriptionResponse),
+	offsetof(struct RICsubscriptionResponse, _asn_ctx),
+	asn_MAP_RICsubscriptionResponse_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubscriptionResponse = {
+	"RICsubscriptionResponse",
+	"RICsubscriptionResponse",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubscriptionResponse_tags_1,
+	sizeof(asn_DEF_RICsubscriptionResponse_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionResponse_tags_1[0]), /* 1 */
+	asn_DEF_RICsubscriptionResponse_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubscriptionResponse_tags_1)
+		/sizeof(asn_DEF_RICsubscriptionResponse_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubscriptionResponse_1,
+	1,	/* Elements count */
+	&asn_SPC_RICsubscriptionResponse_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubsequentAction.c b/e2ap/lib/RICsubsequentAction.c
new file mode 100644
index 0000000..8b3248c
--- /dev/null
+++ b/e2ap/lib/RICsubsequentAction.c
@@ -0,0 +1,60 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubsequentAction.h"
+
+asn_TYPE_member_t asn_MBR_RICsubsequentAction_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubsequentAction, ricSubsequentActionType),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICsubsequentActionType,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricSubsequentActionType"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct RICsubsequentAction, ricTimeToWait),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_RICtimeToWait,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ricTimeToWait"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_RICsubsequentAction_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_RICsubsequentAction_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricSubsequentActionType */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ricTimeToWait */
+};
+asn_SEQUENCE_specifics_t asn_SPC_RICsubsequentAction_specs_1 = {
+	sizeof(struct RICsubsequentAction),
+	offsetof(struct RICsubsequentAction, _asn_ctx),
+	asn_MAP_RICsubsequentAction_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_RICsubsequentAction = {
+	"RICsubsequentAction",
+	"RICsubsequentAction",
+	&asn_OP_SEQUENCE,
+	asn_DEF_RICsubsequentAction_tags_1,
+	sizeof(asn_DEF_RICsubsequentAction_tags_1)
+		/sizeof(asn_DEF_RICsubsequentAction_tags_1[0]), /* 1 */
+	asn_DEF_RICsubsequentAction_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubsequentAction_tags_1)
+		/sizeof(asn_DEF_RICsubsequentAction_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_RICsubsequentAction_1,
+	2,	/* Elements count */
+	&asn_SPC_RICsubsequentAction_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICsubsequentActionType.c b/e2ap/lib/RICsubsequentActionType.c
new file mode 100644
index 0000000..f88a331
--- /dev/null
+++ b/e2ap/lib/RICsubsequentActionType.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICsubsequentActionType.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICsubsequentActionType_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICsubsequentActionType_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICsubsequentActionType_value2enum_1[] = {
+	{ 0,	8,	"continue" },
+	{ 1,	4,	"wait" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICsubsequentActionType_enum2value_1[] = {
+	0,	/* continue(0) */
+	1	/* wait(1) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICsubsequentActionType_specs_1 = {
+	asn_MAP_RICsubsequentActionType_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICsubsequentActionType_enum2value_1,	/* N => "tag"; sorted by N */
+	2,	/* Number of elements in the maps */
+	3,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICsubsequentActionType_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICsubsequentActionType = {
+	"RICsubsequentActionType",
+	"RICsubsequentActionType",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICsubsequentActionType_tags_1,
+	sizeof(asn_DEF_RICsubsequentActionType_tags_1)
+		/sizeof(asn_DEF_RICsubsequentActionType_tags_1[0]), /* 1 */
+	asn_DEF_RICsubsequentActionType_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICsubsequentActionType_tags_1)
+		/sizeof(asn_DEF_RICsubsequentActionType_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICsubsequentActionType_constr_1, &asn_PER_type_RICsubsequentActionType_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICsubsequentActionType_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/RICtimeToWait.c b/e2ap/lib/RICtimeToWait.c
new file mode 100644
index 0000000..94fc184
--- /dev/null
+++ b/e2ap/lib/RICtimeToWait.c
@@ -0,0 +1,90 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "RICtimeToWait.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_RICtimeToWait_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_RICtimeToWait_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  5,  5,  0,  17 }	/* (0..17,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_RICtimeToWait_value2enum_1[] = {
+	{ 0,	4,	"zero" },
+	{ 1,	4,	"w1ms" },
+	{ 2,	4,	"w2ms" },
+	{ 3,	4,	"w5ms" },
+	{ 4,	5,	"w10ms" },
+	{ 5,	5,	"w20ms" },
+	{ 6,	5,	"w30ms" },
+	{ 7,	5,	"w40ms" },
+	{ 8,	5,	"w50ms" },
+	{ 9,	6,	"w100ms" },
+	{ 10,	6,	"w200ms" },
+	{ 11,	6,	"w500ms" },
+	{ 12,	3,	"w1s" },
+	{ 13,	3,	"w2s" },
+	{ 14,	3,	"w5s" },
+	{ 15,	4,	"w10s" },
+	{ 16,	4,	"w20s" },
+	{ 17,	4,	"w60s" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_RICtimeToWait_enum2value_1[] = {
+	9,	/* w100ms(9) */
+	4,	/* w10ms(4) */
+	15,	/* w10s(15) */
+	1,	/* w1ms(1) */
+	12,	/* w1s(12) */
+	10,	/* w200ms(10) */
+	5,	/* w20ms(5) */
+	16,	/* w20s(16) */
+	2,	/* w2ms(2) */
+	13,	/* w2s(13) */
+	6,	/* w30ms(6) */
+	7,	/* w40ms(7) */
+	11,	/* w500ms(11) */
+	8,	/* w50ms(8) */
+	3,	/* w5ms(3) */
+	14,	/* w5s(14) */
+	17,	/* w60s(17) */
+	0	/* zero(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_RICtimeToWait_specs_1 = {
+	asn_MAP_RICtimeToWait_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_RICtimeToWait_enum2value_1,	/* N => "tag"; sorted by N */
+	18,	/* Number of elements in the maps */
+	19,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_RICtimeToWait_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_RICtimeToWait = {
+	"RICtimeToWait",
+	"RICtimeToWait",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_RICtimeToWait_tags_1,
+	sizeof(asn_DEF_RICtimeToWait_tags_1)
+		/sizeof(asn_DEF_RICtimeToWait_tags_1[0]), /* 1 */
+	asn_DEF_RICtimeToWait_tags_1,	/* Same as above */
+	sizeof(asn_DEF_RICtimeToWait_tags_1)
+		/sizeof(asn_DEF_RICtimeToWait_tags_1[0]), /* 1 */
+	{ &asn_OER_type_RICtimeToWait_constr_1, &asn_PER_type_RICtimeToWait_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_RICtimeToWait_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ResetRequest.c b/e2ap/lib/ResetRequest.c
new file mode 100644
index 0000000..f40779f
--- /dev/null
+++ b/e2ap/lib/ResetRequest.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ResetRequest.h"
+
+static asn_TYPE_member_t asn_MBR_ResetRequest_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetRequest, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P14,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResetRequest_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResetRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ResetRequest_specs_1 = {
+	sizeof(struct ResetRequest),
+	offsetof(struct ResetRequest, _asn_ctx),
+	asn_MAP_ResetRequest_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResetRequest = {
+	"ResetRequest",
+	"ResetRequest",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResetRequest_tags_1,
+	sizeof(asn_DEF_ResetRequest_tags_1)
+		/sizeof(asn_DEF_ResetRequest_tags_1[0]), /* 1 */
+	asn_DEF_ResetRequest_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ResetRequest_tags_1)
+		/sizeof(asn_DEF_ResetRequest_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResetRequest_1,
+	1,	/* Elements count */
+	&asn_SPC_ResetRequest_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/ResetResponse.c b/e2ap/lib/ResetResponse.c
new file mode 100644
index 0000000..47c433a
--- /dev/null
+++ b/e2ap/lib/ResetResponse.c
@@ -0,0 +1,50 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Contents"
+ * 	found in "E2AP-PDU-Contents-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "ResetResponse.h"
+
+static asn_TYPE_member_t asn_MBR_ResetResponse_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct ResetResponse, protocolIEs),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProtocolIE_Container_87P15,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"protocolIEs"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_ResetResponse_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ResetResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ResetResponse_specs_1 = {
+	sizeof(struct ResetResponse),
+	offsetof(struct ResetResponse, _asn_ctx),
+	asn_MAP_ResetResponse_tag2el_1,
+	1,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_ResetResponse = {
+	"ResetResponse",
+	"ResetResponse",
+	&asn_OP_SEQUENCE,
+	asn_DEF_ResetResponse_tags_1,
+	sizeof(asn_DEF_ResetResponse_tags_1)
+		/sizeof(asn_DEF_ResetResponse_tags_1[0]), /* 1 */
+	asn_DEF_ResetResponse_tags_1,	/* Same as above */
+	sizeof(asn_DEF_ResetResponse_tags_1)
+		/sizeof(asn_DEF_ResetResponse_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_ResetResponse_1,
+	1,	/* Elements count */
+	&asn_SPC_ResetResponse_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/SuccessfulOutcome.c b/e2ap/lib/SuccessfulOutcome.c
new file mode 100644
index 0000000..7328b32
--- /dev/null
+++ b/e2ap/lib/SuccessfulOutcome.c
@@ -0,0 +1,368 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "SuccessfulOutcome.h"
+
+static const long asn_VAL_1_id_RICsubscription = 8;
+static const long asn_VAL_1_reject = 0;
+static const long asn_VAL_2_id_RICsubscriptionDelete = 9;
+static const long asn_VAL_2_reject = 0;
+static const long asn_VAL_3_id_RICserviceUpdate = 7;
+static const long asn_VAL_3_reject = 0;
+static const long asn_VAL_4_id_RICcontrol = 4;
+static const long asn_VAL_4_reject = 0;
+static const long asn_VAL_5_id_E2setup = 1;
+static const long asn_VAL_5_reject = 0;
+static const long asn_VAL_6_id_Reset = 3;
+static const long asn_VAL_6_reject = 0;
+static const long asn_VAL_7_id_RICindication = 5;
+static const long asn_VAL_7_ignore = 1;
+static const long asn_VAL_8_id_RICserviceQuery = 6;
+static const long asn_VAL_8_ignore = 1;
+static const long asn_VAL_9_id_ErrorIndication = 2;
+static const long asn_VAL_9_ignore = 1;
+static const asn_ioc_cell_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_1_id_RICsubscription },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionDeleteRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_2_id_RICsubscriptionDelete },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceUpdate },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_3_id_RICserviceUpdate },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICcontrolRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_4_id_RICcontrol },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_E2setupRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_E2setupResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2setupFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_5_id_E2setup },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ResetRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_ResetResponse },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_6_id_Reset },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICindication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_7_id_RICindication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceQuery },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_8_id_RICserviceQuery },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ErrorIndication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_9_id_ErrorIndication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore }
+};
+static const asn_ioc_set_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1[] = {
+	{ 9, 5, asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows }
+};
+static int
+memb_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_SuccessfulOutcome_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 4; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SuccessfulOutcome, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_SuccessfulOutcome_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 1; /* &SuccessfulOutcome */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SuccessfulOutcome, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_oer_constraints_t asn_OER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_value_4[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICsubscriptionResponse),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionResponse,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionResponse"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICsubscriptionDeleteResponse),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteResponse,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionDeleteResponse"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICserviceUpdateAcknowledge),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdateAcknowledge,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICserviceUpdateAcknowledge"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICcontrolAcknowledge),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolAcknowledge,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolAcknowledge"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.E2setupResponse),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupResponse,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"E2setupResponse"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.ResetResponse),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_ResetResponse,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"ResetResponse"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 5 }, /* RICsubscriptionResponse */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 4 }, /* RICsubscriptionDeleteResponse */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 3 }, /* RICserviceUpdateAcknowledge */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 2 }, /* RICcontrolAcknowledge */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 1 }, /* E2setupResponse */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 5, -5, 0 } /* ResetResponse */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
+	sizeof(struct SuccessfulOutcome__value),
+	offsetof(struct SuccessfulOutcome__value, _asn_ctx),
+	offsetof(struct SuccessfulOutcome__value, present),
+	sizeof(((struct SuccessfulOutcome__value *)0)->present),
+	asn_MAP_value_tag2el_4,
+	6,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_4 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_4,
+	6,	/* Elements count */
+	&asn_SPC_value_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_SuccessfulOutcome_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, procedureCode),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProcedureCode,
+		0,
+		{ &asn_OER_memb_procedureCode_constr_2, &asn_PER_memb_procedureCode_constr_2,  memb_procedureCode_constraint_1 },
+		0, 0, /* No default value */
+		"procedureCode"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, criticality),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		select_SuccessfulOutcome_criticality_type,
+		{ &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, value),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_value_4,
+		select_SuccessfulOutcome_value_type,
+		{ &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_SuccessfulOutcome_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SuccessfulOutcome_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SuccessfulOutcome_specs_1 = {
+	sizeof(struct SuccessfulOutcome),
+	offsetof(struct SuccessfulOutcome, _asn_ctx),
+	asn_MAP_SuccessfulOutcome_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_SuccessfulOutcome = {
+	"SuccessfulOutcome",
+	"SuccessfulOutcome",
+	&asn_OP_SEQUENCE,
+	asn_DEF_SuccessfulOutcome_tags_1,
+	sizeof(asn_DEF_SuccessfulOutcome_tags_1)
+		/sizeof(asn_DEF_SuccessfulOutcome_tags_1[0]), /* 1 */
+	asn_DEF_SuccessfulOutcome_tags_1,	/* Same as above */
+	sizeof(asn_DEF_SuccessfulOutcome_tags_1)
+		/sizeof(asn_DEF_SuccessfulOutcome_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_SuccessfulOutcome_1,
+	3,	/* Elements count */
+	&asn_SPC_SuccessfulOutcome_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/TimeToWait.c b/e2ap/lib/TimeToWait.c
new file mode 100644
index 0000000..a969d55
--- /dev/null
+++ b/e2ap/lib/TimeToWait.c
@@ -0,0 +1,66 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "TimeToWait.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_TimeToWait_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_TimeToWait_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  5 }	/* (0..5,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_TimeToWait_value2enum_1[] = {
+	{ 0,	3,	"v1s" },
+	{ 1,	3,	"v2s" },
+	{ 2,	3,	"v5s" },
+	{ 3,	4,	"v10s" },
+	{ 4,	4,	"v20s" },
+	{ 5,	4,	"v60s" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_TimeToWait_enum2value_1[] = {
+	3,	/* v10s(3) */
+	0,	/* v1s(0) */
+	4,	/* v20s(4) */
+	1,	/* v2s(1) */
+	2,	/* v5s(2) */
+	5	/* v60s(5) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_TimeToWait_specs_1 = {
+	asn_MAP_TimeToWait_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_TimeToWait_enum2value_1,	/* N => "tag"; sorted by N */
+	6,	/* Number of elements in the maps */
+	7,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_TimeToWait_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TimeToWait = {
+	"TimeToWait",
+	"TimeToWait",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_TimeToWait_tags_1,
+	sizeof(asn_DEF_TimeToWait_tags_1)
+		/sizeof(asn_DEF_TimeToWait_tags_1[0]), /* 1 */
+	asn_DEF_TimeToWait_tags_1,	/* Same as above */
+	sizeof(asn_DEF_TimeToWait_tags_1)
+		/sizeof(asn_DEF_TimeToWait_tags_1[0]), /* 1 */
+	{ &asn_OER_type_TimeToWait_constr_1, &asn_PER_type_TimeToWait_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_TimeToWait_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/TriggeringMessage.c b/e2ap/lib/TriggeringMessage.c
new file mode 100644
index 0000000..7d1dbe8
--- /dev/null
+++ b/e2ap/lib/TriggeringMessage.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-CommonDataTypes"
+ * 	found in "E2AP-CommonDataTypes-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#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,	21,	"unsuccessfull-outcome" }
+};
+static const unsigned int asn_MAP_TriggeringMessage_enum2value_1[] = {
+	0,	/* initiating-message(0) */
+	1,	/* successful-outcome(1) */
+	2	/* unsuccessfull-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 */
+};
+
diff --git a/e2ap/lib/TypeOfError.c b/e2ap/lib/TypeOfError.c
new file mode 100644
index 0000000..e37ab6b
--- /dev/null
+++ b/e2ap/lib/TypeOfError.c
@@ -0,0 +1,58 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-IEs"
+ * 	found in "E2AP-IEs-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "TypeOfError.h"
+
+/*
+ * This type is implemented using NativeEnumerated,
+ * so here we adjust the DEF accordingly.
+ */
+static asn_oer_constraints_t asn_OER_type_TypeOfError_constr_1 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+asn_per_constraints_t asn_PER_type_TypeOfError_constr_1 CC_NOTUSED = {
+	{ APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }	/* (0..1,...) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static const asn_INTEGER_enum_map_t asn_MAP_TypeOfError_value2enum_1[] = {
+	{ 0,	14,	"not-understood" },
+	{ 1,	7,	"missing" }
+	/* This list is extensible */
+};
+static const unsigned int asn_MAP_TypeOfError_enum2value_1[] = {
+	1,	/* missing(1) */
+	0	/* not-understood(0) */
+	/* This list is extensible */
+};
+const asn_INTEGER_specifics_t asn_SPC_TypeOfError_specs_1 = {
+	asn_MAP_TypeOfError_value2enum_1,	/* "tag" => N; sorted by tag */
+	asn_MAP_TypeOfError_enum2value_1,	/* N => "tag"; sorted by N */
+	2,	/* Number of elements in the maps */
+	3,	/* Extensions before this member */
+	1,	/* Strict enumeration */
+	0,	/* Native long size */
+	0
+};
+static const ber_tlv_tag_t asn_DEF_TypeOfError_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_TypeOfError = {
+	"TypeOfError",
+	"TypeOfError",
+	&asn_OP_NativeEnumerated,
+	asn_DEF_TypeOfError_tags_1,
+	sizeof(asn_DEF_TypeOfError_tags_1)
+		/sizeof(asn_DEF_TypeOfError_tags_1[0]), /* 1 */
+	asn_DEF_TypeOfError_tags_1,	/* Same as above */
+	sizeof(asn_DEF_TypeOfError_tags_1)
+		/sizeof(asn_DEF_TypeOfError_tags_1[0]), /* 1 */
+	{ &asn_OER_type_TypeOfError_constr_1, &asn_PER_type_TypeOfError_constr_1, NativeEnumerated_constraint },
+	0, 0,	/* Defined elsewhere */
+	&asn_SPC_TypeOfError_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/UnsuccessfulOutcome.c b/e2ap/lib/UnsuccessfulOutcome.c
new file mode 100644
index 0000000..5c85aa8
--- /dev/null
+++ b/e2ap/lib/UnsuccessfulOutcome.c
@@ -0,0 +1,358 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "E2AP-PDU-Descriptions"
+ * 	found in "E2AP-PDU-Descriptions-v01.00.asn"
+ * 	`asn1c -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
+ */
+
+#include "UnsuccessfulOutcome.h"
+
+static const long asn_VAL_1_id_RICsubscription = 8;
+static const long asn_VAL_1_reject = 0;
+static const long asn_VAL_2_id_RICsubscriptionDelete = 9;
+static const long asn_VAL_2_reject = 0;
+static const long asn_VAL_3_id_RICserviceUpdate = 7;
+static const long asn_VAL_3_reject = 0;
+static const long asn_VAL_4_id_RICcontrol = 4;
+static const long asn_VAL_4_reject = 0;
+static const long asn_VAL_5_id_E2setup = 1;
+static const long asn_VAL_5_reject = 0;
+static const long asn_VAL_6_id_Reset = 3;
+static const long asn_VAL_6_reject = 0;
+static const long asn_VAL_7_id_RICindication = 5;
+static const long asn_VAL_7_ignore = 1;
+static const long asn_VAL_8_id_RICserviceQuery = 6;
+static const long asn_VAL_8_ignore = 1;
+static const long asn_VAL_9_id_ErrorIndication = 2;
+static const long asn_VAL_9_ignore = 1;
+static const asn_ioc_cell_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_1_id_RICsubscription },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionDeleteRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_2_id_RICsubscriptionDelete },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceUpdate },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_3_id_RICserviceUpdate },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICcontrolRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolAcknowledge },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_4_id_RICcontrol },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_E2setupRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_E2setupResponse },
+	{ "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2setupFailure },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_5_id_E2setup },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ResetRequest },
+	{ "&SuccessfulOutcome", aioc__type, &asn_DEF_ResetResponse },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_6_id_Reset },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICindication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_7_id_RICindication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceQuery },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_8_id_RICserviceQuery },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_ignore },
+	{ "&InitiatingMessage", aioc__type, &asn_DEF_ErrorIndication },
+	{ "&SuccessfulOutcome",  },
+	{ "&UnsuccessfulOutcome",  },
+	{ "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_9_id_ErrorIndication },
+	{ "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore }
+};
+static const asn_ioc_set_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1[] = {
+	{ 9, 5, asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows }
+};
+static int
+memb_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	long value;
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	value = *(const long *)sptr;
+	
+	if((value >= 0 && value <= 255)) {
+		/* Constraint check succeeded */
+		return 0;
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: constraint failed (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+static asn_type_selector_result_t
+select_UnsuccessfulOutcome_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 4; /* &criticality */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct UnsuccessfulOutcome, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_type_selector_result_t
+select_UnsuccessfulOutcome_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
+	asn_type_selector_result_t result = {0, 0};
+	const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
+	size_t constraining_column = 3; /* &procedureCode */
+	size_t for_column = 2; /* &UnsuccessfulOutcome */
+	size_t row, presence_index = 0;
+	const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct UnsuccessfulOutcome, procedureCode));
+	
+	for(row=0; row < itable->rows_count; row++) {
+	    const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
+	    const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
+	
+	    if(type_cell->cell_kind == aioc__undefined)
+	        continue;
+	
+	    presence_index++;
+	    if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
+	        result.type_descriptor = type_cell->type_descriptor;
+	        result.presence_index = presence_index;
+	        break;
+	    }
+	}
+	
+	return result;
+}
+
+static int
+memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
+			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+	
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+	
+	
+	if(1 /* No applicable constraints whatsoever */) {
+		/* Nothing is here. See below */
+	}
+	
+	return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
+}
+
+static asn_oer_constraints_t asn_OER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ 1, 1 }	/* (0..255) */,
+	-1};
+static asn_per_constraints_t asn_PER_memb_procedureCode_constr_2 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 8,  8,  0,  255 }	/* (0..255) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
+	{ APC_CONSTRAINED,	 2,  2,  0,  2 }	/* (0..2) */,
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
+	{ 0, 0 },
+	-1};
+static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	{ APC_UNCONSTRAINED,	-1, -1,  0,  0 },
+	0, 0	/* No PER value map */
+};
+static asn_TYPE_member_t asn_MBR_value_4[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.RICsubscriptionFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionFailure"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.RICsubscriptionDeleteFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICsubscriptionDeleteFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICsubscriptionDeleteFailure"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.RICserviceUpdateFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICserviceUpdateFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICserviceUpdateFailure"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.RICcontrolFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_RICcontrolFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"RICcontrolFailure"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome__value, choice.E2setupFailure),
+		(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+		0,
+		&asn_DEF_E2setupFailure,
+		0,
+		{ 0, 0, 0 },
+		0, 0, /* No default value */
+		"E2setupFailure"
+		},
+};
+static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 4 }, /* RICsubscriptionFailure */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 3 }, /* RICsubscriptionDeleteFailure */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 2 }, /* RICserviceUpdateFailure */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 1 }, /* RICcontrolFailure */
+    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 0 } /* E2setupFailure */
+};
+static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
+	sizeof(struct UnsuccessfulOutcome__value),
+	offsetof(struct UnsuccessfulOutcome__value, _asn_ctx),
+	offsetof(struct UnsuccessfulOutcome__value, present),
+	sizeof(((struct UnsuccessfulOutcome__value *)0)->present),
+	asn_MAP_value_tag2el_4,
+	5,	/* Count of tags in the map */
+	0, 0,
+	-1	/* Extensions start */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_value_4 = {
+	"value",
+	"value",
+	&asn_OP_OPEN_TYPE,
+	0,	/* No effective tags (pointer) */
+	0,	/* No effective tags (count) */
+	0,	/* No tags (pointer) */
+	0,	/* No tags (count) */
+	{ 0, 0, OPEN_TYPE_constraint },
+	asn_MBR_value_4,
+	5,	/* Elements count */
+	&asn_SPC_value_specs_4	/* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_UnsuccessfulOutcome_1[] = {
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome, procedureCode),
+		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_ProcedureCode,
+		0,
+		{ &asn_OER_memb_procedureCode_constr_2, &asn_PER_memb_procedureCode_constr_2,  memb_procedureCode_constraint_1 },
+		0, 0, /* No default value */
+		"procedureCode"
+		},
+	{ ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome, criticality),
+		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+		-1,	/* IMPLICIT tag at current level */
+		&asn_DEF_Criticality,
+		select_UnsuccessfulOutcome_criticality_type,
+		{ &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
+		0, 0, /* No default value */
+		"criticality"
+		},
+	{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct UnsuccessfulOutcome, value),
+		(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
+		+1,	/* EXPLICIT tag at current level */
+		&asn_DEF_value_4,
+		select_UnsuccessfulOutcome_value_type,
+		{ &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
+		0, 0, /* No default value */
+		"value"
+		},
+};
+static const ber_tlv_tag_t asn_DEF_UnsuccessfulOutcome_tags_1[] = {
+	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_UnsuccessfulOutcome_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
+    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
+    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
+};
+asn_SEQUENCE_specifics_t asn_SPC_UnsuccessfulOutcome_specs_1 = {
+	sizeof(struct UnsuccessfulOutcome),
+	offsetof(struct UnsuccessfulOutcome, _asn_ctx),
+	asn_MAP_UnsuccessfulOutcome_tag2el_1,
+	3,	/* Count of tags in the map */
+	0, 0, 0,	/* Optional elements (not needed) */
+	-1,	/* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_UnsuccessfulOutcome = {
+	"UnsuccessfulOutcome",
+	"UnsuccessfulOutcome",
+	&asn_OP_SEQUENCE,
+	asn_DEF_UnsuccessfulOutcome_tags_1,
+	sizeof(asn_DEF_UnsuccessfulOutcome_tags_1)
+		/sizeof(asn_DEF_UnsuccessfulOutcome_tags_1[0]), /* 1 */
+	asn_DEF_UnsuccessfulOutcome_tags_1,	/* Same as above */
+	sizeof(asn_DEF_UnsuccessfulOutcome_tags_1)
+		/sizeof(asn_DEF_UnsuccessfulOutcome_tags_1[0]), /* 1 */
+	{ 0, 0, SEQUENCE_constraint },
+	asn_MBR_UnsuccessfulOutcome_1,
+	3,	/* Elements count */
+	&asn_SPC_UnsuccessfulOutcome_specs_1	/* Additional specs */
+};
+
diff --git a/e2ap/lib/asn_SEQUENCE_OF.c b/e2ap/lib/asn_SEQUENCE_OF.c
new file mode 100644
index 0000000..ec952fc
--- /dev/null
+++ b/e2ap/lib/asn_SEQUENCE_OF.c
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_SEQUENCE_OF.h>
+
+typedef A_SEQUENCE_OF(void) asn_sequence;
+
+void
+asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) {
+	asn_sequence *as = (asn_sequence *)asn_sequence_of_x;
+
+	if(as) {
+		void *ptr;
+		int n;
+
+		if(number < 0 || number >= as->count)
+			return;	/* Nothing to delete */
+
+		if(_do_free && as->free) {
+			ptr = as->array[number];
+		} else {
+			ptr = 0;
+		}
+
+		/*
+		 * Shift all elements to the left to hide the gap.
+		 */
+		--as->count;
+		for(n = number; n < as->count; n++)
+			as->array[n] = as->array[n+1];
+
+		/*
+		 * Invoke the third-party function only when the state
+		 * of the parent structure is consistent.
+		 */
+		if(ptr) as->free(ptr);
+	}
+}
+
diff --git a/e2ap/lib/asn_SET_OF.c b/e2ap/lib/asn_SET_OF.c
new file mode 100644
index 0000000..944f2cb
--- /dev/null
+++ b/e2ap/lib/asn_SET_OF.c
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_SET_OF.h>
+#include <errno.h>
+
+/*
+ * Add another element into the set.
+ */
+int
+asn_set_add(void *asn_set_of_x, void *ptr) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as == 0 || ptr == 0) {
+		errno = EINVAL;		/* Invalid arguments */
+		return -1;
+	}
+
+	/*
+	 * Make sure there's enough space to insert an element.
+	 */
+	if(as->count == as->size) {
+		int _newsize = as->size ? (as->size << 1) : 4;
+		void *_new_arr;
+		_new_arr = REALLOC(as->array, _newsize * sizeof(as->array[0]));
+		if(_new_arr) {
+			as->array = (void **)_new_arr;
+			as->size = _newsize;
+		} else {
+			/* ENOMEM */
+			return -1;
+		}
+	}
+
+	as->array[as->count++] = ptr;
+
+	return 0;
+}
+
+void
+asn_set_del(void *asn_set_of_x, int number, int _do_free) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as) {
+		void *ptr;
+		if(number < 0 || number >= as->count)
+			return;
+
+		if(_do_free && as->free) {
+			ptr = as->array[number];
+		} else {
+			ptr = 0;
+		}
+
+		as->array[number] = as->array[--as->count];
+
+		/*
+		 * Invoke the third-party function only when the state
+		 * of the parent structure is consistent.
+		 */
+		if(ptr) as->free(ptr);
+	}
+}
+
+/*
+ * Free the contents of the set, do not free the set itself.
+ */
+void
+asn_set_empty(void *asn_set_of_x) {
+	asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
+
+	if(as) {
+		if(as->array) {
+			if(as->free) {
+				while(as->count--)
+					as->free(as->array[as->count]);
+			}
+			FREEMEM(as->array);
+			as->array = 0;
+		}
+		as->count = 0;
+		as->size = 0;
+	}
+
+}
+
diff --git a/e2ap/lib/asn_application.c b/e2ap/lib/asn_application.c
new file mode 100644
index 0000000..2bff460
--- /dev/null
+++ b/e2ap/lib/asn_application.c
@@ -0,0 +1,481 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_application.h>
+#include <errno.h>
+
+static asn_enc_rval_t asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
+                                          enum asn_transfer_syntax syntax,
+                                          const asn_TYPE_descriptor_t *td,
+                                          const void *sptr,
+                                          asn_app_consume_bytes_f *callback,
+                                          void *callback_key);
+
+
+struct callback_count_bytes_key {
+    asn_app_consume_bytes_f *callback;
+    void *callback_key;
+    size_t computed_size;
+};
+
+/*
+ * Encoder which just counts bytes that come through it.
+ */
+static int
+callback_count_bytes_cb(const void *data, size_t size, void *keyp) {
+    struct callback_count_bytes_key *key = keyp;
+    int ret;
+
+    ret = key->callback(data, size, key->callback_key);
+    if(ret >= 0) {
+        key->computed_size += size;
+    }
+
+    return ret;
+}
+
+struct overrun_encoder_key {
+    void *buffer;
+    size_t buffer_size;
+    size_t computed_size;
+};
+
+struct dynamic_encoder_key {
+    void *buffer;
+    size_t buffer_size;
+    size_t computed_size;
+};
+
+struct callback_failure_catch_key {
+    asn_app_consume_bytes_f *callback;
+    void *callback_key;
+    int callback_failed;
+};
+
+/*
+ * Encoder which doesn't stop counting bytes
+ * even if it reaches the end of the buffer.
+ */
+static int
+overrun_encoder_cb(const void *data, size_t size, void *keyp) {
+    struct overrun_encoder_key *key = keyp;
+
+    if(key->computed_size + size > key->buffer_size) {
+        /*
+         * Avoid accident on the next call:
+         * stop adding bytes to the buffer.
+         */
+        key->buffer_size = 0;
+    } else {
+        memcpy((char *)key->buffer + key->computed_size, data, size);
+    }
+    key->computed_size += size;
+
+    return 0;
+}
+
+/*
+ * Encoder which dynamically allocates output, and continues
+ * to count even if allocation failed.
+ */
+static int
+dynamic_encoder_cb(const void *data, size_t size, void *keyp) {
+    struct dynamic_encoder_key *key = keyp;
+
+    if(key->buffer) {
+        if(key->computed_size + size >= key->buffer_size) {
+            void *p;
+            size_t new_size = key->buffer_size;
+
+            do {
+                new_size *= 2;
+            } while(new_size <= key->computed_size + size);
+
+            p = REALLOC(key->buffer, new_size);
+            if(p) {
+                key->buffer = p;
+                key->buffer_size = new_size;
+            } else {
+                FREEMEM(key->buffer);
+                key->buffer = 0;
+                key->buffer_size = 0;
+                key->computed_size += size;
+                return 0;
+            }
+        }
+        memcpy((char *)key->buffer + key->computed_size, data, size);
+    }
+
+    key->computed_size += size;
+
+    return 0;
+}
+
+/*
+ * Encoder which help convert the application level encoder failure into EIO.
+ */
+static int
+callback_failure_catch_cb(const void *data, size_t size, void *keyp) {
+    struct callback_failure_catch_key *key = keyp;
+    int ret;
+
+    ret = key->callback(data, size, key->callback_key);
+    if(ret < 0) {
+        key->callback_failed = 1;
+    }
+
+    return ret;
+}
+
+asn_enc_rval_t
+asn_encode(const asn_codec_ctx_t *opt_codec_ctx,
+           enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td,
+           const void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) {
+    struct callback_failure_catch_key cb_key;
+    asn_enc_rval_t er = {0,0,0};
+
+    if(!callback) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    cb_key.callback = callback;
+    cb_key.callback_key = callback_key;
+    cb_key.callback_failed = 0;
+
+    er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                             callback_failure_catch_cb, &cb_key);
+    if(cb_key.callback_failed) {
+        assert(er.encoded == -1);
+        assert(errno == EBADF);
+        errno = EIO;
+    }
+
+    return er;
+}
+
+asn_enc_rval_t
+asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_ctx,
+                     enum asn_transfer_syntax syntax,
+                     const asn_TYPE_descriptor_t *td, const void *sptr,
+                     void *buffer, size_t buffer_size) {
+    struct overrun_encoder_key buf_key;
+    asn_enc_rval_t er = {0,0,0};
+
+    if(buffer_size > 0 && !buffer) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    buf_key.buffer = buffer;
+    buf_key.buffer_size = buffer_size;
+    buf_key.computed_size = 0;
+
+    er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                             overrun_encoder_cb, &buf_key);
+
+    if(er.encoded >= 0 && (size_t)er.encoded != buf_key.computed_size) {
+        ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE
+                  " yet produced %" ASN_PRI_SIZE " bytes",
+                  er.encoded, buf_key.computed_size);
+        assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size);
+    }
+
+    return er;
+}
+
+asn_encode_to_new_buffer_result_t
+asn_encode_to_new_buffer(const asn_codec_ctx_t *opt_codec_ctx,
+                         enum asn_transfer_syntax syntax,
+                         const asn_TYPE_descriptor_t *td, const void *sptr) {
+    struct dynamic_encoder_key buf_key;
+    asn_encode_to_new_buffer_result_t res;
+
+    buf_key.buffer_size = 16;
+    buf_key.buffer = MALLOC(buf_key.buffer_size);
+    buf_key.computed_size = 0;
+
+    res.result = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
+                                     dynamic_encoder_cb, &buf_key);
+
+    if(res.result.encoded >= 0
+       && (size_t)res.result.encoded != buf_key.computed_size) {
+        ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE
+                  " yet produced %" ASN_PRI_SIZE " bytes",
+                  res.result.encoded, buf_key.computed_size);
+        assert(res.result.encoded < 0
+               || (size_t)res.result.encoded == buf_key.computed_size);
+    }
+
+    res.buffer = buf_key.buffer;
+
+    /* 0-terminate just in case. */
+    if(res.buffer) {
+        assert(buf_key.computed_size < buf_key.buffer_size);
+        ((char *)res.buffer)[buf_key.computed_size] = '\0';
+    }
+
+    return res;
+}
+
+static asn_enc_rval_t
+asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
+                    enum asn_transfer_syntax syntax,
+                    const asn_TYPE_descriptor_t *td, const void *sptr,
+                    asn_app_consume_bytes_f *callback, void *callback_key) {
+    asn_enc_rval_t er = {0,0,0};
+    enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL;
+
+    (void)opt_codec_ctx; /* Parameters are not checked on encode yet. */
+
+    if(!td || !sptr) {
+        errno = EINVAL;
+        ASN__ENCODE_FAILED;
+    }
+
+    switch(syntax) {
+    case ATS_NONSTANDARD_PLAINTEXT:
+        if(td->op->print_struct) {
+            struct callback_count_bytes_key cb_key;
+            cb_key.callback = callback;
+            cb_key.callback_key = callback_key;
+            cb_key.computed_size = 0;
+            if(td->op->print_struct(td, sptr, 1, callback_count_bytes_cb,
+                                    &cb_key)
+                   < 0
+               || callback_count_bytes_cb("\n", 1, &cb_key) < 0) {
+                errno = EBADF; /* Structure has incorrect form. */
+                er.encoded = -1;
+                er.failed_type = td;
+                er.structure_ptr = sptr;
+            } else {
+                er.encoded = cb_key.computed_size;
+                er.failed_type = 0;
+                er.structure_ptr = 0;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+
+    case ATS_RANDOM:
+        errno = ENOENT; /* Randomization doesn't make sense on output. */
+        ASN__ENCODE_FAILED;
+
+    case ATS_BER:
+        /* BER is a superset of DER. */
+        /* Fall through. */
+    case ATS_DER:
+        if(td->op->der_encoder) {
+            er = der_encode(td, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->der_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* DER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+    case ATS_CER:
+        errno = ENOENT; /* Transfer syntax is not defined for any type. */
+        ASN__ENCODE_FAILED;
+
+#ifdef  ASN_DISABLE_OER_SUPPORT
+    case ATS_BASIC_OER:
+    case ATS_CANONICAL_OER:
+        errno = ENOENT; /* PER is not defined. */
+        ASN__ENCODE_FAILED;
+        break;
+#else /* ASN_DISABLE_OER_SUPPORT */
+    case ATS_BASIC_OER:
+        /* CANONICAL-OER is a superset of BASIC-OER. */
+        /* Fall through. */
+    case ATS_CANONICAL_OER:
+        if(td->op->oer_encoder) {
+            er = oer_encode(td, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->oer_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* OER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+#endif /* ASN_DISABLE_OER_SUPPORT */
+
+#ifdef  ASN_DISABLE_PER_SUPPORT
+    case ATS_UNALIGNED_BASIC_PER:
+    case ATS_UNALIGNED_CANONICAL_PER:
+    case ATS_ALIGNED_BASIC_PER:
+    case ATS_ALIGNED_CANONICAL_PER:
+        errno = ENOENT; /* PER is not defined. */
+        ASN__ENCODE_FAILED;
+        break;
+#else /* ASN_DISABLE_PER_SUPPORT */
+    case ATS_UNALIGNED_BASIC_PER:
+        /* CANONICAL-UPER is a superset of BASIC-UPER. */
+        /* Fall through. */
+    case ATS_UNALIGNED_CANONICAL_PER:
+        if(td->op->uper_encoder) {
+            er = uper_encode(td, 0, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->uper_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* UPER is not defined for this type. */
+                }
+            } else {
+                ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+                if(er.encoded == 0) {
+                    /* Enforce "Complete Encoding" of X.691 #11.1 */
+                    if(callback("\0", 1, callback_key) < 0) {
+                        errno = EBADF;
+                        ASN__ENCODE_FAILED;
+                    }
+                    er.encoded = 8; /* Exactly 8 zero bits is added. */
+                }
+                /* Convert bits into bytes */
+                er.encoded = (er.encoded + 7) >> 3;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+    case ATS_ALIGNED_BASIC_PER:
+        /* CANONICAL-APER is a superset of BASIC-APER. */
+        /* Fall through. */
+    case ATS_ALIGNED_CANONICAL_PER:
+        if(td->op->aper_encoder) {
+            er = aper_encode(td, 0, sptr, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->aper_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* APER is not defined for this type. */
+                }
+            } else {
+                ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+                if(er.encoded == 0) {
+                    /* Enforce "Complete Encoding" of X.691 #11.1 */
+                    if(callback("\0", 1, callback_key) < 0) {
+                        errno = EBADF;
+                        ASN__ENCODE_FAILED;
+                    }
+                    er.encoded = 8; /* Exactly 8 zero bits is added. */
+                }
+                /* Convert bits into bytes */
+                er.encoded = (er.encoded + 7) >> 3;
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+    case ATS_BASIC_XER:
+        /* CANONICAL-XER is a superset of BASIC-XER. */
+        xer_flags &= ~XER_F_CANONICAL;
+        xer_flags |= XER_F_BASIC;
+        /* Fall through. */
+    case ATS_CANONICAL_XER:
+        if(td->op->xer_encoder) {
+            er = xer_encode(td, sptr, xer_flags, callback, callback_key);
+            if(er.encoded == -1) {
+                if(er.failed_type && er.failed_type->op->xer_encoder) {
+                    errno = EBADF;  /* Structure has incorrect form. */
+                } else {
+                    errno = ENOENT; /* XER is not defined for this type. */
+                }
+            }
+        } else {
+            errno = ENOENT; /* Transfer syntax is not defined for this type. */
+            ASN__ENCODE_FAILED;
+        }
+        break;
+
+    default:
+        errno = ENOENT;
+        ASN__ENCODE_FAILED;
+    }
+
+    return er;
+}
+
+asn_dec_rval_t
+asn_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td,
+           void **sptr, const void *buffer, size_t size) {
+    if(!td || !td->op || !sptr || (size && !buffer)) {
+        ASN__DECODE_FAILED;
+    }
+
+    switch(syntax) {
+    case ATS_CER:
+    case ATS_NONSTANDARD_PLAINTEXT:
+    default:
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+
+    case ATS_RANDOM:
+        if(!td->op->random_fill) {
+            ASN__DECODE_FAILED;
+        } else {
+            if(asn_random_fill(td, sptr, 16000) == 0) {
+                asn_dec_rval_t ret = {RC_OK, 0};
+                return ret;
+            } else {
+                ASN__DECODE_FAILED;
+            }
+        }
+        break;
+
+    case ATS_DER:
+    case ATS_BER:
+        return ber_decode(opt_codec_ctx, td, sptr, buffer, size);
+
+    case ATS_BASIC_OER:
+    case ATS_CANONICAL_OER:
+#ifdef  ASN_DISABLE_OER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return oer_decode(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_UNALIGNED_BASIC_PER:
+    case ATS_UNALIGNED_CANONICAL_PER:
+#ifdef  ASN_DISABLE_PER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_ALIGNED_BASIC_PER:
+    case ATS_ALIGNED_CANONICAL_PER:
+#ifdef  ASN_DISABLE_PER_SUPPORT
+        errno = ENOENT;
+        ASN__DECODE_FAILED;
+#else
+        return aper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
+#endif
+
+    case ATS_BASIC_XER:
+    case ATS_CANONICAL_XER:
+        return xer_decode(opt_codec_ctx, td, sptr, buffer, size);
+    }
+}
+
diff --git a/e2ap/lib/asn_bit_data.c b/e2ap/lib/asn_bit_data.c
new file mode 100644
index 0000000..fe4b89b
--- /dev/null
+++ b/e2ap/lib/asn_bit_data.c
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+#include <asn_bit_data.h>
+
+/*
+ * Create a contiguous non-refillable bit data structure.
+ * Can be freed by FREEMEM().
+ */
+asn_bit_data_t *
+asn_bit_data_new_contiguous(const void *data, size_t size_bits) {
+    size_t size_bytes = (size_bits + 7) / 8;
+    asn_bit_data_t *pd;
+    uint8_t *bytes;
+
+    /* Get the extensions map */
+    pd = CALLOC(1, sizeof(*pd) + size_bytes + 1);
+    if(!pd) {
+        return NULL;
+    }
+    bytes = (void *)(((char *)pd) + sizeof(*pd));
+    memcpy(bytes, data, size_bytes);
+    bytes[size_bytes] = 0;
+    pd->buffer = bytes;
+    pd->nboff = 0;
+    pd->nbits = size_bits;
+
+    return pd;
+}
+
+
+char *
+asn_bit_data_string(asn_bit_data_t *pd) {
+	static char buf[2][32];
+	static int n;
+	n = (n+1) % 2;
+    snprintf(buf[n], sizeof(buf[n]),
+             "{m=%" ASN_PRI_SIZE " span %" ASN_PRI_SIZE "[%" ASN_PRI_SIZE
+             "..%" ASN_PRI_SIZE "] (%" ASN_PRI_SIZE ")}",
+             pd->moved, ((uintptr_t)(pd->buffer) & 0xf), pd->nboff, pd->nbits,
+             pd->nbits - pd->nboff);
+    return buf[n];
+}
+
+void
+asn_get_undo(asn_bit_data_t *pd, int nbits) {
+	if((ssize_t)pd->nboff < nbits) {
+		assert((ssize_t)pd->nboff < nbits);
+	} else {
+		pd->nboff -= nbits;
+		pd->moved -= nbits;
+	}
+}
+
+/*
+ * Extract a small number of bits (<= 31) from the specified PER data pointer.
+ */
+int32_t
+asn_get_few_bits(asn_bit_data_t *pd, int nbits) {
+	size_t off;	/* Next after last bit offset */
+	ssize_t nleft;	/* Number of bits left in this stream */
+	uint32_t accum;
+	const uint8_t *buf;
+
+	if(nbits < 0)
+		return -1;
+
+	nleft = pd->nbits - pd->nboff;
+	if(nbits > nleft) {
+		int32_t tailv, vhead;
+		if(!pd->refill || nbits > 31) return -1;
+		/* Accumulate unused bytes before refill */
+		ASN_DEBUG("Obtain the rest %d bits (want %d)",
+			(int)nleft, (int)nbits);
+		tailv = asn_get_few_bits(pd, nleft);
+		if(tailv < 0) return -1;
+		/* Refill (replace pd contents with new data) */
+		if(pd->refill(pd))
+			return -1;
+		nbits -= nleft;
+		vhead = asn_get_few_bits(pd, nbits);
+		/* Combine the rest of previous pd with the head of new one */
+		tailv = (tailv << nbits) | vhead;  /* Could == -1 */
+		return tailv;
+	}
+
+	/*
+	 * Normalize position indicator.
+	 */
+	if(pd->nboff >= 8) {
+		pd->buffer += (pd->nboff >> 3);
+		pd->nbits  -= (pd->nboff & ~0x07);
+		pd->nboff  &= 0x07;
+	}
+	pd->moved += nbits;
+	pd->nboff += nbits;
+	off = pd->nboff;
+	buf = pd->buffer;
+
+	/*
+	 * Extract specified number of bits.
+	 */
+	if(off <= 8)
+		accum = nbits ? (buf[0]) >> (8 - off) : 0;
+	else if(off <= 16)
+		accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
+	else if(off <= 24)
+		accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
+	else if(off <= 31)
+		accum = (((uint32_t)buf[0] << 24) + (buf[1] << 16)
+			+ (buf[2] << 8) + (buf[3])) >> (32 - off);
+	else if(nbits <= 31) {
+		asn_bit_data_t tpd = *pd;
+		/* Here are we with our 31-bits limit plus 1..7 bits offset. */
+		asn_get_undo(&tpd, nbits);
+		/* The number of available bits in the stream allow
+		 * for the following operations to take place without
+		 * invoking the ->refill() function */
+		accum  = asn_get_few_bits(&tpd, nbits - 24) << 24;
+		accum |= asn_get_few_bits(&tpd, 24);
+	} else {
+		asn_get_undo(pd, nbits);
+		return -1;
+	}
+
+	accum &= (((uint32_t)1 << nbits) - 1);
+
+	ASN_DEBUG("  [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
+		(int)nbits, (int)nleft,
+		(int)pd->moved,
+		(((long)pd->buffer) & 0xf),
+		(int)pd->nboff, (int)pd->nbits,
+		((pd->buffer != NULL)?pd->buffer[0]:0),
+		(int)(pd->nbits - pd->nboff),
+		(int)accum);
+
+	return accum;
+}
+
+/*
+ * Extract a large number of bits from the specified PER data pointer.
+ */
+int
+asn_get_many_bits(asn_bit_data_t *pd, uint8_t *dst, int alright, int nbits) {
+	int32_t value;
+
+	if(alright && (nbits & 7)) {
+		/* Perform right alignment of a first few bits */
+		value = asn_get_few_bits(pd, nbits & 0x07);
+		if(value < 0) return -1;
+		*dst++ = value;	/* value is already right-aligned */
+		nbits &= ~7;
+	}
+
+	while(nbits) {
+		if(nbits >= 24) {
+			value = asn_get_few_bits(pd, 24);
+			if(value < 0) return -1;
+			*(dst++) = value >> 16;
+			*(dst++) = value >> 8;
+			*(dst++) = value;
+			nbits -= 24;
+		} else {
+			value = asn_get_few_bits(pd, nbits);
+			if(value < 0) return -1;
+			if(nbits & 7) {	/* implies left alignment */
+				value <<= 8 - (nbits & 7),
+				nbits += 8 - (nbits & 7);
+				if(nbits > 24)
+					*dst++ = value >> 24;
+			}
+			if(nbits > 16)
+				*dst++ = value >> 16;
+			if(nbits > 8)
+				*dst++ = value >> 8;
+			*dst++ = value;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+/*
+ * Put a small number of bits (<= 31).
+ */
+int
+asn_put_few_bits(asn_bit_outp_t *po, uint32_t bits, int obits) {
+	size_t off;	/* Next after last bit offset */
+	size_t omsk;	/* Existing last byte meaningful bits mask */
+	uint8_t *buf;
+
+	if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
+
+	ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
+			obits, (int)bits, (void *)po->buffer, (int)po->nboff);
+
+	/*
+	 * Normalize position indicator.
+	 */
+	if(po->nboff >= 8) {
+		po->buffer += (po->nboff >> 3);
+		po->nbits  -= (po->nboff & ~0x07);
+		po->nboff  &= 0x07;
+	}
+
+	/*
+	 * Flush whole-bytes output, if necessary.
+	 */
+	if(po->nboff + obits > po->nbits) {
+		size_t complete_bytes;
+		if(!po->buffer) po->buffer = po->tmpspace;
+		complete_bytes = (po->buffer - po->tmpspace);
+		ASN_DEBUG("[PER output %ld complete + %ld]",
+			(long)complete_bytes, (long)po->flushed_bytes);
+		if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0)
+			return -1;
+		if(po->nboff)
+			po->tmpspace[0] = po->buffer[0];
+		po->buffer = po->tmpspace;
+		po->nbits = 8 * sizeof(po->tmpspace);
+		po->flushed_bytes += complete_bytes;
+	}
+
+	/*
+	 * Now, due to sizeof(tmpspace), we are guaranteed large enough space.
+	 */
+	buf = po->buffer;
+	omsk = ~((1 << (8 - po->nboff)) - 1);
+	off = (po->nboff + obits);
+
+	/* Clear data of debris before meaningful bits */
+	bits &= (((uint32_t)1 << obits) - 1);
+
+	ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
+		(int)bits, (int)bits,
+		(int)po->nboff, (int)off,
+		buf[0], (int)(omsk&0xff),
+		(int)(buf[0] & omsk));
+
+	if(off <= 8)	/* Completely within 1 byte */
+		po->nboff = off,
+		bits <<= (8 - off),
+		buf[0] = (buf[0] & omsk) | bits;
+	else if(off <= 16)
+		po->nboff = off,
+		bits <<= (16 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 8),
+		buf[1] = bits;
+	else if(off <= 24)
+		po->nboff = off,
+		bits <<= (24 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 16),
+		buf[1] = bits >> 8,
+		buf[2] = bits;
+	else if(off <= 31)
+		po->nboff = off,
+		bits <<= (32 - off),
+		buf[0] = (buf[0] & omsk) | (bits >> 24),
+		buf[1] = bits >> 16,
+		buf[2] = bits >> 8,
+		buf[3] = bits;
+	else {
+		if(asn_put_few_bits(po, bits >> (obits - 24), 24)) return -1;
+		if(asn_put_few_bits(po, bits, obits - 24)) return -1;
+	}
+
+	ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
+		(int)bits, (int)bits, buf[0],
+		(long)(po->buffer - po->tmpspace));
+
+	return 0;
+}
+
+
+/*
+ * Output a large number of bits.
+ */
+int
+asn_put_many_bits(asn_bit_outp_t *po, const uint8_t *src, int nbits) {
+
+	while(nbits) {
+		uint32_t value;
+
+		if(nbits >= 24) {
+			value = (src[0] << 16) | (src[1] << 8) | src[2];
+			src += 3;
+			nbits -= 24;
+			if(asn_put_few_bits(po, value, 24))
+				return -1;
+		} else {
+			value = src[0];
+			if(nbits > 8)
+				value = (value << 8) | src[1];
+			if(nbits > 16)
+				value = (value << 8) | src[2];
+			if(nbits & 0x07)
+				value >>= (8 - (nbits & 0x07));
+			if(asn_put_few_bits(po, value, nbits))
+				return -1;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+
+int
+asn_put_aligned_flush(asn_bit_outp_t *po) {
+    uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07)));
+    size_t complete_bytes =
+        (po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3);
+
+    if(unused_bits) {
+        po->buffer[po->nboff >> 3] &= ~0u << unused_bits;
+    }
+
+    if(po->output(po->tmpspace, complete_bytes, po->op_key) < 0) {
+        return -1;
+    } else {
+        po->buffer = po->tmpspace;
+        po->nboff = 0;
+        po->nbits = 8 * sizeof(po->tmpspace);
+        po->flushed_bytes += complete_bytes;
+        return 0;
+    }
+}
+
diff --git a/e2ap/lib/asn_codecs_prim.c b/e2ap/lib/asn_codecs_prim.c
new file mode 100644
index 0000000..fc24247
--- /dev/null
+++ b/e2ap/lib/asn_codecs_prim.c
@@ -0,0 +1,317 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+#include <errno.h>
+
+/*
+ * Decode an always-primitive type.
+ */
+asn_dec_rval_t
+ber_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buf_ptr, size_t size, int tag_mode) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
+	asn_dec_rval_t rval;
+	ber_tlv_len_t length = 0; /* =0 to avoid [incorrect] warning. */
+
+	/*
+	 * If the structure is not there, allocate it.
+	 */
+	if(st == NULL) {
+		st = (ASN__PRIMITIVE_TYPE_t *)CALLOC(1, sizeof(*st));
+		if(st == NULL) ASN__DECODE_FAILED;
+		*sptr = (void *)st;
+	}
+
+	ASN_DEBUG("Decoding %s as plain primitive (tm=%d)",
+		td->name, tag_mode);
+
+	/*
+	 * Check tags and extract value length.
+	 */
+	rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
+			tag_mode, 0, &length, 0);
+	if(rval.code != RC_OK)
+		return rval;
+
+	ASN_DEBUG("%s length is %d bytes", td->name, (int)length);
+
+	/*
+	 * Make sure we have this length.
+	 */
+	buf_ptr = ((const char *)buf_ptr) + rval.consumed;
+	size -= rval.consumed;
+	if(length > (ber_tlv_len_t)size) {
+		rval.code = RC_WMORE;
+		rval.consumed = 0;
+		return rval;
+	}
+
+	st->size = (int)length;
+	/* The following better be optimized away. */
+	if(sizeof(st->size) != sizeof(length)
+			&& (ber_tlv_len_t)st->size != length) {
+		st->size = 0;
+		ASN__DECODE_FAILED;
+	}
+
+	st->buf = (uint8_t *)MALLOC(length + 1);
+	if(!st->buf) {
+		st->size = 0;
+		ASN__DECODE_FAILED;
+	}
+
+	memcpy(st->buf, buf_ptr, length);
+	st->buf[length] = '\0';		/* Just in case */
+
+	rval.code = RC_OK;
+	rval.consumed += length;
+
+	ASN_DEBUG("Took %ld/%ld bytes to encode %s",
+		(long)rval.consumed,
+		(long)length, td->name);
+
+	return rval;
+}
+
+/*
+ * Encode an always-primitive type using DER.
+ */
+asn_enc_rval_t
+der_encode_primitive(const asn_TYPE_descriptor_t *td, const void *sptr,
+                     int tag_mode, ber_tlv_tag_t tag,
+                     asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_enc_rval_t erval = {0,0,0};
+	const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr;
+
+	ASN_DEBUG("%s %s as a primitive type (tm=%d)",
+		cb?"Encoding":"Estimating", td->name, tag_mode);
+
+	erval.encoded = der_write_tags(td, st->size, tag_mode, 0, tag,
+		cb, app_key);
+	ASN_DEBUG("%s wrote tags %d", td->name, (int)erval.encoded);
+	if(erval.encoded == -1) {
+		erval.failed_type = td;
+		erval.structure_ptr = sptr;
+		return erval;
+	}
+
+	if(cb && st->buf) {
+		if(cb(st->buf, st->size, app_key) < 0) {
+			erval.encoded = -1;
+			erval.failed_type = td;
+			erval.structure_ptr = sptr;
+			return erval;
+		}
+	} else {
+		assert(st->buf || st->size == 0);
+	}
+
+	erval.encoded += st->size;
+	ASN__ENCODED_OK(erval);
+}
+
+void
+ASN__PRIMITIVE_TYPE_free(const asn_TYPE_descriptor_t *td, void *sptr,
+                         enum asn_struct_free_method method) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr;
+
+	if(!td || !sptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as a primitive type", td->name);
+
+	if(st->buf)
+		FREEMEM(st->buf);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(sptr, 0, sizeof(ASN__PRIMITIVE_TYPE_t));
+        break;
+    }
+}
+
+
+/*
+ * Local internal type passed around as an argument.
+ */
+struct xdp_arg_s {
+    const asn_TYPE_descriptor_t *type_descriptor;
+    void *struct_key;
+	xer_primitive_body_decoder_f *prim_body_decoder;
+	int decoded_something;
+	int want_more;
+};
+
+/*
+ * Since some kinds of primitive values can be encoded using value-specific
+ * tags (<MINUS-INFINITY>, <enum-element>, etc), the primitive decoder must
+ * be supplied with such tags to parse them as needed.
+ */
+static int
+xer_decode__unexpected_tag(void *key, const void *chunk_buf, size_t chunk_size) {
+	struct xdp_arg_s *arg = (struct xdp_arg_s *)key;
+	enum xer_pbd_rval bret;
+
+	/*
+	 * The chunk_buf is guaranteed to start at '<'.
+	 */
+	assert(chunk_size && ((const char *)chunk_buf)[0] == 0x3c);
+
+	/*
+	 * Decoding was performed once already. Prohibit doing it again.
+	 */
+	if(arg->decoded_something)
+		return -1;
+
+	bret = arg->prim_body_decoder(arg->type_descriptor,
+		arg->struct_key, chunk_buf, chunk_size);
+	switch(bret) {
+	case XPBD_SYSTEM_FAILURE:
+	case XPBD_DECODER_LIMIT:
+	case XPBD_BROKEN_ENCODING:
+		break;
+	case XPBD_BODY_CONSUMED:
+		/* Tag decoded successfully */
+		arg->decoded_something = 1;
+		/* Fall through */
+	case XPBD_NOT_BODY_IGNORE:	/* Safe to proceed further */
+		return 0;
+	}
+
+	return -1;
+}
+
+static ssize_t
+xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size, int have_more) {
+	struct xdp_arg_s *arg = (struct xdp_arg_s *)key;
+	enum xer_pbd_rval bret;
+	size_t lead_wsp_size;
+
+	if(arg->decoded_something) {
+		if(xer_whitespace_span(chunk_buf, chunk_size) == chunk_size) {
+			/*
+			 * Example:
+			 * "<INTEGER>123<!--/--> </INTEGER>"
+			 *                      ^- chunk_buf position.
+			 */
+			return chunk_size;
+		}
+		/*
+		 * Decoding was done once already. Prohibit doing it again.
+		 */
+		return -1;
+	}
+
+	if(!have_more) {
+		/*
+		 * If we've received something like "1", we can't really
+		 * tell whether it is really `1` or `123`, until we know
+		 * that there is no more data coming.
+		 * The have_more argument will be set to 1 once something
+		 * like this is available to the caller of this callback:
+		 * "1<tag_start..."
+		 */
+		arg->want_more = 1;
+		return -1;
+	}
+
+	lead_wsp_size = xer_whitespace_span(chunk_buf, chunk_size);
+	chunk_buf = (const char *)chunk_buf + lead_wsp_size;
+	chunk_size -= lead_wsp_size;
+
+	bret = arg->prim_body_decoder(arg->type_descriptor,
+		arg->struct_key, chunk_buf, chunk_size);
+	switch(bret) {
+	case XPBD_SYSTEM_FAILURE:
+	case XPBD_DECODER_LIMIT:
+	case XPBD_BROKEN_ENCODING:
+		break;
+	case XPBD_BODY_CONSUMED:
+		/* Tag decoded successfully */
+		arg->decoded_something = 1;
+		/* Fall through */
+	case XPBD_NOT_BODY_IGNORE:	/* Safe to proceed further */
+		return lead_wsp_size + chunk_size;
+	}
+
+	return -1;
+}
+
+
+asn_dec_rval_t
+xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     size_t struct_size, const char *opt_mname,
+                     const void *buf_ptr, size_t size,
+                     xer_primitive_body_decoder_f *prim_body_decoder) {
+    const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+	asn_struct_ctx_t s_ctx;
+	struct xdp_arg_s s_arg;
+	asn_dec_rval_t rc;
+
+	/*
+	 * Create the structure if does not exist.
+	 */
+	if(!*sptr) {
+		*sptr = CALLOC(1, struct_size);
+		if(!*sptr) ASN__DECODE_FAILED;
+	}
+
+	memset(&s_ctx, 0, sizeof(s_ctx));
+	s_arg.type_descriptor = td;
+	s_arg.struct_key = *sptr;
+	s_arg.prim_body_decoder = prim_body_decoder;
+	s_arg.decoded_something = 0;
+	s_arg.want_more = 0;
+
+	rc = xer_decode_general(opt_codec_ctx, &s_ctx, &s_arg,
+		xml_tag, buf_ptr, size,
+		xer_decode__unexpected_tag, xer_decode__primitive_body);
+	switch(rc.code) {
+	case RC_OK:
+		if(!s_arg.decoded_something) {
+			char ch;
+			ASN_DEBUG("Primitive body is not recognized, "
+				"supplying empty one");
+			/*
+			 * Decoding opportunity has come and gone.
+			 * Where's the result?
+			 * Try to feed with empty body, see if it eats it.
+			 */
+			if(prim_body_decoder(s_arg.type_descriptor,
+				s_arg.struct_key, &ch, 0)
+					!= XPBD_BODY_CONSUMED) {
+				/*
+				 * This decoder does not like empty stuff.
+				 */
+				ASN__DECODE_FAILED;
+			}
+		}
+		break;
+	case RC_WMORE:
+		/*
+		 * Redo the whole thing later.
+		 * We don't have a context to save intermediate parsing state.
+		 */
+		rc.consumed = 0;
+		break;
+	case RC_FAIL:
+		rc.consumed = 0;
+		if(s_arg.want_more)
+			rc.code = RC_WMORE;
+		else
+			ASN__DECODE_FAILED;
+		break;
+	}
+	return rc;
+}
+
diff --git a/e2ap/lib/asn_internal.c b/e2ap/lib/asn_internal.c
new file mode 100644
index 0000000..1aff95f
--- /dev/null
+++ b/e2ap/lib/asn_internal.c
@@ -0,0 +1,48 @@
+#include <asn_internal.h>
+
+ssize_t
+asn__format_to_callback(int (*cb)(const void *, size_t, void *key), void *key,
+                        const char *fmt, ...) {
+    char scratch[64];
+    char *buf = scratch;
+    size_t buf_size = sizeof(scratch);
+    int wrote;
+    int cb_ret;
+
+    do {
+        va_list args;
+        va_start(args, fmt);
+
+        wrote = vsnprintf(buf, buf_size, fmt, args);
+        if(wrote < (ssize_t)buf_size) {
+            if(wrote < 0) {
+                if(buf != scratch) FREEMEM(buf);
+		va_end(args);
+                return -1;
+            }
+            break;
+        }
+
+        buf_size <<= 1;
+        if(buf == scratch) {
+            buf = MALLOC(buf_size);
+            if(!buf) return -1;
+        } else {
+            void *p = REALLOC(buf, buf_size);
+            if(!p) {
+                FREEMEM(buf);
+                return -1;
+            }
+            buf = p;
+        }
+    } while(1);
+
+    cb_ret = cb(buf, wrote, key);
+    if(buf != scratch) FREEMEM(buf);
+    if(cb_ret < 0) {
+        return -1;
+    }
+
+    return wrote;
+}
+
diff --git a/e2ap/lib/asn_random_fill.c b/e2ap/lib/asn_random_fill.c
new file mode 100644
index 0000000..eb8ed8f
--- /dev/null
+++ b/e2ap/lib/asn_random_fill.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_random_fill.h>
+#include <constr_TYPE.h>
+
+int
+asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr,
+                size_t length) {
+
+    if(td && td->op->random_fill) {
+        asn_random_fill_result_t res =
+            td->op->random_fill(td, struct_ptr, 0, length);
+        return (res.code == ARFILL_OK) ? 0 : -1;
+    } else {
+        return -1;
+    }
+}
+
+static uintmax_t
+asn__intmax_range(intmax_t lb, intmax_t ub) {
+    assert(lb <= ub);
+    if((ub < 0) == (lb < 0)) {
+        return ub - lb;
+    } else if(lb < 0) {
+        return 1 + ((uintmax_t)ub + (uintmax_t)-(lb + 1));
+    } else {
+        assert(!"Unreachable");
+        return 0;
+    }
+}
+
+intmax_t
+asn_random_between(intmax_t lb, intmax_t rb) {
+    if(lb == rb) {
+        return lb;
+    } else {
+        const uintmax_t intmax_max = ((~(uintmax_t)0) >> 1);
+        uintmax_t range = asn__intmax_range(lb, rb);
+        uintmax_t value = 0;
+        uintmax_t got_entropy = 0;
+
+        assert(RAND_MAX > 0xffffff);    /* Seen 7ffffffd! */
+        assert(range < intmax_max);
+
+        for(; got_entropy < range;) {
+            got_entropy = (got_entropy << 24) | 0xffffff;
+#ifdef WIN32    //MCHECK
+            value = (value << 24) | (rand() % 0xffffff); 
+#else
+            value = (value << 24) | (random() % 0xffffff);
+#endif
+        }
+
+        return lb + (intmax_t)(value % (range + 1));
+    }
+}
diff --git a/e2ap/lib/ber_decoder.c b/e2ap/lib/ber_decoder.c
new file mode 100644
index 0000000..75d6016
--- /dev/null
+++ b/e2ap/lib/ber_decoder.c
@@ -0,0 +1,283 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {					\
+		size_t num = num_bytes;					\
+		ptr = ((const char *)ptr) + num;			\
+		size -= num;						\
+		consumed_myself += num;					\
+	} while(0)
+#undef	RETURN
+#define	RETURN(_code)	do {						\
+		asn_dec_rval_t rval;					\
+		rval.code = _code;					\
+		if(opt_ctx) opt_ctx->step = step; /* Save context */	\
+		if(_code == RC_OK || opt_ctx)				\
+			rval.consumed = consumed_myself;		\
+		else							\
+			rval.consumed = 0;	/* Context-free */	\
+		return rval;						\
+	} while(0)
+
+/*
+ * The BER decoder of any type.
+ */
+asn_dec_rval_t
+ber_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+           const void *ptr, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return type_descriptor->op->ber_decoder(opt_codec_ctx, type_descriptor,
+		struct_ptr,	/* Pointer to the destination structure */
+		ptr, size,	/* Buffer and its size */
+		0		/* Default tag mode is 0 */
+		);
+}
+
+/*
+ * Check the set of <TL<TL<TL...>>> tags matches the definition.
+ */
+asn_dec_rval_t
+ber_check_tags(const asn_codec_ctx_t *opt_codec_ctx,
+               const asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx,
+               const void *ptr, size_t size, int tag_mode, int last_tag_form,
+               ber_tlv_len_t *last_length, int *opt_tlv_form) {
+    ssize_t consumed_myself = 0;
+	ssize_t tag_len;
+	ssize_t len_len;
+	ber_tlv_tag_t tlv_tag;
+	ber_tlv_len_t tlv_len;
+	ber_tlv_len_t limit_len = -1;
+	int expect_00_terminators = 0;
+	int tlv_constr = -1;	/* If CHOICE, opt_tlv_form is not given */
+	int step = opt_ctx ? opt_ctx->step : 0;	/* Where we left previously */
+	int tagno;
+
+	/*
+	 * Make sure we didn't exceed the maximum stack size.
+	 */
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		RETURN(RC_FAIL);
+
+	/*
+	 * So what does all this implicit skip stuff mean?
+	 * Imagine two types,
+	 * 	A ::= [5] IMPLICIT	T
+	 * 	B ::= [2] EXPLICIT	T
+	 * Where T is defined as
+	 *	T ::= [4] IMPLICIT SEQUENCE { ... }
+	 * 
+	 * Let's say, we are starting to decode type A, given the
+	 * following TLV stream: <5> <0>. What does this mean?
+	 * It means that the type A contains type T which is,
+	 * in turn, empty.
+	 * Remember though, that we are still in A. We cannot
+	 * just pass control to the type T decoder. Why? Because
+	 * the type T decoder expects <4> <0>, not <5> <0>.
+	 * So, we must make sure we are going to receive <5> while
+	 * still in A, then pass control to the T decoder, indicating
+	 * that the tag <4> was implicitly skipped. The decoder of T
+	 * hence will be prepared to treat <4> as valid tag, and decode
+	 * it appropriately.
+	 */
+
+	tagno = step	/* Continuing where left previously */
+		+ (tag_mode==1?-1:0)
+		;
+	ASN_DEBUG("ber_check_tags(%s, size=%ld, tm=%d, step=%d, tagno=%d)",
+		td->name, (long)size, tag_mode, step, tagno);
+	/* assert(td->tags_count >= 1) May not be the case for CHOICE or ANY */
+
+	if(tag_mode == 0 && tagno == (int)td->tags_count) {
+		/*
+		 * This must be the _untagged_ ANY type,
+		 * which outermost tag isn't known in advance.
+		 * Fetch the tag and length separately.
+		 */
+		tag_len = ber_fetch_tag(ptr, size, &tlv_tag);
+		switch(tag_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+		tlv_constr = BER_TLV_CONSTRUCTED(ptr);
+		len_len = ber_fetch_length(tlv_constr,
+			(const char *)ptr + tag_len, size - tag_len, &tlv_len);
+		switch(len_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+		ASN_DEBUG("Advancing %ld in ANY case",
+			(long)(tag_len + len_len));
+		ADVANCE(tag_len + len_len);
+	} else {
+		assert(tagno < (int)td->tags_count);	/* At least one loop */
+	}
+	for((void)tagno; tagno < (int)td->tags_count; tagno++, step++) {
+
+		/*
+		 * Fetch and process T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, size, &tlv_tag);
+			ASN_DEBUG("Fetching tag from {%p,%ld}: "
+				"len %ld, step %d, tagno %d got %s",
+				ptr, (long)size,
+				(long)tag_len, step, tagno,
+				ber_tlv_tag_string(tlv_tag));
+		switch(tag_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		tlv_constr = BER_TLV_CONSTRUCTED(ptr);
+
+		/*
+		 * If {I}, don't check anything.
+		 * If {I,B,C}, check B and C unless we're at I.
+		 */
+		if(tag_mode != 0 && step == 0) {
+			/*
+			 * We don't expect tag to match here.
+			 * It's just because we don't know how the tag
+			 * is supposed to look like.
+			 */
+		} else {
+		    assert(tagno >= 0);	/* Guaranteed by the code above */
+		    if(tlv_tag != td->tags[tagno]) {
+			/*
+			 * Unexpected tag. Too bad.
+			 */
+		    	ASN_DEBUG("Expected: %s, "
+				"expectation failed (tn=%d, tm=%d)",
+				ber_tlv_tag_string(td->tags[tagno]),
+				tagno, tag_mode
+			);
+			RETURN(RC_FAIL);
+		    }
+		}
+
+		/*
+		 * Attention: if there are more tags expected,
+		 * ensure that the current tag is presented
+		 * in constructed form (it contains other tags!).
+		 * If this one is the last one, check that the tag form
+		 * matches the one given in descriptor.
+		 */
+		if(tagno < ((int)td->tags_count - 1)) {
+			if(tlv_constr == 0) {
+				ASN_DEBUG("tlv_constr = %d, expfail",
+					tlv_constr);
+				RETURN(RC_FAIL);
+			}
+		} else {
+			if(last_tag_form != tlv_constr
+			&& last_tag_form != -1) {
+				ASN_DEBUG("last_tag_form %d != %d",
+					last_tag_form, tlv_constr);
+				RETURN(RC_FAIL);
+			}
+		}
+
+		/*
+		 * Fetch and process L from TLV.
+		 */
+		len_len = ber_fetch_length(tlv_constr,
+			(const char *)ptr + tag_len, size - tag_len, &tlv_len);
+		ASN_DEBUG("Fetching len = %ld", (long)len_len);
+		switch(len_len) {
+		case -1: RETURN(RC_FAIL);
+		case 0: RETURN(RC_WMORE);
+		}
+
+		/*
+		 * FIXME
+		 * As of today, the chain of tags
+		 * must either contain several indefinite length TLVs,
+		 * or several definite length ones.
+		 * No mixing is allowed.
+		 */
+		if(tlv_len == -1) {
+			/*
+			 * Indefinite length.
+			 */
+			if(limit_len == -1) {
+				expect_00_terminators++;
+			} else {
+				ASN_DEBUG("Unexpected indefinite length "
+					"in a chain of definite lengths");
+				RETURN(RC_FAIL);
+			}
+			ADVANCE(tag_len + len_len);
+			continue;
+		} else {
+			if(expect_00_terminators) {
+				ASN_DEBUG("Unexpected definite length "
+					"in a chain of indefinite lengths");
+				RETURN(RC_FAIL);
+			}
+		}
+
+		/*
+		 * Check that multiple TLVs specify ever decreasing length,
+		 * which is consistent.
+		 */
+		if(limit_len == -1) {
+			limit_len    = tlv_len + tag_len + len_len;
+			if(limit_len < 0) {
+				/* Too great tlv_len value? */
+				RETURN(RC_FAIL);
+			}
+		} else if(limit_len != tlv_len + tag_len + len_len) {
+			/*
+			 * Inner TLV specifies length which is inconsistent
+			 * with the outer TLV's length value.
+			 */
+			ASN_DEBUG("Outer TLV is %ld and inner is %ld",
+				(long)limit_len, (long)tlv_len);
+			RETURN(RC_FAIL);
+		}
+
+		ADVANCE(tag_len + len_len);
+
+		limit_len -= (tag_len + len_len);
+		if((ssize_t)size > limit_len) {
+			/*
+			 * Make sure that we won't consume more bytes
+			 * from the parent frame than the inferred limit.
+			 */
+			size = limit_len;
+		}
+	}
+
+	if(opt_tlv_form)
+		*opt_tlv_form = tlv_constr;
+	if(expect_00_terminators)
+		*last_length = -expect_00_terminators;
+	else
+		*last_length = tlv_len;
+
+	RETURN(RC_OK);
+}
diff --git a/e2ap/lib/ber_tlv_length.c b/e2ap/lib/ber_tlv_length.c
new file mode 100644
index 0000000..0a0deec
--- /dev/null
+++ b/e2ap/lib/ber_tlv_length.c
@@ -0,0 +1,168 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <ber_tlv_length.h>
+#include <ber_tlv_tag.h>
+
+ssize_t
+ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
+		ber_tlv_len_t *len_r) {
+	const uint8_t *buf = (const uint8_t *)bufptr;
+	unsigned oct;
+
+	if(size == 0)
+		return 0;	/* Want more */
+
+	oct = *(const uint8_t *)buf;
+	if((oct & 0x80) == 0) {
+		/*
+		 * Short definite length.
+		 */
+		*len_r = oct;	/* & 0x7F */
+		return 1;
+	} else {
+		ber_tlv_len_t len;
+		size_t skipped;
+
+		if(_is_constructed && oct == 0x80) {
+			*len_r = -1;	/* Indefinite length */
+			return 1;
+		}
+
+		if(oct == 0xff) {
+			/* Reserved in standard for future use. */
+			return -1;
+		}
+
+		oct &= 0x7F;	/* Leave only the 7 LS bits */
+		for(len = 0, buf++, skipped = 1;
+			oct && (++skipped <= size); buf++, oct--) {
+
+			/* Verify that we won't overflow. */
+			if(!(len >> ((8 * sizeof(len)) - (8+1)))) {
+				len = (len << 8) | *buf;
+			} else {
+				/* Too large length value. */
+				return -1;
+			}
+		}
+
+		if(oct == 0) {
+			if(len < 0 || len > RSSIZE_MAX) {
+				/* Length value out of sane range. */
+				return -1;
+			}
+
+			*len_r = len;
+			return skipped;
+		}
+
+		return 0;	/* Want more */
+	}
+
+}
+
+ssize_t
+ber_skip_length(const asn_codec_ctx_t *opt_codec_ctx,
+		int _is_constructed, const void *ptr, size_t size) {
+	ber_tlv_len_t vlen;	/* Length of V in TLV */
+	ssize_t tl;		/* Length of L in TLV */
+	ssize_t ll;		/* Length of L in TLV */
+	size_t skip;
+
+	/*
+	 * Make sure we didn't exceed the maximum stack size.
+	 */
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		return -1;
+
+	/*
+	 * Determine the size of L in TLV.
+	 */
+	ll = ber_fetch_length(_is_constructed, ptr, size, &vlen);
+	if(ll <= 0) return ll;
+
+	/*
+	 * Definite length.
+	 */
+	if(vlen >= 0) {
+		skip = ll + vlen;
+		if(skip > size)
+			return 0;	/* Want more */
+		return skip;
+	}
+
+	/*
+	 * Indefinite length!
+	 */
+	ASN_DEBUG("Skipping indefinite length");
+	for(skip = ll, ptr = ((const char *)ptr) + ll, size -= ll;;) {
+		ber_tlv_tag_t tag;
+
+		/* Fetch the tag */
+		tl = ber_fetch_tag(ptr, size, &tag);
+		if(tl <= 0) return tl;
+
+		ll = ber_skip_length(opt_codec_ctx,
+			BER_TLV_CONSTRUCTED(ptr),
+			((const char *)ptr) + tl, size - tl);
+		if(ll <= 0) return ll;
+
+		skip += tl + ll;
+
+		/*
+		 * This may be the end of the indefinite length structure,
+		 * two consecutive 0 octets.
+		 * Check if it is true.
+		 */
+		if(((const uint8_t *)ptr)[0] == 0
+		&& ((const uint8_t *)ptr)[1] == 0)
+			return skip;
+
+		ptr = ((const char *)ptr) + tl + ll;
+		size -= tl + ll;
+	}
+
+	/* UNREACHABLE */
+}
+
+size_t
+der_tlv_length_serialize(ber_tlv_len_t len, void *bufp, size_t size) {
+	size_t required_size;	/* Size of len encoding */
+	uint8_t *buf = (uint8_t *)bufp;
+	uint8_t *end;
+	int i;
+
+	if(len <= 127) {
+		/* Encoded in 1 octet */
+		if(size) *buf = (uint8_t)len;
+		return 1;
+	}
+
+	/*
+	 * Compute the size of the subsequent bytes.
+	 */
+	for(required_size = 1, i = 8; i < 8 * (int)sizeof(len); i += 8) {
+		if(len >> i)
+			required_size++;
+		else
+			break;
+	}
+
+	if(size <= required_size)
+		return required_size + 1;
+
+	*buf++ = (uint8_t)(0x80 | required_size);  /* Length of the encoding */
+
+	/*
+	 * Produce the len encoding, space permitting.
+	 */
+	end = buf + required_size;
+	for(i -= 8; buf < end; i -= 8, buf++)
+		*buf = (uint8_t)(len >> i);
+
+	return required_size + 1;
+}
+
diff --git a/e2ap/lib/ber_tlv_tag.c b/e2ap/lib/ber_tlv_tag.c
new file mode 100644
index 0000000..4a7d732
--- /dev/null
+++ b/e2ap/lib/ber_tlv_tag.c
@@ -0,0 +1,144 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <ber_tlv_tag.h>
+#include <errno.h>
+
+ssize_t
+ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
+	ber_tlv_tag_t val;
+	ber_tlv_tag_t tclass;
+	size_t skipped;
+
+	if(size == 0)
+		return 0;
+
+	val = *(const uint8_t *)ptr;
+	tclass = (val >> 6);
+	if((val &= 0x1F) != 0x1F) {
+		/*
+		 * Simple form: everything encoded in a single octet.
+		 * Tag Class is encoded using two least significant bits.
+		 */
+		*tag_r = (val << 2) | tclass;
+		return 1;
+	}
+
+	/*
+	 * Each octet contains 7 bits of useful information.
+	 * The MSB is 0 if it is the last octet of the tag.
+	 */
+	for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2;
+			skipped <= size;
+				ptr = ((const char *)ptr) + 1, skipped++) {
+		unsigned int oct = *(const uint8_t *)ptr;
+		if(oct & 0x80) {
+			val = (val << 7) | (oct & 0x7F);
+			/*
+			 * Make sure there are at least 9 bits spare
+			 * at the MS side of a value.
+			 */
+			if(val >> ((8 * sizeof(val)) - 9)) {
+				/*
+				 * We would not be able to accomodate
+				 * any more tag bits.
+				 */
+				return -1;
+			}
+		} else {
+			val = (val << 7) | oct;
+			*tag_r = (val << 2) | tclass;
+			return skipped;
+		}
+	}
+
+	return 0;	/* Want more */
+}
+
+
+ssize_t
+ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *f) {
+	char buf[sizeof("[APPLICATION ]") + 32];
+	ssize_t ret;
+
+	ret = ber_tlv_tag_snprint(tag, buf, sizeof(buf));
+	if(ret >= (ssize_t)sizeof(buf) || ret < 2) {
+		errno = EPERM;
+		return -1;
+	}
+
+	return fwrite(buf, 1, ret, f);
+}
+
+ssize_t
+ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size) {
+	const char *type = 0;
+	int ret;
+
+	switch(tag & 0x3) {
+	case ASN_TAG_CLASS_UNIVERSAL:	type = "UNIVERSAL ";	break;
+	case ASN_TAG_CLASS_APPLICATION:	type = "APPLICATION ";	break;
+	case ASN_TAG_CLASS_CONTEXT:	type = "";		break;
+	case ASN_TAG_CLASS_PRIVATE:	type = "PRIVATE ";	break;
+	}
+
+	ret = snprintf(buf, size, "[%s%u]", type, ((unsigned)tag) >> 2);
+	if(ret <= 0 && size) buf[0] = '\0';	/* against broken libc's */
+
+	return ret;
+}
+
+char *
+ber_tlv_tag_string(ber_tlv_tag_t tag) {
+	static char buf[sizeof("[APPLICATION ]") + 32];
+
+	(void)ber_tlv_tag_snprint(tag, buf, sizeof(buf));
+
+	return buf;
+}
+
+
+size_t
+ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufp, size_t size) {
+	int tclass = BER_TAG_CLASS(tag);
+	ber_tlv_tag_t tval = BER_TAG_VALUE(tag);
+	uint8_t *buf = (uint8_t *)bufp;
+	uint8_t *end;
+	size_t required_size;
+	size_t i;
+
+	if(tval <= 30) {
+		/* Encoded in 1 octet */
+		if(size) buf[0] = (tclass << 6) | tval;
+		return 1;
+	} else if(size) {
+		*buf++ = (tclass << 6) | 0x1F;
+		size--;
+	}
+
+	/*
+	 * Compute the size of the subsequent bytes.
+	 */
+	for(required_size = 1, i = 7; i < 8 * sizeof(tval); i += 7) {
+		if(tval >> i)
+			required_size++;
+		else
+			break;
+	}
+
+	if(size < required_size)
+		return required_size + 1;
+
+	/*
+	 * Fill in the buffer, space permitting.
+	 */
+	end = buf + required_size - 1;
+	for(i -= 7; buf < end; i -= 7, buf++)
+		*buf = 0x80 | ((tval >> i) & 0x7F);
+	*buf = (tval & 0x7F);	/* Last octet without high bit */
+
+	return required_size + 1;
+}
+
diff --git a/e2ap/lib/constr_CHOICE.c b/e2ap/lib/constr_CHOICE.c
new file mode 100644
index 0000000..86dcbb0
--- /dev/null
+++ b/e2ap/lib/constr_CHOICE.c
@@ -0,0 +1,1533 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_CHOICE.h>
+#include <per_opentype.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num;\
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * See the definitions.
+ */
+static unsigned _fetch_present_idx(const void *struct_ptr, unsigned off,
+                                   unsigned size);
+static void _set_present_idx(void *sptr, unsigned offset, unsigned size,
+                             unsigned pres);
+static const void *_get_member_ptr(const asn_TYPE_descriptor_t *,
+                                   const void *sptr, asn_TYPE_member_t **elm,
+                                   unsigned *present);
+
+/*
+ * Tags are canonically sorted in the tag to member table.
+ */
+static int
+_search4tag(const void *ap, const void *bp) {
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+	int a_class = BER_TAG_CLASS(a->el_tag);
+	int b_class = BER_TAG_CLASS(b->el_tag);
+
+	if(a_class == b_class) {
+		ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+		ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+		if(a_value == b_value)
+			return 0;
+		else if(a_value < b_value)
+			return -1;
+		else
+			return 1;
+	} else if(a_class < b_class) {
+		return -1;
+	} else {
+		return 1;
+	}
+}
+
+/*
+ * The decoder of the CHOICE type.
+ */
+asn_dec_rval_t
+CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_CHOICE_specifics_t *specs =
+		(const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
+
+	/*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	ssize_t tag_len;	/* Length of TLV's T */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	ASN_DEBUG("Decoding %s as CHOICE", td->name);
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		if(tag_mode || td->tags_count) {
+			rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+				tag_mode, -1, &ctx->left, 0);
+			if(rval.code != RC_OK) {
+				ASN_DEBUG("%s tagging check failed: %d",
+					td->name, rval.code);
+				return rval;
+			}
+
+			if(ctx->left >= 0) {
+				/* ?Substracted below! */
+				ctx->left += rval.consumed;
+			}
+			ADVANCE(rval.consumed);
+		} else {
+			ctx->left = -1;
+		}
+
+		NEXT_PHASE(ctx);
+
+		ASN_DEBUG("Structure consumes %ld bytes, buffer %ld",
+			(long)ctx->left, (long)size);
+
+		/* Fall through */
+	case 1:
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		ASN_DEBUG("In %s CHOICE tag length %d", td->name, (int)tag_len);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+		do {
+			const asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key;
+
+			key.el_tag = tlv_tag;
+			t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+					specs->tag2el, specs->tag2el_count,
+					sizeof(specs->tag2el[0]), _search4tag);
+			if(t2m) {
+				/*
+				 * Found the element corresponding to the tag.
+				 */
+				NEXT_PHASE(ctx);
+				ctx->step = t2m->el_no;
+				break;
+			} else if(specs->ext_start == -1) {
+				ASN_DEBUG("Unexpected tag %s "
+					"in non-extensible CHOICE %s",
+					ber_tlv_tag_string(tlv_tag), td->name);
+				RETURN(RC_FAIL);
+			} else {
+				/* Skip this tag */
+				ssize_t skip;
+
+				ASN_DEBUG("Skipping unknown tag %s",
+					ber_tlv_tag_string(tlv_tag));
+
+				skip = ber_skip_length(opt_codec_ctx,
+					BER_TLV_CONSTRUCTED(ptr),
+					(const char *)ptr + tag_len,
+					LEFT - tag_len);
+
+				switch(skip) {
+				case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+					/* Fall through */
+				case -1: RETURN(RC_FAIL);
+				}
+
+				ADVANCE(skip + tag_len);
+				RETURN(RC_OK);
+			}
+		} while(0);
+
+	case 2:
+		/*
+		 * PHASE 2.
+		 * Read in the element.
+		 */
+	    do {
+		asn_TYPE_member_t *elm;/* CHOICE's element */
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+
+		elm = &elements[ctx->step];
+
+		/*
+		 * Compute the position of the member inside a structure,
+		 * and also a type of containment (it may be contained
+		 * as pointer or using inline inclusion).
+		 */
+		if(elm->flags & ATF_POINTER) {
+			/* Member is a pointer to another structure */
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			/*
+			 * A pointer to a pointer
+			 * holding the start of the structure
+			 */
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+		/* Set presence to be able to free it properly at any time */
+		_set_present_idx(st, specs->pres_offset,
+				specs->pres_size, ctx->step + 1);
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		rval = elm->type->op->ber_decoder(opt_codec_ctx, elm->type,
+				memb_ptr2, ptr, LEFT, elm->tag_mode);
+		switch(rval.code) {
+		case RC_OK:
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			RETURN(RC_FAIL);
+		case RC_FAIL: /* Fatal error */
+			RETURN(rval.code);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  } while(0);
+
+		NEXT_PHASE(ctx);
+
+		/* Fall through */
+	case 3:
+		ASN_DEBUG("CHOICE %s Leftover: %ld, size = %ld, tm=%d, tc=%d",
+			td->name, (long)ctx->left, (long)size,
+			tag_mode, td->tags_count);
+
+		if(ctx->left > 0) {
+			/*
+			 * The type must be fully decoded
+			 * by the CHOICE member-specific decoder.
+			 */
+			RETURN(RC_FAIL);
+		}
+
+		if(ctx->left == -1
+		&& !(tag_mode || td->tags_count)) {
+			/*
+			 * This is an untagged CHOICE.
+			 * It doesn't contain nothing
+			 * except for the member itself, including all its tags.
+			 * The decoding is completed.
+			 */
+			NEXT_PHASE(ctx);
+			break;
+		}
+
+		/*
+		 * Read in the "end of data chunks"'s.
+		 */
+		while(ctx->left < 0) {
+			ssize_t tl;
+
+			tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+			switch(tl) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			/*
+			 * Expected <0><0>...
+			 */
+			if(((const uint8_t *)ptr)[0] == 0) {
+				if(LEFT < 2) {
+					if(SIZE_VIOLATION)
+						RETURN(RC_FAIL);
+					else
+						RETURN(RC_WMORE);
+				} else if(((const uint8_t *)ptr)[1] == 0) {
+					/*
+					 * Correctly finished with <0><0>.
+					 */
+					ADVANCE(2);
+					ctx->left++;
+					continue;
+				}
+			} else {
+				ASN_DEBUG("Unexpected continuation in %s",
+					td->name);
+				RETURN(RC_FAIL);
+			}
+
+			/* UNREACHABLE */
+		}
+
+		NEXT_PHASE(ctx);
+	case 4:
+		/* No meaningful work here */
+		break;
+	}
+	
+	RETURN(RC_OK);
+}
+
+asn_enc_rval_t
+CHOICE_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elm;	/* CHOICE element */
+	asn_enc_rval_t erval = {0,0,0};
+	const void *memb_ptr;
+	size_t computed_size = 0;
+	unsigned present;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("%s %s as CHOICE",
+		cb?"Encoding":"Estimating", td->name);
+
+	present = _fetch_present_idx(sptr,
+		specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present == 0 || present > td->elements_count) {
+		if(present == 0 && td->elements_count == 0) {
+			/* The CHOICE is empty?! */
+			erval.encoded = 0;
+			ASN__ENCODED_OK(erval);
+		}
+		ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Seek over the present member of the structure.
+	 */
+	elm = &td->elements[present-1];
+	if(elm->flags & ATF_POINTER) {
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(memb_ptr == 0) {
+			if(elm->optional) {
+				erval.encoded = 0;
+				ASN__ENCODED_OK(erval);
+			}
+			/* Mandatory element absent */
+			ASN__ENCODE_FAILED;
+		}
+	} else {
+        memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+    }
+
+	/*
+	 * If the CHOICE itself is tagged EXPLICIT:
+	 * T ::= [2] EXPLICIT CHOICE { ... }
+	 * Then emit the appropriate tags.
+	 */
+	if(tag_mode == 1 || td->tags_count) {
+		/*
+		 * For this, we need to pre-compute the member.
+		 */
+		ssize_t ret;
+
+		/* Encode member with its tag */
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			elm->tag_mode, elm->tag, 0, 0);
+		if(erval.encoded == -1)
+			return erval;
+
+		/* Encode CHOICE with parent or my own tag */
+		ret = der_write_tags(td, erval.encoded, tag_mode, 1, tag,
+			cb, app_key);
+		if(ret == -1)
+			ASN__ENCODE_FAILED;
+		computed_size += ret;
+	}
+
+	/*
+	 * Encode the single underlying member.
+	 */
+	erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+		elm->tag_mode, elm->tag, cb, app_key);
+	if(erval.encoded == -1)
+		return erval;
+
+	ASN_DEBUG("Encoded CHOICE member in %ld bytes (+%ld)",
+		(long)erval.encoded, (long)computed_size);
+
+	erval.encoded += computed_size;
+
+	return erval;
+}
+
+ber_tlv_tag_t
+CHOICE_outmost_tag(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber_tlv_tag_t tag) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	unsigned present;
+
+	assert(tag_mode == 0); (void)tag_mode;
+	assert(tag == 0); (void)tag;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size);
+
+	if(present > 0 && present <= td->elements_count) {
+		const asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)
+					((const char *)ptr + elm->memb_offset);
+		} else {
+			memb_ptr = (const void *)
+					((const char *)ptr + elm->memb_offset);
+		}
+
+		return asn_TYPE_outmost_tag(elm->type, memb_ptr,
+			elm->tag_mode, elm->tag);
+	} else {
+		return (ber_tlv_tag_t)-1;
+	}
+}
+
+int
+CHOICE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional)
+					return 0;
+				ASN__CTFAIL(app_key, td, sptr,
+					"%s: mandatory CHOICE element %s absent (%s:%d)",
+					td->name, elm->name, __FILE__, __LINE__);
+				return -1;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		if(elm->encoding_constraints.general_constraints) {
+			return elm->encoding_constraints.general_constraints(elm->type, memb_ptr,
+				ctfailcb, app_key);
+		} else {
+			return elm->type->encoding_constraints.general_constraints(elm->type,
+					memb_ptr, ctfailcb, app_key);
+		}
+	} else {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: no CHOICE element given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+}
+
+#undef	XER_ADVANCE
+#define	XER_ADVANCE(num_bytes)	do {			\
+		size_t num = num_bytes;			\
+		buf_ptr = (const void *)(((const char *)buf_ptr) + num); \
+		size -= num;				\
+		consumed_myself += num;			\
+	} while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+CHOICE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const char *opt_mname, const void *buf_ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval;		/* Return value of a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* Element index */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	if(ctx->phase == 0 && !*xml_tag)
+		ctx->phase = 1;	/* Skip the outer tag checking phase */
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 * Phase 3: Only waiting for closing tag.
+	 * Phase 4: Skipping unknown extensions.
+	 * Phase 5: PHASED OUT
+	 */
+	for(edx = ctx->step; ctx->phase <= 4;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+		asn_TYPE_member_t *elm;
+
+		/*
+		 * Go inside the member.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval;
+			void *memb_ptr;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+			unsigned old_present;
+
+			elm = &td->elements[edx];
+
+			if(elm->flags & ATF_POINTER) {
+				/* Member is a pointer to another structure */
+				memb_ptr2 = (void **)((char *)st
+					+ elm->memb_offset);
+			} else {
+				memb_ptr = (char *)st + elm->memb_offset;
+				memb_ptr2 = &memb_ptr;
+			}
+
+			/* Start/Continue decoding the inner member */
+			tmprval = elm->type->op->xer_decoder(opt_codec_ctx,
+					elm->type, memb_ptr2, elm->name,
+					buf_ptr, size);
+			XER_ADVANCE(tmprval.consumed);
+			ASN_DEBUG("XER/CHOICE: itdf: [%s] code=%d",
+				elm->type->name, tmprval.code);
+			old_present = _fetch_present_idx(st,
+				specs->pres_offset, specs->pres_size);
+			assert(old_present == 0 || old_present == edx + 1);
+			/* Record what we've got */
+			_set_present_idx(st,
+				specs->pres_offset, specs->pres_size, edx + 1);
+			if(tmprval.code != RC_OK)
+				RETURN(tmprval.code);
+			ctx->phase = 3;
+			/* Fall through */
+		}
+
+		/* No need to wait for closing tag; special mode. */
+		if(ctx->phase == 3 && !*xml_tag) {
+			ctx->phase = 5;	/* Phase out */
+			RETURN(RC_OK);
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+			case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/CHOICE checked [%c%c%c%c] vs [%s], tcv=%d",
+			ch_size>0?((const uint8_t *)buf_ptr)[0]:'?',
+			ch_size>1?((const uint8_t *)buf_ptr)[1]:'?',
+			ch_size>2?((const uint8_t *)buf_ptr)[2]:'?',
+			ch_size>3?((const uint8_t *)buf_ptr)[3]:'?',
+		xml_tag, tcv);
+
+		/* Skip the extensions section */
+		if(ctx->phase == 4) {
+			ASN_DEBUG("skip_unknown(%d, %ld)",
+				tcv, (long)ctx->left);
+			switch(xer_skip_unknown(tcv, &ctx->left)) {
+			case -1:
+				ctx->phase = 5;
+				RETURN(RC_FAIL);
+			case 1:
+				ctx->phase = 3;
+				/* Fall through */
+			case 0:
+				XER_ADVANCE(ch_size);
+				continue;
+			case 2:
+				ctx->phase = 3;
+				break;
+			}
+		}
+
+		switch(tcv) {
+		case XCT_BOTH:
+			break;	/* No CHOICE? */
+		case XCT_CLOSING:
+			if(ctx->phase != 3)
+				break;
+			XER_ADVANCE(ch_size);
+			ctx->phase = 5;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			if(ctx->phase != 1)
+				break;	/* Really unexpected */
+
+			/*
+			 * Search which inner member corresponds to this tag.
+			 */
+			for(edx = 0; edx < td->elements_count; edx++) {
+				elm = &td->elements[edx];
+				tcv = xer_check_tag(buf_ptr,ch_size,elm->name);
+				switch(tcv) {
+				case XCT_BOTH:
+				case XCT_OPENING:
+					/*
+					 * Process this member.
+					 */
+					ctx->step = edx;
+					ctx->phase = 2;
+					break;
+				case XCT_UNKNOWN_OP:
+				case XCT_UNKNOWN_BO:
+					continue;
+				default:
+					edx = td->elements_count;
+					break;	/* Phase out */
+				}
+				break;
+			}
+			if(edx != td->elements_count)
+				continue;
+
+			/* It is expected extension */
+			if(specs->ext_start != -1) {
+				ASN_DEBUG("Got anticipated extension");
+				/*
+				 * Check for (XCT_BOTH or XCT_UNKNOWN_BO)
+				 * By using a mask. Only record a pure
+				 * <opening> tags.
+				 */
+				if(tcv & XCT_CLOSING) {
+					/* Found </extension> without body */
+					ctx->phase = 3; /* Terminating */
+				} else {
+					ctx->left = 1;
+					ctx->phase = 4; /* Skip ...'s */
+				}
+				XER_ADVANCE(ch_size);
+				continue;
+			}
+
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag [%c%c%c%c] in CHOICE [%s]"
+			" (ph=%d, tag=%s)",
+			ch_size>0?((const uint8_t *)buf_ptr)[0]:'?',
+			ch_size>1?((const uint8_t *)buf_ptr)[1]:'?',
+			ch_size>2?((const uint8_t *)buf_ptr)[2]:'?',
+			ch_size>3?((const uint8_t *)buf_ptr)[3]:'?',
+			td->name, ctx->phase, xml_tag);
+		break;
+	}
+
+	ctx->phase = 5;	/* Phase out, just in case */
+	RETURN(RC_FAIL);
+}
+
+
+asn_enc_rval_t
+CHOICE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                  enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+	const asn_CHOICE_specifics_t *specs =
+        	(const asn_CHOICE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	unsigned present = 0;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+
+	if(present == 0 || present > td->elements_count) {
+		ASN__ENCODE_FAILED;
+	}  else {
+		asn_enc_rval_t tmper = {0,0,0};
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr = NULL;
+		const char *mname = elm->name;
+		unsigned int mlen = strlen(mname);
+
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!memb_ptr) ASN__ENCODE_FAILED;
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+
+        er.encoded = 0;
+
+		if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel);
+		ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+		tmper = elm->type->op->xer_encoder(elm->type, memb_ptr,
+				ilevel + 1, flags, cb, app_key);
+		if(tmper.encoded == -1) return tmper;
+		er.encoded += tmper.encoded;
+
+		ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+	}
+
+	if(!(flags & XER_F_CANONICAL)) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+asn_dec_rval_t
+CHOICE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_dec_rval_t rv;
+	const asn_per_constraint_t *ct;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	void *memb_ptr;
+	void **memb_ptr2;
+	void *st = *sptr;
+	int value;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints) ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted */
+	}
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		ASN_DEBUG("CHOICE %s got index %d in range %d",
+			td->name, value, ct->range_bits);
+		if(value > ct->upper_bound)
+			ASN__DECODE_FAILED;
+	} else {
+		if(specs->ext_start == -1)
+			ASN__DECODE_FAILED;
+		value = uper_get_nsnnwn(pd);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->ext_start;
+		if((unsigned)value >= td->elements_count)
+			ASN__DECODE_FAILED;
+	}
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->from_canonical_order) {
+        ASN_DEBUG("CHOICE presence from wire %d", value);
+		value = specs->from_canonical_order[value];
+        ASN_DEBUG("CHOICE presence index effective %d", value);
+    }
+
+	/* Set presence to be able to free it later */
+	_set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1);
+
+	elm = &td->elements[value];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+	ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name);
+
+	if(ct && ct->range_bits >= 0) {
+		rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+			elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	} else {
+		rv = uper_open_type_get(opt_codec_ctx, elm->type,
+			elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	}
+
+	if(rv.code != RC_OK)
+		ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d",
+			elm->name, td->name, rv.code);
+	return rv;
+}
+
+asn_enc_rval_t
+CHOICE_encode_uper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	const asn_per_constraint_t *ct;
+	const void *memb_ptr;
+	unsigned present;
+	int present_enc;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Encoding %s as CHOICE", td->name);
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized properly, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present == 0 || present > td->elements_count)
+		ASN__ENCODE_FAILED;
+	else
+		present--;
+
+	ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present);
+
+    /* Adjust if canonical order is different from natural order */
+    if(specs->to_canonical_order)
+        present_enc = specs->to_canonical_order[present];
+    else
+        present_enc = present;
+
+    if(ct && ct->range_bits >= 0) {
+		if(present_enc < ct->lower_bound
+		|| present_enc > ct->upper_bound) {
+			if(ct->flags & APC_EXTENSIBLE) {
+                ASN_DEBUG(
+                    "CHOICE member %d (enc %d) is an extension (%ld..%ld)",
+                    present, present_enc, ct->lower_bound, ct->upper_bound);
+                if(per_put_few_bits(po, 1, 1))
+					ASN__ENCODE_FAILED;
+			} else {
+				ASN__ENCODE_FAILED;
+			}
+			ct = 0;
+		}
+	}
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+        ASN_DEBUG("CHOICE member %d (enc %d) is not an extension (%ld..%ld)",
+                  present, present_enc, ct->lower_bound, ct->upper_bound);
+        if(per_put_few_bits(po, 0, 1))
+			ASN__ENCODE_FAILED;
+    }
+
+
+	elm = &td->elements[present];
+    ASN_DEBUG("CHOICE member \"%s\" %d (as %d)", elm->name, present,
+              present_enc);
+    if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+	} else {
+        memb_ptr = (const char *)sptr + elm->memb_offset;
+    }
+
+    if(ct && ct->range_bits >= 0) {
+        if(per_put_few_bits(po, present_enc, ct->range_bits))
+            ASN__ENCODE_FAILED;
+
+        return elm->type->op->uper_encoder(
+            elm->type, elm->encoding_constraints.per_constraints, memb_ptr, po);
+    } else {
+        asn_enc_rval_t rval = {0,0,0};
+        if(specs->ext_start == -1) ASN__ENCODE_FAILED;
+        if(uper_put_nsnnwn(po, present_enc - specs->ext_start))
+            ASN__ENCODE_FAILED;
+        if(uper_open_type_put(elm->type,
+                              elm->encoding_constraints.per_constraints,
+                              memb_ptr, po))
+            ASN__ENCODE_FAILED;
+        rval.encoded = 0;
+        ASN__ENCODED_OK(rval);
+    }
+}
+
+asn_dec_rval_t
+CHOICE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	asn_dec_rval_t rv;
+	const asn_per_constraint_t *ct;
+	const asn_per_constraint_t *ext_ct = NULL;
+	asn_TYPE_member_t *elm;	/* CHOICE's element */
+	void *memb_ptr;
+	void **memb_ptr2;
+	void *st = *sptr;
+	int value;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) {
+		  ext_ct = ct;
+		  ct = 0;	/* Not restricted */
+		}
+	}
+
+
+	if(ct && ct->range_bits >= 0) {
+		value = per_get_few_bits(pd, ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		ASN_DEBUG("CHOICE %s got index %d in range %d",
+		          td->name, value, ct->range_bits);
+		if(value > ct->upper_bound)
+			ASN__DECODE_FAILED;
+	} else {
+		if(specs->ext_start == -1)
+			ASN__DECODE_FAILED;
+		value = aper_get_nsnnwn(pd, ext_ct->range_bits);
+		if(value < 0) ASN__DECODE_STARVED;
+		value += specs->ext_start;
+		if((unsigned)value >= td->elements_count)
+			ASN__DECODE_FAILED;
+	}
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->from_canonical_order)
+		value = specs->from_canonical_order[value];
+
+	/* Set presence to be able to free it later */
+	_set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1);
+
+	elm = &td->elements[value];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+	ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name);
+
+	if(ct && ct->range_bits >= 0) {
+		rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+		                                 elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	} else {
+		rv = aper_open_type_get(opt_codec_ctx, elm->type,
+		                        elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+	}
+
+	if(rv.code != RC_OK)
+		ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d",
+		          elm->name, td->name, rv.code);
+	return rv;
+}
+
+asn_enc_rval_t
+CHOICE_encode_aper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   const void *sptr, asn_per_outp_t *po) {
+	const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm; /* CHOICE's element */
+	const asn_per_constraint_t *ct = NULL;
+	const asn_per_constraint_t *ext_ct = NULL;
+	const void *memb_ptr;
+	unsigned present;
+	int present_enc;
+	
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Encoding %s as CHOICE using ALIGNED PER", td->name);
+
+	if(constraints) ct = &constraints->value;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->value;
+	else ct = NULL;
+
+	present = _fetch_present_idx(sptr,
+	                             specs->pres_offset, specs->pres_size);
+
+	/*
+	 * If the structure was not initialized properly, it cannot be encoded:
+	 * can't deduce what to encode in the choice type.
+	 */
+	if(present <= 0 || (unsigned)present > td->elements_count)
+		ASN__ENCODE_FAILED;
+	else
+		present--;
+
+	/* Adjust if canonical order is different from natural order */
+	if(specs->to_canonical_order)
+		present_enc = specs->to_canonical_order[present];
+	else
+	        present_enc = present;
+	
+	ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present);
+
+	if(ct && (ct->range_bits >= 0)) {
+	  // Value is not within the range of the primary values ?
+	  if(present < ct->lower_bound || present > ct->upper_bound) {
+	    if(ct->flags & APC_EXTENSIBLE) {
+	      ASN_DEBUG("CHOICE member %d (enc %d) is an extension (%ld..%ld)",
+			present, present_enc, ct->lower_bound, ct->upper_bound);
+	      // X691/23.5 Extension marker = 1 
+	      if(per_put_few_bits(po, 1, 1)) {
+		ASN__ENCODE_FAILED;
+	      }
+	    } else {
+	      ASN__ENCODE_FAILED;
+	    }
+	    // no more need of constraint.
+	    ext_ct = ct;
+	    ct = NULL;
+	  }
+	}
+	
+	if(ct && (ct->flags & APC_EXTENSIBLE)) {
+	  ASN_DEBUG("CHOICE member %d (enc %d) is not an extension (%ld..%ld)",
+		    present, present, ct->lower_bound, ct->upper_bound);
+	  // X691.23.5 Extension marker = 0
+	  if(per_put_few_bits(po, 0, 1)) {
+	    ASN__ENCODE_FAILED;
+	  }
+	}
+
+	elm = &td->elements[present];
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr = *(const void *const *)((const char *)sptr + elm->memb_offset);
+		if(!memb_ptr) ASN__ENCODE_FAILED;
+	} else {
+		memb_ptr = (const char *)sptr + elm->memb_offset;
+	}
+
+	if(ct && (ct->range_bits >= 0)) {
+	        // By construction (ct != 0), the alternative value is a non extended one.
+	        // X691/23.7 X691/23.6 alternative value encoded as a range_bits bits value.
+		if(per_put_few_bits(po, present_enc, ct->range_bits))
+			ASN__ENCODE_FAILED;
+
+		return elm->type->op->aper_encoder(elm->type, elm->encoding_constraints.per_constraints,
+		                                   memb_ptr, po);
+	} else {
+		asn_enc_rval_t rval = {0,0,0};
+		if(specs->ext_start == -1)
+			ASN__ENCODE_FAILED;
+		// X691/23.8 normally encoded as a small non negative whole number
+		
+		if(ext_ct && aper_put_nsnnwn(po, ext_ct->range_bits, present_enc - specs->ext_start))
+			ASN__ENCODE_FAILED;
+		if(aper_open_type_put(elm->type, elm->encoding_constraints.per_constraints,
+		                      memb_ptr, po))
+			ASN__ENCODE_FAILED;
+		rval.encoded = 0;
+		ASN__ENCODED_OK(rval);
+	}
+}
+
+int
+CHOICE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+             asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs = (const asn_CHOICE_specifics_t *)td->specifics;
+	unsigned present;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset,specs->pres_size);
+
+	/*
+	 * Print that element.
+	 */
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		/* Print member's name and stuff */
+		if(0) {
+			if(cb(elm->name, strlen(elm->name), app_key) < 0
+			|| cb(": ", 2, app_key) < 0)
+				return -1;
+		}
+
+		return elm->type->op->print_struct(elm->type, memb_ptr, ilevel,
+			cb, app_key);
+	} else {
+		return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+	}
+}
+
+void
+CHOICE_free(const asn_TYPE_descriptor_t *td, void *ptr,
+            enum asn_struct_free_method method) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+	if(!td || !ptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as CHOICE", td->name);
+
+	/*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(ptr, specs->pres_offset, specs->pres_size);
+
+	/*
+	 * Free that element.
+	 */
+	if(present > 0 && present <= td->elements_count) {
+		asn_TYPE_member_t *elm = &td->elements[present-1];
+		void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
+			if(memb_ptr)
+				ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		} else {
+			memb_ptr = (void *)((char *)ptr + elm->memb_offset);
+			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
+		}
+	}
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(ptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(ptr, 0, specs->struct_size);
+        break;
+    }
+}
+
+
+/*
+ * The following functions functions offer protection against -fshort-enums,
+ * compatible with little- and big-endian machines.
+ * If assertion is triggered, either disable -fshort-enums, or add an entry
+ * here with the ->pres_size of your target stracture.
+ * Unless the target structure is packed, the ".present" member
+ * is guaranteed to be aligned properly. ASN.1 compiler itself does not
+ * produce packed code.
+ */
+static unsigned
+_fetch_present_idx(const void *struct_ptr, unsigned pres_offset,
+                   unsigned pres_size) {
+    const void *present_ptr;
+	unsigned present;
+
+	present_ptr = ((const char *)struct_ptr) + pres_offset;
+
+	switch(pres_size) {
+	case sizeof(int):	present = *(const unsigned int *)present_ptr; break;
+	case sizeof(short):	present = *(const unsigned short *)present_ptr; break;
+	case sizeof(char):	present = *(const unsigned char *)present_ptr; break;
+	default:
+		/* ANSI C mandates enum to be equivalent to integer */
+		assert(pres_size != sizeof(int));
+		return 0;	/* If not aborted, pass back safe value */
+	}
+
+	return present;
+}
+
+static void
+_set_present_idx(void *struct_ptr, unsigned pres_offset, unsigned pres_size,
+                 unsigned present) {
+    void *present_ptr;
+	present_ptr = ((char *)struct_ptr) + pres_offset;
+
+	switch(pres_size) {
+	case sizeof(int):	*(unsigned int *)present_ptr   = present; break;
+	case sizeof(short):	*(unsigned short *)present_ptr = present; break;
+	case sizeof(char):	*(unsigned char *)present_ptr  = present; break;
+	default:
+		/* ANSI C mandates enum to be equivalent to integer */
+		assert(pres_size != sizeof(int));
+	}
+}
+
+static const void *
+_get_member_ptr(const asn_TYPE_descriptor_t *td, const void *sptr,
+                asn_TYPE_member_t **elm_ptr, unsigned *present_out) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned present;
+
+    if(!sptr) {
+        *elm_ptr = NULL;
+        *present_out = 0;
+        return NULL;
+    }
+
+    /*
+	 * Figure out which CHOICE element is encoded.
+	 */
+	present = _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+    *present_out = present;
+
+    /*
+     * The presence index is intentionally 1-based to avoid
+     * treating zeroed structure as a valid one.
+     */
+	if(present > 0 && present <= td->elements_count) {
+        asn_TYPE_member_t *const elm = &td->elements[present - 1];
+        const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+        *elm_ptr = elm;
+        return memb_ptr;
+    } else {
+        *elm_ptr = NULL;
+        return NULL;
+    }
+
+}
+
+int
+CHOICE_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const void *bptr) {
+    asn_TYPE_member_t *aelm;
+    asn_TYPE_member_t *belm;
+    unsigned apresent = 0;
+    unsigned bpresent = 0;
+    const void *amember = _get_member_ptr(td, aptr, &aelm, &apresent);
+    const void *bmember = _get_member_ptr(td, bptr, &belm, &bpresent);
+
+    if(amember && bmember) {
+        if(apresent == bpresent) {
+            assert(aelm == belm);
+            return aelm->type->op->compare_struct(aelm->type, amember, bmember);
+        } else if(apresent < bpresent) {
+            return -1;
+        } else {
+            return 1;
+        }
+    } else if(!amember) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+/*
+ * Return the 1-based choice variant presence index.
+ * Returns 0 in case of error.
+ */
+unsigned
+CHOICE_variant_get_presence(const asn_TYPE_descriptor_t *td, const void *sptr) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    return _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+}
+
+/*
+ * Sets or resets the 1-based choice variant presence index.
+ * In case a previous index is not zero, the currently selected structure
+ * member is freed and zeroed-out first.
+ * Returns 0 on success and -1 on error.
+ */
+int
+CHOICE_variant_set_presence(const asn_TYPE_descriptor_t *td, void *sptr,
+                            unsigned present) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    unsigned old_present;
+
+    if(!sptr) {
+        return -1;
+    }
+
+    if(present > td->elements_count)
+        return -1;
+
+    old_present =
+        _fetch_present_idx(sptr, specs->pres_offset, specs->pres_size);
+    if(present == old_present)
+        return 0;
+
+    if(old_present != 0) {
+        assert(old_present <= td->elements_count);
+        ASN_STRUCT_RESET(*td, sptr);
+    }
+
+    _set_present_idx(sptr, specs->pres_offset, specs->pres_size, present);
+
+    return 0;
+}
+
+
+asn_random_fill_result_t
+CHOICE_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constr,
+                   size_t max_length) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_random_fill_result_t res;
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    const asn_TYPE_member_t *elm;
+    unsigned present;
+    void *memb_ptr;   /* Pointer to the member */
+    void **memb_ptr2; /* Pointer to that pointer */
+    void *st = *sptr;
+
+    if(max_length == 0) return result_skipped;
+
+    (void)constr;
+
+    if(st == NULL) {
+        st = CALLOC(1, specs->struct_size);
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    present = asn_random_between(1, td->elements_count);
+    elm = &td->elements[present - 1];
+
+	if(elm->flags & ATF_POINTER) {
+		/* Member is a pointer to another structure */
+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+	} else {
+		memb_ptr = (char *)st + elm->memb_offset;
+		memb_ptr2 = &memb_ptr;
+	}
+
+    res = elm->type->op->random_fill(elm->type, memb_ptr2,
+                                    &elm->encoding_constraints, max_length);
+    _set_present_idx(st, specs->pres_offset, specs->pres_size, present);
+    if(res.code == ARFILL_OK) {
+        *sptr = st;
+    } else {
+        if(st == *sptr) {
+            ASN_STRUCT_RESET(*td, st);
+        } else {
+            ASN_STRUCT_FREE(*td, st);
+        }
+    }
+
+    return res;
+}
+
+
+asn_TYPE_operation_t asn_OP_CHOICE = {
+	CHOICE_free,
+	CHOICE_print,
+	CHOICE_compare,
+	CHOICE_decode_ber,
+	CHOICE_encode_der,
+	CHOICE_decode_xer,
+	CHOICE_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	CHOICE_decode_oer,
+	CHOICE_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	CHOICE_decode_uper,
+	CHOICE_encode_uper,
+	CHOICE_decode_aper,
+	CHOICE_encode_aper,
+#endif	/* ASN_DISABLE_PER_SUPPORT */
+	CHOICE_random_fill,
+	CHOICE_outmost_tag
+};
diff --git a/e2ap/lib/constr_CHOICE_oer.c b/e2ap/lib/constr_CHOICE_oer.c
new file mode 100644
index 0000000..a4c591c
--- /dev/null
+++ b/e2ap/lib/constr_CHOICE_oer.c
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_CHOICE.h>
+#include <errno.h>
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)                    \
+    do {                                 \
+        asn_dec_rval_t rval;             \
+        rval.code = _code;               \
+        rval.consumed = consumed_myself; \
+        return rval;                     \
+    } while(0)
+
+#undef  ADVANCE
+#define ADVANCE(num_bytes)               \
+    do {                                 \
+        size_t num = num_bytes;          \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+#undef  SET_PHASE
+#define SET_PHASE(ctx, value) \
+    do {                      \
+        ctx->phase = value;   \
+        ctx->step = 0;        \
+    } while(0)
+
+/*
+ * Tags are canonically sorted in the tag to member table.
+ */
+static int
+_search4tag(const void *ap, const void *bp) {
+    const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+    const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+    int a_class = BER_TAG_CLASS(a->el_tag);
+    int b_class = BER_TAG_CLASS(b->el_tag);
+
+    if(a_class == b_class) {
+        ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+        ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+        if(a_value == b_value)
+            return 0;
+        else if(a_value < b_value)
+            return -1;
+        else
+            return 1;
+    } else if(a_class < b_class) {
+        return -1;
+    } else {
+        return 1;
+    }
+}
+
+/*
+ * X.696 (08/2015) #8.7 Encoding of tags
+ */
+static ssize_t
+oer_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
+    ber_tlv_tag_t val;
+    ber_tlv_tag_t tclass;
+    size_t skipped;
+
+    if(size == 0)
+        return 0;
+
+    val = *(const uint8_t *)ptr;
+    tclass = (val >> 6);
+    if((val & 0x3F) != 0x3F) {
+        /* #8.7.1 */
+        *tag_r = ((val & 0x3F) << 2) | tclass;
+        return 1;
+    }
+
+    /*
+     * Each octet contains 7 bits of useful information.
+     * The MSB is 0 if it is the last octet of the tag.
+     */
+    for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; skipped <= size;
+        ptr = ((const char *)ptr) + 1, skipped++) {
+        unsigned int oct = *(const uint8_t *)ptr;
+        if(oct & 0x80) {
+            val = (val << 7) | (oct & 0x7F);
+            /*
+             * Make sure there are at least 9 bits spare
+             * at the MS side of a value.
+             */
+            if(val >> ((8 * sizeof(val)) - 9)) {
+                /*
+                 * We would not be able to accomodate
+                 * any more tag bits.
+                 */
+                return -1;
+            }
+        } else {
+            val = (val << 7) | oct;
+            *tag_r = (val << 2) | tclass;
+            return skipped;
+        }
+    }
+
+    return 0; /* Want more */
+}
+
+asn_dec_rval_t
+CHOICE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *ptr, size_t size) {
+    /*
+     * Bring closer parts of structure description.
+     */
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_TYPE_member_t *elements = td->elements;
+
+    /*
+     * Parts of the structure being constructed.
+     */
+    void *st = *struct_ptr; /* Target structure. */
+    asn_struct_ctx_t *ctx;  /* Decoder context */
+
+    ssize_t consumed_myself = 0; /* Consumed bytes from ptr */
+
+    (void)constraints;
+
+    ASN_DEBUG("Decoding %s as CHOICE", td->name);
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Discover the tag.
+         */
+        ber_tlv_tag_t tlv_tag; /* T from TLV */
+        ssize_t tag_len;       /* Length of TLV's T */
+
+        tag_len = oer_fetch_tag(ptr, size, &tlv_tag);
+        switch(tag_len) {
+        case 0:
+            ASN__DECODE_STARVED;
+        case -1:
+            ASN__DECODE_FAILED;
+        }
+
+        do {
+            const asn_TYPE_tag2member_t *t2m;
+            asn_TYPE_tag2member_t key = {0, 0, 0, 0};
+            key.el_tag = tlv_tag;
+
+            t2m = (const asn_TYPE_tag2member_t *)bsearch(
+                &key, specs->tag2el, specs->tag2el_count,
+                sizeof(specs->tag2el[0]), _search4tag);
+            if(t2m) {
+                /*
+                 * Found the element corresponding to the tag.
+                 */
+                NEXT_PHASE(ctx);
+                ctx->step = t2m->el_no;
+                break;
+            } else if(specs->ext_start == -1) {
+                ASN_DEBUG(
+                    "Unexpected tag %s "
+                    "in non-extensible CHOICE %s",
+                    ber_tlv_tag_string(tlv_tag), td->name);
+                RETURN(RC_FAIL);
+            } else {
+                /* Skip open type extension */
+                ASN_DEBUG(
+                    "Not implemented skipping open type extension for tag %s",
+                    ber_tlv_tag_string(tlv_tag));
+                RETURN(RC_FAIL);
+            }
+        } while(0);
+
+
+        ADVANCE(tag_len);
+    }
+        /* Fall through */
+    case 1: {
+        asn_TYPE_member_t *elm = &elements[ctx->step]; /* CHOICE's element */
+        void *memb_ptr;         /* Pointer to the member */
+        void **memb_ptr2;       /* Pointer to that pointer */
+        asn_dec_rval_t rval = {0,0};
+
+        /*
+         * Compute the position of the member inside a structure,
+         * and also a type of containment (it may be contained
+         * as pointer or using inline inclusion).
+         */
+        if(elm->flags & ATF_POINTER) {
+            /* Member is a pointer to another structure */
+            memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+        } else {
+            /*
+             * A pointer to a pointer
+             * holding the start of the structure
+             */
+            memb_ptr = (char *)st + elm->memb_offset;
+            memb_ptr2 = &memb_ptr;
+        }
+
+        /* Set presence to be able to free it properly at any time */
+        (void)CHOICE_variant_set_presence(td, st, ctx->step + 1);
+
+        if(specs->ext_start >= 0 && specs->ext_start <= ctx->step) {
+            ssize_t got =
+                oer_open_type_get(opt_codec_ctx, elm->type,
+                                  elm->encoding_constraints.oer_constraints,
+                                  memb_ptr2, ptr, size);
+            if(got < 0) ASN__DECODE_FAILED;
+            if(got == 0) ASN__DECODE_STARVED;
+            rval.code = RC_OK;
+            rval.consumed = got;
+        } else {
+            rval = elm->type->op->oer_decoder(
+                opt_codec_ctx, elm->type,
+                elm->encoding_constraints.oer_constraints, memb_ptr2, ptr,
+                size);
+        }
+        rval.consumed += consumed_myself;
+        switch(rval.code) {
+        case RC_OK:
+            NEXT_PHASE(ctx);
+        case RC_WMORE:
+            break;
+        case RC_FAIL:
+            SET_PHASE(ctx, 3);  /* => 3 */
+        }
+        return rval;
+    }
+    case 2:
+        /* Already decoded everything */
+        RETURN(RC_OK);
+    case 3:
+        /* Failed to decode, after all */
+        RETURN(RC_FAIL);
+    }
+
+    RETURN(RC_FAIL);
+}
+
+/*
+ * X.696 (08/2015) #8.7 Encoding of tags
+ */
+static ssize_t
+oer_put_tag(ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
+    uint8_t tclass = BER_TAG_CLASS(tag);
+    ber_tlv_tag_t tval = BER_TAG_VALUE(tag);
+
+    if(tval < 0x3F) {
+        uint8_t b = (uint8_t)((tclass << 6) | tval);
+        if(cb(&b, 1, app_key) < 0) {
+            return -1;
+        }
+        return 1;
+    } else {
+        uint8_t buf[1 + 2 * sizeof(tval)];
+        uint8_t *b = &buf[sizeof(buf)-1]; /* Last addressable */
+        size_t encoded;
+        for(; ; tval >>= 7) {
+            if(tval >> 7) {
+                *b-- = 0x80 | (tval & 0x7f);
+            } else {
+                *b-- = tval & 0x7f;
+                break;
+            }
+        }
+        *b = (uint8_t)((tclass << 6) | 0x3F);
+        encoded = sizeof(buf) - (b - buf);
+        if(cb(b, encoded, app_key) < 0) {
+            return -1;
+        }
+        return encoded;
+    }
+
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+CHOICE_encode_oer(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_CHOICE_specifics_t *specs =
+        (const asn_CHOICE_specifics_t *)td->specifics;
+    asn_TYPE_member_t *elm; /* CHOICE element */
+    unsigned present;
+    const void *memb_ptr;
+    ber_tlv_tag_t tag;
+    ssize_t tag_len;
+    asn_enc_rval_t er = {0, 0, 0};
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("OER %s encoding as CHOICE", td->name);
+
+    present = CHOICE_variant_get_presence(td, sptr);
+    if(present == 0 || present > td->elements_count) {
+        ASN_DEBUG("CHOICE %s member is not selected", td->name);
+        ASN__ENCODE_FAILED;
+    }
+
+    elm = &td->elements[present-1];
+    if(elm->flags & ATF_POINTER) {
+        memb_ptr =
+            *(const void *const *)((const char *)sptr + elm->memb_offset);
+        if(memb_ptr == 0) {
+            /* Mandatory element absent */
+            ASN__ENCODE_FAILED;
+        }
+    } else {
+        memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+    }
+
+    tag = asn_TYPE_outmost_tag(elm->type, memb_ptr, elm->tag_mode, elm->tag);
+    if(tag == 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    tag_len = oer_put_tag(tag, cb, app_key);
+    if(tag_len < 0) {
+        ASN__ENCODE_FAILED;
+    }
+
+    if(specs->ext_start >= 0 && (unsigned)specs->ext_start <= (present-1)) {
+        ssize_t encoded = oer_open_type_put(elm->type,
+                               elm->encoding_constraints.oer_constraints,
+                               memb_ptr, cb, app_key);
+        if(encoded < 0) ASN__ENCODE_FAILED;
+        er.encoded = tag_len + encoded;
+    } else {
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded >= 0) er.encoded += tag_len;
+    }
+
+    return er;
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/constr_SEQUENCE.c b/e2ap/lib/constr_SEQUENCE.c
new file mode 100644
index 0000000..43dcac7
--- /dev/null
+++ b/e2ap/lib/constr_SEQUENCE.c
@@ -0,0 +1,2059 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SEQUENCE.h>
+#include <OPEN_TYPE.h>
+#include <per_opentype.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num; \
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#undef	PHASE_OUT
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+#define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * Check whether we are inside the extensions group.
+ */
+#define IN_EXTENSION_GROUP(specs, memb_idx) \
+    ((specs)->first_extension >= 0          \
+     && (unsigned)(specs)->first_extension <= (memb_idx))
+
+/*
+ * Tags are canonically sorted in the tag2element map.
+ */
+static int
+_t2e_cmp(const void *ap, const void *bp) {
+	const asn_TYPE_tag2member_t *a = (const asn_TYPE_tag2member_t *)ap;
+	const asn_TYPE_tag2member_t *b = (const asn_TYPE_tag2member_t *)bp;
+
+	int a_class = BER_TAG_CLASS(a->el_tag);
+	int b_class = BER_TAG_CLASS(b->el_tag);
+
+	if(a_class == b_class) {
+		ber_tlv_tag_t a_value = BER_TAG_VALUE(a->el_tag);
+		ber_tlv_tag_t b_value = BER_TAG_VALUE(b->el_tag);
+
+		if(a_value == b_value) {
+			if(a->el_no > b->el_no)
+				return 1;
+			/*
+			 * Important: we do not check
+			 * for a->el_no <= b->el_no!
+			 */
+			return 0;
+		} else if(a_value < b_value)
+			return -1;
+		else
+			return 1;
+	} else if(a_class < b_class) {
+		return -1;
+	} else {
+		return 1;
+	}
+}
+
+
+/*
+ * The decoder of the SEQUENCE type.
+ */
+asn_dec_rval_t
+SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                    const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elements = td->elements;
+
+    /*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* SEQUENCE element's index */
+
+	ASN_DEBUG("Decoding %s as SEQUENCE", td->name);
+	
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+			tag_mode, 1, &ctx->left, 0);
+		if(rval.code != RC_OK) {
+			ASN_DEBUG("%s tagging check failed: %d",
+				td->name, rval.code);
+			return rval;
+		}
+
+		if(ctx->left >= 0)
+			ctx->left += rval.consumed; /* ?Substracted below! */
+		ADVANCE(rval.consumed);
+
+		NEXT_PHASE(ctx);
+
+		ASN_DEBUG("Structure consumes %ld bytes, buffer %ld",
+			(long)ctx->left, (long)size);
+
+		/* Fall through */
+	case 1:
+		/*
+		 * PHASE 1.
+		 * From the place where we've left it previously,
+		 * try to decode the next member from the list of
+		 * this structure's elements.
+		 * (ctx->step) stores the member being processed
+		 * between invocations and the microphase {0,1} of parsing
+		 * that member:
+		 * 	step = (<member_number> * 2 + <microphase>).
+		 */
+	  for(edx = ((size_t)ctx->step >> 1); edx < td->elements_count;
+			edx++, ctx->step = (ctx->step & ~1) + 2) {
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+		ssize_t tag_len;	/* Length of TLV's T */
+		size_t opt_edx_end;	/* Next non-optional element */
+		size_t n;
+		int use_bsearch;
+
+		if(ctx->step & 1)
+			goto microphase2;
+
+		/*
+		 * MICROPHASE 1: Synchronize decoding.
+		 */
+		ASN_DEBUG("In %s SEQUENCE left %d, edx=%" ASN_PRI_SIZE " flags=%d"
+				" opt=%d ec=%d",
+			td->name, (int)ctx->left, edx,
+			elements[edx].flags, elements[edx].optional,
+			td->elements_count);
+
+        if(ctx->left == 0 /* No more stuff is expected */
+           && (
+                  /* Explicit OPTIONAL specification reaches the end */
+                  (edx + elements[edx].optional == td->elements_count) ||
+                  /* All extensions are optional */
+                  IN_EXTENSION_GROUP(specs, edx))) {
+            ASN_DEBUG("End of SEQUENCE %s", td->name);
+            /*
+             * Found the legitimate end of the structure.
+             */
+            PHASE_OUT(ctx);
+            RETURN(RC_OK);
+        }
+
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		ASN_DEBUG("Current tag in %s SEQUENCE for element %" ASN_PRI_SIZE " "
+			"(%s) is %s encoded in %d bytes, of frame %ld",
+			td->name, edx, elements[edx].name,
+			ber_tlv_tag_string(tlv_tag), (int)tag_len, (long)LEFT);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+        if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) {
+            if(LEFT < 2) {
+                if(SIZE_VIOLATION) {
+                    RETURN(RC_FAIL);
+                } else {
+                    RETURN(RC_WMORE);
+                }
+            } else if(((const uint8_t *)ptr)[1] == 0) {
+                ASN_DEBUG("edx = %" ASN_PRI_SIZE ", opt = %d, ec=%d", edx,
+                          elements[edx].optional, td->elements_count);
+                if((edx + elements[edx].optional == td->elements_count)
+                   || IN_EXTENSION_GROUP(specs, edx)) {
+                    /*
+                     * Yeah, baby! Found the terminator
+                     * of the indefinite length structure.
+                     */
+                    /*
+                     * Proceed to the canonical
+                     * finalization function.
+                     * No advancing is necessary.
+                     */
+                    goto phase3;
+                }
+            }
+        }
+
+		/*
+		 * Find the next available type with this tag.
+		 */
+		use_bsearch = 0;
+		opt_edx_end = edx + elements[edx].optional + 1;
+		if(opt_edx_end > td->elements_count)
+			opt_edx_end = td->elements_count;	/* Cap */
+		else if(opt_edx_end - edx > 8) {
+			/* Limit the scope of linear search... */
+			opt_edx_end = edx + 8;
+			use_bsearch = 1;
+			/* ... and resort to bsearch() */
+		}
+		for(n = edx; n < opt_edx_end; n++) {
+			if(BER_TAGS_EQUAL(tlv_tag, elements[n].tag)) {
+				/*
+				 * Found element corresponding to the tag
+				 * being looked at.
+				 * Reposition over the right element.
+				 */
+				edx = n;
+				ctx->step = 1 + 2 * edx;	/* Remember! */
+				goto microphase2;
+			} else if(elements[n].flags & ATF_ANY_TYPE) {
+				/*
+				 * This is the ANY type, which may bear
+				 * any flag whatsoever.
+				 */
+				edx = n;
+				ctx->step = 1 + 2 * edx;	/* Remember! */
+				goto microphase2;
+			} else if(elements[n].tag == (ber_tlv_tag_t)-1) {
+				use_bsearch = 1;
+				break;
+			}
+		}
+		if(use_bsearch) {
+			/*
+			 * Resort to a binary search over
+			 * sorted array of tags.
+			 */
+			const asn_TYPE_tag2member_t *t2m;
+			asn_TYPE_tag2member_t key = {0, 0, 0, 0};
+			key.el_tag = tlv_tag;
+			key.el_no = edx;
+			t2m = (const asn_TYPE_tag2member_t *)bsearch(&key,
+				specs->tag2el, specs->tag2el_count,
+				sizeof(specs->tag2el[0]), _t2e_cmp);
+			if(t2m) {
+				const asn_TYPE_tag2member_t *best = 0;
+				const asn_TYPE_tag2member_t *t2m_f, *t2m_l;
+				size_t edx_max = edx + elements[edx].optional;
+				/*
+				 * Rewind to the first element with that tag,
+				 * `cause bsearch() does not guarantee order.
+				 */
+				t2m_f = t2m + t2m->toff_first;
+				t2m_l = t2m + t2m->toff_last;
+				for(t2m = t2m_f; t2m <= t2m_l; t2m++) {
+					if(t2m->el_no > edx_max) break;
+					if(t2m->el_no < edx) continue;
+					best = t2m;
+				}
+				if(best) {
+					edx = best->el_no;
+					ctx->step = 1 + 2 * edx;
+					goto microphase2;
+				}
+			}
+			n = opt_edx_end;
+		}
+		if(n == opt_edx_end) {
+			/*
+			 * If tag is unknown, it may be either
+			 * an unknown (thus, incorrect) tag,
+			 * or an extension (...),
+			 * or an end of the indefinite-length structure.
+			 */
+			if(!IN_EXTENSION_GROUP(specs,
+				edx + elements[edx].optional)) {
+				ASN_DEBUG("Unexpected tag %s (at %" ASN_PRI_SIZE ")",
+					ber_tlv_tag_string(tlv_tag), edx);
+				ASN_DEBUG("Expected tag %s (%s)%s",
+					ber_tlv_tag_string(elements[edx].tag),
+					elements[edx].name,
+					elements[edx].optional
+						?" or alternatives":"");
+				RETURN(RC_FAIL);
+			} else {
+				/* Skip this tag */
+				ssize_t skip;
+				edx += elements[edx].optional;
+
+				ASN_DEBUG("Skipping unexpected %s (at %" ASN_PRI_SIZE ")",
+					ber_tlv_tag_string(tlv_tag), edx);
+				skip = ber_skip_length(opt_codec_ctx,
+					BER_TLV_CONSTRUCTED(ptr),
+					(const char *)ptr + tag_len,
+					LEFT - tag_len);
+				ASN_DEBUG("Skip length %d in %s",
+					(int)skip, td->name);
+				switch(skip) {
+				case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+					/* Fall through */
+				case -1: RETURN(RC_FAIL);
+				}
+
+				ADVANCE(skip + tag_len);
+				ctx->step -= 2;
+				edx--;
+				continue;  /* Try again with the next tag */
+			}
+		}
+
+		/*
+		 * MICROPHASE 2: Invoke the member-specific decoder.
+		 */
+		ctx->step |= 1;		/* Confirm entering next microphase */
+	microphase2:
+		ASN_DEBUG("Inside SEQUENCE %s MF2", td->name);
+		
+		/*
+		 * Compute the position of the member inside a structure,
+		 * and also a type of containment (it may be contained
+		 * as pointer or using inline inclusion).
+		 */
+		if(elements[edx].flags & ATF_POINTER) {
+			/* Member is a pointer to another structure */
+			memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset);
+		} else {
+			/*
+			 * A pointer to a pointer
+			 * holding the start of the structure
+			 */
+			memb_ptr = (char *)st + elements[edx].memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		if(elements[edx].flags & ATF_OPEN_TYPE) {
+			rval = OPEN_TYPE_ber_get(opt_codec_ctx, td, st, &elements[edx], ptr, LEFT);
+        } else {
+			rval = elements[edx].type->op->ber_decoder(opt_codec_ctx,
+					elements[edx].type,
+					memb_ptr2, ptr, LEFT,
+					elements[edx].tag_mode);
+		}
+		ASN_DEBUG("In %s SEQUENCE decoded %" ASN_PRI_SIZE " %s of %d "
+			"in %d bytes rval.code %d, size=%d",
+			td->name, edx, elements[edx].type->name,
+			(int)LEFT, (int)rval.consumed, rval.code, (int)size);
+		switch(rval.code) {
+		case RC_OK:
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			ASN_DEBUG("Size violation (c->l=%ld <= s=%ld)",
+				(long)ctx->left, (long)size);
+			/* Fall through */
+		case RC_FAIL: /* Fatal error */
+			RETURN(RC_FAIL);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  }	/* for(all structure members) */
+
+	phase3:
+		ctx->phase = 3;
+        /* Fall through */
+	case 3:	/* 00 and other tags expected */
+	case 4:	/* only 00's expected */
+
+		ASN_DEBUG("SEQUENCE %s Leftover: %ld, size = %ld",
+			td->name, (long)ctx->left, (long)size);
+
+		/*
+		 * Skip everything until the end of the SEQUENCE.
+		 */
+		while(ctx->left) {
+			ssize_t tl, ll;
+
+			tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+			switch(tl) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			/*
+			 * If expected <0><0>...
+			 */
+			if(ctx->left < 0
+				&& ((const uint8_t *)ptr)[0] == 0) {
+				if(LEFT < 2) {
+					if(SIZE_VIOLATION)
+						RETURN(RC_FAIL);
+					else
+						RETURN(RC_WMORE);
+				} else if(((const uint8_t *)ptr)[1] == 0) {
+					/*
+					 * Correctly finished with <0><0>.
+					 */
+					ADVANCE(2);
+					ctx->left++;
+					ctx->phase = 4;
+					continue;
+				}
+			}
+
+			if(!IN_EXTENSION_GROUP(specs, td->elements_count)
+			|| ctx->phase == 4) {
+				ASN_DEBUG("Unexpected continuation "
+					"of a non-extensible type "
+					"%s (SEQUENCE): %s",
+					td->name,
+					ber_tlv_tag_string(tlv_tag));
+				RETURN(RC_FAIL);
+			}
+
+			ll = ber_skip_length(opt_codec_ctx,
+				BER_TLV_CONSTRUCTED(ptr),
+				(const char *)ptr + tl, LEFT - tl);
+			switch(ll) {
+			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+				/* Fall through */
+			case -1: RETURN(RC_FAIL);
+			}
+
+			ADVANCE(tl + ll);
+		}
+
+		PHASE_OUT(ctx);
+	}
+	
+	RETURN(RC_OK);
+}
+
+
+/*
+ * The DER encoder of the SEQUENCE type.
+ */
+asn_enc_rval_t
+SEQUENCE_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int tag_mode, ber_tlv_tag_t tag,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t computed_size = 0;
+	asn_enc_rval_t erval = {0,0,0};
+	ssize_t ret;
+	size_t edx;
+
+	ASN_DEBUG("%s %s as SEQUENCE",
+		cb?"Encoding":"Estimating", td->name);
+
+	/*
+	 * Gather the length of the underlying members sequence.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+
+		const void *memb_ptr;		/* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %" ASN_PRI_SIZE " not present",
+					elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+			continue;
+
+		erval = elm->type->op->der_encoder(elm->type, *memb_ptr2,
+			elm->tag_mode, elm->tag,
+			0, 0);
+		if(erval.encoded == -1)
+			return erval;
+		computed_size += erval.encoded;
+		ASN_DEBUG("Member %" ASN_PRI_SIZE " %s estimated %ld bytes",
+			edx, elm->name, (long)erval.encoded);
+	}
+
+	/*
+	 * Encode the TLV for the sequence itself.
+	 */
+	ret = der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key);
+	ASN_DEBUG("Wrote tags: %ld (+%ld)", (long)ret, (long)computed_size);
+	if(ret == -1)
+		ASN__ENCODE_FAILED;
+	erval.encoded = computed_size + ret;
+
+	if(!cb) ASN__ENCODED_OK(erval);
+
+	/*
+	 * Encode all members.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		asn_enc_rval_t tmperval = {0,0,0};
+        const void *memb_ptr;           /* Pointer to the member */
+        const void *const *memb_ptr2;   /* Pointer to that pointer */
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) continue;
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+        if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+            continue;
+
+		tmperval = elm->type->op->der_encoder(elm->type, *memb_ptr2,
+			elm->tag_mode, elm->tag, cb, app_key);
+		if(tmperval.encoded == -1)
+			return tmperval;
+		computed_size -= tmperval.encoded;
+		ASN_DEBUG("Member %" ASN_PRI_SIZE " %s of SEQUENCE %s encoded in %ld bytes",
+			edx, elm->name, td->name, (long)tmperval.encoded);
+	}
+
+	if(computed_size != 0)
+		/*
+		 * Encoded size is not equal to the computed size.
+		 */
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(erval);
+}
+
+
+#undef	XER_ADVANCE
+#define XER_ADVANCE(num_bytes)           \
+    do {                                 \
+        size_t num = (num_bytes);        \
+        ptr = ((const char *)ptr) + num; \
+        size -= num;                     \
+        consumed_myself += num;          \
+    } while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+SEQUENCE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                    const char *opt_mname, const void *ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SEQUENCE_specifics_t *specs
+		= (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_TYPE_member_t *elements = td->elements;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * ... and parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval;		/* Return value from a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+	size_t edx;			/* Element index */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 * Phase 3: Skipping unknown extensions.
+	 * Phase 4: PHASED OUT
+	 */
+	for(edx = ctx->step; ctx->phase <= 3;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+		asn_TYPE_member_t *elm;
+
+		/*
+		 * Go inside the inner member of a sequence.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval;
+			void *memb_ptr_dontuse;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+
+			elm = &td->elements[edx];
+
+			if(elm->flags & ATF_POINTER) {
+				/* Member is a pointer to another structure */
+				memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+			} else {
+				memb_ptr_dontuse = (char *)st + elm->memb_offset;
+				memb_ptr2 = &memb_ptr_dontuse;  /* Only use of memb_ptr_dontuse */
+			}
+
+			if(elm->flags & ATF_OPEN_TYPE) {
+				tmprval = OPEN_TYPE_xer_get(opt_codec_ctx, td, st, elm, ptr, size);
+			} else {
+				/* Invoke the inner type decoder, m.b. multiple times */
+				tmprval = elm->type->op->xer_decoder(opt_codec_ctx,
+						elm->type, memb_ptr2, elm->name,
+						ptr, size);
+			}
+			XER_ADVANCE(tmprval.consumed);
+			if(tmprval.code != RC_OK)
+				RETURN(tmprval.code);
+			ctx->phase = 1;	/* Back to body processing */
+			ctx->step = ++edx;
+			ASN_DEBUG("XER/SEQUENCE phase => %d, step => %d",
+				ctx->phase, ctx->step);
+			/* Fall through */
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, ptr, size,
+			&ch_type);
+		if(ch_size == -1) {
+		    RETURN(RC_FAIL);
+		} else {
+			switch(ch_type) {
+			case PXER_WMORE:
+				RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/SEQUENCE: tcv = %d, ph=%d [%s]",
+			tcv, ctx->phase, xml_tag);
+
+		/* Skip the extensions section */
+		if(ctx->phase == 3) {
+			switch(xer_skip_unknown(tcv, &ctx->left)) {
+			case -1:
+				ctx->phase = 4;
+				RETURN(RC_FAIL);
+			case 0:
+				XER_ADVANCE(ch_size);
+				continue;
+			case 1:
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;
+				continue;
+			case 2:
+				ctx->phase = 1;
+				break;
+			}
+		}
+
+		switch(tcv) {
+		case XCT_CLOSING:
+			if(ctx->phase == 0) break;
+			ctx->phase = 0;
+			/* Fall through */
+		case XCT_BOTH:
+            if(ctx->phase == 0) {
+                if(edx >= td->elements_count ||
+                   /* Explicit OPTIONAL specs reaches the end */
+                   (edx + elements[edx].optional == td->elements_count) ||
+                   /* All extensions are optional */
+                   IN_EXTENSION_GROUP(specs, edx)) {
+                    XER_ADVANCE(ch_size);
+					ctx->phase = 4;	/* Phase out */
+					RETURN(RC_OK);
+				} else {
+					ASN_DEBUG("Premature end of XER SEQUENCE");
+					RETURN(RC_FAIL);
+				}
+			}
+			/* Fall through */
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d, edx=%" ASN_PRI_SIZE "",
+				tcv, ctx->phase, edx);
+			if(ctx->phase != 1) {
+				break;	/* Really unexpected */
+			}
+
+			if(edx < td->elements_count) {
+				/*
+				 * Search which member corresponds to this tag.
+				 */
+				size_t n;
+				size_t edx_end = edx + elements[edx].optional + 1;
+				if(edx_end > td->elements_count)
+					edx_end = td->elements_count;
+				for(n = edx; n < edx_end; n++) {
+					elm = &td->elements[n];
+					tcv = xer_check_tag(ptr, ch_size, elm->name);
+					switch(tcv) {
+					case XCT_BOTH:
+					case XCT_OPENING:
+						/*
+						 * Process this member.
+						 */
+						ctx->step = edx = n;
+						ctx->phase = 2;
+						break;
+					case XCT_UNKNOWN_OP:
+					case XCT_UNKNOWN_BO:
+						continue;
+					default:
+						n = edx_end;
+						break;	/* Phase out */
+					}
+					break;
+				}
+				if(n != edx_end)
+					continue;
+			} else {
+				ASN_DEBUG("Out of defined members: %" ASN_PRI_SIZE "/%u",
+					edx, td->elements_count);
+			}
+
+			/* It is expected extension */
+			if(IN_EXTENSION_GROUP(specs,
+				edx + (edx < td->elements_count
+					? elements[edx].optional : 0))) {
+				ASN_DEBUG("Got anticipated extension at %" ASN_PRI_SIZE "",
+					edx);
+				/*
+				 * Check for (XCT_BOTH or XCT_UNKNOWN_BO)
+				 * By using a mask. Only record a pure
+				 * <opening> tags.
+				 */
+				if(tcv & XCT_CLOSING) {
+					/* Found </extension> without body */
+				} else {
+					ctx->left = 1;
+					ctx->phase = 3;	/* Skip ...'s */
+				}
+				XER_ADVANCE(ch_size);
+				continue;
+			}
+
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag in SEQUENCE [%c%c%c%c%c%c]",
+			size>0?((const char *)ptr)[0]:'.',
+			size>1?((const char *)ptr)[1]:'.',
+			size>2?((const char *)ptr)[2]:'.',
+			size>3?((const char *)ptr)[3]:'.',
+			size>4?((const char *)ptr)[4]:'.',
+			size>5?((const char *)ptr)[5]:'.');
+		break;
+	}
+
+	ctx->phase = 4;	/* "Phase out" on hard failure */
+	RETURN(RC_FAIL);
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    int ilevel, enum xer_encoder_flags_e flags,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    int xcan = (flags & XER_F_CANONICAL);
+    asn_TYPE_descriptor_t *tmp_def_val_td = 0;
+    void *tmp_def_val = 0;
+    size_t edx;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    er.encoded = 0;
+
+    for(edx = 0; edx < td->elements_count; edx++) {
+        asn_enc_rval_t tmper = {0,0,0};
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        const void *memb_ptr;
+        const char *mname = elm->name;
+        unsigned int mlen = strlen(mname);
+
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr =
+                *(const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!memb_ptr) {
+                assert(tmp_def_val == 0);
+                if(elm->default_value_set) {
+                    if(elm->default_value_set(&tmp_def_val)) {
+                        ASN__ENCODE_FAILED;
+                    } else {
+                        memb_ptr = tmp_def_val;
+                        tmp_def_val_td = elm->type;
+                    }
+                } else if(elm->optional) {
+                    continue;
+                } else {
+                    /* Mandatory element is missing */
+                    ASN__ENCODE_FAILED;
+                }
+            }
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+        }
+
+        if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+        ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+        /* Print the member itself */
+        tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1,
+                                           flags, cb, app_key);
+        if(tmp_def_val) {
+            ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val);
+            tmp_def_val = 0;
+        }
+        if(tmper.encoded == -1) return tmper;
+        er.encoded += tmper.encoded;
+
+        ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+    }
+
+    if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+    ASN__ENCODED_OK(er);
+cb_failed:
+    if(tmp_def_val) ASN_STRUCT_FREE(*tmp_def_val_td, tmp_def_val);
+    ASN__ENCODE_FAILED;
+}
+
+int
+SEQUENCE_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+               asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t edx;
+	int ret;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/* Dump preamble */
+	if(cb(td->name, strlen(td->name), app_key) < 0
+	|| cb(" ::= {", 6, app_key) < 0)
+		return -1;
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional) continue;
+				/* Print <absent> line */
+				/* Fall through */
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		/* Indentation */
+		_i_INDENT(1);
+
+		/* Print the member's name and stuff */
+		if(cb(elm->name, strlen(elm->name), app_key) < 0
+		|| cb(": ", 2, app_key) < 0)
+			return -1;
+
+		/* Print the member itself */
+		ret = elm->type->op->print_struct(elm->type, memb_ptr, ilevel + 1,
+			cb, app_key);
+		if(ret) return ret;
+	}
+
+	ilevel--;
+	_i_INDENT(1);
+
+	return (cb("}", 1, app_key) < 0) ? -1 : 0;
+}
+
+void
+SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
+              enum asn_struct_free_method method) {
+    size_t edx;
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_struct_ctx_t *ctx; /* Decoder context */
+
+	if(!td || !sptr)
+		return;
+
+	ASN_DEBUG("Freeing %s as SEQUENCE", td->name);
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
+			if(memb_ptr)
+				ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		} else {
+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
+			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
+		}
+	}
+
+	/* Clean parsing context */
+	ctx = (asn_struct_ctx_t *)((char *)sptr + specs->ctx_offset);
+	FREEMEM(ctx->ptr);
+
+    switch(method) {
+    case ASFM_FREE_EVERYTHING:
+        FREEMEM(sptr);
+        break;
+    case ASFM_FREE_UNDERLYING:
+        break;
+    case ASFM_FREE_UNDERLYING_AND_RESET:
+        memset(
+            sptr, 0,
+            ((const asn_SEQUENCE_specifics_t *)(td->specifics))->struct_size);
+        break;
+    }
+}
+
+int
+SEQUENCE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                    asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    size_t edx;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	/*
+	 * Iterate over structure members and check their validity.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;
+
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!memb_ptr) {
+				if(elm->optional)
+					continue;
+				ASN__CTFAIL(app_key, td, sptr,
+				"%s: mandatory element %s absent (%s:%d)",
+				td->name, elm->name, __FILE__, __LINE__);
+				return -1;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+		}
+
+		if(elm->encoding_constraints.general_constraints) {
+			int ret = elm->encoding_constraints.general_constraints(elm->type, memb_ptr,
+				ctfailcb, app_key);
+			if(ret) return ret;
+		} else {
+			return elm->type->encoding_constraints.general_constraints(elm->type,
+				memb_ptr, ctfailcb, app_key);
+		}
+	}
+
+	return 0;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+SEQUENCE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, void **sptr,
+                     asn_per_data_t *pd) {
+    const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	void *st = *sptr;	/* Target structure. */
+	int extpresent;		/* Extension additions are present */
+	uint8_t *opres;		/* Presence of optional root members */
+	asn_per_data_t opmd;
+	asn_dec_rval_t rv;
+	size_t edx;
+
+	(void)constraints;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as SEQUENCE (UPER)", td->name);
+
+	/* Handle extensions */
+	if(specs->first_extension < 0) {
+		extpresent = 0;
+	} else {
+		extpresent = per_get_few_bits(pd, 1);
+		if(extpresent < 0) ASN__DECODE_STARVED;
+	}
+
+	/* Prepare a place and read-in the presence bitmap */
+	memset(&opmd, 0, sizeof(opmd));
+	if(specs->roms_count) {
+		opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
+		if(!opres) ASN__DECODE_FAILED;
+		/* Get the presence map */
+		if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
+			FREEMEM(opres);
+			ASN__DECODE_STARVED;
+		}
+		opmd.buffer = opres;
+		opmd.nbits = specs->roms_count;
+		ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
+			td->name, specs->roms_count, *opres);
+	} else {
+		opres = 0;
+	}
+
+	/*
+	 * Get the sequence ROOT elements.
+	 */
+    for(edx = 0;
+        edx < (specs->first_extension < 0 ? td->elements_count
+                                          : (size_t)specs->first_extension);
+        edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+
+		assert(!IN_EXTENSION_GROUP(specs, edx));
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+
+		/* Deal with optionality */
+		if(elm->optional) {
+			int present = per_get_few_bits(&opmd, 1);
+			ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)",
+				td->name, elm->name, present,
+				(int)opmd.nboff, (int)opmd.nbits);
+			if(present == 0) {
+				/* This element is not present */
+				if(elm->default_value_set) {
+					/* Fill-in DEFAULT */
+					if(elm->default_value_set(memb_ptr2)) {
+						FREEMEM(opres);
+						ASN__DECODE_FAILED;
+					}
+					ASN_DEBUG("Filled-in default");
+				}
+				/* The member is just not present */
+				continue;
+			}
+			/* Fall through */
+		}
+
+		/* Fetch the member from the stream */
+		ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name);
+
+		if(elm->flags & ATF_OPEN_TYPE) {
+			rv = OPEN_TYPE_uper_get(opt_codec_ctx, td, st, elm, pd);
+		} else {
+			rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+					elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+		}
+		if(rv.code != RC_OK) {
+			ASN_DEBUG("Failed decode %s in %s",
+				elm->name, td->name);
+			FREEMEM(opres);
+			return rv;
+		}
+	}
+
+	/* Optionality map is not needed anymore */
+	FREEMEM(opres);
+
+	/*
+	 * Deal with extensions.
+	 */
+	if(extpresent) {
+		ssize_t bmlength;
+		uint8_t *epres;		/* Presence of extension members */
+		asn_per_data_t epmd;
+
+		bmlength = uper_get_nslength(pd);
+		if(bmlength < 0) ASN__DECODE_STARVED;
+
+		ASN_DEBUG("Extensions %" ASN_PRI_SSIZE " present in %s", bmlength, td->name);
+
+		epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
+		if(!epres) ASN__DECODE_STARVED;
+
+		/* Get the extensions map */
+		if(per_get_many_bits(pd, epres, 0, bmlength)) {
+			FREEMEM(epres);
+			ASN__DECODE_STARVED;
+		}
+
+		memset(&epmd, 0, sizeof(epmd));
+		epmd.buffer = epres;
+		epmd.nbits = bmlength;
+		ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
+			td->name, (long)bmlength, *epres);
+
+	    /* Go over extensions and read them in */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            void *memb_ptr;   /* Pointer to the member */
+            void **memb_ptr2; /* Pointer to that pointer */
+            int present;
+
+            /* Fetch the pointer to this member */
+            if(elm->flags & ATF_POINTER) {
+                memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+            } else {
+                memb_ptr = (void *)((char *)st + elm->memb_offset);
+                memb_ptr2 = &memb_ptr;
+            }
+
+            present = per_get_few_bits(&epmd, 1);
+            if(present <= 0) {
+                if(present < 0) break; /* No more extensions */
+                continue;
+            }
+
+            ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name,
+                      *memb_ptr2);
+            rv = uper_open_type_get(opt_codec_ctx, elm->type,
+                                    elm->encoding_constraints.per_constraints,
+                                    memb_ptr2, pd);
+            if(rv.code != RC_OK) {
+                FREEMEM(epres);
+                return rv;
+            }
+	    }
+
+		/* Skip over overflow extensions which aren't present
+		 * in this system's version of the protocol */
+		for(;;) {
+			ASN_DEBUG("Getting overflow extensions");
+			switch(per_get_few_bits(&epmd, 1)) {
+			case -1: break;
+			case 0: continue;
+			default:
+				if(uper_open_type_skip(opt_codec_ctx, pd)) {
+					FREEMEM(epres);
+					ASN__DECODE_STARVED;
+				}
+                ASN_DEBUG("Skipped overflow extension");
+                continue;
+			}
+			break;
+		}
+
+		FREEMEM(epres);
+	}
+
+    if(specs->first_extension >= 0) {
+        unsigned i;
+        /* Fill DEFAULT members in extensions */
+        for(i = specs->roms_count; i < specs->roms_count + specs->aoms_count;
+            i++) {
+            asn_TYPE_member_t *elm;
+            void **memb_ptr2; /* Pointer to member pointer */
+
+            edx = specs->oms[i];
+            elm = &td->elements[edx];
+
+            if(!elm->default_value_set) continue;
+
+            /* Fetch the pointer to this member */
+            if(elm->flags & ATF_POINTER) {
+                memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+                if(*memb_ptr2) continue;
+            } else {
+                continue; /* Extensions are all optionals */
+            }
+
+            /* Set default value */
+            if(elm->default_value_set(memb_ptr2)) {
+                ASN__DECODE_FAILED;
+            }
+        }
+    }
+
+	rv.consumed = 0;
+	rv.code = RC_OK;
+	return rv;
+}
+
+static int
+SEQUENCE__handle_extensions(const asn_TYPE_descriptor_t *td, const void *sptr,
+                            asn_per_outp_t *po1, asn_per_outp_t *po2) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    int exts_present = 0;
+    int exts_count = 0;
+    size_t edx;
+
+    if(specs->first_extension < 0) {
+        return 0;
+    }
+
+    /* Find out which extensions are present */
+    for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        const void *memb_ptr;         /* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+        int present;
+
+        /* Fetch the pointer to this member */
+        if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            present = (*memb_ptr2 != 0);
+        } else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+        ASN_DEBUG("checking %s:%s (@%" ASN_PRI_SIZE ") present => %d", elm->name,
+                  elm->type->name, edx, present);
+        exts_count++;
+        exts_present += present;
+
+        /* Encode as presence marker */
+        if(po1 && per_put_few_bits(po1, present, 1)) {
+            return -1;
+        }
+        /* Encode as open type field */
+        if(po2 && present
+           && uper_open_type_put(elm->type,
+                                 elm->encoding_constraints.per_constraints,
+                                 *memb_ptr2, po2))
+            return -1;
+    }
+
+    return exts_present ? exts_count : 0;
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_uper(const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, const void *sptr,
+                     asn_per_outp_t *po) {
+    const asn_SEQUENCE_specifics_t *specs
+		= (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	int n_extensions;
+	size_t edx;
+	size_t i;
+
+	(void)constraints;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE (UPER)", td->name);
+
+	/*
+	 * X.691#18.1 Whether structure is extensible
+	 * and whether to encode extensions
+	 */
+    if(specs->first_extension < 0) {
+        n_extensions = 0; /* There are no extensions to encode */
+    } else {
+        n_extensions = SEQUENCE__handle_extensions(td, sptr, 0, 0);
+        if(n_extensions < 0) ASN__ENCODE_FAILED;
+        if(per_put_few_bits(po, n_extensions ? 1 : 0, 1)) {
+            ASN__ENCODE_FAILED;
+        }
+    }
+
+	/* Encode a presence bitmap */
+	for(i = 0; i < specs->roms_count; i++) {
+		asn_TYPE_member_t *elm;
+		const void *memb_ptr;		/* Pointer to the member */
+        const void *const *memb_ptr2; /* Pointer to that pointer */
+        int present;
+
+		edx = specs->oms[i];
+		elm = &td->elements[edx];
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            present = (*memb_ptr2 != 0);
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		/* Eliminate default values */
+        if(present && elm->default_value_cmp
+           && elm->default_value_cmp(*memb_ptr2) == 0)
+            present = 0;
+
+		ASN_DEBUG("Element %s %s %s->%s is %s",
+			elm->flags & ATF_POINTER ? "ptr" : "inline",
+			elm->default_value_cmp ? "def" : "wtv",
+			td->name, elm->name, present ? "present" : "absent");
+		if(per_put_few_bits(po, present, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Encode the sequence ROOT elements.
+	 */
+    ASN_DEBUG("first_extension = %d, elements = %d", specs->first_extension,
+              td->elements_count);
+	for(edx = 0;
+		edx < ((specs->first_extension < 0) ? td->elements_count
+                                            : (size_t)specs->first_extension);
+		edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;         /* Pointer to the member */
+		const void *const *memb_ptr2; /* Pointer to that pointer */
+
+		ASN_DEBUG("About to encode %s", elm->type->name);
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+            memb_ptr2 =
+                (const void *const *)((const char *)sptr + elm->memb_offset);
+            if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %" ASN_PRI_SIZE " not present",
+					elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+            memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+            memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(*memb_ptr2) == 0)
+			continue;
+
+        ASN_DEBUG("Encoding %s->%s:%s", td->name, elm->name, elm->type->name);
+        er = elm->type->op->uper_encoder(
+            elm->type, elm->encoding_constraints.per_constraints, *memb_ptr2,
+            po);
+        if(er.encoded == -1) return er;
+    }
+
+	/* No extensions to encode */
+	if(!n_extensions) ASN__ENCODED_OK(er);
+
+	ASN_DEBUG("Length of extensions %d bit-map", n_extensions);
+	/* #18.8. Write down the presence bit-map length. */
+	if(uper_put_nslength(po, n_extensions))
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Bit-map of %d elements", n_extensions);
+	/* #18.7. Encoding the extensions presence bit-map. */
+	/* TODO: act upon NOTE in #18.7 for canonical PER */
+	if(SEQUENCE__handle_extensions(td, sptr, po, 0) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Writing %d extensions", n_extensions);
+	/* #18.9. Encode extensions as open type fields. */
+	if(SEQUENCE__handle_extensions(td, sptr, 0, po) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_dec_rval_t
+SEQUENCE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	void *st = *sptr;	/* Target structure. */
+	int extpresent;		/* Extension additions are present */
+	uint8_t *opres;		/* Presence of optional root members */
+	asn_per_data_t opmd;
+	asn_dec_rval_t rv;
+	size_t edx;
+
+	(void)constraints;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+
+	ASN_DEBUG("Decoding %s as SEQUENCE (APER)", td->name);
+
+	/* Handle extensions */
+	if(specs->first_extension < 0) {
+		extpresent = 0;
+	} else {
+		extpresent = per_get_few_bits(pd, 1);
+		if(extpresent < 0) ASN__DECODE_STARVED;
+	}
+
+	/* Prepare a place and read-in the presence bitmap */
+	memset(&opmd, 0, sizeof(opmd));
+	if(specs->roms_count) {
+		opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
+		if(!opres) ASN__DECODE_FAILED;
+		/* Get the presence map */
+		if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
+			FREEMEM(opres);
+			ASN__DECODE_STARVED;
+		}
+		opmd.buffer = opres;
+		opmd.nbits = specs->roms_count;
+		ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
+		          td->name, specs->roms_count, *opres);
+	} else {
+		opres = 0;
+	}
+
+	/*
+	 * Get the sequence ROOT elements.
+	 */
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void *memb_ptr;		/* Pointer to the member */
+		void **memb_ptr2;	/* Pointer to that pointer */
+#if 0
+		int padding;
+#endif
+
+		if(IN_EXTENSION_GROUP(specs, edx))
+			continue;
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+		} else {
+			memb_ptr = (char *)st + elm->memb_offset;
+			memb_ptr2 = &memb_ptr;
+		}
+#if 0
+		/* Get Padding */
+		padding = (8 - (pd->moved % 8)) % 8;
+		if(padding > 0)
+			ASN_DEBUG("For element %s,offset= %ld Padding bits = %d", td->name, pd->moved, padding);
+#if 0 /* old way of removing padding */
+		per_get_few_bits(pd, padding);
+#else /* Experimental fix proposed by @mhanna123 */
+		if(edx != (td->elements_count-1))
+			per_get_few_bits(pd, padding);
+		else {
+			if(specs->roms_count && (padding > 0))
+				ASN_DEBUG(">>>>> not skipping padding of %d bits for element:%ld out of %d", padding, edx, td->elements_count);
+			else
+				per_get_few_bits(pd, padding);
+		}
+#endif /* dealing with padding */
+#endif
+		/* Deal with optionality */
+		if(elm->optional) {
+			int present = per_get_few_bits(&opmd, 1);
+			ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)",
+			          td->name, elm->name, present,
+			          (int)opmd.nboff, (int)opmd.nbits);
+			if(present == 0) {
+				/* This element is not present */
+				if(elm->default_value_set) {
+					/* Fill-in DEFAULT */
+					if(elm->default_value_set(memb_ptr2)) {
+						FREEMEM(opres);
+						ASN__DECODE_FAILED;
+					}
+					ASN_DEBUG("Filled-in default");
+				}
+				/* The member is just not present */
+				continue;
+			}
+			/* Fall through */
+		}
+
+		/* Fetch the member from the stream */
+		ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name);
+
+		if(elm->flags & ATF_OPEN_TYPE) {
+			rv = OPEN_TYPE_aper_get(opt_codec_ctx, td, st, elm, pd);
+		} else {
+			rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+					elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+		}
+		if(rv.code != RC_OK) {
+			ASN_DEBUG("Failed decode %s in %s",
+			          elm->name, td->name);
+			FREEMEM(opres);
+			return rv;
+		}
+	}
+
+	/* Optionality map is not needed anymore */
+	FREEMEM(opres);
+
+	/*
+	 * Deal with extensions.
+	 */
+	if(extpresent) {
+		ssize_t bmlength;
+		uint8_t *epres;		/* Presence of extension members */
+		asn_per_data_t epmd;
+
+		bmlength = aper_get_nslength(pd);
+		if(bmlength < 0) ASN__DECODE_STARVED;
+
+		ASN_DEBUG("Extensions %" ASN_PRI_SSIZE " present in %s", bmlength, td->name);
+
+		epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
+		if(!epres) ASN__DECODE_STARVED;
+
+		/* Get the extensions map */
+		if(per_get_many_bits(pd, epres, 0, bmlength))
+			ASN__DECODE_STARVED;
+
+		memset(&epmd, 0, sizeof(epmd));
+		epmd.buffer = epres;
+		epmd.nbits = bmlength;
+		ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
+		          td->name, bmlength, *epres);
+
+		/* Go over extensions and read them in */
+		for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+			asn_TYPE_member_t *elm = &td->elements[edx];
+			void *memb_ptr;		/* Pointer to the member */
+			void **memb_ptr2;	/* Pointer to that pointer */
+			int present;
+
+			if(!IN_EXTENSION_GROUP(specs, edx)) {
+				ASN_DEBUG("%ld is not extension", edx);
+				continue;
+			}
+
+			/* Fetch the pointer to this member */
+			if(elm->flags & ATF_POINTER) {
+				memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+			} else {
+				memb_ptr = (void *)((char *)st + elm->memb_offset);
+				memb_ptr2 = &memb_ptr;
+			}
+
+			present = per_get_few_bits(&epmd, 1);
+			if(present <= 0) {
+				if(present < 0) break;	/* No more extensions */
+				continue;
+			}
+
+			ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, *memb_ptr2);
+			rv = aper_open_type_get(opt_codec_ctx, elm->type,
+			                        elm->encoding_constraints.per_constraints, memb_ptr2, pd);
+			if(rv.code != RC_OK) {
+				FREEMEM(epres);
+				return rv;
+			}
+		}
+
+		/* Skip over overflow extensions which aren't present
+		 * in this system's version of the protocol */
+		for(;;) {
+			ASN_DEBUG("Getting overflow extensions");
+			switch(per_get_few_bits(&epmd, 1)) {
+			case -1:
+				break;
+			case 0:
+				continue;
+			default:
+				if(aper_open_type_skip(opt_codec_ctx, pd)) {
+					FREEMEM(epres);
+					ASN__DECODE_STARVED;
+				}
+			}
+			break;
+		}
+
+		FREEMEM(epres);
+	}
+
+	/* Fill DEFAULT members in extensions */
+	for(edx = specs->roms_count; edx < specs->roms_count
+	        + specs->aoms_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		void **memb_ptr2;	/* Pointer to member pointer */
+
+		if(!elm->default_value_set) continue;
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (void **)((char *)st
+			                      + elm->memb_offset);
+			if(*memb_ptr2) continue;
+		} else {
+			continue;	/* Extensions are all optionals */
+		}
+
+		/* Set default value */
+		if(elm->default_value_set(memb_ptr2)) {
+			ASN__DECODE_FAILED;
+		}
+	}
+
+	rv.consumed = 0;
+	rv.code = RC_OK;
+	return rv;
+}
+
+static int
+SEQUENCE_handle_extensions_aper(const asn_TYPE_descriptor_t *td,
+                                const void *sptr,
+                                asn_per_outp_t *po1, asn_per_outp_t *po2) {
+	const asn_SEQUENCE_specifics_t *specs
+	    = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	int exts_present = 0;
+	int exts_count = 0;
+	size_t edx;
+
+	if(specs->first_extension < 0) {
+		return 0;
+	}
+
+	/* Find out which extensions are present */
+	for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;           /* Pointer to the member */
+		const void * const *memb_ptr2;  /* Pointer to that pointer */
+		int present;
+
+		if(!IN_EXTENSION_GROUP(specs, edx)) {
+			ASN_DEBUG("%s (@%ld) is not extension", elm->type->name, edx);
+			continue;
+		}
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			present = (*memb_ptr2 != 0);
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		ASN_DEBUG("checking %s (@%ld) present => %d",
+		          elm->type->name, edx, present);
+		exts_count++;
+		exts_present += present;
+
+		/* Encode as presence marker */
+		if(po1 && per_put_few_bits(po1, present, 1))
+			return -1;
+		/* Encode as open type field */
+		if(po2 && present && aper_open_type_put(elm->type,
+		                                        elm->encoding_constraints.per_constraints, *memb_ptr2, po2))
+			return -1;
+
+	}
+
+	return exts_present ? exts_count : 0;
+}
+
+asn_enc_rval_t
+SEQUENCE_encode_aper(const asn_TYPE_descriptor_t *td,
+                     const asn_per_constraints_t *constraints,
+                     const void *sptr, asn_per_outp_t *po) {
+	const asn_SEQUENCE_specifics_t *specs
+	    = (const asn_SEQUENCE_specifics_t *)td->specifics;
+	asn_enc_rval_t er = {0,0,0};
+	int n_extensions;
+	size_t edx;
+	size_t i;
+
+	(void)constraints;
+
+	if(!sptr)
+		ASN__ENCODE_FAILED;
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE (APER)", td->name);
+
+	/*
+	 * X.691#18.1 Whether structure is extensible
+	 * and whether to encode extensions
+	 */
+	if(specs->first_extension < 0) {
+		n_extensions = 0; /* There are no extensions to encode */
+	} else {
+		n_extensions = SEQUENCE_handle_extensions_aper(td, sptr, 0, 0);
+		if(n_extensions < 0) ASN__ENCODE_FAILED;
+		if(per_put_few_bits(po, n_extensions ? 1 : 0, 1)) {
+			ASN__ENCODE_FAILED;
+		}
+	}
+
+	/* Encode a presence bitmap */
+	for(i = 0; i < specs->roms_count; i++) {
+		asn_TYPE_member_t *elm;
+		const void *memb_ptr;	 /* Pointer to the member */
+		const void * const *memb_ptr2;       /* Pointer to that pointer */
+		int present;
+
+		edx = specs->oms[i];
+		elm = &td->elements[edx];
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			present = (*memb_ptr2 != 0);
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+			present = 1;
+		}
+
+		/* Eliminate default values */
+		if(present && elm->default_value_cmp
+		        && elm->default_value_cmp(memb_ptr2) == 1)
+			present = 0;
+
+		ASN_DEBUG("Element %s %s %s->%s is %s",
+		          elm->flags & ATF_POINTER ? "ptr" : "inline",
+		          elm->default_value_cmp ? "def" : "wtv",
+		          td->name, elm->name, present ? "present" : "absent");
+		if(per_put_few_bits(po, present, 1))
+			ASN__ENCODE_FAILED;
+	}
+
+	/*
+	 * Encode the sequence ROOT elements.
+	 */
+	ASN_DEBUG("first_extension = %d, elements = %d", specs->first_extension,
+              td->elements_count);
+	for(edx = 0;
+		edx < ((specs->first_extension < 0) ? td->elements_count
+                                            : (size_t)specs->first_extension);
+		edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *memb_ptr;          /* Pointer to the member */
+		const void * const *memb_ptr2; /* Pointer to that pointer */
+
+		if(IN_EXTENSION_GROUP(specs, edx))
+			continue;
+
+		ASN_DEBUG("About to encode %s", elm->type->name);
+
+		/* Fetch the pointer to this member */
+		if(elm->flags & ATF_POINTER) {
+			memb_ptr2 = (const void * const *)((const char *)sptr + elm->memb_offset);
+			if(!*memb_ptr2) {
+				ASN_DEBUG("Element %s %ld not present",
+				          elm->name, edx);
+				if(elm->optional)
+					continue;
+				/* Mandatory element is missing */
+				ASN__ENCODE_FAILED;
+			}
+		} else {
+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
+			memb_ptr2 = &memb_ptr;
+		}
+
+		/* Eliminate default values */
+		if(elm->default_value_cmp && elm->default_value_cmp(memb_ptr2) == 1)
+			continue;
+
+		ASN_DEBUG("Encoding %s->%s", td->name, elm->name);
+		er = elm->type->op->aper_encoder(elm->type, elm->encoding_constraints.per_constraints,
+		                                 *memb_ptr2, po);
+		if(er.encoded == -1)
+			return er;
+	}
+
+	/* No extensions to encode */
+	if(!n_extensions) ASN__ENCODED_OK(er);
+
+	ASN_DEBUG("Length of %d bit-map", n_extensions);
+	/* #18.8. Write down the presence bit-map length. */
+	if(aper_put_nslength(po, n_extensions))
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Bit-map of %d elements", n_extensions);
+	/* #18.7. Encoding the extensions presence bit-map. */
+	/* TODO: act upon NOTE in #18.7 for canonical PER */
+	if(SEQUENCE_handle_extensions_aper(td, sptr, po, 0) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN_DEBUG("Writing %d extensions", n_extensions);
+	/* #18.9. Encode extensions as open type fields. */
+	if(SEQUENCE_handle_extensions_aper(td, sptr, 0, po) != n_extensions)
+		ASN__ENCODE_FAILED;
+
+	ASN__ENCODED_OK(er);
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+SEQUENCE_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+                 const void *bptr) {
+    size_t edx;
+
+	for(edx = 0; edx < td->elements_count; edx++) {
+		asn_TYPE_member_t *elm = &td->elements[edx];
+		const void *amemb;
+		const void *bmemb;
+        int ret;
+
+		if(elm->flags & ATF_POINTER) {
+            amemb =
+                *(const void *const *)((const char *)aptr + elm->memb_offset);
+            bmemb =
+                *(const void *const *)((const char *)bptr + elm->memb_offset);
+            if(!amemb) {
+                if(!bmemb) continue;
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(bmemb) == 0) {
+                    /* A is absent, but B is present and equal to DEFAULT */
+                    continue;
+                }
+                return -1;
+            } else if(!bmemb) {
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(amemb) == 0) {
+                    /* B is absent, but A is present and equal to DEFAULT */
+                    continue;
+                }
+                return 1;
+            }
+		} else {
+            amemb = (const void *)((const char *)aptr + elm->memb_offset);
+            bmemb = (const void *)((const char *)bptr + elm->memb_offset);
+		}
+
+        ret = elm->type->op->compare_struct(elm->type, amemb, bmemb);
+        if(ret != 0) return ret;
+    }
+
+    return 0;
+}
+
+asn_TYPE_operation_t asn_OP_SEQUENCE = {
+	SEQUENCE_free,
+	SEQUENCE_print,
+	SEQUENCE_compare,
+	SEQUENCE_decode_ber,
+	SEQUENCE_encode_der,
+	SEQUENCE_decode_xer,
+	SEQUENCE_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SEQUENCE_decode_oer,
+	SEQUENCE_encode_oer,
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SEQUENCE_decode_uper,
+	SEQUENCE_encode_uper,
+	SEQUENCE_decode_aper,
+	SEQUENCE_encode_aper,
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SEQUENCE_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
+
+asn_random_fill_result_t
+SEQUENCE_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constr,
+                   size_t max_length) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_random_fill_result_t result_ok = {ARFILL_OK, 0};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    void *st = *sptr;
+    size_t edx;
+
+    if(max_length == 0) return result_skipped;
+
+    (void)constr;
+
+    if(st == NULL) {
+        st = CALLOC(1, specs->struct_size);
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    for(edx = 0; edx < td->elements_count; edx++) {
+        const asn_TYPE_member_t *elm = &td->elements[edx];
+        void *memb_ptr;   /* Pointer to the member */
+        void **memb_ptr2; /* Pointer to that pointer */
+        asn_random_fill_result_t tmpres;
+
+        if(elm->optional && asn_random_between(0, 4) == 2) {
+            /* Sometimes decide not to fill the optional value */
+            continue;
+        }
+
+        if(elm->flags & ATF_POINTER) {
+            /* Member is a pointer to another structure */
+            memb_ptr2 = (void **)((char *)st + elm->memb_offset);
+        } else {
+            memb_ptr = (char *)st + elm->memb_offset;
+            memb_ptr2 = &memb_ptr;
+        }
+
+        tmpres = elm->type->op->random_fill(
+            elm->type, memb_ptr2, &elm->encoding_constraints,
+            max_length > result_ok.length ? max_length - result_ok.length : 0);
+        switch(tmpres.code) {
+        case ARFILL_OK:
+            result_ok.length += tmpres.length;
+            continue;
+        case ARFILL_SKIPPED:
+            assert(!(elm->flags & ATF_POINTER) || *memb_ptr2 == NULL);
+            continue;
+        case ARFILL_FAILED:
+            if(st == *sptr) {
+                ASN_STRUCT_RESET(*td, st);
+            } else {
+                ASN_STRUCT_FREE(*td, st);
+            }
+            return tmpres;
+        }
+    }
+
+    *sptr = st;
+
+    return result_ok;
+}
+
diff --git a/e2ap/lib/constr_SEQUENCE_OF.c b/e2ap/lib/constr_SEQUENCE_OF.c
new file mode 100644
index 0000000..10f18cf
--- /dev/null
+++ b/e2ap/lib/constr_SEQUENCE_OF.c
@@ -0,0 +1,358 @@
+/*-
+ * Copyright (c) 2003, 2004, 2006 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SEQUENCE_OF.h>
+#include <asn_SEQUENCE_OF.h>
+
+/*
+ * The DER encoder of the SEQUENCE OF type.
+ */
+asn_enc_rval_t
+SEQUENCE_OF_encode_der(const asn_TYPE_descriptor_t *td, const void *ptr,
+                       int tag_mode, ber_tlv_tag_t tag,
+                       asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_TYPE_member_t *elm = td->elements;
+	const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(ptr);
+	size_t computed_size = 0;
+	ssize_t encoding_size = 0;
+	asn_enc_rval_t erval = {0,0,0};
+	int edx;
+
+	ASN_DEBUG("Estimating size of SEQUENCE OF %s", td->name);
+
+	/*
+	 * Gather the length of the underlying members sequence.
+	 */
+	for(edx = 0; edx < list->count; edx++) {
+		void *memb_ptr = list->array[edx];
+		if(!memb_ptr) continue;
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			0, elm->tag,
+			0, 0);
+		if(erval.encoded == -1)
+			return erval;
+		computed_size += erval.encoded;
+	}
+
+	/*
+	 * Encode the TLV for the sequence itself.
+	 */
+	encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag,
+		cb, app_key);
+	if(encoding_size == -1) {
+		erval.encoded = -1;
+		erval.failed_type = td;
+		erval.structure_ptr = ptr;
+		return erval;
+	}
+
+	computed_size += encoding_size;
+	if(!cb) {
+		erval.encoded = computed_size;
+		ASN__ENCODED_OK(erval);
+	}
+
+	ASN_DEBUG("Encoding members of SEQUENCE OF %s", td->name);
+
+	/*
+	 * Encode all members.
+	 */
+	for(edx = 0; edx < list->count; edx++) {
+		void *memb_ptr = list->array[edx];
+		if(!memb_ptr) continue;
+		erval = elm->type->op->der_encoder(elm->type, memb_ptr,
+			0, elm->tag,
+			cb, app_key);
+		if(erval.encoded == -1)
+			return erval;
+		encoding_size += erval.encoded;
+	}
+
+	if(computed_size != (size_t)encoding_size) {
+		/*
+		 * Encoded size is not equal to the computed size.
+		 */
+		erval.encoded = -1;
+		erval.failed_type = td;
+		erval.structure_ptr = ptr;
+	} else {
+		erval.encoded = computed_size;
+		erval.structure_ptr = 0;
+		erval.failed_type = 0;
+	}
+
+	return erval;
+}
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
+                       int ilevel, enum xer_encoder_flags_e flags,
+                       asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+    const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(sptr);
+    const char *mname = specs->as_XMLValueList
+                            ? 0
+                            : ((*elm->name) ? elm->name : elm->type->xml_tag);
+    size_t mlen = mname ? strlen(mname) : 0;
+    int xcan = (flags & XER_F_CANONICAL);
+    int i;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    er.encoded = 0;
+
+    for(i = 0; i < list->count; i++) {
+        asn_enc_rval_t tmper = {0,0,0};
+        void *memb_ptr = list->array[i];
+        if(!memb_ptr) continue;
+
+        if(mname) {
+            if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+            ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+        }
+
+        tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1,
+                                           flags, cb, app_key);
+        if(tmper.encoded == -1) return tmper;
+        er.encoded += tmper.encoded;
+        if(tmper.encoded == 0 && specs->as_XMLValueList) {
+            const char *name = elm->type->xml_tag;
+            size_t len = strlen(name);
+            if(!xcan) ASN__TEXT_INDENT(1, ilevel + 1);
+            ASN__CALLBACK3("<", 1, name, len, "/>", 2);
+        }
+
+        if(mname) {
+            ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+        }
+    }
+
+    if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+    ASN__ENCODED_OK(er);
+cb_failed:
+    ASN__ENCODE_FAILED;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_uper(const asn_TYPE_descriptor_t *td,
+                        const asn_per_constraints_t *constraints,
+                        const void *sptr, asn_per_outp_t *po) {
+    const asn_anonymous_sequence_ *list;
+	const asn_per_constraint_t *ct;
+	asn_enc_rval_t er = {0,0,0};
+	const asn_TYPE_member_t *elm = td->elements;
+	size_t encoded_edx;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+    list = _A_CSEQUENCE_FROM_VOID(sptr);
+
+    er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count);
+
+    if(constraints) ct = &constraints->size;
+    else if(td->encoding_constraints.per_constraints)
+        ct = &td->encoding_constraints.per_constraints->size;
+    else ct = 0;
+
+    /* If extensible constraint, check if size is in root */
+    if(ct) {
+        int not_in_root =
+            (list->count < ct->lower_bound || list->count > ct->upper_bound);
+        ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound,
+                  ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+        if(ct->flags & APC_EXTENSIBLE) {
+            /* Declare whether size is in extension root */
+            if(per_put_few_bits(po, not_in_root, 1)) ASN__ENCODE_FAILED;
+            if(not_in_root) ct = 0;
+        } else if(not_in_root && ct->effective_bits >= 0) {
+            ASN__ENCODE_FAILED;
+        }
+
+    }
+
+    if(ct && ct->effective_bits >= 0) {
+        /* X.691, #19.5: No length determinant */
+        if(per_put_few_bits(po, list->count - ct->lower_bound,
+                            ct->effective_bits))
+            ASN__ENCODE_FAILED;
+    } else if(list->count == 0) {
+        /* When the list is empty add only the length determinant
+         * X.691, #20.6 and #11.9.4.1
+         */
+        if (uper_put_length(po, 0, 0)) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+    for(encoded_edx = 0; (ssize_t)encoded_edx < list->count;) {
+        ssize_t may_encode;
+        size_t edx;
+        int need_eom = 0;
+
+        if(ct && ct->effective_bits >= 0) {
+            may_encode = list->count;
+        } else {
+            may_encode =
+                uper_put_length(po, list->count - encoded_edx, &need_eom);
+            if(may_encode < 0) ASN__ENCODE_FAILED;
+        }
+
+        for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) {
+            void *memb_ptr = list->array[edx];
+            if(!memb_ptr) ASN__ENCODE_FAILED;
+            er = elm->type->op->uper_encoder(
+                elm->type, elm->encoding_constraints.per_constraints, memb_ptr,
+                po);
+            if(er.encoded == -1) ASN__ENCODE_FAILED;
+        }
+
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+
+        encoded_edx += may_encode;
+    }
+
+	ASN__ENCODED_OK(er);
+}
+
+asn_enc_rval_t
+SEQUENCE_OF_encode_aper(const asn_TYPE_descriptor_t *td,
+                        const asn_per_constraints_t *constraints,
+                        const void *sptr, asn_per_outp_t *po) {
+	const asn_anonymous_sequence_ *list;
+	const asn_per_constraint_t *ct;
+	asn_enc_rval_t er = {0,0,0};
+	asn_TYPE_member_t *elm = td->elements;
+	int seq;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+	list = _A_CSEQUENCE_FROM_VOID(sptr);
+
+	er.encoded = 0;
+
+	ASN_DEBUG("Encoding %s as SEQUENCE OF size (%d) using ALIGNED PER", td->name, list->count);
+
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	/* If extensible constraint, check if size is in root */
+	if(ct) {
+		int not_in_root = (list->count < ct->lower_bound
+				|| list->count > ct->upper_bound);
+		ASN_DEBUG("lb %ld ub %ld %s",
+			ct->lower_bound, ct->upper_bound,
+			ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+		if(ct->flags & APC_EXTENSIBLE) {
+			/* Declare whether size is in extension root */
+			if(per_put_few_bits(po, not_in_root, 1))
+				ASN__ENCODE_FAILED;
+			if(not_in_root) ct = 0;
+		} else if(not_in_root && ct->effective_bits >= 0)
+			ASN__ENCODE_FAILED;
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+/*		 if(per_put_few_bits(po, list->count - ct->lower_bound,
+				 ct->effective_bits))
+			 ASN__ENCODE_FAILED;
+*/
+		if (aper_put_length(po, ct->upper_bound - ct->lower_bound + 1, list->count - ct->lower_bound) < 0)
+			ASN__ENCODE_FAILED;
+	}
+
+	for(seq = -1; seq < list->count;) {
+		ssize_t mayEncode;
+		if(seq < 0) seq = 0;
+		if(ct && ct->effective_bits >= 0) {
+			mayEncode = list->count;
+		} else {
+			mayEncode = aper_put_length(po, -1, list->count - seq);
+			if(mayEncode < 0) ASN__ENCODE_FAILED;
+		}
+
+		while(mayEncode--) {
+			void *memb_ptr = list->array[seq++];
+			if(!memb_ptr) ASN__ENCODE_FAILED;
+			er = elm->type->op->aper_encoder(elm->type,
+				elm->encoding_constraints.per_constraints, memb_ptr, po);
+			if(er.encoded == -1)
+				ASN__ENCODE_FAILED;
+		}
+	}
+
+	ASN__ENCODED_OK(er);
+}
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+int
+SEQUENCE_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+               const void *bptr) {
+    const asn_anonymous_sequence_ *a = _A_CSEQUENCE_FROM_VOID(aptr);
+    const asn_anonymous_sequence_ *b = _A_CSEQUENCE_FROM_VOID(bptr);
+    ssize_t idx;
+
+    if(a && b) {
+        ssize_t common_length = (a->count < b->count ? a->count : b->count);
+        for(idx = 0; idx < common_length; idx++) {
+            int ret = td->elements->type->op->compare_struct(
+                td->elements->type, a->array[idx], b->array[idx]);
+            if(ret) return ret;
+        }
+
+        if(idx < b->count) /* more elements in b */
+            return -1;    /* a is shorter, so put it first */
+        if(idx < a->count) return 1;
+
+    } else if(!a) {
+        return -1;
+    } else if(!b) {
+        return 1;
+    }
+
+    return 0;
+}
+
+
+asn_TYPE_operation_t asn_OP_SEQUENCE_OF = {
+	SEQUENCE_OF_free,
+	SEQUENCE_OF_print,
+	SEQUENCE_OF_compare,
+	SEQUENCE_OF_decode_ber,
+	SEQUENCE_OF_encode_der,
+	SEQUENCE_OF_decode_xer,
+	SEQUENCE_OF_encode_xer,
+#ifdef	ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SEQUENCE_OF_decode_oer, /* Same as SET OF decoder. */
+	SEQUENCE_OF_encode_oer, /* Same as SET OF encoder */
+#endif  /* ASN_DISABLE_OER_SUPPORT */
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SEQUENCE_OF_decode_uper, /* Same as SET OF decoder */
+	SEQUENCE_OF_encode_uper,
+	SEQUENCE_OF_decode_aper,
+	SEQUENCE_OF_encode_aper,
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SEQUENCE_OF_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
diff --git a/e2ap/lib/constr_SEQUENCE_oer.c b/e2ap/lib/constr_SEQUENCE_oer.c
new file mode 100644
index 0000000..ecb589c
--- /dev/null
+++ b/e2ap/lib/constr_SEQUENCE_oer.c
@@ -0,0 +1,561 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_SEQUENCE.h>
+#include <OPEN_TYPE.h>
+#include <errno.h>
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef  ADVANCE
+#define ADVANCE(num_bytes)                   \
+    do {                                     \
+        size_t num = num_bytes;              \
+        ptr = ((const char *)ptr) + num;     \
+        size -= num;                         \
+        consumed_myself += num;              \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#undef PHASE_OUT
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+
+/*
+ * Check whether we are inside the extensions group.
+ */
+#define IN_EXTENSION_GROUP(specs, memb_idx) \
+    ((specs)->first_extension >= 0          \
+     && (unsigned)(specs)->first_extension <= (memb_idx))
+
+#define IN_ROOT_GROUP_PRED(edx)                            \
+    edx < (specs->first_extension < 0 ? td->elements_count \
+                                      : (size_t)specs->first_extension)
+
+#define FOR_IN_ROOT_GROUP(edx) for(edx = 0; IN_ROOT_GROUP_PRED(edx); edx++)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)   do {                    \
+                rval.code = _code;              \
+                rval.consumed = consumed_myself;\
+                return rval;                    \
+        } while(0)
+
+/*
+ * Return pointer to a member.
+ */
+static void **
+element_ptrptr(void *struct_ptr, asn_TYPE_member_t *elm, void **tmp_save_ptr) {
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        return (void **)((char *)struct_ptr + elm->memb_offset);
+    } else {
+        assert(tmp_save_ptr);
+        *tmp_save_ptr = (void *)((char *)struct_ptr + elm->memb_offset);
+        return tmp_save_ptr;
+    }
+}
+
+static const void *
+element_ptr(const void *struct_ptr, const asn_TYPE_member_t *elm) {
+    if(elm->flags & ATF_POINTER) {
+        /* Member is a pointer to another structure */
+        return *(const void *const *)((const char *)struct_ptr
+                                      + elm->memb_offset);
+    } else {
+        return (const void *)((const char *)struct_ptr + elm->memb_offset);
+    }
+}
+
+asn_dec_rval_t
+SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                    const asn_TYPE_descriptor_t *td,
+                    const asn_oer_constraints_t *constraints, void **struct_ptr,
+                    const void *ptr, size_t size) {
+    const asn_SEQUENCE_specifics_t *specs =
+        (const asn_SEQUENCE_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    void *st = *struct_ptr; /* Target structure */
+    asn_struct_ctx_t *ctx; /* Decoder context */
+    size_t consumed_myself = 0; /* Consumed bytes from ptr. */
+
+    (void)constraints;
+
+    if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+        ASN__DECODE_FAILED;
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+    /*
+     * Start to parse where left previously.
+     */
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Fetch preamble.
+         */
+        asn_bit_data_t *preamble;
+        int has_extensions_bit = (specs->first_extension >= 0);
+        size_t preamble_bits = (has_extensions_bit + specs->roms_count);
+        size_t preamble_bytes = ((7 + preamble_bits) >> 3);
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 0", td->name);
+
+        ASN_DEBUG(
+            "Expecting preamble bits %" ASN_PRI_SIZE " for %s (including %d extension bits)",
+            preamble_bits, td->name, has_extensions_bit);
+
+        if(preamble_bytes > size) {
+            ASN__DECODE_STARVED;
+        }
+
+        preamble = asn_bit_data_new_contiguous(ptr, preamble_bits);
+        if(!preamble) {
+            RETURN(RC_FAIL);
+        }
+        preamble->nboff = has_extensions_bit;
+        ctx->ptr = preamble;
+        ADVANCE(preamble_bytes);
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 1: {
+        /* Decode components of the extension root */
+        asn_bit_data_t *preamble = ctx->ptr;
+        size_t edx;
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 1 (Root)", td->name);
+
+        assert(preamble);
+
+        for(edx = (ctx->step >> 1); IN_ROOT_GROUP_PRED(edx);
+            edx++, ctx->step = (ctx->step & ~1) + 2) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+
+            ASN_DEBUG("Decoding %s->%s", td->name, elm->name);
+
+            assert(!IN_EXTENSION_GROUP(specs, edx));
+
+            if(ctx->step & 1) {
+                goto microphase2_decode_continues;
+            }
+
+
+            if(elm->optional) {
+                int32_t present = asn_get_few_bits(preamble, 1);
+                if(present < 0) {
+                    ASN_DEBUG("Presence map ended prematurely: %d", present);
+                    RETURN(RC_FAIL);
+                } else if(present == 0) {
+                    if(elm->default_value_set) {
+                        /* Fill-in DEFAULT */
+                        void *tmp;
+                        if(elm->default_value_set(
+                               element_ptrptr(st, elm, &tmp))) {
+                            RETURN(RC_FAIL);
+                        }
+                    }
+                    /* The member is not present. */
+                    continue;
+                }
+                /* Present OPTIONAL or DEFAULT component. */
+            }
+
+            /*
+             * MICROPHASE 2: Invoke the member-specific decoder.
+             */
+            ctx->step |= 1; /* Confirm entering next microphase */
+        microphase2_decode_continues:
+            if(elm->flags & ATF_OPEN_TYPE) {
+                rval = OPEN_TYPE_oer_get(opt_codec_ctx, td, st, elm, ptr, size);
+            } else {
+                void *save_memb_ptr; /* Temporary reference. */
+                void **memb_ptr2;  /* Pointer to a pointer to a memmber */
+
+                memb_ptr2 = element_ptrptr(st, elm, &save_memb_ptr);
+
+                rval = elm->type->op->oer_decoder(
+                    opt_codec_ctx, elm->type,
+                    elm->encoding_constraints.oer_constraints, memb_ptr2, ptr,
+                    size);
+            }
+            switch(rval.code) {
+            case RC_OK:
+                ADVANCE(rval.consumed);
+                break;
+            case RC_WMORE:
+                ASN_DEBUG("More bytes needed at element %s \"%s\"", td->name,
+                          elm->name);
+                ADVANCE(rval.consumed);
+                RETURN(RC_WMORE);
+            case RC_FAIL:
+                ASN_DEBUG("Decoding failed at element %s \"%s\"", td->name,
+                          elm->name);
+                RETURN(RC_FAIL);
+            }
+        } /* for(all root members) */
+
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 2:
+        assert(ctx->ptr);
+        {
+        /* Cleanup preamble. */
+        asn_bit_data_t *preamble = ctx->ptr;
+        asn_bit_data_t *extadds;
+        int has_extensions_bit = (specs->first_extension >= 0);
+        int extensions_present =
+            has_extensions_bit
+            && (preamble->buffer == NULL
+                || (((const uint8_t *)preamble->buffer)[0] & 0x80));
+        uint8_t unused_bits;
+        size_t len = 0;
+        ssize_t len_len;
+
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 2", td->name);
+
+        preamble->buffer = 0; /* Will do extensions_present==1 next time. */
+
+        if(!extensions_present) {
+            ctx->phase = 10;
+            RETURN(RC_OK);
+        }
+
+        /*
+         * X.696 (08/2015) #16.1 (c), #16.4
+         * Read in the extension addition presence bitmap.
+         */
+
+        len_len = oer_fetch_length(ptr, size, &len);
+        if(len_len > 0) {
+            ADVANCE(len_len);
+        } else if(len_len < 0) {
+            RETURN(RC_FAIL);
+        } else {
+            RETURN(RC_WMORE);
+        }
+
+        if(len == 0) {
+            /* 16.4.1-2 */
+            RETURN(RC_FAIL);
+        } else if(len > size) {
+            RETURN(RC_WMORE);
+        }
+
+        /* Account for unused bits */
+        unused_bits = 0x7 & *(const uint8_t *)ptr;
+        ADVANCE(1);
+        len--;
+        if(unused_bits && len == 0) {
+            RETURN(RC_FAIL);
+        }
+
+        /* Get the extensions map */
+        extadds = asn_bit_data_new_contiguous(ptr, len * 8 - unused_bits);
+        if(!extadds) {
+            RETURN(RC_FAIL);
+        }
+        FREEMEM(preamble);
+        ctx->ptr = extadds;
+        ADVANCE(len);
+    }
+        NEXT_PHASE(ctx);
+        ctx->step =
+            (specs->first_extension < 0 ? td->elements_count
+                                        : (size_t)specs->first_extension);
+        /* Fall through */
+    case 3:
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 3 (Extensions)", td->name);
+        for(; ctx->step < (signed)td->elements_count; ctx->step++) {
+            asn_bit_data_t *extadds = ctx->ptr;
+            size_t edx = ctx->step;
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            void *tmp_memb_ptr;
+            void **memb_ptr2 = element_ptrptr(st, elm, &tmp_memb_ptr);
+
+            switch(asn_get_few_bits(extadds, 1)) {
+            case -1:
+                /*
+                 * Not every one of our extensions is known to the remote side.
+                 * Continue filling in their defaults though.
+                 */
+                /* Fall through */
+            case 0:
+                /* Fill-in DEFAULT */
+                if(elm->default_value_set
+                   && elm->default_value_set(memb_ptr2)) {
+                    RETURN(RC_FAIL);
+                }
+                continue;
+            case 1: {
+                /* Read OER open type */
+                ssize_t ot_size =
+                    oer_open_type_get(opt_codec_ctx, elm->type,
+                                      elm->encoding_constraints.oer_constraints,
+                                      memb_ptr2, ptr, size);
+                assert(ot_size <= (ssize_t)size);
+                if(ot_size > 0) {
+                    ADVANCE(ot_size);
+                } else if(ot_size < 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    /* Roll back open type parsing */
+                    asn_get_undo(extadds, 1);
+                    RETURN(RC_WMORE);
+                }
+                break;
+            }
+            default:
+                RETURN(RC_FAIL);
+            }
+        }
+
+        NEXT_PHASE(ctx);
+        /* Fall through */
+    case 4:
+        ASN_DEBUG("OER SEQUENCE %s Decoding PHASE 4", td->name);
+        /* Read in the rest of Open Types while ignoring them */
+        for(;;) {
+            asn_bit_data_t *extadds = ctx->ptr;
+            switch(asn_get_few_bits(extadds, 1)) {
+            case 0:
+                continue;
+            case 1: {
+                ssize_t skipped = oer_open_type_skip(ptr, size);
+                if(skipped > 0) {
+                    ADVANCE(skipped);
+                } else if(skipped < 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    asn_get_undo(extadds, 1);
+                    RETURN(RC_WMORE);
+                }
+                continue;
+            }
+            case -1:
+                /* No more Open Type encoded components */
+                break;
+            default:
+                RETURN(RC_FAIL);
+            }
+            break;
+        }
+    }
+
+    RETURN(RC_OK);
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+SEQUENCE_encode_oer(const asn_TYPE_descriptor_t *td,
+                    const asn_oer_constraints_t *constraints, const void *sptr,
+                    asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_SEQUENCE_specifics_t *specs = (const asn_SEQUENCE_specifics_t *)td->specifics;
+    size_t computed_size = 0;
+    int has_extensions_bit = (specs->first_extension >= 0);
+    size_t preamble_bits = (has_extensions_bit + specs->roms_count);
+    uint32_t has_extensions = 0;
+    size_t edx;
+    int ret;
+
+    (void)constraints;
+
+    if(preamble_bits) {
+        asn_bit_outp_t preamble;
+
+        memset(&preamble, 0, sizeof(preamble));
+        preamble.output = cb;
+        preamble.op_key = app_key;
+
+        if(has_extensions_bit) {
+            for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+                asn_TYPE_member_t *elm = &td->elements[edx];
+                const void *memb_ptr = element_ptr(sptr, elm);
+                if(memb_ptr) {
+                    if(elm->default_value_cmp
+                       && elm->default_value_cmp(memb_ptr) == 0) {
+                        /* Do not encode default values in extensions */
+                    } else {
+                        has_extensions = 1;
+                        break;
+                    }
+                }
+            }
+            ret = asn_put_few_bits(&preamble, has_extensions, 1);
+            assert(ret == 0);
+            if(ret < 0) {
+                ASN__ENCODE_FAILED;
+            }
+        }
+
+        /*
+         * Encode optional components bitmap.
+         */
+        if(specs->roms_count) {
+            FOR_IN_ROOT_GROUP(edx) {
+                asn_TYPE_member_t *elm = &td->elements[edx];
+
+                if(IN_EXTENSION_GROUP(specs, edx)) break;
+
+                if(elm->optional) {
+                    const void *memb_ptr = element_ptr(sptr, elm);
+                    uint32_t has_component = memb_ptr != NULL;
+                    if(has_component && elm->default_value_cmp
+                       && elm->default_value_cmp(memb_ptr) == 0) {
+                        has_component = 0;
+                    }
+                    ret = asn_put_few_bits(&preamble, has_component, 1);
+                    if(ret < 0) {
+                        ASN__ENCODE_FAILED;
+                    }
+                }
+            }
+        }
+
+        asn_put_aligned_flush(&preamble);
+        computed_size += preamble.flushed_bytes;
+    }   /* if(preamble_bits) */
+
+    /*
+     * Put root components and extensions root.
+     */
+    for(edx = 0; edx < td->elements_count; edx++) {
+        asn_TYPE_member_t *elm = &td->elements[edx];
+        asn_enc_rval_t er = {0,0,0};
+        const void *memb_ptr;
+
+        if(IN_EXTENSION_GROUP(specs, edx)) break;
+
+        memb_ptr = element_ptr(sptr, elm);
+        if(memb_ptr) {
+            if(elm->default_value_cmp
+               && elm->default_value_cmp(memb_ptr) == 0) {
+                /* Skip default values in encoding */
+                continue;
+            }
+        } else {
+            if(elm->optional) continue;
+            /* Mandatory element is missing */
+            ASN__ENCODE_FAILED;
+        }
+        if(!elm->type->op->oer_encoder) {
+            ASN_DEBUG("OER encoder is not defined for type %s", elm->type->name);
+            ASN__ENCODE_FAILED;
+        }
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded == -1) {
+            ASN_DEBUG("... while encoding %s member \"%s\"\n", td->name,
+                      elm->name);
+            return er;
+        }
+        computed_size += er.encoded;
+    }
+
+    /*
+     * Before encode extensions, encode extensions additions presense bitmap
+     # X.696 (08/2015) #16.4.
+     */
+    if(has_extensions) {
+        asn_bit_outp_t extadds;
+
+        /* Special case allowing us to use exactly one byte for #8.6 */
+        size_t aoms_length_bits = specs->aoms_count;
+        size_t aoms_length_bytes = (7 + aoms_length_bits) >> 3;
+        uint8_t unused_bits = 0x07 & (8 - (aoms_length_bits & 0x07));
+
+        assert(1 + aoms_length_bytes <= 127);
+
+        memset(&extadds, 0, sizeof(extadds));
+        extadds.output = cb;
+        extadds.op_key = app_key;
+
+        /* #8.6 length determinant */
+        ret = asn_put_few_bits(&extadds, (1 + aoms_length_bytes), 8);
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        /* Number of unused bytes, #16.4.2 */
+        ret = asn_put_few_bits(&extadds, unused_bits, 8);
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        /* Encode presence bitmap #16.4.3 */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            const void *memb_ptr = element_ptr(sptr, elm);
+            if(memb_ptr && elm->default_value_cmp
+               && elm->default_value_cmp(memb_ptr) == 0) {
+                memb_ptr = 0;   /* Do not encode default value. */
+            }
+            ret |= asn_put_few_bits(&extadds, memb_ptr ? 1 : 0, 1);
+        }
+        if(ret < 0) ASN__ENCODE_FAILED;
+
+        asn_put_aligned_flush(&extadds);
+        computed_size += extadds.flushed_bytes;
+
+        /* Now, encode extensions */
+        for(edx = specs->first_extension; edx < td->elements_count; edx++) {
+            asn_TYPE_member_t *elm = &td->elements[edx];
+            const void *memb_ptr = element_ptr(sptr, elm);
+
+            if(memb_ptr) {
+                if(elm->default_value_cmp
+                   && elm->default_value_cmp(memb_ptr) == 0) {
+                    /* Do not encode default value. */
+                } else {
+                    ssize_t wrote = oer_open_type_put(
+                        elm->type, elm->encoding_constraints.oer_constraints,
+                        memb_ptr, cb, app_key);
+                    if(wrote == -1) {
+                        ASN__ENCODE_FAILED;
+                    }
+                    computed_size += wrote;
+                }
+            } else if(!elm->optional) {
+                ASN__ENCODE_FAILED;
+            }
+        }
+    }   /* if(has_extensions) */
+
+
+    {
+        asn_enc_rval_t er = {0, 0, 0};
+        er.encoded = computed_size;
+        ASN__ENCODED_OK(er);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/constr_SET_OF.c b/e2ap/lib/constr_SET_OF.c
new file mode 100644
index 0000000..bf1dc27
--- /dev/null
+++ b/e2ap/lib/constr_SET_OF.c
@@ -0,0 +1,1441 @@
+/*
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_SET_OF.h>
+#include <asn_SET_OF.h>
+
+/*
+ * Number of bytes left for this structure.
+ * (ctx->left) indicates the number of bytes _transferred_ for the structure.
+ * (size) contains the number of bytes in the buffer passed.
+ */
+#define	LEFT	((size<(size_t)ctx->left)?size:(size_t)ctx->left)
+
+/*
+ * If the subprocessor function returns with an indication that it wants
+ * more data, it may well be a fatal decoding problem, because the
+ * size is constrained by the <TLV>'s L, even if the buffer size allows
+ * reading more data.
+ * For example, consider the buffer containing the following TLVs:
+ * <T:5><L:1><V> <T:6>...
+ * The TLV length clearly indicates that one byte is expected in V, but
+ * if the V processor returns with "want more data" even if the buffer
+ * contains way more data than the V processor have seen.
+ */
+#define	SIZE_VIOLATION	(ctx->left >= 0 && (size_t)ctx->left <= size)
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {		\
+		size_t num = num_bytes;		\
+		ptr = ((const char *)ptr) + num;\
+		size -= num;			\
+		if(ctx->left >= 0)		\
+			ctx->left -= num;	\
+		consumed_myself += num;		\
+	} while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef	NEXT_PHASE
+#undef	PHASE_OUT
+#define	NEXT_PHASE(ctx)	do {			\
+		ctx->phase++;			\
+		ctx->step = 0;			\
+	} while(0)
+#define	PHASE_OUT(ctx)	do { ctx->phase = 10; } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef	RETURN
+#define	RETURN(_code)	do {			\
+		rval.code = _code;		\
+		rval.consumed = consumed_myself;\
+		return rval;			\
+	} while(0)
+
+/*
+ * The decoder of the SET OF type.
+ */
+asn_dec_rval_t
+SET_OF_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const void *ptr, size_t size, int tag_mode) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements; /* Single one */
+
+    /*
+	 * Parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	ber_tlv_tag_t tlv_tag;	/* T from TLV */
+	asn_dec_rval_t rval;	/* Return code from subparsers */
+
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	ASN_DEBUG("Decoding %s as SET OF", td->name);
+	
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) {
+			RETURN(RC_FAIL);
+		}
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+	
+	/*
+	 * Start to parse where left previously
+	 */
+	switch(ctx->phase) {
+	case 0:
+		/*
+		 * PHASE 0.
+		 * Check that the set of tags associated with given structure
+		 * perfectly fits our expectations.
+		 */
+
+		rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
+			tag_mode, 1, &ctx->left, 0);
+		if(rval.code != RC_OK) {
+			ASN_DEBUG("%s tagging check failed: %d",
+				td->name, rval.code);
+			return rval;
+		}
+
+		if(ctx->left >= 0)
+			ctx->left += rval.consumed; /* ?Substracted below! */
+		ADVANCE(rval.consumed);
+
+		ASN_DEBUG("Structure consumes %ld bytes, "
+			"buffer %ld", (long)ctx->left, (long)size);
+
+		NEXT_PHASE(ctx);
+		/* Fall through */
+	case 1:
+		/*
+		 * PHASE 1.
+		 * From the place where we've left it previously,
+		 * try to decode the next item.
+		 */
+	  for(;; ctx->step = 0) {
+		ssize_t tag_len;	/* Length of TLV's T */
+
+		if(ctx->step & 1)
+			goto microphase2;
+
+		/*
+		 * MICROPHASE 1: Synchronize decoding.
+		 */
+
+		if(ctx->left == 0) {
+			ASN_DEBUG("End of SET OF %s", td->name);
+			/*
+			 * No more things to decode.
+			 * Exit out of here.
+			 */
+			PHASE_OUT(ctx);
+			RETURN(RC_OK);
+		}
+
+		/*
+		 * Fetch the T from TLV.
+		 */
+		tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
+		switch(tag_len) {
+		case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
+			/* Fall through */
+		case -1: RETURN(RC_FAIL);
+		}
+
+		if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) {
+			if(LEFT < 2) {
+				if(SIZE_VIOLATION)
+					RETURN(RC_FAIL);
+				else
+					RETURN(RC_WMORE);
+			} else if(((const uint8_t *)ptr)[1] == 0) {
+				/*
+				 * Found the terminator of the
+				 * indefinite length structure.
+				 */
+				break;
+			}
+		}
+
+		/* Outmost tag may be unknown and cannot be fetched/compared */
+		if(elm->tag != (ber_tlv_tag_t)-1) {
+		    if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) {
+			/*
+			 * The new list member of expected type has arrived.
+			 */
+		    } else {
+			ASN_DEBUG("Unexpected tag %s fixed SET OF %s",
+				ber_tlv_tag_string(tlv_tag), td->name);
+			ASN_DEBUG("%s SET OF has tag %s",
+				td->name, ber_tlv_tag_string(elm->tag));
+			RETURN(RC_FAIL);
+		    }
+		}
+
+		/*
+		 * MICROPHASE 2: Invoke the member-specific decoder.
+		 */
+		ctx->step |= 1;		/* Confirm entering next microphase */
+	microphase2:
+		
+		/*
+		 * Invoke the member fetch routine according to member's type
+		 */
+		rval = elm->type->op->ber_decoder(opt_codec_ctx,
+				elm->type, &ctx->ptr, ptr, LEFT, 0);
+		ASN_DEBUG("In %s SET OF %s code %d consumed %d",
+			td->name, elm->type->name,
+			rval.code, (int)rval.consumed);
+		switch(rval.code) {
+		case RC_OK:
+			{
+				asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+				if(ASN_SET_ADD(list, ctx->ptr) != 0)
+					RETURN(RC_FAIL);
+				else
+					ctx->ptr = 0;
+			}
+			break;
+		case RC_WMORE: /* More data expected */
+			if(!SIZE_VIOLATION) {
+				ADVANCE(rval.consumed);
+				RETURN(RC_WMORE);
+			}
+			/* Fall through */
+		case RC_FAIL: /* Fatal error */
+			ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+			ctx->ptr = 0;
+			RETURN(RC_FAIL);
+		} /* switch(rval) */
+		
+		ADVANCE(rval.consumed);
+	  }	/* for(all list members) */
+
+		NEXT_PHASE(ctx);
+	case 2:
+		/*
+		 * Read in all "end of content" TLVs.
+		 */
+		while(ctx->left < 0) {
+			if(LEFT < 2) {
+				if(LEFT > 0 && ((const char *)ptr)[0] != 0) {
+					/* Unexpected tag */
+					RETURN(RC_FAIL);
+				} else {
+					RETURN(RC_WMORE);
+				}
+			}
+			if(((const char *)ptr)[0] == 0
+			&& ((const char *)ptr)[1] == 0) {
+				ADVANCE(2);
+				ctx->left++;
+			} else {
+				RETURN(RC_FAIL);
+			}
+		}
+
+		PHASE_OUT(ctx);
+	}
+	
+	RETURN(RC_OK);
+}
+
+/*
+ * Internally visible buffer holding a single encoded element.
+ */
+struct _el_buffer {
+	uint8_t *buf;
+	size_t length;
+	size_t allocated_size;
+    unsigned bits_unused;
+};
+/* Append bytes to the above structure */
+static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) {
+    struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr;
+
+    if(el_buf->length + size > el_buf->allocated_size) {
+        size_t new_size = el_buf->allocated_size ? el_buf->allocated_size : 8;
+        void *p;
+
+        do {
+            new_size <<= 2;
+        } while(el_buf->length + size > new_size);
+
+        p = REALLOC(el_buf->buf, new_size);
+        if(p) {
+            el_buf->buf = p;
+            el_buf->allocated_size = new_size;
+        } else {
+            return -1;
+        }
+    }
+
+    memcpy(el_buf->buf + el_buf->length, buffer, size);
+
+    el_buf->length += size;
+    return 0;
+}
+
+static void assert_unused_bits(const struct _el_buffer* p) {
+    if(p->length) {
+        assert((p->buf[p->length-1] & ~(0xff << p->bits_unused)) == 0);
+    } else {
+        assert(p->bits_unused == 0);
+    }
+}
+
+static int _el_buf_cmp(const void *ap, const void *bp) {
+    const struct _el_buffer *a = (const struct _el_buffer *)ap;
+    const struct _el_buffer *b = (const struct _el_buffer *)bp;
+    size_t common_len;
+    int ret = 0;
+
+    if(a->length < b->length)
+        common_len = a->length;
+    else
+        common_len = b->length;
+
+    if (a->buf && b->buf) {
+        ret = memcmp(a->buf, b->buf, common_len);
+    }
+    if(ret == 0) {
+        if(a->length < b->length)
+            ret = -1;
+        else if(a->length > b->length)
+            ret = 1;
+        /* Ignore unused bits. */
+        assert_unused_bits(a);
+        assert_unused_bits(b);
+    }
+
+    return ret;
+}
+
+static void
+SET_OF__encode_sorted_free(struct _el_buffer *el_buf, size_t count) {
+    size_t i;
+
+    for(i = 0; i < count; i++) {
+        FREEMEM(el_buf[i].buf);
+    }
+
+    FREEMEM(el_buf);
+}
+
+enum SET_OF__encode_method {
+    SOES_DER,   /* Distinguished Encoding Rules */
+    SOES_CUPER  /* Canonical Unaligned Packed Encoding Rules */
+};
+
+static struct _el_buffer *
+SET_OF__encode_sorted(const asn_TYPE_member_t *elm,
+                      const asn_anonymous_set_ *list,
+                      enum SET_OF__encode_method method) {
+    struct _el_buffer *encoded_els;
+    int edx;
+
+    encoded_els =
+        (struct _el_buffer *)CALLOC(list->count, sizeof(encoded_els[0]));
+    if(encoded_els == NULL) {
+        return NULL;
+    }
+
+	/*
+	 * Encode all members.
+	 */
+    for(edx = 0; edx < list->count; edx++) {
+        const void *memb_ptr = list->array[edx];
+        struct _el_buffer *encoding_el = &encoded_els[edx];
+        asn_enc_rval_t erval = {0,0,0};
+
+        if(!memb_ptr) break;
+
+        /*
+		 * Encode the member into the prepared space.
+		 */
+        switch(method) {
+        case SOES_DER:
+            erval = elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag,
+                                               _el_addbytes, encoding_el);
+            break;
+        case SOES_CUPER:
+            erval = uper_encode(elm->type,
+                                elm->encoding_constraints.per_constraints,
+                                memb_ptr, _el_addbytes, encoding_el);
+            if(erval.encoded != -1) {
+                size_t extra_bits = erval.encoded % 8;
+                assert(encoding_el->length == (size_t)(erval.encoded + 7) / 8);
+                encoding_el->bits_unused = (8 - extra_bits) & 0x7;
+            }
+            break;
+        default:
+            assert(!"Unreachable");
+            break;
+        }
+        if(erval.encoded < 0) break;
+	}
+
+    if(edx == list->count) {
+        /*
+         * Sort the encoded elements according to their encoding.
+         */
+        qsort(encoded_els, list->count, sizeof(encoded_els[0]), _el_buf_cmp);
+
+        return encoded_els;
+    } else {
+        SET_OF__encode_sorted_free(encoded_els, edx);
+        return NULL;
+    }
+}
+
+
+/*
+ * The DER encoder of the SET OF type.
+ */
+asn_enc_rval_t
+SET_OF_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+    size_t computed_size = 0;
+    ssize_t encoding_size = 0;
+    struct _el_buffer *encoded_els;
+    int edx;
+
+	ASN_DEBUG("Estimating size for SET OF %s", td->name);
+
+    /*
+     * Gather the length of the underlying members sequence.
+     */
+    for(edx = 0; edx < list->count; edx++) {
+        void *memb_ptr = list->array[edx];
+        asn_enc_rval_t erval = {0,0,0};
+
+        if(!memb_ptr) ASN__ENCODE_FAILED;
+
+        erval =
+            elm->type->op->der_encoder(elm->type, memb_ptr, 0, elm->tag, 0, 0);
+        if(erval.encoded == -1) return erval;
+        computed_size += erval.encoded;
+	}
+
+
+    /*
+     * Encode the TLV for the sequence itself.
+     */
+    encoding_size =
+        der_write_tags(td, computed_size, tag_mode, 1, tag, cb, app_key);
+    if(encoding_size < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    computed_size += encoding_size;
+
+    if(!cb || list->count == 0) {
+        asn_enc_rval_t erval = {0,0,0};
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    }
+
+    ASN_DEBUG("Encoding members of %s SET OF", td->name);
+
+    /*
+     * DER mandates dynamic sorting of the SET OF elements
+     * according to their encodings. Build an array of the
+     * encoded elements.
+     */
+    encoded_els = SET_OF__encode_sorted(elm, list, SOES_DER);
+
+    /*
+     * Report encoded elements to the application.
+     * Dispose of temporary sorted members table.
+     */
+    for(edx = 0; edx < list->count; edx++) {
+        struct _el_buffer *encoded_el = &encoded_els[edx];
+        /* Report encoded chunks to the application */
+        if(cb(encoded_el->buf, encoded_el->length, app_key) < 0) {
+            break;
+        } else {
+            encoding_size += encoded_el->length;
+        }
+    }
+
+    SET_OF__encode_sorted_free(encoded_els, list->count);
+
+    if(edx == list->count) {
+        asn_enc_rval_t erval = {0,0,0};
+        assert(computed_size == (size_t)encoding_size);
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    } else {
+        ASN__ENCODE_FAILED;
+    }
+}
+
+#undef	XER_ADVANCE
+#define	XER_ADVANCE(num_bytes)	do {			\
+		size_t num = num_bytes;			\
+		buf_ptr = ((const char *)buf_ptr) + num;\
+		size -= num;				\
+		consumed_myself += num;			\
+	} while(0)
+
+/*
+ * Decode the XER (XML) data.
+ */
+asn_dec_rval_t
+SET_OF_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td, void **struct_ptr,
+                  const char *opt_mname, const void *buf_ptr, size_t size) {
+    /*
+	 * Bring closer parts of structure description.
+	 */
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *element = td->elements;
+	const char *elm_tag;
+	const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
+
+	/*
+	 * ... and parts of the structure being constructed.
+	 */
+	void *st = *struct_ptr;	/* Target structure. */
+	asn_struct_ctx_t *ctx;	/* Decoder context */
+
+	asn_dec_rval_t rval = {RC_OK, 0};/* Return value from a decoder */
+	ssize_t consumed_myself = 0;	/* Consumed bytes from ptr */
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(st == 0) {
+		st = *struct_ptr = CALLOC(1, specs->struct_size);
+		if(st == 0) RETURN(RC_FAIL);
+	}
+
+	/* Which tag is expected for the downstream */
+	if(specs->as_XMLValueList) {
+		elm_tag = (specs->as_XMLValueList == 1) ? 0 : "";
+	} else {
+		elm_tag = (*element->name)
+				? element->name : element->type->xml_tag;
+	}
+
+	/*
+	 * Restore parsing context.
+	 */
+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 * Phase 2: Processing inner type.
+	 */
+	for(; ctx->phase <= 2;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+
+		/*
+		 * Go inside the inner member of a set.
+		 */
+		if(ctx->phase == 2) {
+			asn_dec_rval_t tmprval = {RC_OK, 0};
+
+			/* Invoke the inner type decoder, m.b. multiple times */
+			ASN_DEBUG("XER/SET OF element [%s]", elm_tag);
+			tmprval = element->type->op->xer_decoder(opt_codec_ctx,
+					element->type, &ctx->ptr, elm_tag,
+					buf_ptr, size);
+			if(tmprval.code == RC_OK) {
+				asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+				if(ASN_SET_ADD(list, ctx->ptr) != 0)
+					RETURN(RC_FAIL);
+				ctx->ptr = 0;
+				XER_ADVANCE(tmprval.consumed);
+			} else {
+				XER_ADVANCE(tmprval.consumed);
+				RETURN(tmprval.code);
+			}
+			ctx->phase = 1;	/* Back to body processing */
+			ASN_DEBUG("XER/SET OF phase => %d", ctx->phase);
+			/* Fall through */
+		}
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context,
+			buf_ptr, size, &ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+            case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:	/* Got XML comment */
+			case PXER_TEXT:		/* Ignore free-standing text */
+				XER_ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s",
+			tcv, ctx->phase, xml_tag);
+		switch(tcv) {
+		case XCT_CLOSING:
+			if(ctx->phase == 0) break;
+			ctx->phase = 0;
+			/* Fall through */
+		case XCT_BOTH:
+			if(ctx->phase == 0) {
+				/* No more things to decode */
+				XER_ADVANCE(ch_size);
+				ctx->phase = 3;	/* Phase out */
+				RETURN(RC_OK);
+			}
+			/* Fall through */
+		case XCT_OPENING:
+			if(ctx->phase == 0) {
+				XER_ADVANCE(ch_size);
+				ctx->phase = 1;	/* Processing body phase */
+				continue;
+			}
+			/* Fall through */
+		case XCT_UNKNOWN_OP:
+		case XCT_UNKNOWN_BO:
+
+			ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase);
+			if(ctx->phase == 1) {
+				/*
+				 * Process a single possible member.
+				 */
+				ctx->phase = 2;
+				continue;
+			}
+			/* Fall through */
+		default:
+			break;
+		}
+
+		ASN_DEBUG("Unexpected XML tag in SET OF");
+		break;
+	}
+
+	ctx->phase = 3;	/* "Phase out" on hard failure */
+	RETURN(RC_FAIL);
+}
+
+
+
+typedef struct xer_tmp_enc_s {
+	void *buffer;
+	size_t offset;
+	size_t size;
+} xer_tmp_enc_t;
+static int
+SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) {
+	xer_tmp_enc_t *t = (xer_tmp_enc_t *)key;
+	if(t->offset + size >= t->size) {
+		size_t newsize = (t->size << 2) + size;
+		void *p = REALLOC(t->buffer, newsize);
+		if(!p) return -1;
+		t->buffer = p;
+		t->size = newsize;
+	}
+	memcpy((char *)t->buffer + t->offset, buffer, size);
+	t->offset += size;
+	return 0;
+}
+static int
+SET_OF_xer_order(const void *aptr, const void *bptr) {
+	const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr;
+	const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr;
+	size_t minlen = a->offset;
+	int ret;
+	if(b->offset < minlen) minlen = b->offset;
+	/* Well-formed UTF-8 has this nice lexicographical property... */
+	ret = memcmp(a->buffer, b->buffer, minlen);
+	if(ret != 0) return ret;
+	if(a->offset == b->offset)
+		return 0;
+	if(a->offset == minlen)
+		return -1;
+	return 1;
+}
+
+
+asn_enc_rval_t
+SET_OF_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+                  enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
+                  void *app_key) {
+    asn_enc_rval_t er = {0,0,0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm = td->elements;
+    const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+    const char *mname = specs->as_XMLValueList
+		? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag);
+	size_t mlen = mname ? strlen(mname) : 0;
+	int xcan = (flags & XER_F_CANONICAL);
+	xer_tmp_enc_t *encs = 0;
+	size_t encs_count = 0;
+	void *original_app_key = app_key;
+	asn_app_consume_bytes_f *original_cb = cb;
+	int i;
+
+	if(!sptr) ASN__ENCODE_FAILED;
+
+	if(xcan) {
+		encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0]));
+		if(!encs) ASN__ENCODE_FAILED;
+		cb = SET_OF_encode_xer_callback;
+	}
+
+	er.encoded = 0;
+
+	for(i = 0; i < list->count; i++) {
+		asn_enc_rval_t tmper = {0,0,0};
+
+		void *memb_ptr = list->array[i];
+		if(!memb_ptr) continue;
+
+		if(encs) {
+			memset(&encs[encs_count], 0, sizeof(encs[0]));
+			app_key = &encs[encs_count];
+			encs_count++;
+		}
+
+		if(mname) {
+			if(!xcan) ASN__TEXT_INDENT(1, ilevel);
+			ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+		}
+
+		if(!xcan && specs->as_XMLValueList == 1)
+			ASN__TEXT_INDENT(1, ilevel + 1);
+		tmper = elm->type->op->xer_encoder(elm->type, memb_ptr,
+				ilevel + (specs->as_XMLValueList != 2),
+				flags, cb, app_key);
+		if(tmper.encoded == -1) return tmper;
+		er.encoded += tmper.encoded;
+		if(tmper.encoded == 0 && specs->as_XMLValueList) {
+			const char *name = elm->type->xml_tag;
+			size_t len = strlen(name);
+			ASN__CALLBACK3("<", 1, name, len, "/>", 2);
+		}
+
+		if(mname) {
+			ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
+		}
+
+	}
+
+	if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
+
+	if(encs) {
+		xer_tmp_enc_t *enc = encs;
+		xer_tmp_enc_t *end = encs + encs_count;
+		ssize_t control_size = 0;
+
+		er.encoded = 0;
+		cb = original_cb;
+		app_key = original_app_key;
+		qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order);
+
+		for(; enc < end; enc++) {
+			ASN__CALLBACK(enc->buffer, enc->offset);
+			FREEMEM(enc->buffer);
+			enc->buffer = 0;
+			control_size += enc->offset;
+		}
+		assert(control_size == er.encoded);
+	}
+
+	goto cleanup;
+cb_failed:
+	ASN__ENCODE_FAILED;
+cleanup:
+	if(encs) {
+		size_t n;
+		for(n = 0; n < encs_count; n++) {
+			FREEMEM(encs[n].buffer);
+		}
+		FREEMEM(encs);
+	}
+	ASN__ENCODED_OK(er);
+}
+
+int
+SET_OF_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
+             asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_TYPE_member_t *elm = td->elements;
+	const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+	int ret;
+	int i;
+
+	if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
+
+	/* Dump preamble */
+	if(cb(td->name, strlen(td->name), app_key) < 0
+	|| cb(" ::= {", 6, app_key) < 0)
+		return -1;
+
+	for(i = 0; i < list->count; i++) {
+		const void *memb_ptr = list->array[i];
+		if(!memb_ptr) continue;
+
+		_i_INDENT(1);
+
+		ret = elm->type->op->print_struct(elm->type, memb_ptr,
+			ilevel + 1, cb, app_key);
+		if(ret) return ret;
+	}
+
+	ilevel--;
+	_i_INDENT(1);
+
+	return (cb("}", 1, app_key) < 0) ? -1 : 0;
+}
+
+void
+SET_OF_free(const asn_TYPE_descriptor_t *td, void *ptr,
+            enum asn_struct_free_method method) {
+    if(td && ptr) {
+		const asn_SET_OF_specifics_t *specs;
+		asn_TYPE_member_t *elm = td->elements;
+		asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr);
+		asn_struct_ctx_t *ctx;	/* Decoder context */
+		int i;
+
+		/*
+		 * Could not use set_of_empty() because of (*free)
+		 * incompatibility.
+		 */
+		for(i = 0; i < list->count; i++) {
+			void *memb_ptr = list->array[i];
+			if(memb_ptr)
+			ASN_STRUCT_FREE(*elm->type, memb_ptr);
+		}
+		list->count = 0;	/* No meaningful elements left */
+
+		asn_set_empty(list);	/* Remove (list->array) */
+
+		specs = (const asn_SET_OF_specifics_t *)td->specifics;
+		ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
+		if(ctx->ptr) {
+			ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+			ctx->ptr = 0;
+		}
+
+        switch(method) {
+        case ASFM_FREE_EVERYTHING:
+            FREEMEM(ptr);
+            break;
+        case ASFM_FREE_UNDERLYING:
+            break;
+        case ASFM_FREE_UNDERLYING_AND_RESET:
+            memset(ptr, 0, specs->struct_size);
+            break;
+        }
+    }
+}
+
+int
+SET_OF_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
+                  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+    const asn_TYPE_member_t *elm = td->elements;
+	asn_constr_check_f *constr;
+	const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
+	int i;
+
+	if(!sptr) {
+		ASN__CTFAIL(app_key, td, sptr,
+			"%s: value not given (%s:%d)",
+			td->name, __FILE__, __LINE__);
+		return -1;
+	}
+
+	constr = elm->encoding_constraints.general_constraints;
+	if(!constr) constr = elm->type->encoding_constraints.general_constraints;
+
+	/*
+	 * Iterate over the members of an array.
+	 * Validate each in turn, until one fails.
+	 */
+	for(i = 0; i < list->count; i++) {
+		const void *memb_ptr = list->array[i];
+		int ret;
+
+		if(!memb_ptr) continue;
+
+		ret = constr(elm->type, memb_ptr, ctfailcb, app_key);
+		if(ret) return ret;
+	}
+
+	return 0;
+}
+
+#ifndef ASN_DISABLE_PER_SUPPORT
+
+asn_dec_rval_t
+SET_OF_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    asn_dec_rval_t rv = {RC_OK, 0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    const asn_TYPE_member_t *elm = td->elements; /* Single one */
+    void *st = *sptr;
+	asn_anonymous_set_ *list;
+	const asn_per_constraint_t *ct;
+	int repeat = 0;
+	ssize_t nelems;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}                                                                       
+	list = _A_SET_FROM_VOID(st);
+
+	/* Figure out which constraints to use */
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted! */
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+		nelems = per_get_few_bits(pd, ct->effective_bits);
+		ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
+			(long)nelems, ct->lower_bound, td->name);
+		if(nelems < 0)  ASN__DECODE_STARVED;
+		nelems += ct->lower_bound;
+	} else {
+		nelems = -1;
+	}
+
+	do {
+		int i;
+		if(nelems < 0) {
+			nelems = uper_get_length(pd, -1, 0, &repeat);
+            ASN_DEBUG("Got to decode %" ASN_PRI_SSIZE " elements (eff %d)",
+                      nelems, (int)(ct ? ct->effective_bits : -1));
+            if(nelems < 0) ASN__DECODE_STARVED;
+		}
+
+		for(i = 0; i < nelems; i++) {
+			void *ptr = 0;
+			ASN_DEBUG("SET OF %s decoding", elm->type->name);
+			rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
+				elm->encoding_constraints.per_constraints, &ptr, pd);
+			ASN_DEBUG("%s SET OF %s decoded %d, %p",
+				td->name, elm->type->name, rv.code, ptr);
+			if(rv.code == RC_OK) {
+				if(ASN_SET_ADD(list, ptr) == 0) {
+                    if(rv.consumed == 0 && nelems > 200) {
+                        /* Protect from SET OF NULL compression bombs. */
+                        ASN__DECODE_FAILED;
+                    }
+					continue;
+                }
+				ASN_DEBUG("Failed to add element into %s",
+					td->name);
+				/* Fall through */
+				rv.code = RC_FAIL;
+			} else {
+				ASN_DEBUG("Failed decoding %s of %s (SET OF)",
+					elm->type->name, td->name);
+			}
+			if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
+			return rv;
+		}
+
+		nelems = -1;	/* Allow uper_get_length() */
+	} while(repeat);
+
+	ASN_DEBUG("Decoded %s as SET OF", td->name);
+
+	rv.code = RC_OK;
+	rv.consumed = 0;
+	return rv;
+}
+
+asn_enc_rval_t
+SET_OF_encode_uper(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+    const asn_anonymous_set_ *list;
+    const asn_per_constraint_t *ct;
+    const asn_TYPE_member_t *elm = td->elements;
+    struct _el_buffer *encoded_els;
+    asn_enc_rval_t er = {0,0,0};
+    size_t encoded_edx;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    list = _A_CSET_FROM_VOID(sptr);
+
+    er.encoded = 0;
+
+    ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count);
+
+    if(constraints) ct = &constraints->size;
+    else if(td->encoding_constraints.per_constraints)
+        ct = &td->encoding_constraints.per_constraints->size;
+    else ct = 0;
+
+    /* If extensible constraint, check if size is in root */
+    if(ct) {
+        int not_in_root =
+            (list->count < ct->lower_bound || list->count > ct->upper_bound);
+        ASN_DEBUG("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound,
+                  ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
+        if(ct->flags & APC_EXTENSIBLE) {
+            /* Declare whether size is in extension root */
+            if(per_put_few_bits(po, not_in_root, 1)) ASN__ENCODE_FAILED;
+            if(not_in_root) ct = 0;
+        } else if(not_in_root && ct->effective_bits >= 0) {
+            ASN__ENCODE_FAILED;
+        }
+
+    }
+
+    if(ct && ct->effective_bits >= 0) {
+        /* X.691, #19.5: No length determinant */
+        if(per_put_few_bits(po, list->count - ct->lower_bound,
+                            ct->effective_bits))
+            ASN__ENCODE_FAILED;
+    } else if(list->count == 0) {
+        /* When the list is empty add only the length determinant
+         * X.691, #20.6 and #11.9.4.1
+         */
+        if (uper_put_length(po, 0, 0)) {
+            ASN__ENCODE_FAILED;
+        }
+        ASN__ENCODED_OK(er);
+    }
+
+
+    /*
+     * Canonical UPER #22.1 mandates dynamic sorting of the SET OF elements
+     * according to their encodings. Build an array of the encoded elements.
+     */
+    encoded_els = SET_OF__encode_sorted(elm, list, SOES_CUPER);
+
+    for(encoded_edx = 0; (ssize_t)encoded_edx < list->count;) {
+        ssize_t may_encode;
+        size_t edx;
+        int need_eom = 0;
+
+        if(ct && ct->effective_bits >= 0) {
+            may_encode = list->count;
+        } else {
+            may_encode =
+                uper_put_length(po, list->count - encoded_edx, &need_eom);
+            if(may_encode < 0) ASN__ENCODE_FAILED;
+        }
+
+        for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) {
+            const struct _el_buffer *el = &encoded_els[edx];
+            if(asn_put_many_bits(po, el->buf,
+                                 (8 * el->length) - el->bits_unused) < 0) {
+                break;
+            }
+        }
+
+        if(need_eom && uper_put_length(po, 0, 0))
+            ASN__ENCODE_FAILED; /* End of Message length */
+
+        encoded_edx += may_encode;
+    }
+
+    SET_OF__encode_sorted_free(encoded_els, list->count);
+
+    if((ssize_t)encoded_edx == list->count) {
+        ASN__ENCODED_OK(er);
+    } else {
+        ASN__ENCODE_FAILED;
+    }
+}
+
+asn_dec_rval_t
+SET_OF_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	asn_dec_rval_t rv = {RC_OK, 0};
+	const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+	const asn_TYPE_member_t *elm = td->elements; /* Single one */
+	void *st = *sptr;
+	asn_anonymous_set_ *list;
+	const asn_per_constraint_t *ct;
+	int repeat = 0;
+	ssize_t nelems;
+
+	if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Create the target structure if it is not present already.
+	 */
+	if(!st) {
+		st = *sptr = CALLOC(1, specs->struct_size);
+		if(!st) ASN__DECODE_FAILED;
+	}
+	list = _A_SET_FROM_VOID(st);
+
+	/* Figure out which constraints to use */
+	if(constraints) ct = &constraints->size;
+	else if(td->encoding_constraints.per_constraints)
+		ct = &td->encoding_constraints.per_constraints->size;
+	else ct = 0;
+
+	if(ct && ct->flags & APC_EXTENSIBLE) {
+		int value = per_get_few_bits(pd, 1);
+		if(value < 0) ASN__DECODE_STARVED;
+		if(value) ct = 0;	/* Not restricted! */
+	}
+
+	if(ct && ct->effective_bits >= 0) {
+		/* X.691, #19.5: No length determinant */
+		nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
+		ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
+		          (long)nelems, ct->lower_bound, td->name);
+		if(nelems < 0)  ASN__DECODE_STARVED;
+		nelems += ct->lower_bound;
+	} else {
+		nelems = -1;
+	}
+
+	do {
+		int i;
+		if(nelems < 0) {
+			nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1,
+			                         ct ? ct->effective_bits : -1, &repeat);
+			ASN_DEBUG("Got to decode %d elements (eff %d)",
+			          (int)nelems, (int)(ct ? ct->effective_bits : -1));
+			if(nelems < 0) ASN__DECODE_STARVED;
+		}
+
+		for(i = 0; i < nelems; i++) {
+			void *ptr = 0;
+			ASN_DEBUG("SET OF %s decoding", elm->type->name);
+			rv = elm->type->op->aper_decoder(opt_codec_ctx, elm->type,
+			                                 elm->encoding_constraints.per_constraints, &ptr, pd);
+			ASN_DEBUG("%s SET OF %s decoded %d, %p",
+			          td->name, elm->type->name, rv.code, ptr);
+			if(rv.code == RC_OK) {
+				if(ASN_SET_ADD(list, ptr) == 0)
+					continue;
+				ASN_DEBUG("Failed to add element into %s",
+				          td->name);
+				/* Fall through */
+				rv.code = RC_FAIL;
+			} else {
+				ASN_DEBUG("Failed decoding %s of %s (SET OF)",
+				          elm->type->name, td->name);
+			}
+			if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
+			return rv;
+		}
+
+		nelems = -1;	/* Allow uper_get_length() */
+	} while(repeat);
+
+	ASN_DEBUG("Decoded %s as SET OF", td->name);
+
+	rv.code = RC_OK;
+	rv.consumed = 0;
+	return rv;
+}
+
+#endif  /* ASN_DISABLE_PER_SUPPORT */
+
+struct comparable_ptr {
+    const asn_TYPE_descriptor_t *td;
+    const void *sptr;
+};
+
+static int
+SET_OF__compare_cb(const void *aptr, const void *bptr) {
+    const struct comparable_ptr *a = aptr;
+    const struct comparable_ptr *b = bptr;
+    assert(a->td == b->td);
+    return a->td->op->compare_struct(a->td, a->sptr, b->sptr);
+}
+
+int
+SET_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
+               const void *bptr) {
+    const asn_anonymous_set_ *a = _A_CSET_FROM_VOID(aptr);
+    const asn_anonymous_set_ *b = _A_CSET_FROM_VOID(bptr);
+
+    if(a && b) {
+        struct comparable_ptr *asorted;
+        struct comparable_ptr *bsorted;
+        ssize_t common_length;
+        ssize_t idx;
+
+        if(a->count == 0) {
+            if(b->count) return -1;
+            return 0;
+        } else if(b->count == 0) {
+            return 1;
+        }
+
+        asorted = MALLOC(a->count * sizeof(asorted[0]));
+        bsorted = MALLOC(b->count * sizeof(bsorted[0]));
+        if(!asorted || !bsorted) {
+            FREEMEM(asorted);
+            FREEMEM(bsorted);
+            return -1;
+        }
+
+        for(idx = 0; idx < a->count; idx++) {
+            asorted[idx].td = td->elements->type;
+            asorted[idx].sptr = a->array[idx];
+        }
+
+        for(idx = 0; idx < b->count; idx++) {
+            bsorted[idx].td = td->elements->type;
+            bsorted[idx].sptr = b->array[idx];
+        }
+
+        qsort(asorted, a->count, sizeof(asorted[0]), SET_OF__compare_cb);
+        qsort(bsorted, b->count, sizeof(bsorted[0]), SET_OF__compare_cb);
+
+        common_length = (a->count < b->count ? a->count : b->count);
+        for(idx = 0; idx < common_length; idx++) {
+            int ret = td->elements->type->op->compare_struct(
+                td->elements->type, asorted[idx].sptr, bsorted[idx].sptr);
+            if(ret) {
+                FREEMEM(asorted);
+                FREEMEM(bsorted);
+                return ret;
+            }
+        }
+
+        FREEMEM(asorted);
+        FREEMEM(bsorted);
+
+        if(idx < b->count) /* more elements in b */
+            return -1;     /* a is shorter, so put it first */
+        if(idx < a->count) return 1;
+    } else if(!a) {
+        return -1;
+    } else if(!b) {
+        return 1;
+    }
+
+	return 0;
+}
+
+
+asn_TYPE_operation_t asn_OP_SET_OF = {
+	SET_OF_free,
+	SET_OF_print,
+	SET_OF_compare,
+	SET_OF_decode_ber,
+	SET_OF_encode_der,
+	SET_OF_decode_xer,
+	SET_OF_encode_xer,
+#ifdef ASN_DISABLE_OER_SUPPORT
+	0,
+	0,
+#else
+	SET_OF_decode_oer,
+	SET_OF_encode_oer,
+#endif
+#ifdef ASN_DISABLE_PER_SUPPORT
+	0,
+	0,
+	0,
+	0,
+#else
+	SET_OF_decode_uper,
+	SET_OF_encode_uper,
+	SET_OF_decode_aper,
+	0,	/* SET_OF_encode_aper */
+#endif /* ASN_DISABLE_PER_SUPPORT */
+	SET_OF_random_fill,
+	0	/* Use generic outmost tag fetcher */
+};
+
+
+asn_random_fill_result_t
+SET_OF_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
+                   const asn_encoding_constraints_t *constraints,
+                   size_t max_length) {
+    const asn_SET_OF_specifics_t *specs =
+        (const asn_SET_OF_specifics_t *)td->specifics;
+    asn_random_fill_result_t res_ok = {ARFILL_OK, 0};
+    asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
+    asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
+    const asn_TYPE_member_t *elm = td->elements;
+    void *st = *sptr;
+    long max_elements = 5;
+    long slb = 0;   /* Lower size bound */
+    long sub = 0;   /* Upper size bound */
+    size_t rnd_len;
+
+    if(max_length == 0) return result_skipped;
+
+    if(st == NULL) {
+        st = (*sptr = CALLOC(1, specs->struct_size));
+        if(st == NULL) {
+            return result_failed;
+        }
+    }
+
+    switch(asn_random_between(0, 6)) {
+    case 0: max_elements = 0; break;
+    case 1: max_elements = 1; break;
+    case 2: max_elements = 5; break;
+    case 3: max_elements = max_length; break;
+    case 4: max_elements = max_length / 2; break;
+    case 5: max_elements = max_length / 4; break;
+    default: break;
+    }
+    sub = slb + max_elements;
+
+    if(!constraints || !constraints->per_constraints)
+        constraints = &td->encoding_constraints;
+    if(constraints->per_constraints) {
+        const asn_per_constraint_t *pc = &constraints->per_constraints->size;
+        if(pc->flags & APC_SEMI_CONSTRAINED) {
+            slb = pc->lower_bound;
+            sub = pc->lower_bound + max_elements;
+        } else if(pc->flags & APC_CONSTRAINED) {
+            slb = pc->lower_bound;
+            sub = pc->upper_bound;
+            if(sub - slb > max_elements) sub = slb + max_elements;
+        }
+    }
+
+    /* Bias towards edges of allowed space */
+    switch(asn_random_between(-1, 4)) {
+    default:
+    case -1:
+        /* Prepare lengths somewhat outside of constrained range. */
+        if(constraints->per_constraints
+           && (constraints->per_constraints->size.flags & APC_EXTENSIBLE)) {
+            switch(asn_random_between(0, 5)) {
+            default:
+            case 0:
+                rnd_len = 0;
+                break;
+            case 1:
+                if(slb > 0) {
+                    rnd_len = slb - 1;
+                } else {
+                    rnd_len = 0;
+                }
+                break;
+            case 2:
+                rnd_len = asn_random_between(0, slb);
+                break;
+            case 3:
+                if(sub < (ssize_t)max_length) {
+                    rnd_len = sub + 1;
+                } else {
+                    rnd_len = max_length;
+                }
+                break;
+            case 4:
+                if(sub < (ssize_t)max_length) {
+                    rnd_len = asn_random_between(sub + 1, max_length);
+                } else {
+                    rnd_len = max_length;
+                }
+                break;
+            case 5:
+                rnd_len = max_length;
+                break;
+            }
+            break;
+        }
+        /* Fall through */
+    case 0:
+        rnd_len = asn_random_between(slb, sub);
+        break;
+    case 1:
+        if(slb < sub) {
+            rnd_len = asn_random_between(slb + 1, sub);
+            break;
+        }
+        /* Fall through */
+    case 2:
+        rnd_len = asn_random_between(slb, slb);
+        break;
+    case 3:
+        if(slb < sub) {
+            rnd_len = asn_random_between(slb, sub - 1);
+            break;
+        }
+        /* Fall through */
+    case 4:
+        rnd_len = asn_random_between(sub, sub);
+        break;
+    }
+
+    for(; rnd_len > 0; rnd_len--) {
+        asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+        void *ptr = 0;
+        asn_random_fill_result_t tmpres = elm->type->op->random_fill(
+            elm->type, &ptr, &elm->encoding_constraints,
+            (max_length > res_ok.length ? max_length - res_ok.length : 0)
+                / rnd_len);
+        switch(tmpres.code) {
+        case ARFILL_OK:
+            ASN_SET_ADD(list, ptr);
+            res_ok.length += tmpres.length;
+            break;
+        case ARFILL_SKIPPED:
+            break;
+        case ARFILL_FAILED:
+            assert(ptr == 0);
+            return tmpres;
+        }
+    }
+
+    return res_ok;
+}
+
diff --git a/e2ap/lib/constr_SET_OF_oer.c b/e2ap/lib/constr_SET_OF_oer.c
new file mode 100644
index 0000000..5200518
--- /dev/null
+++ b/e2ap/lib/constr_SET_OF_oer.c
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#ifndef ASN_DISABLE_OER_SUPPORT
+
+#include <asn_internal.h>
+#include <constr_SET_OF.h>
+#include <asn_SET_OF.h>
+#include <errno.h>
+
+/*
+ * This macro "eats" the part of the buffer which is definitely "consumed",
+ * i.e. was correctly converted into local representation or rightfully skipped.
+ */
+#undef  ADVANCE
+#define ADVANCE(num_bytes)                   \
+    do {                                     \
+        size_t num = num_bytes;              \
+        ptr = ((const char *)ptr) + num;     \
+        size -= num;                         \
+        consumed_myself += num;              \
+    } while(0)
+
+/*
+ * Switch to the next phase of parsing.
+ */
+#undef  NEXT_PHASE
+#define NEXT_PHASE(ctx) \
+    do {                \
+        ctx->phase++;   \
+        ctx->step = 0;  \
+    } while(0)
+#undef  SET_PHASE
+#define SET_PHASE(ctx, value) \
+    do {                      \
+        ctx->phase = value;   \
+        ctx->step = 0;        \
+    } while(0)
+
+/*
+ * Return a standardized complex structure.
+ */
+#undef  RETURN
+#define RETURN(_code)                    \
+    do {                                 \
+        asn_dec_rval_t rval;             \
+        rval.code = _code;               \
+        rval.consumed = consumed_myself; \
+        return rval;                     \
+    } while(0)
+
+/*
+ * The SEQUENCE OF and SET OF values utilize a "quantity field".
+ * It is is a pointless combination of #8.6 (length determinant, capable
+ * of encoding tiny and huge numbers in the shortest possible number of octets)
+ * and the variable sized integer. What could have been encoded by #8.6 alone
+ * is required to be encoded by #8.6 followed by that number of unsigned octets.
+ * This doesn't make too much sense. It seems that the original version of OER
+ * standard have been using the unconstrained unsigned integer as a quantity
+ * field, and this legacy have gone through ISO/ITU-T standardization process.
+ */
+static ssize_t
+oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) {
+    const uint8_t *b;
+    const uint8_t *bend;
+    size_t len = 0;
+    size_t qty;
+
+    ssize_t len_len = oer_fetch_length(ptr, size, &len);
+    if(len_len <= 0) {
+        *qty_r = 0;
+        return len_len;
+    }
+
+    if((len_len + len) > size) {
+        *qty_r = 0;
+        return 0;
+    }
+
+    b = (const uint8_t *)ptr + len_len;
+    bend = b + len;
+
+    /* Skip the leading 0-bytes */
+    for(; b < bend && *b == 0; b++) {
+    }
+
+    if((bend - b) > (ssize_t)sizeof(size_t)) {
+        /* Length is not representable by the native size_t type */
+        *qty_r = 0;
+        return -1;
+    }
+
+    for(qty = 0; b < bend; b++) {
+        qty = (qty << 8) + *b;
+    }
+
+    if(qty > RSIZE_MAX) { /* A bit of C11 validation */
+        *qty_r = 0;
+        return -1;
+    }
+
+    *qty_r = qty;
+    assert((size_t)len_len + len == (size_t)(bend - (const uint8_t *)ptr));
+    return len_len + len;
+}
+
+asn_dec_rval_t
+SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
+                  const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *ptr, size_t size) {
+    const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    void *st = *struct_ptr; /* Target structure */
+    asn_struct_ctx_t *ctx; /* Decoder context */
+    size_t consumed_myself = 0; /* Consumed bytes from ptr. */
+
+    (void)constraints;
+
+    if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
+        ASN__DECODE_FAILED;
+
+    /*
+     * Create the target structure if it is not present already.
+     */
+    if(st == 0) {
+        st = *struct_ptr = CALLOC(1, specs->struct_size);
+        if(st == 0) {
+            RETURN(RC_FAIL);
+        }
+    }
+
+    /*
+     * Restore parsing context.
+     */
+    ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
+
+    /*
+     * Start to parse where left previously.
+     */
+    switch(ctx->phase) {
+    case 0: {
+        /*
+         * Fetch number of elements to decode.
+         */
+        size_t length = 0;
+        size_t len_size = oer_fetch_quantity(ptr, size, &length);
+        switch(len_size) {
+        case 0:
+            RETURN(RC_WMORE);
+        case -1:
+            RETURN(RC_FAIL);
+        default:
+            ADVANCE(len_size);
+            ctx->left = length;
+        }
+    }
+        NEXT_PHASE(ctx);
+        /* FALL THROUGH */
+    case 1: {
+        /* Decode components of the extension root */
+        asn_TYPE_member_t *elm = td->elements;
+        asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
+        const void *base_ptr = ptr;
+        ber_tlv_len_t base_ctx_left = ctx->left;
+
+        assert(td->elements_count == 1);
+
+        ASN_DEBUG("OER SET OF %s Decoding PHASE 1", td->name);
+
+        for(; ctx->left > 0; ctx->left--) {
+            asn_dec_rval_t rv = elm->type->op->oer_decoder(
+                opt_codec_ctx, elm->type,
+                elm->encoding_constraints.oer_constraints, &ctx->ptr, ptr,
+                size);
+            ADVANCE(rv.consumed);
+            switch(rv.code) {
+            case RC_OK:
+                if(ASN_SET_ADD(list, ctx->ptr) != 0) {
+                    RETURN(RC_FAIL);
+                } else {
+                    ctx->ptr = 0;
+                    /*
+                     * This check is to avoid compression bomb with
+                     * specs like SEQUENCE/SET OF NULL which don't
+                     * consume data at all.
+                     */
+                    if(rv.consumed == 0 && base_ptr == ptr
+                       && (base_ctx_left - ctx->left) > 200) {
+                        ASN__DECODE_FAILED;
+                    }
+                    break;
+                }
+            case RC_WMORE:
+                RETURN(RC_WMORE);
+            case RC_FAIL:
+                ASN_STRUCT_FREE(*elm->type, ctx->ptr);
+                ctx->ptr = 0;
+                SET_PHASE(ctx, 3);
+                RETURN(RC_FAIL);
+            }
+        }
+        /* Decoded decently. */
+        NEXT_PHASE(ctx);
+    }
+        /* Fall through */
+    case 2:
+        /* Ignore fully decoded */
+        assert(ctx->left == 0);
+        RETURN(RC_OK);
+    case 3:
+        /* Failed to decode. */
+        RETURN(RC_FAIL);
+    }
+
+    return rval;
+}
+
+static ssize_t
+oer_put_quantity(size_t qty, asn_app_consume_bytes_f *cb, void *app_key) {
+    uint8_t buf[1 + sizeof(size_t)];
+    uint8_t *b = &buf[sizeof(size_t)]; /* Last addressable */
+    size_t encoded;
+
+    do {
+        *b-- = qty;
+        qty >>= 8;
+    } while(qty);
+
+    *b = sizeof(buf) - (b-buf) - 1;
+    encoded = sizeof(buf) - (b-buf);
+    if(cb(b, encoded, app_key) < 0)
+        return -1;
+    return encoded;
+}
+
+/*
+ * Encode as Canonical OER.
+ */
+asn_enc_rval_t
+SET_OF_encode_oer(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    const asn_TYPE_member_t *elm;
+    const asn_anonymous_set_ *list;
+    size_t computed_size = 0;
+    ssize_t qty_len;
+    int n;
+
+    (void)constraints;
+
+    if(!sptr) ASN__ENCODE_FAILED;
+
+    elm = td->elements;
+    list = _A_CSET_FROM_VOID(sptr);
+
+    qty_len = oer_put_quantity(list->count, cb, app_key);
+    if(qty_len < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    computed_size += qty_len;
+
+    for(n = 0; n < list->count; n++) {
+        void *memb_ptr = list->array[n];
+        asn_enc_rval_t er = {0,0,0};
+        er = elm->type->op->oer_encoder(
+            elm->type, elm->encoding_constraints.oer_constraints, memb_ptr, cb,
+            app_key);
+        if(er.encoded < 0) {
+            return er;
+        } else {
+            computed_size += er.encoded;
+        }
+    }
+
+    {
+        asn_enc_rval_t erval = {0,0,0};
+        erval.encoded = computed_size;
+        ASN__ENCODED_OK(erval);
+    }
+}
+
+#endif  /* ASN_DISABLE_OER_SUPPORT */
diff --git a/e2ap/lib/constr_TYPE.c b/e2ap/lib/constr_TYPE.c
new file mode 100644
index 0000000..aefaefd
--- /dev/null
+++ b/e2ap/lib/constr_TYPE.c
@@ -0,0 +1,80 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <constr_TYPE.h>
+#include <errno.h>
+
+/*
+ * Version of the ASN.1 infrastructure shipped with compiler.
+ */
+int get_asn1c_environment_version() { return ASN1C_ENVIRONMENT_VERSION; }
+
+static asn_app_consume_bytes_f _print2fp;
+
+/*
+ * Return the outmost tag of the type.
+ */
+ber_tlv_tag_t
+asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor,
+		const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) {
+
+	if(tag_mode)
+		return tag;
+
+	if(type_descriptor->tags_count)
+		return type_descriptor->tags[0];
+
+	return type_descriptor->op->outmost_tag(type_descriptor, struct_ptr, 0, 0);
+}
+
+/*
+ * Print the target language's structure in human readable form.
+ */
+int
+asn_fprint(FILE *stream, const asn_TYPE_descriptor_t *td,
+           const void *struct_ptr) {
+    if(!stream) stream = stdout;
+    if(!td || !struct_ptr) {
+        errno = EINVAL;
+        return -1;
+	}
+
+	/* Invoke type-specific printer */
+    if(td->op->print_struct(td, struct_ptr, 1, _print2fp, stream)) {
+        return -1;
+    }
+
+    /* Terminate the output */
+    if(_print2fp("\n", 1, stream)) {
+        return -1;
+    }
+
+    return fflush(stream);
+}
+
+/* Dump the data into the specified stdio stream */
+static int
+_print2fp(const void *buffer, size_t size, void *app_key) {
+	FILE *stream = (FILE *)app_key;
+
+	if(fwrite(buffer, 1, size, stream) != size)
+		return -1;
+
+	return 0;
+}
+
+
+/*
+ * Some compilers do not support variable args macros.
+ * This function is a replacement of ASN_DEBUG() macro.
+ */
+void ASN_DEBUG_f(const char *fmt, ...);
+void ASN_DEBUG_f(const char *fmt, ...) {
+	va_list ap;
+	va_start(ap, fmt);
+	vfprintf(stderr, fmt, ap);
+	fprintf(stderr, "\n");
+	va_end(ap);
+}
diff --git a/e2ap/lib/constraints.c b/e2ap/lib/constraints.c
new file mode 100644
index 0000000..df3c6c1
--- /dev/null
+++ b/e2ap/lib/constraints.c
@@ -0,0 +1,93 @@
+#include <asn_internal.h>
+#include <constraints.h>
+
+int
+asn_generic_no_constraint(const asn_TYPE_descriptor_t *type_descriptor,
+                          const void *struct_ptr,
+                          asn_app_constraint_failed_f *cb, void *key) {
+    (void)type_descriptor;	/* Unused argument */
+	(void)struct_ptr;	/* Unused argument */
+	(void)cb;	/* Unused argument */
+	(void)key;	/* Unused argument */
+
+	/* Nothing to check */
+	return 0;
+}
+
+int
+asn_generic_unknown_constraint(const asn_TYPE_descriptor_t *type_descriptor,
+                               const void *struct_ptr,
+                               asn_app_constraint_failed_f *cb, void *key) {
+    (void)type_descriptor;	/* Unused argument */
+	(void)struct_ptr;	/* Unused argument */
+	(void)cb;	/* Unused argument */
+	(void)key;	/* Unused argument */
+
+	/* Unknown how to check */
+	return 0;
+}
+
+struct errbufDesc {
+    const asn_TYPE_descriptor_t *failed_type;
+    const void *failed_struct_ptr;
+	char *errbuf;
+	size_t errlen;
+};
+
+static void
+_asn_i_ctfailcb(void *key, const asn_TYPE_descriptor_t *td, const void *sptr,
+                const char *fmt, ...) {
+    struct errbufDesc *arg = key;
+	va_list ap;
+	ssize_t vlen;
+	ssize_t maxlen;
+
+	arg->failed_type = td;
+	arg->failed_struct_ptr = sptr;
+
+	maxlen = arg->errlen;
+	if(maxlen <= 0)
+		return;
+
+	va_start(ap, fmt);
+	vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap);
+	va_end(ap);
+	if(vlen >= maxlen) {
+		arg->errbuf[maxlen-1] = '\0';	/* Ensuring libc correctness */
+		arg->errlen = maxlen - 1;	/* Not counting termination */
+		return;
+	} else if(vlen >= 0) {
+		arg->errbuf[vlen] = '\0';	/* Ensuring libc correctness */
+		arg->errlen = vlen;		/* Not counting termination */
+	} else {
+		/*
+		 * The libc on this system is broken.
+		 */
+		vlen = sizeof("<broken vsnprintf>") - 1;
+		maxlen--;
+		arg->errlen = vlen < maxlen ? vlen : maxlen;
+		memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
+		arg->errbuf[arg->errlen] = 0;
+	}
+
+	return;
+}
+
+int
+asn_check_constraints(const asn_TYPE_descriptor_t *type_descriptor,
+                      const void *struct_ptr, char *errbuf, size_t *errlen) {
+    struct errbufDesc arg;
+    int ret;
+
+    arg.failed_type = 0;
+    arg.failed_struct_ptr = 0;
+    arg.errbuf = errbuf;
+    arg.errlen = errlen ? *errlen : 0;
+
+    ret = type_descriptor->encoding_constraints.general_constraints(
+        type_descriptor, struct_ptr, _asn_i_ctfailcb, &arg);
+    if(ret == -1 && errlen) *errlen = arg.errlen;
+
+    return ret;
+}
+
diff --git a/e2ap/lib/der_encoder.c b/e2ap/lib/der_encoder.c
new file mode 100644
index 0000000..2c6a6f7
--- /dev/null
+++ b/e2ap/lib/der_encoder.c
@@ -0,0 +1,194 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <errno.h>
+
+static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len,
+	asn_app_consume_bytes_f *cb, void *app_key, int constructed);
+
+/*
+ * The DER encoder of any type.
+ */
+asn_enc_rval_t
+der_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr,
+           asn_app_consume_bytes_f *consume_bytes, void *app_key) {
+    ASN_DEBUG("DER encoder invoked for %s",
+		type_descriptor->name);
+
+	/*
+	 * Invoke type-specific encoder.
+	 */
+    return type_descriptor->op->der_encoder(
+        type_descriptor, struct_ptr, /* Pointer to the destination structure */
+        0, 0, consume_bytes, app_key);
+}
+
+/*
+ * Argument type and callback necessary for der_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+	void *buffer;
+	size_t left;
+} enc_to_buf_arg;
+static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+	enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+	if(arg->left < size)
+		return -1;	/* Data exceeds the available buffer size */
+
+	memcpy(arg->buffer, buffer, size);
+	arg->buffer = ((char *)arg->buffer) + size;
+	arg->left -= size;
+
+	return 0;
+}
+
+/*
+ * A variant of the der_encode() which encodes the data into the provided buffer
+ */
+asn_enc_rval_t
+der_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor,
+                     const void *struct_ptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg arg;
+	asn_enc_rval_t ec;
+
+	arg.buffer = buffer;
+	arg.left = buffer_size;
+
+	ec = type_descriptor->op->der_encoder(type_descriptor,
+		struct_ptr,	/* Pointer to the destination structure */
+		0, 0, encode_to_buffer_cb, &arg);
+	if(ec.encoded != -1) {
+		assert(ec.encoded == (ssize_t)(buffer_size - arg.left));
+		/* Return the encoded contents size */
+	}
+	return ec;
+}
+
+
+/*
+ * Write out leading TL[v] sequence according to the type definition.
+ */
+ssize_t
+der_write_tags(const asn_TYPE_descriptor_t *sd, size_t struct_length,
+               int tag_mode, int last_tag_form,
+               ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */
+               asn_app_consume_bytes_f *cb, void *app_key) {
+#define ASN1_DER_MAX_TAGS_COUNT 4
+    ber_tlv_tag_t
+        tags_buf_scratch[ASN1_DER_MAX_TAGS_COUNT * sizeof(ber_tlv_tag_t)];
+    ssize_t lens[ASN1_DER_MAX_TAGS_COUNT * sizeof(ssize_t)];
+    const ber_tlv_tag_t *tags; /* Copy of tags stream */
+    int tags_count;            /* Number of tags */
+    size_t overall_length;
+    int i;
+
+    ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)",
+		sd->name, tag_mode, sd->tags_count,
+		ber_tlv_tag_string(tag),
+		tag_mode
+			?(sd->tags_count+1
+				-((tag_mode == -1) && sd->tags_count))
+			:sd->tags_count
+	);
+
+    if(sd->tags_count + 1 > ASN1_DER_MAX_TAGS_COUNT) {
+        ASN_DEBUG("System limit %d on tags count", ASN1_DER_MAX_TAGS_COUNT);
+        return -1;
+    }
+
+	if(tag_mode) {
+		/*
+		 * Instead of doing shaman dance like we do in ber_check_tags(),
+		 * allocate a small array on the stack
+		 * and initialize it appropriately.
+		 */
+		int stag_offset;
+		ber_tlv_tag_t *tags_buf = tags_buf_scratch;
+		tags_count = sd->tags_count
+			+ 1	/* EXPLICIT or IMPLICIT tag is given */
+			- ((tag_mode == -1) && sd->tags_count);
+		/* Copy tags over */
+		tags_buf[0] = tag;
+		stag_offset = -1 + ((tag_mode == -1) && sd->tags_count);
+		for(i = 1; i < tags_count; i++)
+			tags_buf[i] = sd->tags[i + stag_offset];
+		tags = tags_buf;
+	} else {
+		tags = sd->tags;
+		tags_count = sd->tags_count;
+	}
+
+	/* No tags to write */
+	if(tags_count == 0)
+		return 0;
+
+	/*
+	 * Array of tags is initialized.
+	 * Now, compute the size of the TLV pairs, from right to left.
+	 */
+	overall_length = struct_length;
+	for(i = tags_count - 1; i >= 0; --i) {
+		lens[i] = der_write_TL(tags[i], overall_length, 0, 0, 0);
+		if(lens[i] == -1) return -1;
+		overall_length += lens[i];
+		lens[i] = overall_length - lens[i];
+	}
+
+	if(!cb) return overall_length - struct_length;
+
+	ASN_DEBUG("Encoding %s TL sequence (%d elements)", sd->name,
+                  tags_count);
+
+	/*
+	 * Encode the TL sequence for real.
+	 */
+	for(i = 0; i < tags_count; i++) {
+		ssize_t len;
+		int _constr;
+
+		/* Check if this tag happens to be constructed */
+		_constr = (last_tag_form || i < (tags_count - 1));
+
+		len = der_write_TL(tags[i], lens[i], cb, app_key, _constr);
+		if(len == -1) return -1;
+	}
+
+	return overall_length - struct_length;
+}
+
+static ssize_t
+der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len,
+		asn_app_consume_bytes_f *cb, void *app_key,
+		int constructed) {
+	uint8_t buf[32];
+	size_t size = 0;
+	int buf_size = cb?sizeof(buf):0;
+	ssize_t tmp;
+
+	/* Serialize tag (T from TLV) into possibly zero-length buffer */
+	tmp = ber_tlv_tag_serialize(tag, buf, buf_size);
+	if(tmp == -1 || tmp > (ssize_t)sizeof(buf)) return -1;
+	size += tmp;
+
+	/* Serialize length (L from TLV) into possibly zero-length buffer */
+	tmp = der_tlv_length_serialize(len, buf+size, buf_size?buf_size-size:0);
+	if(tmp == -1) return -1;
+	size += tmp;
+
+	if(size > sizeof(buf))
+		return -1;
+
+	/*
+	 * If callback is specified, invoke it, and check its return value.
+	 */
+	if(cb) {
+		if(constructed) *buf |= 0x20;
+		if(cb(buf, size, app_key) < 0)
+			return -1;
+	}
+
+	return size;
+}
diff --git a/e2ap/lib/oer_decoder.c b/e2ap/lib/oer_decoder.c
new file mode 100644
index 0000000..0701738
--- /dev/null
+++ b/e2ap/lib/oer_decoder.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+
+/*
+ * The OER decoder of any type.
+ */
+asn_dec_rval_t
+oer_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr,
+           const void *ptr, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return type_descriptor->op->oer_decoder(opt_codec_ctx, type_descriptor, 0,
+		struct_ptr,	/* Pointer to the destination structure */
+		ptr, size	/* Buffer and its size */
+		);
+}
+
+/*
+ * Open Type is encoded as a length (#8.6) followed by that number of bytes.
+ * Since we're just skipping, reading the length would be enough.
+ */
+ssize_t
+oer_open_type_skip(const void *bufptr, size_t size) {
+    size_t len = 0;
+    return oer_fetch_length(bufptr, size, &len);
+}
+
+/*
+ * Read the Open Type (X.696 (08/2015), #30).
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t
+oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
+                  const struct asn_TYPE_descriptor_s *td,
+                  const asn_oer_constraints_t *constraints, void **struct_ptr,
+                  const void *bufptr, size_t size) {
+    asn_dec_rval_t dr;
+    size_t container_len = 0;
+    ssize_t len_len;
+    enum asn_struct_free_method dispose_method =
+        (*struct_ptr) ? ASFM_FREE_UNDERLYING_AND_RESET : ASFM_FREE_EVERYTHING;
+
+    /* Get the size of a length determinant */
+    len_len = oer_fetch_length(bufptr, size, &container_len);
+    if(len_len <= 0) {
+        return len_len; /* Error or more data expected */
+    }
+
+    /*
+     * len_len can't be bigger than size, but size without len_len
+     * should be bigger or equal to container length
+     */
+    if(size - len_len < container_len) {
+        /* More data is expected */
+        return 0;
+    }
+
+    dr = td->op->oer_decoder(opt_codec_ctx, td, constraints, struct_ptr,
+                         (const uint8_t *)bufptr + len_len, container_len);
+    if(dr.code == RC_OK) {
+        return len_len + container_len;
+    } else {
+        /* Even if RC_WMORE, we can't get more data into a closed container. */
+        td->op->free_struct(td, *struct_ptr, dispose_method);
+        *struct_ptr = NULL;
+        return -1;
+    }
+}
+
+
+asn_dec_rval_t
+oer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td,
+                     const asn_oer_constraints_t *constraints, void **sptr,
+                     const void *ptr, size_t size) {
+    ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
+    asn_dec_rval_t rval = {RC_OK, 0};
+    size_t expected_length = 0;
+    ssize_t len_len;
+
+    (void)td;
+    (void)opt_codec_ctx;
+    (void)constraints;
+
+    if(!st) {
+        st = (ASN__PRIMITIVE_TYPE_t *)(*sptr = CALLOC(
+                                           1, sizeof(ASN__PRIMITIVE_TYPE_t)));
+        if(!st) ASN__DECODE_FAILED;
+    }
+
+
+    /*
+     * X.696 (08/2015) #27.2
+     * Encode length determinant as _number of octets_, but only
+     * if upper bound is not equal to lower bound.
+     */
+    len_len = oer_fetch_length(ptr, size, &expected_length);
+    if(len_len > 0) {
+        rval.consumed = len_len;
+        ptr = (const char *)ptr + len_len;
+        size -= len_len;
+    } else if(len_len == 0) {
+        ASN__DECODE_STARVED;
+    } else if(len_len < 0) {
+        ASN__DECODE_FAILED;
+    }
+
+    if(size < expected_length) {
+        ASN__DECODE_STARVED;
+    } else {
+        uint8_t *buf = MALLOC(expected_length + 1);
+        if(buf == NULL) {
+            ASN__DECODE_FAILED;
+        } else {
+            memcpy(buf, ptr, expected_length);
+            buf[expected_length] = '\0';
+        }
+        FREEMEM(st->buf);
+        st->buf = buf;
+        st->size = expected_length;
+
+        rval.consumed += expected_length;
+        return rval;
+    }
+}
diff --git a/e2ap/lib/oer_encoder.c b/e2ap/lib/oer_encoder.c
new file mode 100644
index 0000000..a284cc2
--- /dev/null
+++ b/e2ap/lib/oer_encoder.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <asn_codecs_prim.h>
+
+/*
+ * The OER encoder of any type.
+ */
+asn_enc_rval_t
+oer_encode(const asn_TYPE_descriptor_t *type_descriptor, const void *struct_ptr,
+           asn_app_consume_bytes_f *consume_bytes, void *app_key) {
+    ASN_DEBUG("OER encoder invoked for %s", type_descriptor->name);
+
+    /*
+     * Invoke type-specific encoder.
+     */
+    return type_descriptor->op->oer_encoder(
+        type_descriptor, 0,
+        struct_ptr, /* Pointer to the destination structure */
+        consume_bytes, app_key);
+}
+
+/*
+ * Argument type and callback necessary for oer_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+        void *buffer;
+        size_t left;
+} enc_to_buf_arg;
+static int
+encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+    enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+    if(arg->left < size) return -1; /* Data exceeds the available buffer size */
+
+    memcpy(arg->buffer, buffer, size);
+    arg->buffer = ((char *)arg->buffer) + size;
+    arg->left -= size;
+
+    return 0;
+}
+
+/*
+ * A variant of the oer_encode() which encodes the data into the provided buffer
+ */
+asn_enc_rval_t
+oer_encode_to_buffer(const asn_TYPE_descriptor_t *type_descriptor,
+                     const asn_oer_constraints_t *constraints,
+                     const void *struct_ptr, /* Structure to be encoded */
+                     void *buffer,           /* Pre-allocated buffer */
+                     size_t buffer_size      /* Initial buffer size (maximum) */
+) {
+    enc_to_buf_arg arg;
+    asn_enc_rval_t ec;
+
+    arg.buffer = buffer;
+    arg.left = buffer_size;
+
+    if(type_descriptor->op->oer_encoder == NULL) {
+        ec.encoded = -1;
+        ec.failed_type = type_descriptor;
+        ec.structure_ptr = struct_ptr;
+        ASN_DEBUG("OER encoder is not defined for %s",
+                type_descriptor->name);
+    } else {
+        ec = type_descriptor->op->oer_encoder(
+            type_descriptor, constraints,
+            struct_ptr, /* Pointer to the destination structure */
+            encode_to_buffer_cb, &arg);
+        if(ec.encoded != -1) {
+            assert(ec.encoded == (ssize_t)(buffer_size - arg.left));
+            /* Return the encoded contents size */
+        }
+    }
+    return ec;
+}
+
+asn_enc_rval_t
+oer_encode_primitive(const asn_TYPE_descriptor_t *td,
+                     const asn_oer_constraints_t *constraints, const void *sptr,
+                     asn_app_consume_bytes_f *cb, void *app_key) {
+    const ASN__PRIMITIVE_TYPE_t *st = (const ASN__PRIMITIVE_TYPE_t *)sptr;
+    asn_enc_rval_t er = {0, 0, 0};
+    ssize_t ret;
+
+    (void)constraints;
+
+    if(!st) ASN__ENCODE_FAILED;
+
+    ASN_DEBUG("Encoding %s (%" ASN_PRI_SIZE " bytes)", td ? td->name : "", st->size);
+
+    /*
+     * X.696 (08/2015) #27.2
+     */
+    ret = oer_serialize_length(st->size, cb, app_key);
+    if(ret < 0) {
+        ASN__ENCODE_FAILED;
+    }
+    er.encoded += ret;
+
+    er.encoded += st->size;
+    if(cb(st->buf, st->size, app_key) < 0) {
+        ASN__ENCODE_FAILED;
+    } else {
+        ASN__ENCODED_OK(er);
+    }
+}
+
+static int
+oer__count_bytes(const void *buffer, size_t size, void *bytes_ptr) {
+    size_t *bytes = bytes_ptr;
+    (void)buffer;
+    *bytes += size;
+    return 0;
+}
+
+ssize_t
+oer_open_type_put(const asn_TYPE_descriptor_t *td,
+                  const asn_oer_constraints_t *constraints, const void *sptr,
+                  asn_app_consume_bytes_f *cb, void *app_key) {
+    size_t serialized_byte_count = 0;
+    asn_enc_rval_t er = {0,0,0};
+    ssize_t len_len;
+
+    er = td->op->oer_encoder(td, constraints, sptr, oer__count_bytes,
+                             &serialized_byte_count);
+    if(er.encoded < 0) return -1;
+    assert(serialized_byte_count == (size_t)er.encoded);
+
+    len_len = oer_serialize_length(serialized_byte_count, cb, app_key);
+    if(len_len == -1) return -1;
+
+    er = td->op->oer_encoder(td, constraints, sptr, cb, app_key);
+    if(er.encoded < 0) return -1;
+    assert(serialized_byte_count == (size_t)er.encoded);
+
+    return len_len + er.encoded;
+}
+
diff --git a/e2ap/lib/oer_support.c b/e2ap/lib/oer_support.c
new file mode 100644
index 0000000..b15a3bc
--- /dev/null
+++ b/e2ap/lib/oer_support.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
+ * All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+
+#include <oer_support.h>
+
+/*
+ * Fetch the length determinant (X.696 08/2015, #8.6) into *len_r.
+ * RETURN VALUES:
+ *       0:     More data expected than bufptr contains.
+ *      -1:     Fatal error deciphering length.
+ *      >0:     Number of bytes used from bufptr.
+ */
+ssize_t
+oer_fetch_length(const void *bufptr, size_t size, size_t *len_r) {
+    uint8_t first_byte;
+    size_t len_len;    /* Length of the length determinant */
+    const uint8_t *b;
+    const uint8_t *bend;
+    size_t len;
+
+    if(size == 0) {
+        *len_r = 0;
+        return 0;
+    }
+
+    first_byte = *(const uint8_t *)bufptr;
+    if((first_byte & 0x80) == 0) {   /* Short form */
+        *len_r = first_byte; /* 0..127 */
+        return 1;
+    }
+
+    len_len = (first_byte & 0x7f);
+    if((1 + len_len) > size) {
+        *len_r = 0;
+        return 0;
+    }
+
+    b = (const uint8_t *)bufptr + 1;
+    bend = b + len_len;
+
+    for(; b < bend && *b == 0; b++) {
+        /* Skip the leading 0-bytes */
+    }
+
+    if((bend - b) > (ssize_t)sizeof(size_t)) {
+        /* Length is not representable by the native size_t type */
+        *len_r = 0;
+        return -1;
+    }
+
+    for(len = 0; b < bend; b++) {
+        len = (len << 8) + *b;
+    }
+
+    if(len > RSIZE_MAX) { /* A bit of C11 validation */
+        *len_r = 0;
+        return -1;
+    }
+
+    *len_r = len;
+    assert(len_len + 1 == (size_t)(bend - (const uint8_t *)bufptr));
+    return len_len + 1;
+}
+
+
+/*
+ * Serialize OER length. Returns the number of bytes serialized
+ * or -1 if a given callback returned with negative result.
+ */
+ssize_t
+oer_serialize_length(size_t length, asn_app_consume_bytes_f *cb,
+                     void *app_key) {
+    uint8_t scratch[1 + sizeof(length)];
+    uint8_t *sp = scratch;
+    int littleEndian = 1;   /* Run-time detection */
+    const uint8_t *pstart;
+    const uint8_t *pend;
+    const uint8_t *p;
+    int add;
+
+    if(length <= 127) {
+        uint8_t b = length;
+        if(cb(&b, 1, app_key) < 0) {
+            return -1;
+        }
+        return 1;
+    }
+
+    if(*(char *)&littleEndian) {
+        pstart = (const uint8_t *)&length + sizeof(length) - 1;
+        pend = (const uint8_t *)&length;
+        add = -1;
+    } else {
+        pstart = (const uint8_t *)&length;
+        pend = pstart + sizeof(length);
+        add = 1;
+    }
+
+    for(p = pstart; p != pend; p += add) {
+        /* Skip leading zeros. */
+        if(*p) break;
+    }
+
+    for(sp = scratch + 1; ; p += add) {
+        *sp++ = *p;
+        if(p == pend) break;
+    }
+    assert((sp - scratch) - 1 <= 0x7f);
+    scratch[0] = 0x80 + ((sp - scratch) - 1);
+
+    if(cb(scratch, sp - scratch, app_key) < 0) {
+        return -1;
+    }
+
+    return sp - scratch;
+}
+
diff --git a/e2ap/lib/per_decoder.c b/e2ap/lib/per_decoder.c
new file mode 100644
index 0000000..8a3e39d
--- /dev/null
+++ b/e2ap/lib/per_decoder.c
@@ -0,0 +1,185 @@
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <per_decoder.h>
+
+/*
+ * Decode a "Production of a complete encoding", X.691#10.1.
+ * The complete encoding contains at least one byte, and is an integral
+ * multiple of 8 bytes.
+ */
+asn_dec_rval_t
+uper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buffer, size_t size) {
+    asn_dec_rval_t rval;
+
+	rval = uper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
+	if(rval.consumed) {
+		/*
+		 * We've always given 8-aligned data,
+		 * so convert bits to integral bytes.
+		 */
+		rval.consumed += 7;
+		rval.consumed >>= 3;
+	} else if(rval.code == RC_OK) {
+		if(size) {
+			if(((const uint8_t *)buffer)[0] == 0) {
+				rval.consumed = 1;	/* 1 byte */
+			} else {
+				ASN_DEBUG("Expecting single zeroed byte");
+				rval.code = RC_FAIL;
+			}
+		} else {
+			/* Must contain at least 8 bits. */
+			rval.code = RC_WMORE;
+		}
+	}
+
+	return rval;
+}
+
+asn_dec_rval_t
+uper_decode(const asn_codec_ctx_t *opt_codec_ctx,
+            const asn_TYPE_descriptor_t *td, void **sptr, const void *buffer,
+            size_t size, int skip_bits, int unused_bits) {
+    asn_codec_ctx_t s_codec_ctx;
+	asn_dec_rval_t rval;
+	asn_per_data_t pd;
+
+	if(skip_bits < 0 || skip_bits > 7
+	|| unused_bits < 0 || unused_bits > 7
+	|| (unused_bits > 0 && !size))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/* Fill in the position indicator */
+	memset(&pd, 0, sizeof(pd));
+	pd.buffer = (const uint8_t *)buffer;
+	pd.nboff = skip_bits;
+	pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from <limits.h> */
+	if(pd.nboff > pd.nbits)
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	if(!td->op->uper_decoder)
+		ASN__DECODE_FAILED;	/* PER is not compiled in */
+	rval = td->op->uper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
+	if(rval.code == RC_OK) {
+		/* Return the number of consumed bits */
+		rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
+					+ pd.nboff - skip_bits;
+		ASN_DEBUG("PER decoding consumed %ld, counted %ld",
+			(long)rval.consumed, (long)pd.moved);
+		assert(rval.consumed == pd.moved);
+	} else {
+		/* PER codec is not a restartable */
+		rval.consumed = 0;
+	}
+	return rval;
+}
+
+asn_dec_rval_t
+aper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx,
+                     const asn_TYPE_descriptor_t *td, void **sptr,
+                     const void *buffer, size_t size) {
+	asn_dec_rval_t rval;
+
+	rval = aper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
+	if(rval.consumed) {
+		/*
+		 * We've always given 8-aligned data,
+		 * so convert bits to integral bytes.
+		 */
+		rval.consumed += 7;
+		rval.consumed >>= 3;
+	} else if(rval.code == RC_OK) {
+		if(size) {
+			if(((const uint8_t *)buffer)[0] == 0) {
+				rval.consumed = 1;	/* 1 byte */
+			} else {
+				ASN_DEBUG("Expecting single zeroed byte");
+				rval.code = RC_FAIL;
+			}
+		} else {
+			/* Must contain at least 8 bits. */
+			rval.code = RC_WMORE;
+		}
+	}
+
+	return rval;
+}
+
+asn_dec_rval_t
+aper_decode(const asn_codec_ctx_t *opt_codec_ctx,
+            const asn_TYPE_descriptor_t *td, void **sptr, const void *buffer,
+            size_t size, int skip_bits, int unused_bits) {
+	asn_codec_ctx_t s_codec_ctx;
+	asn_dec_rval_t rval;
+	asn_per_data_t pd;
+
+	if(skip_bits < 0 || skip_bits > 7
+		|| unused_bits < 0 || unused_bits > 7
+		|| (unused_bits > 0 && !size))
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/* Fill in the position indicator */
+	memset(&pd, 0, sizeof(pd));
+	pd.buffer = (const uint8_t *)buffer;
+	pd.nboff = skip_bits;
+	pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from <limits.h> */
+	if(pd.nboff > pd.nbits)
+		ASN__DECODE_FAILED;
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	if(!td->op->aper_decoder)
+		ASN__DECODE_FAILED;	/* PER is not compiled in */
+		rval = td->op->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
+	if(rval.code == RC_OK) {
+		/* Return the number of consumed bits */
+		rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
+		+ pd.nboff - skip_bits;
+		ASN_DEBUG("PER decoding consumed %zu, counted %zu",
+				  rval.consumed, pd.moved);
+		assert(rval.consumed == pd.moved);
+	} else {
+		/* PER codec is not a restartable */
+		rval.consumed = 0;
+	}
+	return rval;
+}
+
diff --git a/e2ap/lib/per_encoder.c b/e2ap/lib/per_encoder.c
new file mode 100644
index 0000000..a35e1f0
--- /dev/null
+++ b/e2ap/lib/per_encoder.c
@@ -0,0 +1,265 @@
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <per_encoder.h>
+
+static int _uper_encode_flush_outp(asn_per_outp_t *po);
+
+static int
+ignore_output(const void *data, size_t size, void *app_key) {
+    (void)data;
+    (void)size;
+    (void)app_key;
+    return 0;
+}
+
+asn_enc_rval_t
+uper_encode(const asn_TYPE_descriptor_t *td,
+            const asn_per_constraints_t *constraints, const void *sptr,
+            asn_app_consume_bytes_f *cb, void *app_key) {
+    asn_per_outp_t po;
+    asn_enc_rval_t er = {0,0,0};
+
+    /*
+     * Invoke type-specific encoder.
+     */
+    if(!td || !td->op->uper_encoder)
+        ASN__ENCODE_FAILED;	/* PER is not compiled in */
+
+    po.buffer = po.tmpspace;
+    po.nboff = 0;
+    po.nbits = 8 * sizeof(po.tmpspace);
+    po.output = cb ? cb : ignore_output;
+    po.op_key = app_key;
+    po.flushed_bytes = 0;
+
+    er = td->op->uper_encoder(td, constraints, sptr, &po);
+    if(er.encoded != -1) {
+        size_t bits_to_flush;
+
+        bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff;
+
+        /* Set number of bits encoded to a firm value */
+        er.encoded = (po.flushed_bytes << 3) + bits_to_flush;
+
+        if(_uper_encode_flush_outp(&po)) ASN__ENCODE_FAILED;
+    }
+
+    return er;
+}
+
+/*
+ * Argument type and callback necessary for uper_encode_to_buffer().
+ */
+typedef struct enc_to_buf_arg {
+	void *buffer;
+	size_t left;
+} enc_to_buf_arg;
+static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) {
+	enc_to_buf_arg *arg = (enc_to_buf_arg *)key;
+
+	if(arg->left < size)
+		return -1;	/* Data exceeds the available buffer size */
+
+	memcpy(arg->buffer, buffer, size);
+	arg->buffer = ((char *)arg->buffer) + size;
+	arg->left -= size;
+
+	return 0;
+}
+
+asn_enc_rval_t
+uper_encode_to_buffer(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg key;
+
+    key.buffer = buffer;
+    key.left = buffer_size;
+
+    if(td) ASN_DEBUG("Encoding \"%s\" using UNALIGNED PER", td->name);
+
+    return uper_encode(td, constraints, sptr, encode_to_buffer_cb, &key);
+}
+
+typedef struct enc_dyn_arg {
+	void *buffer;
+	size_t length;
+	size_t allocated;
+} enc_dyn_arg;
+static int
+encode_dyn_cb(const void *buffer, size_t size, void *key) {
+    enc_dyn_arg *arg = key;
+    if(arg->length + size >= arg->allocated) {
+        size_t new_size = arg->allocated ? arg->allocated : 8;
+        void *p;
+
+        do {
+            new_size <<= 2;
+        } while(arg->length + size >= new_size);
+
+        p = REALLOC(arg->buffer, new_size);
+        if(!p) {
+            FREEMEM(arg->buffer);
+            memset(arg, 0, sizeof(*arg));
+            return -1;
+        }
+        arg->buffer = p;
+        arg->allocated = new_size;
+    }
+    memcpy(((char *)arg->buffer) + arg->length, buffer, size);
+    arg->length += size;
+    return 0;
+}
+ssize_t
+uper_encode_to_new_buffer(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, void **buffer_r) {
+    asn_enc_rval_t er = {0,0,0};
+	enc_dyn_arg key;
+
+	memset(&key, 0, sizeof(key));
+
+	er = uper_encode(td, constraints, sptr, encode_dyn_cb, &key);
+	switch(er.encoded) {
+	case -1:
+		FREEMEM(key.buffer);
+		return -1;
+	case 0:
+		FREEMEM(key.buffer);
+		key.buffer = MALLOC(1);
+		if(key.buffer) {
+			*(char *)key.buffer = '\0';
+			*buffer_r = key.buffer;
+			return 1;
+		} else {
+			return -1;
+		}
+	default:
+		*buffer_r = key.buffer;
+		ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+		return ((er.encoded + 7) >> 3);
+	}
+}
+
+/*
+ * Internally useful functions.
+ */
+
+/* Flush partially filled buffer */
+static int
+_uper_encode_flush_outp(asn_per_outp_t *po) {
+	uint8_t *buf;
+
+	if(po->nboff == 0 && po->buffer == po->tmpspace)
+		return 0;
+
+	buf = po->buffer + (po->nboff >> 3);
+	/* Make sure we account for the last, partially filled */
+	if(po->nboff & 0x07) {
+		buf[0] &= 0xff << (8 - (po->nboff & 0x07));
+		buf++;
+	}
+
+	return po->output(po->tmpspace, buf - po->tmpspace, po->op_key);
+}
+
+asn_enc_rval_t
+aper_encode_to_buffer(const asn_TYPE_descriptor_t *td,
+                      const asn_per_constraints_t *constraints,
+                      const void *sptr, void *buffer, size_t buffer_size) {
+    enc_to_buf_arg key;
+
+    key.buffer = buffer;
+    key.left = buffer_size;
+
+    if(td) ASN_DEBUG("Encoding \"%s\" using ALIGNED PER", td->name);
+
+    return aper_encode(td, constraints, sptr, encode_to_buffer_cb, &key);
+}
+
+ssize_t
+aper_encode_to_new_buffer(const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints,
+                          const void *sptr, void **buffer_r) {
+    asn_enc_rval_t er = {0,0,0};
+	enc_dyn_arg key;
+
+	memset(&key, 0, sizeof(key));
+
+	er = aper_encode(td, constraints, sptr, encode_dyn_cb, &key);
+	switch(er.encoded) {
+	case -1:
+		FREEMEM(key.buffer);
+		return -1;
+	case 0:
+		FREEMEM(key.buffer);
+		key.buffer = MALLOC(1);
+		if(key.buffer) {
+			*(char *)key.buffer = '\0';
+			*buffer_r = key.buffer;
+			return 1;
+		} else {
+			return -1;
+		}
+	default:
+		*buffer_r = key.buffer;
+		ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
+		return ((er.encoded + 7) >> 3);
+	}
+}
+
+static int
+_aper_encode_flush_outp(asn_per_outp_t *po) {
+	uint8_t *buf;
+
+	if(po->nboff == 0 && po->buffer == po->tmpspace)
+		return 0;
+
+	buf = po->buffer + (po->nboff >> 3);
+	/* Make sure we account for the last, partially filled */
+	if(po->nboff & 0x07) {
+		buf[0] &= 0xff << (8 - (po->nboff & 0x07));
+		buf++;
+	}
+
+	if (po->output) {
+		return po->output(po->tmpspace, buf - po->tmpspace, po->op_key);
+	}
+	return 0;
+}
+
+asn_enc_rval_t
+aper_encode(const asn_TYPE_descriptor_t *td,
+        const asn_per_constraints_t *constraints,
+        const void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
+	asn_per_outp_t po;
+	asn_enc_rval_t er = {0,0,0};
+
+	/*
+	 * Invoke type-specific encoder.
+	 */
+	if(!td || !td->op->aper_encoder)
+		ASN__ENCODE_FAILED;	 /* PER is not compiled in */
+
+	po.buffer = po.tmpspace;
+	po.nboff = 0;
+	po.nbits = 8 * sizeof(po.tmpspace);
+	po.output = cb;
+	po.op_key = app_key;
+	po.flushed_bytes = 0;
+
+	er = td->op->aper_encoder(td, constraints, sptr, &po);
+	if(er.encoded != -1) {
+		size_t bits_to_flush;
+
+		bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff;
+
+		/* Set number of bits encoded to a firm value */
+		er.encoded = (po.flushed_bytes << 3) + bits_to_flush;
+
+		if(_aper_encode_flush_outp(&po))
+			ASN__ENCODE_FAILED;
+	}
+
+	return er;
+}
diff --git a/e2ap/lib/per_opentype.c b/e2ap/lib/per_opentype.c
new file mode 100644
index 0000000..28f3cb6
--- /dev/null
+++ b/e2ap/lib/per_opentype.c
@@ -0,0 +1,533 @@
+/*
+ * Copyright (c) 2007 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <per_support.h>
+#include <constr_TYPE.h>
+#include <per_opentype.h>
+
+typedef struct uper_ugot_key {
+	asn_per_data_t oldpd;	/* Old per data source */
+	size_t unclaimed;
+	size_t ot_moved;	/* Number of bits moved by OT processing */
+	int repeat;
+} uper_ugot_key;
+
+static int uper_ugot_refill(asn_per_data_t *pd);
+static int per_skip_bits(asn_per_data_t *pd, int skip_nbits);
+static asn_dec_rval_t uper_sot_suck(const asn_codec_ctx_t *,
+                                    const asn_TYPE_descriptor_t *td,
+                                    const asn_per_constraints_t *constraints,
+                                    void **sptr, asn_per_data_t *pd);
+
+/*
+ * Encode an "open type field".
+ * #10.1, #10.2
+ */
+int
+uper_open_type_put(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, const void *sptr,
+                   asn_per_outp_t *po) {
+    void *buf;
+    void *bptr;
+    ssize_t size;
+
+    ASN_DEBUG("Open type put %s ...", td->name);
+
+    size = uper_encode_to_new_buffer(td, constraints, sptr, &buf);
+    if(size <= 0) return -1;
+
+    ASN_DEBUG("Open type put %s of length %" ASN_PRI_SSIZE " + overhead (1byte?)", td->name,
+              size);
+
+    bptr = buf;
+    do {
+        int need_eom = 0;
+        ssize_t may_save = uper_put_length(po, size, &need_eom);
+        ASN_DEBUG("Prepending length %" ASN_PRI_SSIZE
+                  " to %s and allowing to save %" ASN_PRI_SSIZE,
+                  size, td->name, may_save);
+        if(may_save < 0) break;
+        if(per_put_many_bits(po, bptr, may_save * 8)) break;
+        bptr = (char *)bptr + may_save;
+        size -= may_save;
+        if(need_eom && uper_put_length(po, 0, 0)) {
+            FREEMEM(buf);
+            return -1;
+        }
+    } while(size);
+
+    FREEMEM(buf);
+    if(size) return -1;
+
+    return 0;
+}
+
+static asn_dec_rval_t
+uper_open_type_get_simple(const asn_codec_ctx_t *ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr,
+                          asn_per_data_t *pd) {
+    asn_dec_rval_t rv;
+	ssize_t chunk_bytes;
+	int repeat;
+	uint8_t *buf = 0;
+	size_t bufLen = 0;
+	size_t bufSize = 0;
+	asn_per_data_t spd;
+	size_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s...", td->name);
+
+	do {
+		chunk_bytes = uper_get_length(pd, -1, 0, &repeat);
+		if(chunk_bytes < 0) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		if(bufLen + chunk_bytes > bufSize) {
+			void *ptr;
+			bufSize = chunk_bytes + (bufSize << 2);
+			ptr = REALLOC(buf, bufSize);
+			if(!ptr) {
+				FREEMEM(buf);
+				ASN__DECODE_FAILED;
+			}
+			buf = ptr;
+		}
+		if(per_get_many_bits(pd, buf + bufLen, 0, chunk_bytes << 3)) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		bufLen += chunk_bytes;
+	} while(repeat);
+
+	ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name,
+		(long)bufLen);
+
+	memset(&spd, 0, sizeof(spd));
+	spd.buffer = buf;
+	spd.nbits = bufLen << 3;
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->uper_decoder(ctx, td, constraints, sptr, &spd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+	if(rv.code == RC_OK) {
+		/* Check padding validity */
+		padding = spd.nbits - spd.nboff;
+                if (((padding > 0 && padding < 8) ||
+		/* X.691#10.1.3 */
+		(spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) &&
+                    per_get_few_bits(&spd, padding) == 0) {
+			/* Everything is cool */
+			FREEMEM(buf);
+			return rv;
+		}
+		FREEMEM(buf);
+		if(padding >= 8) {
+			ASN_DEBUG("Too large padding %d in open type", (int)padding);
+			ASN__DECODE_FAILED;
+		} else {
+			ASN_DEBUG("No padding");
+		}
+	} else {
+		FREEMEM(buf);
+		/* rv.code could be RC_WMORE, nonsense in this context */
+		rv.code = RC_FAIL; /* Noone would give us more */
+	}
+
+	return rv;
+}
+
+static asn_dec_rval_t CC_NOTUSED
+uper_open_type_get_complex(const asn_codec_ctx_t *ctx,
+                           const asn_TYPE_descriptor_t *td,
+                           asn_per_constraints_t *constraints, void **sptr,
+                           asn_per_data_t *pd) {
+    uper_ugot_key arg;
+	asn_dec_rval_t rv;
+	ssize_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s from %s", td->name,
+		asn_bit_data_string(pd));
+	arg.oldpd = *pd;
+	arg.unclaimed = 0;
+	arg.ot_moved = 0;
+	arg.repeat = 1;
+	pd->refill = uper_ugot_refill;
+	pd->refill_key = &arg;
+	pd->nbits = pd->nboff;	/* 0 good bits at this point, will refill */
+	pd->moved = 0;	/* This now counts the open type size in bits */
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->uper_decoder(ctx, td, constraints, sptr, pd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+#define	UPDRESTOREPD	do {						\
+	/* buffer and nboff are valid, preserve them. */		\
+	pd->nbits = arg.oldpd.nbits - (pd->moved - arg.ot_moved);	\
+	pd->moved = arg.oldpd.moved + (pd->moved - arg.ot_moved);	\
+	pd->refill = arg.oldpd.refill;					\
+	pd->refill_key = arg.oldpd.refill_key;				\
+  } while(0)
+
+	if(rv.code != RC_OK) {
+		UPDRESTOREPD;
+		return rv;
+	}
+
+	ASN_DEBUG("OpenType %s pd%s old%s unclaimed=%d, repeat=%d", td->name,
+		asn_bit_data_string(pd),
+		asn_bit_data_string(&arg.oldpd),
+		(int)arg.unclaimed, (int)arg.repeat);
+
+	padding = pd->moved % 8;
+	if(padding) {
+		int32_t pvalue;
+		if(padding > 7) {
+			ASN_DEBUG("Too large padding %d in open type",
+				(int)padding);
+			rv.code = RC_FAIL;
+			UPDRESTOREPD;
+			return rv;
+		}
+		padding = 8 - padding;
+		ASN_DEBUG("Getting padding of %d bits", (int)padding);
+		pvalue = per_get_few_bits(pd, padding);
+		switch(pvalue) {
+		case -1:
+			ASN_DEBUG("Padding skip failed");
+			UPDRESTOREPD;
+			ASN__DECODE_STARVED;
+		case 0: break;
+		default:
+			ASN_DEBUG("Non-blank padding (%d bits 0x%02x)",
+				(int)padding, (int)pvalue);
+			UPDRESTOREPD;
+			ASN__DECODE_FAILED;
+		}
+	}
+	if(pd->nboff != pd->nbits) {
+		ASN_DEBUG("Open type %s overhead pd%s old%s", td->name,
+			asn_bit_data_string(pd), asn_bit_data_string(&arg.oldpd));
+		if(1) {
+			UPDRESTOREPD;
+			ASN__DECODE_FAILED;
+		} else {
+			arg.unclaimed += pd->nbits - pd->nboff;
+		}
+	}
+
+	/* Adjust pd back so it points to original data */
+	UPDRESTOREPD;
+
+	/* Skip data not consumed by the decoder */
+	if(arg.unclaimed) {
+		ASN_DEBUG("Getting unclaimed %d", (int)arg.unclaimed);
+		switch(per_skip_bits(pd, arg.unclaimed)) {
+		case -1:
+			ASN_DEBUG("Claim of %d failed", (int)arg.unclaimed);
+			ASN__DECODE_STARVED;
+		case 0:
+			ASN_DEBUG("Got claim of %d", (int)arg.unclaimed);
+			break;
+		default:
+			/* Padding must be blank */
+			ASN_DEBUG("Non-blank unconsumed padding");
+			ASN__DECODE_FAILED;
+		}
+		arg.unclaimed = 0;
+	}
+
+	if(arg.repeat) {
+		ASN_DEBUG("Not consumed the whole thing");
+		rv.code = RC_FAIL;
+		return rv;
+	}
+
+	return rv;
+}
+
+
+asn_dec_rval_t
+uper_open_type_get(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints, void **sptr,
+                   asn_per_data_t *pd) {
+    return uper_open_type_get_simple(ctx, td, constraints, sptr, pd);
+}
+
+int
+uper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
+	asn_TYPE_descriptor_t s_td;
+    asn_TYPE_operation_t s_op;
+	asn_dec_rval_t rv;
+
+	s_td.name = "<unknown extension>";
+	s_td.op = &s_op;
+    s_op.uper_decoder = uper_sot_suck;
+
+	rv = uper_open_type_get(ctx, &s_td, 0, 0, pd);
+	if(rv.code != RC_OK)
+		return -1;
+	else
+		return 0;
+}
+
+/*
+ * Internal functions.
+ */
+
+static asn_dec_rval_t
+uper_sot_suck(const asn_codec_ctx_t *ctx, const asn_TYPE_descriptor_t *td,
+              const asn_per_constraints_t *constraints, void **sptr,
+              asn_per_data_t *pd) {
+    asn_dec_rval_t rv;
+
+	(void)ctx;
+	(void)td;
+	(void)constraints;
+	(void)sptr;
+
+	while(per_get_few_bits(pd, 1) >= 0);
+
+	rv.code = RC_OK;
+	rv.consumed = pd->moved;
+
+	return rv;
+}
+
+static int
+uper_ugot_refill(asn_per_data_t *pd) {
+	uper_ugot_key *arg = pd->refill_key;
+	ssize_t next_chunk_bytes, next_chunk_bits;
+	ssize_t avail;
+
+	asn_per_data_t *oldpd = &arg->oldpd;
+
+	ASN_DEBUG("REFILLING pd->moved=%ld, oldpd->moved=%ld",
+		(long)pd->moved, (long)oldpd->moved);
+
+	/* Advance our position to where pd is */
+	oldpd->buffer = pd->buffer;
+	oldpd->nboff  = pd->nboff;
+	oldpd->nbits -= pd->moved - arg->ot_moved;
+	oldpd->moved += pd->moved - arg->ot_moved;
+	arg->ot_moved = pd->moved;
+
+	if(arg->unclaimed) {
+		/* Refill the container */
+		if(per_get_few_bits(oldpd, 1))
+			return -1;
+		if(oldpd->nboff == 0) {
+			assert(0);
+			return -1;
+		}
+		pd->buffer = oldpd->buffer;
+		pd->nboff = oldpd->nboff - 1;
+		pd->nbits = oldpd->nbits;
+		ASN_DEBUG("UNCLAIMED <- return from (pd->moved=%ld)",
+			(long)pd->moved);
+		return 0;
+	}
+
+	if(!arg->repeat) {
+		ASN_DEBUG("Want more but refill doesn't have it");
+		return -1;
+	}
+
+	next_chunk_bytes = uper_get_length(oldpd, -1, 0, &arg->repeat);
+	ASN_DEBUG("Open type LENGTH %ld bytes at off %ld, repeat %ld",
+		(long)next_chunk_bytes, (long)oldpd->moved, (long)arg->repeat);
+	if(next_chunk_bytes < 0) return -1;
+	if(next_chunk_bytes == 0) {
+		pd->refill = 0;	/* No more refills, naturally */
+		assert(!arg->repeat);	/* Implementation guarantee */
+	}
+	next_chunk_bits = next_chunk_bytes << 3;
+	avail = oldpd->nbits - oldpd->nboff;
+	if(avail >= next_chunk_bits) {
+		pd->nbits = oldpd->nboff + next_chunk_bits;
+		arg->unclaimed = 0;
+		ASN_DEBUG("!+Parent frame %ld bits, alloting %ld [%ld..%ld] (%ld)",
+			(long)next_chunk_bits, (long)oldpd->moved,
+			(long)oldpd->nboff, (long)oldpd->nbits,
+			(long)(oldpd->nbits - oldpd->nboff));
+	} else {
+		pd->nbits = oldpd->nbits;
+		arg->unclaimed = next_chunk_bits - avail;
+		ASN_DEBUG("!-Parent frame %ld, require %ld, will claim %ld",
+			(long)avail, (long)next_chunk_bits,
+			(long)arg->unclaimed);
+	}
+	pd->buffer = oldpd->buffer;
+	pd->nboff = oldpd->nboff;
+	ASN_DEBUG("Refilled pd%s old%s",
+		asn_bit_data_string(pd), asn_bit_data_string(oldpd));
+	return 0;
+}
+
+static int
+per_skip_bits(asn_per_data_t *pd, int skip_nbits) {
+	int hasNonZeroBits = 0;
+	while(skip_nbits > 0) {
+		int skip;
+
+		/* per_get_few_bits() is more efficient when nbits <= 24 */
+		if(skip_nbits < 24)
+			skip = skip_nbits;
+		else
+			skip = 24;
+		skip_nbits -= skip;
+
+		switch(per_get_few_bits(pd, skip)) {
+		case -1: return -1;	/* Starving */
+		case 0: continue;	/* Skipped empty space */
+		default: hasNonZeroBits = 1; continue;
+		}
+	}
+	return hasNonZeroBits;
+}
+
+static asn_dec_rval_t
+aper_open_type_get_simple(const asn_codec_ctx_t *ctx,
+                          const asn_TYPE_descriptor_t *td,
+                          const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
+	asn_dec_rval_t rv;
+	ssize_t chunk_bytes;
+	int repeat;
+	uint8_t *buf = 0;
+	size_t bufLen = 0;
+	size_t bufSize = 0;
+	asn_per_data_t spd;
+	size_t padding;
+
+	ASN__STACK_OVERFLOW_CHECK(ctx);
+
+	ASN_DEBUG("Getting open type %s...", td->name);
+
+	do {
+	        chunk_bytes = aper_get_length(pd, -1, -1, &repeat);
+		if(chunk_bytes < 0) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		if(bufLen + chunk_bytes > bufSize) {
+			void *ptr;
+			bufSize = chunk_bytes + (bufSize << 2);
+			ptr = REALLOC(buf, bufSize);
+			if(!ptr) {
+				FREEMEM(buf);
+				ASN__DECODE_FAILED;
+			}
+			buf = ptr;
+		}
+		if(per_get_many_bits(pd, buf + bufLen, 0, chunk_bytes << 3)) {
+			FREEMEM(buf);
+			ASN__DECODE_STARVED;
+		}
+		bufLen += chunk_bytes;
+	} while(repeat);
+
+	ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name,
+		(long)bufLen);
+
+	memset(&spd, 0, sizeof(spd));
+	spd.buffer = buf;
+	spd.nbits = bufLen << 3;
+
+	ASN_DEBUG_INDENT_ADD(+4);
+	rv = td->op->aper_decoder(ctx, td, constraints, sptr, &spd);
+	ASN_DEBUG_INDENT_ADD(-4);
+
+	if(rv.code == RC_OK) {
+		/* Check padding validity */
+		padding = spd.nbits - spd.nboff;
+                if (((padding > 0 && padding < 8) ||
+		/* X.691#10.1.3 */
+		(spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) &&
+                    per_get_few_bits(&spd, padding) == 0) {
+			/* Everything is cool */
+			FREEMEM(buf);
+			return rv;
+		}
+		FREEMEM(buf);
+		if(padding >= 8) {
+			ASN_DEBUG("Too large padding %d in open type", (int)padding);
+			ASN__DECODE_FAILED;
+		} else {
+			ASN_DEBUG("No padding");
+		}
+	} else {
+		FREEMEM(buf);
+		/* rv.code could be RC_WMORE, nonsense in this context */
+		rv.code = RC_FAIL; /* Noone would give us more */
+	}
+
+	return rv;
+}
+
+int
+aper_open_type_put(const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   const void *sptr, asn_per_outp_t *po) {
+	void *buf;
+	void *bptr;
+	ssize_t size;
+	size_t toGo;
+
+	ASN_DEBUG("Open type put %s ...", td->name);
+
+	size = aper_encode_to_new_buffer(td, constraints, sptr, &buf);
+	if(size <= 0) return -1;
+
+	for(bptr = buf, toGo = size; toGo;) {
+		ssize_t maySave = aper_put_length(po, -1, toGo);
+		if(maySave < 0) break;
+		if(per_put_many_bits(po, bptr, maySave * 8)) break;
+		bptr = (char *)bptr + maySave;
+		toGo -= maySave;
+	}
+
+	FREEMEM(buf);
+	if(toGo) return -1;
+
+	ASN_DEBUG("Open type put %s of length %ld + overhead (1byte?)",
+			  td->name, size);
+
+	return 0;
+}
+
+asn_dec_rval_t
+aper_open_type_get(const asn_codec_ctx_t *ctx,
+                   const asn_TYPE_descriptor_t *td,
+                   const asn_per_constraints_t *constraints,
+                   void **sptr, asn_per_data_t *pd) {
+
+	return aper_open_type_get_simple(ctx, td, constraints, sptr, pd);
+}
+
+int
+aper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
+	asn_TYPE_descriptor_t s_td;
+	asn_dec_rval_t rv;
+	asn_TYPE_operation_t op_t;
+
+	memset(&op_t, 0, sizeof(op_t));
+	s_td.name = "<unknown extension>";
+	s_td.op = &op_t;
+	s_td.op->aper_decoder = uper_sot_suck;
+
+	rv = aper_open_type_get(ctx, &s_td, 0, 0, pd);
+	if(rv.code != RC_OK)
+		return -1;
+	else
+		return 0;
+}
+
+
diff --git a/e2ap/lib/per_support.c b/e2ap/lib/per_support.c
new file mode 100644
index 0000000..2285677
--- /dev/null
+++ b/e2ap/lib/per_support.c
@@ -0,0 +1,489 @@
+/*
+ * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <asn_internal.h>
+#include <per_support.h>
+
+/*
+ * X.691-201508 #10.9 General rules for encoding a length determinant.
+ * Get the optionally constrained length "n" from the stream.
+ */
+ssize_t
+uper_get_length(asn_per_data_t *pd, int ebits, size_t lower_bound,
+                int *repeat) {
+    ssize_t value;
+
+    *repeat = 0;
+
+    /* #11.9.4.1 Encoding if constrained (according to effective bits) */
+    if(ebits >= 0 && ebits <= 16) {
+        value = per_get_few_bits(pd, ebits);
+        if(value >= 0) value += lower_bound;
+        return value;
+    }
+
+	value = per_get_few_bits(pd, 8);
+    if((value & 0x80) == 0) { /* #11.9.3.6 */
+        return (value & 0x7F);
+    } else if((value & 0x40) == 0) { /* #11.9.3.7 */
+        /* bit 8 ... set to 1 and bit 7 ... set to zero */
+        value = ((value & 0x3f) << 8) | per_get_few_bits(pd, 8);
+        return value; /* potential -1 from per_get_few_bits passes through. */
+    } else if(value < 0) {
+        ASN_DEBUG("END of stream reached for PER");
+        return -1;
+    }
+    value &= 0x3f; /* this is "m" from X.691, #11.9.3.8 */
+    if(value < 1 || value > 4) {
+        return -1; /* Prohibited by #11.9.3.8 */
+    }
+    *repeat = 1;
+    return (16384 * value);
+}
+
+/*
+ * Get the normally small length "n".
+ * This procedure used to decode length of extensions bit-maps
+ * for SET and SEQUENCE types.
+ */
+ssize_t
+uper_get_nslength(asn_per_data_t *pd) {
+	ssize_t length;
+
+	ASN_DEBUG("Getting normally small length");
+
+	if(per_get_few_bits(pd, 1) == 0) {
+		length = per_get_few_bits(pd, 6) + 1;
+		if(length <= 0) return -1;
+		ASN_DEBUG("l=%d", (int)length);
+		return length;
+	} else {
+		int repeat;
+		length = uper_get_length(pd, -1, 0, &repeat);
+		if(length >= 0 && !repeat) return length;
+		return -1; /* Error, or do not support >16K extensions */
+	}
+}
+
+/*
+ * Get the normally small non-negative whole number.
+ * X.691, #10.6
+ */
+ssize_t
+uper_get_nsnnwn(asn_per_data_t *pd) {
+	ssize_t value;
+
+	value = per_get_few_bits(pd, 7);
+	if(value & 64) {	/* implicit (value < 0) */
+		value &= 63;
+		value <<= 2;
+		value |= per_get_few_bits(pd, 2);
+		if(value & 128)	/* implicit (value < 0) */
+			return -1;
+		if(value == 0)
+			return 0;
+		if(value >= 3)
+			return -1;
+		value = per_get_few_bits(pd, 8 * value);
+		return value;
+	}
+
+	return value;
+}
+
+/*
+ * X.691-11/2008, #11.6
+ * Encoding of a normally small non-negative whole number
+ */
+int
+uper_put_nsnnwn(asn_per_outp_t *po, int n) {
+	int bytes;
+
+	if(n <= 63) {
+		if(n < 0) return -1;
+		return per_put_few_bits(po, n, 7);
+	}
+	if(n < 256)
+		bytes = 1;
+	else if(n < 65536)
+		bytes = 2;
+	else if(n < 256 * 65536)
+		bytes = 3;
+	else
+		return -1;	/* This is not a "normally small" value */
+	if(per_put_few_bits(po, bytes, 8))
+		return -1;
+
+	return per_put_few_bits(po, n, 8 * bytes);
+}
+
+
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits) {
+	unsigned long lhalf;    /* Lower half of the number*/
+	long half;
+
+	if(nbits <= 31) {
+		half = per_get_few_bits(pd, nbits);
+		if(half < 0) return -1;
+		*out_value = half;
+		return 0;
+	}
+
+	if((size_t)nbits > 8 * sizeof(*out_value))
+		return -1;  /* RANGE */
+
+	half = per_get_few_bits(pd, 31);
+	if(half < 0) return -1;
+
+	if(uper_get_constrained_whole_number(pd, &lhalf, nbits - 31))
+		return -1;
+
+	*out_value = ((unsigned long)half << (nbits - 31)) | lhalf;
+	return 0;
+}
+
+
+/* X.691-2008/11, #11.5.6 -> #11.3 */
+int
+uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v,
+                                    int nbits) {
+    if(nbits <= 31) {
+        return per_put_few_bits(po, v, nbits);
+    } else {
+        /* Put higher portion first, followed by lower 31-bit */
+        if(uper_put_constrained_whole_number_u(po, v >> 31, nbits - 31))
+            return -1;
+        return per_put_few_bits(po, v, 31);
+    }
+}
+
+/*
+ * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
+ * Put the length "n" (or part of it) into the stream.
+ */
+ssize_t
+uper_put_length(asn_per_outp_t *po, size_t length, int *need_eom) {
+    int dummy = 0;
+    if(!need_eom) need_eom = &dummy;
+
+    if(length <= 127) {	/* #11.9.3.6 */
+        *need_eom = 0;
+        return per_put_few_bits(po, length, 8)
+            ? -1 : (ssize_t)length;
+    } else if(length < 16384) { /* #10.9.3.7 */
+        *need_eom = 0;
+        return per_put_few_bits(po, length|0x8000, 16)
+            ? -1 : (ssize_t)length;
+    }
+
+    *need_eom = 0 == (length & 16383);
+    length >>= 14;
+    if(length > 4) {
+        *need_eom = 0;
+        length = 4;
+    }
+
+    return per_put_few_bits(po, 0xC0 | length, 8)
+            ? -1 : (ssize_t)(length << 14);
+
+}
+
+
+/*
+ * Put the normally small length "n" into the stream.
+ * This procedure used to encode length of extensions bit-maps
+ * for SET and SEQUENCE types.
+ */
+int
+uper_put_nslength(asn_per_outp_t *po, size_t length) {
+    if(length <= 64) {
+        /* #11.9.3.4 */
+        if(length == 0) return -1;
+        return per_put_few_bits(po, length - 1, 7) ? -1 : 0;
+    } else {
+        int need_eom = 0;
+        if(uper_put_length(po, length, &need_eom) != (ssize_t)length
+           || need_eom) {
+            /* This might happen in case of >16K extensions */
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+static int
+per__long_range(long lb, long ub, unsigned long *range_r) {
+    unsigned long bounds_range;
+    if((ub < 0) == (lb < 0)) {
+        bounds_range = ub - lb;
+    } else if(lb < 0) {
+        assert(ub >= 0);
+        bounds_range = 1 + ((unsigned long)ub + (unsigned long)-(lb + 1));
+    } else {
+        assert(!"Unreachable");
+        return -1;
+    }
+    *range_r = bounds_range;
+    return 0;
+}
+
+int
+per_long_range_rebase(long v, long lb, long ub, unsigned long *output) {
+    unsigned long range;
+
+    assert(lb <= ub);
+
+    if(v < lb || v > ub || per__long_range(lb, ub, &range) < 0) {
+        /* Range error. */
+        return -1;
+    }
+
+    /*
+     * Fundamentally what we're doing is returning (v-lb).
+     * However, this triggers undefined behavior when the word width
+     * of signed (v) is the same as the size of unsigned (*output).
+     * In practice, it triggers the UndefinedSanitizer. Therefore we shall
+     * compute the ranges accurately to avoid C's undefined behavior.
+     */
+    if((v < 0) == (lb < 0)) {
+        *output = v-lb;
+        return 0;
+    } else if(v < 0) {
+        unsigned long rebased = 1 + (unsigned long)-(v+1) + (unsigned long)lb;
+        assert(rebased <= range);   /* By construction */
+        *output = rebased;
+        return 0;
+    } else if(lb < 0) {
+        unsigned long rebased = 1 + (unsigned long)-(lb+1) + (unsigned long)v;
+        assert(rebased <= range);   /* By construction */
+        *output = rebased;
+        return 0;
+    } else {
+        assert(!"Unreachable");
+        return -1;
+    }
+}
+
+int
+per_long_range_unrebase(unsigned long inp, long lb, long ub, long *outp) {
+    unsigned long range;
+
+    if(per__long_range(lb, ub, &range) != 0) {
+        return -1;
+    }
+
+    if(inp > range) {
+        /*
+         * We can encode something in the given number of bits that technically
+         * exceeds the range. This is an avenue for security errors,
+         * so we don't allow that.
+         */
+        return -1;
+    }
+
+    if(inp <= LONG_MAX) {
+        *outp = (long)inp + lb;
+    } else {
+        *outp = (lb + LONG_MAX + 1) + (long)((inp - LONG_MAX) - 1);
+    }
+
+    return 0;
+}
+
+int32_t
+aper_get_align(asn_per_data_t *pd) {
+
+	if(pd->nboff & 0x7) {
+		ASN_DEBUG("Aligning %ld bits", 8 - ((unsigned long)pd->nboff & 0x7));
+		return per_get_few_bits(pd, 8 - (pd->nboff & 0x7));
+	}
+	return 0;
+}
+
+ssize_t
+aper_get_length(asn_per_data_t *pd, int range, int ebits, int *repeat) {
+	ssize_t value;
+
+	*repeat = 0;
+
+	if (range <= 65536 && range >= 0)
+		return aper_get_nsnnwn(pd, range);
+
+	if (aper_get_align(pd) < 0)
+		return -1;
+
+	if(ebits >= 0) return per_get_few_bits(pd, ebits);
+
+	value = per_get_few_bits(pd, 8);
+	if(value < 0) return -1;
+	if((value & 128) == 0)  /* #10.9.3.6 */
+		return (value & 0x7F);
+	if((value & 64) == 0) { /* #10.9.3.7 */
+		value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
+		if(value < 0) return -1;
+		return value;
+	}
+	value &= 63;	/* this is "m" from X.691, #10.9.3.8 */
+	if(value < 1 || value > 4)
+		return -1;
+	*repeat = 1;
+	return (16384 * value);
+}
+
+ssize_t
+aper_get_nslength(asn_per_data_t *pd) {
+	ssize_t length;
+
+	ASN_DEBUG("Getting normally small length");
+
+	if(per_get_few_bits(pd, 1) == 0) {
+		length = per_get_few_bits(pd, 6) + 1;
+		if(length <= 0) return -1;
+		ASN_DEBUG("l=%ld", length);
+		return length;
+	} else {
+		int repeat;
+		length = aper_get_length(pd, -1, -1, &repeat);
+		if(length >= 0 && !repeat) return length;
+		return -1; /* Error, or do not support >16K extensions */
+	}
+}
+
+ssize_t
+aper_get_nsnnwn(asn_per_data_t *pd, int range) {
+	ssize_t value;
+	int bytes = 0;
+
+	ASN_DEBUG("getting nsnnwn with range %d", range);
+
+	if(range <= 255) {
+		int i;
+
+		if (range < 0) return -1;
+		/* 1 -> 8 bits */
+		for (i = 1; i <= 8; i++) {
+			int upper = 1 << i;
+			if (upper >= range)
+				break;
+		}
+		value = per_get_few_bits(pd, i);
+		return value;
+	} else if (range == 256){
+		/* 1 byte */
+		bytes = 1;
+	} else if (range <= 65536) {
+		/* 2 bytes */
+		bytes = 2;
+	} else {
+		return -1;
+	}
+	if (aper_get_align(pd) < 0)
+		return -1;
+	value = per_get_few_bits(pd, 8 * bytes);
+	return value;
+}
+
+int aper_put_align(asn_per_outp_t *po) {
+
+	if(po->nboff & 0x7) {
+		ASN_DEBUG("Aligning %ld bits", 8 - ((unsigned long)po->nboff & 0x7));
+		if(per_put_few_bits(po, 0x00, (8 - (po->nboff & 0x7))))
+			return -1;
+	}
+	return 0;
+}
+
+ssize_t
+aper_put_length(asn_per_outp_t *po, int range, size_t length) {
+
+	ASN_DEBUG("APER put length %zu with range %d", length, range);
+
+	/* 10.9 X.691 Note 2 */
+	if (range <= 65536 && range >= 0)
+		return aper_put_nsnnwn(po, range, length);
+
+	if (aper_put_align(po) < 0)
+		return -1;
+
+	if(length <= 127)	   /* #10.9.3.6 */{
+		return per_put_few_bits(po, length, 8)
+		? -1 : (ssize_t)length;
+	}
+	else if(length < 16384) /* #10.9.3.7 */
+		return per_put_few_bits(po, length|0x8000, 16)
+		? -1 : (ssize_t)length;
+
+	length >>= 14;
+	if(length > 4) length = 4;
+
+	return per_put_few_bits(po, 0xC0 | length, 8)
+	? -1 : (ssize_t)(length << 14);
+}
+
+
+int
+aper_put_nslength(asn_per_outp_t *po, size_t length) {
+
+	if(length <= 64) {
+		/* #10.9.3.4 */
+		if(length == 0) return -1;
+		return per_put_few_bits(po, length-1, 7) ? -1 : 0;
+	} else {
+		if(aper_put_length(po, -1, length) != (ssize_t)length) {
+			/* This might happen in case of >16K extensions */
+			return -1;
+		}
+	}
+
+	return 0;
+}
+
+int
+aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
+	int bytes;
+
+    ASN_DEBUG("aper put nsnnwn %d with range %d", number, range);
+	/* 10.5.7.1 X.691 */
+	if(range < 0) {
+		int i;
+		for (i = 1; ; i++) {
+			int bits = 1 << (8 * i);
+			if (number <= bits)
+				break;
+		}
+		bytes = i;
+		assert(i <= 4);
+	}
+	if(range <= 255) {
+		int i;
+		for (i = 1; i <= 8; i++) {
+			int bits = 1 << i;
+			if (range <= bits)
+				break;
+		}
+		return per_put_few_bits(po, number, i);
+	} else if(range == 256) {
+		bytes = 1;
+	} else if(range <= 65536) {
+		bytes = 2;
+	} else { /* Ranges > 64K */
+		int i;
+		for (i = 1; ; i++) {
+			int bits = 1 << (8 * i);
+			if (range <= bits)
+				break;
+		}
+		assert(i <= 4);
+		bytes = i;
+	}
+	if(aper_put_align(po) < 0) /* Aligning on octet */
+		return -1;
+/* 	if(per_put_few_bits(po, bytes, 8))
+		return -1;
+*/
+    return per_put_few_bits(po, number, 8 * bytes);
+}
diff --git a/e2ap/lib/xer_decoder.c b/e2ap/lib/xer_decoder.c
new file mode 100644
index 0000000..5b87703
--- /dev/null
+++ b/e2ap/lib/xer_decoder.c
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_application.h>
+#include <asn_internal.h>
+#include <xer_support.h>		/* XER/XML parsing support */
+
+
+/*
+ * Decode the XER encoding of a given type.
+ */
+asn_dec_rval_t
+xer_decode(const asn_codec_ctx_t *opt_codec_ctx,
+           const asn_TYPE_descriptor_t *td, void **struct_ptr,
+           const void *buffer, size_t size) {
+    asn_codec_ctx_t s_codec_ctx;
+
+	/*
+	 * Stack checker requires that the codec context
+	 * must be allocated on the stack.
+	 */
+	if(opt_codec_ctx) {
+		if(opt_codec_ctx->max_stack_size) {
+			s_codec_ctx = *opt_codec_ctx;
+			opt_codec_ctx = &s_codec_ctx;
+		}
+	} else {
+		/* If context is not given, be security-conscious anyway */
+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
+		s_codec_ctx.max_stack_size = ASN__DEFAULT_STACK_MAX;
+		opt_codec_ctx = &s_codec_ctx;
+	}
+
+	/*
+	 * Invoke type-specific decoder.
+	 */
+	return td->op->xer_decoder(opt_codec_ctx, td, struct_ptr, 0, buffer, size);
+}
+
+
+
+struct xer__cb_arg {
+	pxml_chunk_type_e	chunk_type;
+	size_t			chunk_size;
+	const void		*chunk_buf;
+	int callback_not_invoked;
+};
+
+static int
+xer__token_cb(pxml_chunk_type_e type, const void *_chunk_data, size_t _chunk_size, void *key) {
+	struct xer__cb_arg *arg = (struct xer__cb_arg *)key;
+	arg->chunk_type = type;
+	arg->chunk_size = _chunk_size;
+	arg->chunk_buf = _chunk_data;
+	arg->callback_not_invoked = 0;
+	return -1;	/* Terminate the XML parsing */
+}
+
+/*
+ * Fetch the next token from the XER/XML stream.
+ */
+ssize_t
+xer_next_token(int *stateContext, const void *buffer, size_t size, pxer_chunk_type_e *ch_type) {
+	struct xer__cb_arg arg;
+	int new_stateContext = *stateContext;
+	ssize_t ret;
+
+	arg.callback_not_invoked = 1;
+	ret = pxml_parse(&new_stateContext, buffer, size, xer__token_cb, &arg);
+	if(ret < 0) return -1;
+	if(arg.callback_not_invoked) {
+		assert(ret == 0);	/* No data was consumed */
+        *ch_type = PXER_WMORE;
+		return 0;		/* Try again with more data */
+	} else {
+		assert(arg.chunk_size);
+		assert(arg.chunk_buf == buffer);
+	}
+
+	/*
+	 * Translate the XML chunk types into more convenient ones.
+	 */
+	switch(arg.chunk_type) {
+	case PXML_TEXT:
+		*ch_type = PXER_TEXT;
+		break;
+	case PXML_TAG:
+		*ch_type = PXER_WMORE;
+		return 0;	/* Want more */
+	case PXML_TAG_END:
+		*ch_type = PXER_TAG;
+		break;
+	case PXML_COMMENT:
+	case PXML_COMMENT_END:
+		*ch_type = PXER_COMMENT;
+		break;
+	}
+
+	*stateContext = new_stateContext;
+	return arg.chunk_size;
+}
+
+#define	CSLASH	0x2f	/* '/' */
+#define	LANGLE	0x3c	/* '<' */
+#define	RANGLE	0x3e	/* '>' */
+
+xer_check_tag_e
+xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
+	const char *buf = (const char *)buf_ptr;
+	const char *end;
+	xer_check_tag_e ct = XCT_OPENING;
+
+	if(size < 2 || buf[0] != LANGLE || buf[size-1] != RANGLE) {
+		if(size >= 2)
+			ASN_DEBUG("Broken XML tag: \"%c...%c\"",
+			buf[0], buf[size - 1]);
+		return XCT_BROKEN;
+	}
+
+	/*
+	 * Determine the tag class.
+	 */
+	if(buf[1] == CSLASH) {
+		buf += 2;	/* advance past "</" */
+		size -= 3;	/* strip "</" and ">" */
+		ct = XCT_CLOSING;
+		if(size > 0 && buf[size-1] == CSLASH)
+			return XCT_BROKEN;	/* </abc/> */
+	} else {
+		buf++;		/* advance past "<" */
+		size -= 2;	/* strip "<" and ">" */
+		if(size > 0 && buf[size-1] == CSLASH) {
+			ct = XCT_BOTH;
+			size--;	/* One more, for "/" */
+		}
+	}
+
+	/* Sometimes we don't care about the tag */
+	if(!need_tag || !*need_tag)
+		return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+
+	/*
+	 * Determine the tag name.
+	 */
+	for(end = buf + size; buf < end; buf++, need_tag++) {
+		int b = *buf, n = *need_tag;
+		if(b != n) {
+			if(n == 0) {
+				switch(b) {
+				case 0x09: case 0x0a: case 0x0c: case 0x0d:
+				case 0x20:
+					/* "<abc def/>": whitespace is normal */
+					return ct;
+				}
+			}
+			return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+		}
+		if(b == 0)
+			return XCT_BROKEN;	/* Embedded 0 in buf?! */
+	}
+	if(*need_tag)
+		return (xer_check_tag_e)(XCT__UNK__MASK | ct);
+
+	return ct;
+}
+
+
+#undef	ADVANCE
+#define	ADVANCE(num_bytes)	do {				\
+		size_t num = (num_bytes);			\
+		buf_ptr = ((const char *)buf_ptr) + num;	\
+		size -= num;					\
+		consumed_myself += num;				\
+	} while(0)
+
+#undef	RETURN
+#define	RETURN(_code)	do {					\
+		rval.code = _code;				\
+		rval.consumed = consumed_myself;		\
+		if(rval.code != RC_OK)				\
+			ASN_DEBUG("Failed with %d", rval.code);	\
+		return rval;					\
+	} while(0)
+
+#define	XER_GOT_BODY(chunk_buf, chunk_size, size)	do {	\
+		ssize_t converted_size = body_receiver		\
+			(struct_key, chunk_buf, chunk_size,	\
+				(size_t)chunk_size < size);	\
+		if(converted_size == -1) RETURN(RC_FAIL);	\
+		if(converted_size == 0				\
+			&& size == (size_t)chunk_size)		\
+			RETURN(RC_WMORE);			\
+		chunk_size = converted_size;			\
+	} while(0)
+#define	XER_GOT_EMPTY()	do {					\
+	if(body_receiver(struct_key, 0, 0, size > 0) == -1)	\
+			RETURN(RC_FAIL);			\
+	} while(0)
+
+/*
+ * Generalized function for decoding the primitive values.
+ */
+asn_dec_rval_t
+xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx,
+	asn_struct_ctx_t *ctx,	/* Type decoder context */
+	void *struct_key,
+	const char *xml_tag,	/* Expected XML tag */
+	const void *buf_ptr, size_t size,
+	int (*opt_unexpected_tag_decoder)
+		(void *struct_key, const void *chunk_buf, size_t chunk_size),
+	ssize_t (*body_receiver)
+		(void *struct_key, const void *chunk_buf, size_t chunk_size,
+			int have_more)
+	) {
+
+	asn_dec_rval_t rval;
+	ssize_t consumed_myself = 0;
+
+	(void)opt_codec_ctx;
+
+	/*
+	 * Phases of XER/XML processing:
+	 * Phase 0: Check that the opening tag matches our expectations.
+	 * Phase 1: Processing body and reacting on closing tag.
+	 */
+	if(ctx->phase > 1) RETURN(RC_FAIL);
+	for(;;) {
+		pxer_chunk_type_e ch_type;	/* XER chunk type */
+		ssize_t ch_size;		/* Chunk size */
+		xer_check_tag_e tcv;		/* Tag check value */
+
+		/*
+		 * Get the next part of the XML stream.
+		 */
+		ch_size = xer_next_token(&ctx->context, buf_ptr, size,
+			&ch_type);
+		if(ch_size == -1) {
+            RETURN(RC_FAIL);
+        } else {
+			switch(ch_type) {
+			case PXER_WMORE:
+                RETURN(RC_WMORE);
+			case PXER_COMMENT:		/* Got XML comment */
+				ADVANCE(ch_size);	/* Skip silently */
+				continue;
+			case PXER_TEXT:
+				if(ctx->phase == 0) {
+					/*
+					 * We have to ignore whitespace here,
+					 * but in order to be forward compatible
+					 * with EXTENDED-XER (EMBED-VALUES, #25)
+					 * any text is just ignored here.
+					 */
+				} else {
+					XER_GOT_BODY(buf_ptr, ch_size, size);
+				}
+				ADVANCE(ch_size);
+				continue;
+			case PXER_TAG:
+				break;	/* Check the rest down there */
+			}
+		}
+
+		assert(ch_type == PXER_TAG && size);
+
+		tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
+		/*
+		 * Phase 0:
+		 * 	Expecting the opening tag
+		 * 	for the type being processed.
+		 * Phase 1:
+		 * 	Waiting for the closing XML tag.
+		 */
+		switch(tcv) {
+		case XCT_BOTH:
+			if(ctx->phase) break;
+			/* Finished decoding of an empty element */
+			XER_GOT_EMPTY();
+			ADVANCE(ch_size);
+			ctx->phase = 2;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_OPENING:
+			if(ctx->phase) break;
+			ADVANCE(ch_size);
+			ctx->phase = 1;	/* Processing body phase */
+			continue;
+		case XCT_CLOSING:
+			if(!ctx->phase) break;
+			ADVANCE(ch_size);
+			ctx->phase = 2;	/* Phase out */
+			RETURN(RC_OK);
+		case XCT_UNKNOWN_BO:
+			/*
+			 * Certain tags in the body may be expected.
+			 */
+			if(opt_unexpected_tag_decoder
+			&& opt_unexpected_tag_decoder(struct_key,
+					buf_ptr, ch_size) >= 0) {
+				/* Tag's processed fine */
+				ADVANCE(ch_size);
+				if(!ctx->phase) {
+					/* We are not expecting
+					 * the closing tag anymore. */
+					ctx->phase = 2;	/* Phase out */
+					RETURN(RC_OK);
+				}
+				continue;
+			}
+			/* Fall through */
+		default:
+			break;		/* Unexpected tag */
+		}
+
+		ASN_DEBUG("Unexpected XML tag (expected \"%s\")", xml_tag);
+		break;	/* Dark and mysterious things have just happened */
+	}
+
+	RETURN(RC_FAIL);
+}
+
+
+size_t
+xer_whitespace_span(const void *chunk_buf, size_t chunk_size) {
+	const char *p = (const char *)chunk_buf;
+	const char *pend = p + chunk_size;
+
+	for(; p < pend; p++) {
+		switch(*p) {
+		/* X.693, #8.1.4
+		 * HORISONTAL TAB (9)
+		 * LINE FEED (10) 
+		 * CARRIAGE RETURN (13) 
+		 * SPACE (32)
+		 */
+		case 0x09: case 0x0a: case 0x0d: case 0x20:
+			continue;
+		default:
+			break;
+		}
+		break;
+	}
+	return (p - (const char *)chunk_buf);
+}
+
+/*
+ * This is a vastly simplified, non-validating XML tree skipper.
+ */
+int
+xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth) {
+	assert(*depth > 0);
+	switch(tcv) {
+	case XCT_BOTH:
+	case XCT_UNKNOWN_BO:
+		/* These negate each other. */
+		return 0;
+	case XCT_OPENING:
+	case XCT_UNKNOWN_OP:
+		++(*depth);
+		return 0;
+	case XCT_CLOSING:
+	case XCT_UNKNOWN_CL:
+		if(--(*depth) == 0)
+			return (tcv == XCT_CLOSING) ? 2 : 1;
+		return 0;
+	default:
+		return -1;
+	}
+}
diff --git a/e2ap/lib/xer_encoder.c b/e2ap/lib/xer_encoder.c
new file mode 100644
index 0000000..4177ede
--- /dev/null
+++ b/e2ap/lib/xer_encoder.c
@@ -0,0 +1,237 @@
+/*-
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_internal.h>
+#include <stdio.h>
+#include <errno.h>
+
+/*
+ * The XER encoder of any type. May be invoked by the application.
+ */
+asn_enc_rval_t
+xer_encode(const asn_TYPE_descriptor_t *td, const void *sptr,
+           enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *cb,
+           void *app_key) {
+    asn_enc_rval_t er = {0, 0, 0};
+	asn_enc_rval_t tmper;
+	const char *mname;
+	size_t mlen;
+	int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2;
+
+	if(!td || !sptr) goto cb_failed;
+
+	mname = td->xml_tag;
+	mlen = strlen(mname);
+
+	ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
+
+	tmper = td->op->xer_encoder(td, sptr, 1, xer_flags, cb, app_key);
+	if(tmper.encoded == -1) return tmper;
+	er.encoded += tmper.encoded;
+
+	ASN__CALLBACK3("</", 2, mname, mlen, ">\n", xcan);
+
+	ASN__ENCODED_OK(er);
+cb_failed:
+	ASN__ENCODE_FAILED;
+}
+
+/*
+ * This is a helper function for xer_fprint, which directs all incoming data
+ * into the provided file descriptor.
+ */
+static int
+xer__print2fp(const void *buffer, size_t size, void *app_key) {
+	FILE *stream = (FILE *)app_key;
+
+	if(fwrite(buffer, 1, size, stream) != size)
+		return -1;
+
+	return 0;
+}
+
+int
+xer_fprint(FILE *stream, const asn_TYPE_descriptor_t *td, const void *sptr) {
+	asn_enc_rval_t er = {0,0,0};
+
+	if(!stream) stream = stdout;
+	if(!td || !sptr)
+		return -1;
+
+	er = xer_encode(td, sptr, XER_F_BASIC, xer__print2fp, stream);
+	if(er.encoded == -1)
+		return -1;
+
+	return fflush(stream);
+}
+
+struct xer_buffer {
+    char *buffer;
+    size_t buffer_size;
+    size_t allocated_size;
+};
+
+static int
+xer__buffer_append(const void *buffer, size_t size, void *app_key) {
+    struct xer_buffer *xb = app_key;
+
+    while(xb->buffer_size + size + 1 > xb->allocated_size) {
+        size_t new_size = 2 * (xb->allocated_size ? xb->allocated_size : 64);
+        char *new_buf = MALLOC(new_size);
+        if(!new_buf) return -1;
+        if (xb->buffer) {
+            memcpy(new_buf, xb->buffer, xb->buffer_size);
+        }
+        FREEMEM(xb->buffer);
+        xb->buffer = new_buf;
+        xb->allocated_size = new_size;
+    }
+
+    memcpy(xb->buffer + xb->buffer_size, buffer, size);
+    xb->buffer_size += size;
+    xb->buffer[xb->buffer_size] = '\0';
+    return 0;
+}
+
+enum xer_equivalence_e
+xer_equivalent(const struct asn_TYPE_descriptor_s *td, const void *struct1,
+               const void *struct2, FILE *opt_debug_stream) {
+    struct xer_buffer xb1 = {0, 0, 0};
+    struct xer_buffer xb2 = {0, 0, 0};
+    asn_enc_rval_t e1, e2;
+    asn_dec_rval_t rval;
+    void *sptr = NULL;
+
+    if(!td || !struct1 || !struct2) {
+        if(opt_debug_stream) {
+            if(!td) fprintf(opt_debug_stream, "Type descriptor missing\n");
+            if(!struct1) fprintf(opt_debug_stream, "Structure 1 missing\n");
+            if(!struct2) fprintf(opt_debug_stream, "Structure 2 missing\n");
+        }
+        return XEQ_FAILURE;
+    }
+
+    e1 = xer_encode(td, struct1, XER_F_BASIC, xer__buffer_append, &xb1);
+    if(e1.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of %s failed\n", td->name);
+        }
+        FREEMEM(xb1.buffer);
+        return XEQ_ENCODE1_FAILED;
+    }
+
+    e2 = xer_encode(td, struct2, XER_F_BASIC, xer__buffer_append, &xb2);
+    if(e2.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of %s failed\n", td->name);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ENCODE1_FAILED;
+    }
+
+    if(xb1.buffer_size != xb2.buffer_size
+       || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structures XER-encoded into different byte streams:\n=== "
+                    "Structure 1 ===\n%s\n=== Structure 2 ===\n%s\n",
+                    xb1.buffer, xb2.buffer);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_DIFFERENT;
+    } else {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Both structures encoded into the same XER byte stream "
+                    "of size %" ASN_PRI_SIZE ":\n%s",
+                    xb1.buffer_size, xb1.buffer);
+        }
+    }
+
+    rval = xer_decode(NULL, td, (void **)&sptr, xb1.buffer,
+               xb1.buffer_size);
+    switch(rval.code) {
+    case RC_OK:
+        break;
+    case RC_WMORE:
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structure %s XER decode unexpectedly requires "
+                    "more data:\n%s\n",
+                    td->name, xb1.buffer);
+        }
+        /* Fall through */
+    case RC_FAIL:
+    default:
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Structure %s XER decoding resulted in failure.\n",
+                    td->name);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_DECODE_FAILED;
+    }
+
+    if(rval.consumed != xb1.buffer_size
+       && ((rval.consumed > xb1.buffer_size)
+           || xer_whitespace_span(xb1.buffer + rval.consumed,
+                                  xb1.buffer_size - rval.consumed)
+                  != (xb1.buffer_size - rval.consumed))) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "Round-trip decode of %s required less bytes (%" ASN_PRI_SIZE ") than "
+                    "encoded (%" ASN_PRI_SIZE ")\n",
+                    td->name, rval.consumed, xb1.buffer_size);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+    /*
+     * Reuse xb2 to encode newly decoded structure.
+     */
+    FREEMEM(xb2.buffer);
+    memset(&xb2, 0, sizeof(xb2));
+
+    e2 = xer_encode(td, sptr, XER_F_BASIC, xer__buffer_append, &xb2);
+    if(e2.encoded == -1) {
+        if(opt_debug_stream) {
+            fprintf(stderr, "XER Encoding of round-trip decode of %s failed\n",
+                    td->name);
+        }
+        ASN_STRUCT_FREE(*td, sptr);
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+    ASN_STRUCT_FREE(*td, sptr);
+    sptr = 0;
+
+    if(xb1.buffer_size != xb2.buffer_size
+       || memcmp(xb1.buffer, xb2.buffer, xb1.buffer_size) != 0) {
+        if(opt_debug_stream) {
+            fprintf(opt_debug_stream,
+                    "XER Encoding of round-trip decode of %s resulted in "
+                    "different byte stream:\n"
+                    "=== Original ===\n%s\n"
+                    "=== Round-tripped ===\n%s\n",
+                    xb1.buffer, xb2.buffer, td->name);
+        }
+        FREEMEM(xb1.buffer);
+        FREEMEM(xb2.buffer);
+        return XEQ_ROUND_TRIP_FAILED;
+    }
+
+	FREEMEM(xb1.buffer);
+	FREEMEM(xb2.buffer);
+	return XEQ_SUCCESS;
+}
+
diff --git a/e2ap/lib/xer_support.c b/e2ap/lib/xer_support.c
new file mode 100644
index 0000000..36b4bfb
--- /dev/null
+++ b/e2ap/lib/xer_support.c
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com.
+ * Copyright (c) 2003, 2004, 2005 Lev Walkin <vlm@lionet.info>.
+ * 	All rights reserved.
+ * Redistribution and modifications are permitted subject to BSD license.
+ */
+#include <asn_system.h>
+#include <xer_support.h>
+
+/* Parser states */
+typedef enum {
+	ST_TEXT,
+	ST_TAG_START,
+	ST_TAG_BODY,
+	ST_TAG_QUOTE_WAIT,
+	ST_TAG_QUOTED_STRING,
+	ST_TAG_UNQUOTED_STRING,
+	ST_COMMENT_WAIT_DASH1,	/* "<!--"[1] */
+	ST_COMMENT_WAIT_DASH2,	/* "<!--"[2] */
+	ST_COMMENT,
+	ST_COMMENT_CLO_DASH2,	/* "-->"[0] */
+	ST_COMMENT_CLO_RT	/* "-->"[1] */
+} pstate_e;
+
+static const int
+_charclass[256] = {
+	0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,0,
+	0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+	1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+	2,2,2,2,2,2,2,2, 2,2,0,0,0,0,0,0,	/* 01234567 89       */
+	0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,	/*  ABCDEFG HIJKLMNO */
+	3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0,	/* PQRSTUVW XYZ      */
+	0,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,	/*  abcdefg hijklmno */
+	3,3,3,3,3,3,3,3, 3,3,3,0,0,0,0,0	/* pqrstuvw xyz      */
+};
+#define WHITESPACE(c)	(_charclass[(unsigned char)(c)] == 1)
+#define ALNUM(c)	(_charclass[(unsigned char)(c)] >= 2)
+#define ALPHA(c)	(_charclass[(unsigned char)(c)] == 3)
+
+/* Aliases for characters, ASCII/UTF-8 */
+#define	EXCLAM	0x21	/* '!' */
+#define	CQUOTE	0x22	/* '"' */
+#define	CDASH	0x2d	/* '-' */
+#define	CSLASH	0x2f	/* '/' */
+#define	LANGLE	0x3c	/* '<' */
+#define	CEQUAL	0x3d	/* '=' */
+#define	RANGLE	0x3e	/* '>' */
+#define	CQUEST	0x3f	/* '?' */
+
+/* Invoke token callback */
+#define	TOKEN_CB_CALL(type, _ns, _current_too, _final) do {	\
+		int _ret;					\
+		pstate_e ns  = _ns;				\
+		ssize_t _sz = (p - chunk_start) + _current_too;	\
+		if (!_sz) {					\
+			/* Shortcut */				\
+			state = _ns;				\
+			break;					\
+		}						\
+		_ret = cb(type, chunk_start, _sz, key);		\
+		if(_ret < _sz) {				\
+			if(_current_too && _ret == -1)		\
+				state = ns;			\
+			goto finish;				\
+		}						\
+		chunk_start = p + _current_too;			\
+		state = ns;					\
+	} while(0)
+
+#define TOKEN_CB(_type, _ns, _current_too)			\
+	TOKEN_CB_CALL(_type, _ns, _current_too, 0)
+
+#define PXML_TAG_FINAL_CHUNK_TYPE      PXML_TAG_END
+#define PXML_COMMENT_FINAL_CHUNK_TYPE  PXML_COMMENT_END
+
+#define TOKEN_CB_FINAL(_type, _ns, _current_too)		\
+	TOKEN_CB_CALL( _type ## _FINAL_CHUNK_TYPE , _ns, _current_too, 1)
+
+/*
+ * Parser itself
+ */
+ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_callback_f *cb, void *key) {
+	pstate_e state = (pstate_e)*stateContext;
+	const char *chunk_start = (const char *)xmlbuf;
+	const char *p = chunk_start;
+	const char *end = p + size;
+
+	for(; p < end; p++) {
+	  int C = *(const unsigned char *)p;
+	  switch(state) {
+	  case ST_TEXT:
+		/*
+		 * Initial state: we're in the middle of some text,
+		 * or just have started.
+		 */
+		if (C == LANGLE) 
+			/* We're now in the tag, probably */
+			TOKEN_CB(PXML_TEXT, ST_TAG_START, 0);
+		break;
+	  case ST_TAG_START:
+		if (ALPHA(C) || (C == CSLASH))
+			state = ST_TAG_BODY;
+		else if (C == EXCLAM)
+			state = ST_COMMENT_WAIT_DASH1;
+		else 
+			/*
+			 * Not characters and not whitespace.
+			 * Must be something like "3 < 4".
+			 */
+			TOKEN_CB(PXML_TEXT, ST_TEXT, 1);/* Flush as data */
+		break;
+	  case ST_TAG_BODY:
+		switch(C) {
+		case RANGLE:
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+			break;
+		case LANGLE:
+			/*
+			 * The previous tag wasn't completed, but still
+			 * recognized as valid. (Mozilla-compatible)
+			 */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TAG_START, 0);	
+			break;
+		case CEQUAL:
+			state = ST_TAG_QUOTE_WAIT;
+			break;
+		}
+		break;
+	  case ST_TAG_QUOTE_WAIT:
+		/*
+		 * State after the equal sign ("=") in the tag.
+		 */
+		switch(C) {
+		case CQUOTE:
+			state = ST_TAG_QUOTED_STRING;
+			break;
+		case RANGLE:
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+			break;
+		default:
+			if(!WHITESPACE(C))
+				/* Unquoted string value */
+				state = ST_TAG_UNQUOTED_STRING;
+		}
+		break;
+	  case ST_TAG_QUOTED_STRING:
+		/*
+		 * Tag attribute's string value in quotes.
+		 */
+		if(C == CQUOTE) {
+			/* Return back to the tag state */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_TAG_UNQUOTED_STRING:
+		if(C == RANGLE) {
+			/* End of the tag */
+			TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1);
+		} else if(WHITESPACE(C)) {
+			/* Return back to the tag state */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT_WAIT_DASH1:
+		if(C == CDASH) {
+			state = ST_COMMENT_WAIT_DASH2;
+		} else {
+			/* Some ordinary tag. */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT_WAIT_DASH2:
+		if(C == CDASH) {
+			/* Seen "<--" */
+			state = ST_COMMENT;
+		} else {
+			/* Some ordinary tag */
+			state = ST_TAG_BODY;
+		}
+		break;
+	  case ST_COMMENT:
+		if(C == CDASH) {
+			state = ST_COMMENT_CLO_DASH2;
+		}
+		break;
+	  case ST_COMMENT_CLO_DASH2:
+		if(C == CDASH) {
+			state = ST_COMMENT_CLO_RT;
+		} else {
+			/* This is not an end of a comment */
+			state = ST_COMMENT;
+		}
+		break;
+	  case ST_COMMENT_CLO_RT:
+		if(C == RANGLE) {
+			TOKEN_CB_FINAL(PXML_COMMENT, ST_TEXT, 1);
+		} else if(C == CDASH) {
+			/* Maintain current state, still waiting for '>' */
+		} else {
+			state = ST_COMMENT;
+		}
+		break;
+	  } /* switch(*ptr) */
+	} /* for() */
+
+	/*
+	 * Flush the partially processed chunk, state permitting.
+	 */
+	if(p - chunk_start) {
+		switch (state) {
+		case ST_COMMENT:
+			TOKEN_CB(PXML_COMMENT, state, 0);
+			break;
+		case ST_TEXT:
+			TOKEN_CB(PXML_TEXT, state, 0);
+			break;
+		default: break;	/* a no-op */
+		}
+	}
+
+finish:
+	*stateContext = (int)state;
+	return chunk_start - (const char *)xmlbuf;
+}
+
diff --git a/e2ap/wrapper.c b/e2ap/wrapper.c
new file mode 100644
index 0000000..1e38f0f
--- /dev/null
+++ b/e2ap/wrapper.c
@@ -0,0 +1,142 @@
+#include <errno.h>
+#include "wrapper.h"
+
+size_t encode_E2AP_PDU(E2AP_PDU_t* pdu, void* buffer, size_t buf_size)
+{
+    asn_enc_rval_t encode_result;
+    encode_result = aper_encode_to_buffer(&asn_DEF_E2AP_PDU, NULL, pdu, buffer, buf_size);
+    ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pdu);
+    if(encode_result.encoded == -1) {
+        fprintf(stderr, "Cannot encode %s: %s\n", encode_result.failed_type->name, strerror(errno));
+        return -1;
+    } else {
+          return encode_result.encoded;
+    }
+}
+
+E2AP_PDU_t* decode_E2AP_PDU(const void* buffer, size_t buf_size)
+{
+    asn_dec_rval_t decode_result;
+    E2AP_PDU_t *pdu = 0;
+    decode_result = aper_decode_complete(NULL, &asn_DEF_E2AP_PDU, (void **)&pdu, buffer, buf_size);
+    if(decode_result.code == RC_OK) {
+        return pdu;
+    } else {
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pdu);
+        return 0;
+    }
+}
+
+ssize_t e2ap_encode_ric_control_request_message(void *buffer, size_t buf_size, long ricRequestorID, long ricRequestSequenceNumber, 
+                  long ranFunctionID, void *ricControlHdr, size_t ricControlHdrSize, void *ricControlMsg, size_t ricControlMsgSize)
+{
+  
+    E2AP_PDU_t *init = (E2AP_PDU_t *)calloc(1, sizeof(E2AP_PDU_t));
+    if(!init) {
+        fprintf(stderr, "alloc E2AP_PDU failed\n");
+        return -1;
+    }
+
+    
+    InitiatingMessage_t *initiatingMsg = (InitiatingMessage_t *)calloc(1, sizeof(InitiatingMessage_t));
+    if(!initiatingMsg) {
+        fprintf(stderr, "alloc InitiatingMessage failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+        init->choice.initiatingMessage = initiatingMsg;
+    init->present = E2AP_PDU_PR_initiatingMessage;
+
+    initiatingMsg->procedureCode = ProcedureCode_id_RICcontrol;
+    initiatingMsg->criticality = Criticality_reject;
+    initiatingMsg->value.present = InitiatingMessage__value_PR_RICcontrolRequest;
+
+    RICcontrolRequest_t *control_request = &initiatingMsg->value.choice.RICcontrolRequest;
+
+
+    //RICrequestID
+    RICcontrolRequest_IEs_t *controlReqID = (RICcontrolRequest_IEs_t *)calloc(1, sizeof(RICcontrolRequest_IEs_t));
+    if(!controlReqID) {
+        fprintf(stderr, "alloc RICrequestID failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+    controlReqID->criticality = Criticality_reject;
+    controlReqID->id = ProtocolIE_ID_id_RICrequestID;
+
+    controlReqID->value.present = RICcontrolRequest_IEs__value_PR_RICrequestID;
+    RICrequestID_t *ricrequest_ie = &controlReqID->value.choice.RICrequestID;
+    ricrequest_ie->ricRequestorID = ricRequestorID;
+    ricrequest_ie->ricInstanceID = ricRequestSequenceNumber;
+    ASN_SEQUENCE_ADD(&control_request->protocolIEs.list, controlReqID);
+
+    //RICfunctionID
+    RICcontrolRequest_IEs_t *controlReqFunID = (RICcontrolRequest_IEs_t *)calloc(1, sizeof(RICcontrolRequest_IEs_t));
+    if(!controlReqFunID) {
+        fprintf(stderr, "alloc RICrequestID failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+    controlReqFunID->criticality = Criticality_reject;
+    controlReqFunID->id = ProtocolIE_ID_id_RANfunctionID;
+    controlReqFunID->value.present = RICcontrolRequest_IEs__value_PR_RANfunctionID;
+    RANfunctionID_t *ranfunction_ie = &controlReqFunID->value.choice.RANfunctionID;
+    *ranfunction_ie = ranFunctionID;
+    ASN_SEQUENCE_ADD(&control_request->protocolIEs.list, controlReqFunID);
+
+    // RICControlHdr
+    RICcontrolRequest_IEs_t *controlReqHdr = (RICcontrolRequest_IEs_t *)calloc(1, sizeof(RICcontrolRequest_IEs_t));
+    if(!controlReqHdr) {
+        fprintf(stderr, "alloc RICcontrolRequest_IEs_t failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+    controlReqHdr->criticality = Criticality_reject;
+    controlReqHdr->id = ProtocolIE_ID_id_RICcontrolHeader;
+    controlReqHdr->value.present = RICcontrolRequest_IEs__value_PR_RICcontrolHeader;
+    RICcontrolHeader_t *controlHdr = &controlReqHdr->value.choice.RICcontrolHeader;
+    controlHdr->buf = (uint8_t *)calloc(1, ricControlHdrSize);
+    if(!controlHdr->buf) {
+        fprintf(stderr, "alloc RICcontrolHeader_t buf failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+    memcpy(controlHdr->buf, ricControlHdr, ricControlHdrSize);
+    controlHdr->size = ricControlHdrSize;
+    ASN_SEQUENCE_ADD(&control_request->protocolIEs.list, controlReqHdr);
+
+    //Ric Control Message
+    RICcontrolRequest_IEs_t *controlReqMsg = (RICcontrolRequest_IEs_t *)calloc(1, sizeof(RICcontrolRequest_IEs_t));
+    if(!controlReqMsg) {
+        fprintf(stderr, "alloc RICcontrolRequest_IEs_t failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+    controlReqMsg->criticality = Criticality_reject;
+    controlReqMsg->id = ProtocolIE_ID_id_RICcontrolMessage;
+    controlReqMsg->value.present = RICcontrolRequest_IEs__value_PR_RICcontrolMessage;
+    RICcontrolMessage_t *controlMsg = &controlReqMsg->value.choice.RICcontrolMessage;
+    controlMsg->buf = (uint8_t *)calloc(1, ricControlMsgSize);
+    if(!controlMsg->buf) {
+        fprintf(stderr, "alloc RICcontrolMessage_t buf failed\n");
+        ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, init);
+        return -1;
+    }
+
+    memcpy(controlMsg->buf, ricControlMsg, ricControlMsgSize);
+    controlMsg->size = ricControlMsgSize;
+    ASN_SEQUENCE_ADD(&control_request->protocolIEs.list, controlReqMsg);
+
+    fprintf(stderr, "showing xer of asn_DEF_E2AP_PDU data\n");
+    xer_fprint(stderr, &asn_DEF_E2AP_PDU, init);
+    fprintf(stderr, "\n");
+    fprintf(stderr, "After xer of asn_DEF_E2AP_PDU data\n");
+   
+    return encode_E2AP_PDU(init, buffer, buf_size);
+}
+
+                                            
diff --git a/e2ap/wrapper.h b/e2ap/wrapper.h
new file mode 100644
index 0000000..af1ec2e
--- /dev/null
+++ b/e2ap/wrapper.h
@@ -0,0 +1,20 @@
+#ifndef	_WRAPPER_H_
+#define	_WRAPPER_H_
+
+#include "RICcontrolRequest.h"
+#include "E2AP-PDU.h"
+#include "InitiatingMessage.h"
+#include "SuccessfulOutcome.h"
+#include "UnsuccessfulOutcome.h"
+#include "ProtocolIE-Container.h"
+#include "ProtocolIE-Field.h"
+#include "RICactionDefinition.h"
+#include "RICsubsequentAction.h"
+#include "CauseRIC.h"
+
+size_t encode_E2AP_PDU(E2AP_PDU_t* pdu, void* buffer, size_t buf_size);
+E2AP_PDU_t* decode_E2AP_PDU(const void* buffer, size_t buf_size);
+
+/* RICcontrol */
+ssize_t e2ap_encode_ric_control_request_message(void *buffer, size_t buf_size, long ricRequestorID, long ricRequestSequenceNumber, long ranFunctionID, void *ricControlHdr, size_t ricControlHdrSize, void *ricControlMsg, size_t ricControlMsgSize);
+#endif /* _WRAPPER_H_ */
