diff --git a/e2ap/libe2ap_wrapper/E2AP_if.c b/e2ap/libe2ap_wrapper/E2AP_if.c
index 9a5dc0a..8686908 100644
--- a/e2ap/libe2ap_wrapper/E2AP_if.c
+++ b/e2ap/libe2ap_wrapper/E2AP_if.c
@@ -20,28 +20,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "E2_asn_constant.h"
 #include "E2AP-PDU.h"
 #include "ProtocolIE-Field.h"
 #include "RICsubsequentAction.h"
-#include "E2_E2SM-gNB-X2-eventTriggerDefinition.h"
-#include "E2_E2SM-gNB-NRT-EventTriggerDefinition.h"
-#include "E2_E2SM-gNB-X2-ActionDefinitionChoice.h"
-#include "E2_E2SM-gNB-X2-actionDefinition.h"
-#include "E2_ActionParameter-Item.h"
-#include "E2_E2SM-gNB-X2-ActionDefinition-Format2.h"
-#include "E2_RANueGroup-Item.h"
-#include "E2_RANueGroupDef-Item.h"
-#include "E2_RANimperativePolicy.h"
-#include "E2_RANParameter-Item.h"
-
-// E2SM-gNB-NRT
-#include "E2_E2SM-gNB-NRT-ActionDefinition.h"
-#include "E2_E2SM-gNB-NRT-ActionDefinition-Format1.h"
-#include "E2_RANparameter-Item.h"
 
 #include "asn_constant.h"
-#include "E2_asn_constant.h"
 #include "E2AP_if.h"
 
 
@@ -170,10 +153,6 @@
             pRICsubscriptionRequest_IEs->value.present = RICsubscriptionRequest_IEs__value_PR_RICsubscriptionDetails;
 
             // RICeventTriggerDefinition
-            uint64_t returnCode;
-            if ((returnCode = packRICEventTriggerDefinition(pLogBuffer, &pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition) != e2err_OK))
-                return returnCode;
-
             pRICsubscriptionRequest_IEs->value.choice.RICsubscriptionDetails.ricEventTriggerDefinition.buf =
               calloc(1, pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.octetString.contentLength);
             if (pRICsubscriptionRequest_IEs->value.choice.RICsubscriptionDetails.ricEventTriggerDefinition.buf) {
@@ -205,10 +184,6 @@
 
                     // RICactionDefinition, OPTIONAL
                     if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent) {
-                        uint64_t returnCode;
-                        if ((returnCode = packRICActionDefinition(pLogBuffer, &pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice) != e2err_OK)) {
-                            return returnCode;
-                        }
                         pRICaction_ToBeSetup_ItemIEs->value.choice.RICaction_ToBeSetup_Item.ricActionDefinition = calloc(1, sizeof (RICactionDefinition_t));
                         if (pRICaction_ToBeSetup_ItemIEs->value.choice.RICaction_ToBeSetup_Item.ricActionDefinition) {
                             pRICaction_ToBeSetup_ItemIEs->value.choice.RICaction_ToBeSetup_Item.ricActionDefinition->buf =
@@ -259,676 +234,6 @@
     return e2err_RICSubscriptionRequestAllocE2AP_PDUFail;
 }
 
-//////////////////////////////////////////////////////////////////////
-uint64_t packRICEventTriggerDefinition(char* pLogBuffer, RICEventTriggerDefinition_t* pRICEventTriggerDefinition) {
-
-    if (pRICEventTriggerDefinition->E2SMgNBX2EventTriggerDefinitionPresent)
-        return packRICEventTriggerDefinitionX2Format(pLogBuffer, pRICEventTriggerDefinition);
-    else if(pRICEventTriggerDefinition->E2SMgNBNRTEventTriggerDefinitionPresent)
-        return packRICEventTriggerDefinitionNRTFormat(pLogBuffer, pRICEventTriggerDefinition);
-    else
-        return e2err_RICEventTriggerDefinitionAllocEventTriggerDefinitionEmptyFail;
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t packRICEventTriggerDefinitionX2Format(char* pLogBuffer, RICEventTriggerDefinition_t* pRICEventTriggerDefinition) {
-
-    E2_E2SM_gNB_X2_eventTriggerDefinition_t* pE2SM_gNB_X2_eventTriggerDefinition = calloc(1, sizeof(E2_E2SM_gNB_X2_eventTriggerDefinition_t));
-    if(pE2SM_gNB_X2_eventTriggerDefinition == NULL)
-        return e2err_RICEventTriggerDefinitionAllocE2SM_gNB_X2_eventTriggerDefinitionFail;
-
-    // RICeventTriggerDefinition
-    // InterfaceID
-    if ((pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent == true &&
-         pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent == true) ||
-        (pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent == false &&
-         pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent == false))
-        return e2err_RICEventTriggerDefinitionIEValueFail_1;
-
-    // GlobalENB-ID or GlobalGNB-ID
-    if (pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent)
-    {
-        pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.present = E2_Interface_ID_PR_global_eNB_ID;
-
-        // GlobalENB-ID
-        // PLMN-Identity
-        pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.pLMN_Identity.size =
-        pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.contentLength;
-        pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.pLMN_Identity.buf = calloc(1,3);
-        if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.pLMN_Identity.buf) {
-            memcpy(pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.pLMN_Identity.buf,
-                   pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal,
-                   pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.contentLength);
-        }
-        else
-            return e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDpLMN_IdentityBufFail;
-
-        // Add ENB-ID
-        if (pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits == cMacroENBIDP_20Bits){
-            // BIT STRING, SIZE 20
-            pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.present = ENB_ID_PR_macro_eNB_ID;
-            pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.macro_eNB_ID.buf = calloc(1,3);
-            if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.macro_eNB_ID.buf) {
-                pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.macro_eNB_ID.size = 3; // bytes
-                pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.macro_eNB_ID.bits_unused = 4; // trailing unused bits
-                memcpy(pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.macro_eNB_ID.buf,
-                       (void*)&pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID,3);
-            }
-            else
-                return e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail;
-        }
-        else if (pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits == cHomeENBID_28Bits) {
-            // BIT STRING, SIZE 28
-            pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.present = ENB_ID_PR_home_eNB_ID;
-            pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.home_eNB_ID.buf = calloc(1,4);
-            if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.home_eNB_ID.buf) {
-                pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.home_eNB_ID.size = 4; // bytes
-                pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.home_eNB_ID.bits_unused = 4; // trailing unused bits
-                memcpy(pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.home_eNB_ID.buf,
-                       (void*)&pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID,4);
-            }
-            else
-                return e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDhome_eNB_IDBufFail;
-        }
-        else if (pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits == cShortMacroENBID_18Bits) {
-            // BIT STRING, SIZE 18
-            pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.present = ENB_ID_PR_short_Macro_eNB_ID;
-            pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.short_Macro_eNB_ID.buf = calloc(1,3);
-            if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.short_Macro_eNB_ID.buf) {
-                pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.short_Macro_eNB_ID.size = 3;
-                pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.short_Macro_eNB_ID.bits_unused = 6; // trailing unused bits
-                memcpy(pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.short_Macro_eNB_ID.buf,
-                       (void*)&pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID,3);
-            }
-            else
-                return e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail;
-        }
-        else if (pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits == clongMacroENBIDP_21Bits) {
-            // BIT STRING, SIZE 21
-            pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.present = ENB_ID_PR_long_Macro_eNB_ID;
-            pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.long_Macro_eNB_ID.buf = calloc(1,3);
-            if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.long_Macro_eNB_ID.buf) {
-                pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.long_Macro_eNB_ID.size = 3; // bytes
-                pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.long_Macro_eNB_ID.bits_unused = 3; // trailing unused bits
-                memcpy(pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.long_Macro_eNB_ID.buf,
-                       (void*)&pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID,3);
-            }
-            else
-                return e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail;
-        }
-        else
-            return e2err_RICEventTriggerDefinitionIEValueFail_2;
-    }
-    else if (pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent) {
-        // GlobalGNB-ID
-        pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.present = E2_Interface_ID_PR_global_gNB_ID;
-
-        // PLMN-Identity
-        pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.pLMN_Identity.size =
-          pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.contentLength;
-        pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.pLMN_Identity.buf =
-          calloc(1,pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.contentLength);
-        if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.pLMN_Identity.buf) {
-            memcpy(pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.pLMN_Identity.buf,
-                   (void*)&pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal,
-                    pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.contentLength);
-        }
-        else
-            return e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDpLMN_IdentityBufFail;
-
-        // GNB-ID, BIT STRING, SIZE 22..32
-        pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.gNB_ID.choice.gNB_ID.size = 4;  //32bits
-        pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.gNB_ID.choice.gNB_ID.buf = calloc(1, 4);
-        if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.gNB_ID.choice.gNB_ID.buf) {
-            memcpy(pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.gNB_ID.choice.gNB_ID.buf,
-                   (void*)&pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID,4); //32bits
-        }
-        else
-            return e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDgNB_IDBufFail;
-    }
-    else
-        return e2err_RICEventTriggerDefinitionIEValueFail_3;
-
-    // InterfaceDirection
-    pE2SM_gNB_X2_eventTriggerDefinition->interfaceDirection = pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceDirection;
-
-    // InterfaceMessageType
-    // ProcedureCode
-    pE2SM_gNB_X2_eventTriggerDefinition->interfaceMessageType.procedureCode = pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceMessageType.procedureCode;
-
-    // TypeOfMessage
-    if(pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage == cE2InitiatingMessage)
-        pE2SM_gNB_X2_eventTriggerDefinition->interfaceMessageType.typeOfMessage = E2_TypeOfMessage_initiating_message;
-    else if(pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage == cE2SuccessfulOutcome)
-        pE2SM_gNB_X2_eventTriggerDefinition->interfaceMessageType.typeOfMessage = E2_TypeOfMessage_successful_outcome;
-    else if(pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage == cE2UnsuccessfulOutcome)
-        pE2SM_gNB_X2_eventTriggerDefinition->interfaceMessageType.typeOfMessage = E2_TypeOfMessage_unsuccessful_outcome;
-    else
-        return e2err_RICEventTriggerDefinitionIEValueFail_4;
-
-    // InterfaceProtocolIE-List, OPTIONAL. Not used in RIC currently
-    if (pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceProtocolIEListPresent == true) {}
-
-    // Debug print
-    if (debug)
-        asn_fprint(stdout, &asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition);
-
-    // Encode
-    size_t bufferSize = sizeof(pRICEventTriggerDefinition->octetString.data);
-    asn_enc_rval_t rval;
-    rval = asn_encode_to_buffer(0, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition,
-                                pRICEventTriggerDefinition->octetString.data, bufferSize);
-
-    if(rval.encoded == -1) {
-        sprintf(pLogBuffer,"Serialization of %s failed", asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition.name);
-        return e2err_RICEventTriggerDefinitionPackFail_1;
-    }
-    else if(rval.encoded > bufferSize) {
-       sprintf(pLogBuffer,"Buffer of size %zu is too small for %s, need %zu",bufferSize, asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition.name, rval.encoded);
-        return e2err_RICEventTriggerDefinitionPackFail_2;
-    }
-    else
-    if (debug)
-           sprintf(pLogBuffer,"Successfully encoded %s. Buffer size %zu, encoded size %zu",asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition.name, bufferSize, rval.encoded);
-
-    ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition);
-
-    pRICEventTriggerDefinition->octetString.contentLength = rval.encoded;
-    return e2err_OK;
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t packRICEventTriggerDefinitionNRTFormat(char* pLogBuffer, RICEventTriggerDefinition_t* pRICEventTriggerDefinition) {
-
-    E2_E2SM_gNB_NRT_EventTriggerDefinition_t* pE2_E2SM_gNB_NRT_EventTriggerDefinition = calloc(1, sizeof(E2_E2SM_gNB_NRT_EventTriggerDefinition_t));
-    if(pE2_E2SM_gNB_NRT_EventTriggerDefinition == NULL)
-        return e2err_RICEventTriggerDefinitionAllocE2SM_gNB_NRT_eventTriggerDefinitionFail;
-
-    pE2_E2SM_gNB_NRT_EventTriggerDefinition->present = E2_E2SM_gNB_NRT_EventTriggerDefinition_PR_eventDefinition_Format1;
-    pE2_E2SM_gNB_NRT_EventTriggerDefinition->choice.eventDefinition_Format1.triggerNature =
-      pRICEventTriggerDefinition->e2SMgNBNRTEventTriggerDefinition.eventDefinitionFormat1.triggerNature;
-
-    // Debug print
-    if (debug)
-        asn_fprint(stdout, &asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition, pE2_E2SM_gNB_NRT_EventTriggerDefinition);
-
-    // Encode
-    size_t bufferSize = sizeof(pRICEventTriggerDefinition->octetString.data);
-    asn_enc_rval_t rval;
-    rval = asn_encode_to_buffer(0, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition, pE2_E2SM_gNB_NRT_EventTriggerDefinition,
-                                pRICEventTriggerDefinition->octetString.data, bufferSize);
-
-    if(rval.encoded == -1) {
-        sprintf(pLogBuffer,"Serialization of %s failed", asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition.name);
-        return e2err_RICENRTventTriggerDefinitionPackFail_1;
-    }
-    else if(rval.encoded > bufferSize) {
-       sprintf(pLogBuffer,"Buffer of size %zu is too small for %s, need %zu",bufferSize, asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition.name, rval.encoded);
-        return e2err_RICNRTEventTriggerDefinitionPackFail_2;
-    }
-    else
-    if (debug)
-           sprintf(pLogBuffer,"Successfully encoded %s. Buffer size %zu, encoded size %zu",asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition.name, bufferSize, rval.encoded);
-
-    ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition, pE2_E2SM_gNB_NRT_EventTriggerDefinition);
-
-    pRICEventTriggerDefinition->octetString.contentLength = rval.encoded;
-    return e2err_OK;
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t packRICActionDefinition(char* pLogBuffer, RICActionDefinitionChoice_t* pRICActionDefinitionChoice) {
-
-    if (pRICActionDefinitionChoice->actionDefinitionX2Format1Present ||
-        pRICActionDefinitionChoice->actionDefinitionX2Format2Present) {
-        // E2SM-gNB-X2-actionDefinition
-        return packActionDefinitionX2Format(pLogBuffer,pRICActionDefinitionChoice);
-    }
-    else if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1Present) {
-        // E2SM-gNB-NRT-actionDefinition
-        return packActionDefinitionNRTFormat(pLogBuffer,pRICActionDefinitionChoice);
-    }
-    else
-        return e2err_RICSubscriptionRequestRICActionDefinitionEmpty;
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t packActionDefinitionX2Format(char* pLogBuffer, RICActionDefinitionChoice_t* pRICActionDefinitionChoice) {
-
-    int result;
-
-    // E2SM-gNB-X2-actionDefinition
-    E2_E2SM_gNB_X2_ActionDefinitionChoice_t* pE2_E2SM_gNB_X2_ActionDefinitionChoice = calloc(1, sizeof(E2_E2SM_gNB_X2_ActionDefinitionChoice_t));
-    if (pE2_E2SM_gNB_X2_ActionDefinitionChoice == NULL) {
-        return e2err_RICSubscriptionRequestAllocE2_E2SM_gNB_X2_ActionDefinitionChoiceFail;
-    }
-
-    if (pRICActionDefinitionChoice->actionDefinitionX2Format1Present) {
-
-        // E2SM-gNB-X2-actionDefinition
-        pE2_E2SM_gNB_X2_ActionDefinitionChoice->present = E2_E2SM_gNB_X2_ActionDefinitionChoice_PR_actionDefinition_Format1;
-        pE2_E2SM_gNB_X2_ActionDefinitionChoice->choice.actionDefinition_Format1.style_ID = pRICActionDefinitionChoice->actionDefinitionX2Format1->styleID;
-
-        if (pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterCount > 0) {
-            struct E2_E2SM_gNB_X2_actionDefinition__actionParameter_List* pE2_E2SM_gNB_X2_actionDefinition__actionParameter_List =
-            calloc(1, sizeof (struct E2_E2SM_gNB_X2_actionDefinition__actionParameter_List));
-            uint64_t index = 0;
-            while (index < pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterCount && index < E2_maxofRANParameters) {
-                E2_ActionParameter_Item_t* pE2_ActionParameter_Item = calloc(1, sizeof(E2_ActionParameter_Item_t));
-                if (pE2_ActionParameter_Item) {
-                    pE2_ActionParameter_Item->actionParameter_ID = pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].parameterID;
-                    if (pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueIntPresent) {
-                        pE2_ActionParameter_Item->actionParameter_Value.present = E2_ActionParameter_Value_PR_valueInt;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueInt =
-                        pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueInt;
-                    }
-                    else if (pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueEnumPresent) {
-                        pE2_ActionParameter_Item->actionParameter_Value.present = E2_ActionParameter_Value_PR_valueEnum;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueEnum =
-                        pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueIntPresent;
-                    }
-                    else if (pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBoolPresent) {
-                        pE2_ActionParameter_Item->actionParameter_Value.present = E2_ActionParameter_Value_PR_valueBool;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueBool =
-                        pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBool;
-                    }
-                    else if (pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBitSPresent) {
-                        pE2_ActionParameter_Item->actionParameter_Value.present = E2_ActionParameter_Value_PR_valueBitS;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueBitS.size =
-                        pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBitS.byteLength;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueBitS.bits_unused =
-                        pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBitS.unusedBits;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueBitS.buf =
-                        calloc(pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBitS.byteLength, 1);
-                        if (pE2_ActionParameter_Item->actionParameter_Value.choice.valueBitS.buf) {
-                            memcpy(pE2_ActionParameter_Item->actionParameter_Value.choice.valueBitS.buf,
-                                pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBitS.data,
-                                pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBitS.byteLength);
-                        }
-                        else
-                            return e2err_RICSubscriptionRequestAllocactionParameterValueValueBitSFail;
-                    }
-                    else if (pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueOctSPresent) {
-                        pE2_ActionParameter_Item->actionParameter_Value.present = E2_ActionParameter_Value_PR_valueOctS;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueOctS.size =
-                        pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueOctS.length;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueOctS.buf =
-                        calloc(pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueOctS.length, 1);
-                        if (pE2_ActionParameter_Item->actionParameter_Value.choice.valueOctS.buf) {
-                            memcpy(pE2_ActionParameter_Item->actionParameter_Value.choice.valueOctS.buf,
-                                pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueOctS.data,
-                                pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueOctS.length);
-                        }
-                        else
-                            return e2err_RICSubscriptionRequestAllocactionParameterValueValueOctSFail;
-                    }
-                    else if (pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valuePrtSPresent) {
-                        pE2_ActionParameter_Item->actionParameter_Value.present = E2_ActionParameter_Value_PR_valuePrtS;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valuePrtS.size =
-                        pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valuePrtS.length;
-                        pE2_ActionParameter_Item->actionParameter_Value.choice.valuePrtS.buf =
-                        calloc(pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valuePrtS.length ,1);
-                        if (pE2_ActionParameter_Item->actionParameter_Value.choice.valuePrtS.buf) {
-                            memcpy(pE2_ActionParameter_Item->actionParameter_Value.choice.valuePrtS.buf,
-                                pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valuePrtS.data,
-                                pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valuePrtS.length);
-                        }
-                        else
-                            return e2err_RICSubscriptionRequestAllocactionParameterValueValuePrtsSFail;
-                    }
-                    else
-                        return e2err_RICSubscriptionRequestActionParameterItemFail;
-
-                    if ((result = asn_set_add(pE2_E2SM_gNB_X2_actionDefinition__actionParameter_List, pE2_ActionParameter_Item)) != 0)
-                        return e2err_RICSubscriptionRequestAsn_set_addE2_ActionParameter_ItemFail;
-                }
-                else
-                    return e2err_RICSubscriptionRequestAllocActionDefinitionFail;
-                index++;
-            }
-            pE2_E2SM_gNB_X2_ActionDefinitionChoice->choice.actionDefinition_Format1.actionParameter_List = pE2_E2SM_gNB_X2_actionDefinition__actionParameter_List;
-        }
-    }
-    else if (pRICActionDefinitionChoice->actionDefinitionX2Format2Present) {
-
-        // E2SM-gNB-X2-ActionDefinition-Format2
-        pE2_E2SM_gNB_X2_ActionDefinitionChoice->present = E2_E2SM_gNB_X2_ActionDefinitionChoice_PR_actionDefinition_Format2;
-
-        if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupCount > 0) {
-            struct E2_E2SM_gNB_X2_ActionDefinition_Format2__ranUEgroup_List* pE2_E2SM_gNB_X2_ActionDefinition_Format2__ranUEgroup_List =
-            calloc(1, sizeof(struct E2_E2SM_gNB_X2_ActionDefinition_Format2__ranUEgroup_List));
-
-            uint64_t index = 0;
-            while (index < pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupCount && index < E2_maxofUEgroup) {
-
-                E2_RANueGroup_Item_t* pE2_RANueGroup_Item = calloc(1, sizeof(E2_RANueGroup_Item_t));
-                if (pE2_RANueGroup_Item) {
-
-                    struct E2_RANueGroupDefinition__ranUEgroupDef_List* pE2_RANueGroupDefinition__ranUEgroupDef_List =
-                    calloc(1, sizeof (struct E2_RANueGroupDefinition__ranUEgroupDef_List));
-
-                    pE2_RANueGroup_Item->ranUEgroupID = pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupID;
-
-                    uint64_t index2 = 0;
-                    while (index2 < pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefCount && index2 < E2_maxofRANParameters) {
-                        E2_RANueGroupDef_Item_t* pE2_RANueGroupDef_Item = calloc(1, sizeof(E2_RANueGroupDef_Item_t));
-                        if(pE2_RANueGroupDef_Item) {
-                            pE2_RANueGroupDef_Item->ranParameter_ID = pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterID;
-                            pE2_RANueGroupDef_Item->ranParameter_Test = pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterTest;
-                            if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueIntPresent) {
-                                pE2_RANueGroupDef_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueInt;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueInt =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueInt;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueEnum) {
-                                pE2_RANueGroupDef_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueEnum;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueEnum =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueEnum;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBoolPresent) {
-                                pE2_RANueGroupDef_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueBool;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBool =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBool;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBitSPresent) {
-                                pE2_RANueGroupDef_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueBitS;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBitS.size =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBitS.byteLength;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBitS.bits_unused =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBitS.unusedBits;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBitS.buf =
-                                calloc(pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBitS.byteLength, 1);
-                                if (pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBitS.buf) {
-                                    memcpy(pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBitS.buf,
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBitS.data,
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBitS.byteLength);
-                                }
-                                else
-                                    return e2err_RICSubscriptionRequestAllocactionRanParameterValueValueBitSFail;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueOctSPresent) {
-                                pE2_RANueGroupDef_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueOctS;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueOctS.size =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueOctS.length;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueOctS.buf =
-                                calloc(pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueOctS.length, 1);
-                                if (pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueOctS.buf) {
-                                    memcpy(pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueOctS.buf,
-                                            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueOctS.data,
-                                            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueOctS.length);
-                                }
-                                else
-                                    return e2err_RICSubscriptionRequestAllocactionRanParameterValueValueOctSFail;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valuePrtSPresent) {
-                                pE2_RANueGroupDef_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valuePrtS;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valuePrtS.size =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valuePrtS.length;
-                                pE2_RANueGroupDef_Item->ranParameter_Value.choice.valuePrtS.buf =
-                                calloc(pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valuePrtS.length, 1);
-                                if (pE2_RANueGroupDef_Item->ranParameter_Value.choice.valuePrtS.buf) {
-                                    memcpy(pE2_RANueGroupDef_Item->ranParameter_Value.choice.valuePrtS.buf,
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valuePrtS.data,
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valuePrtS.length);
-                                }
-                                else
-                                    return e2err_RICSubscriptionRequestAllocactionRanParameterValueValuePrtsSFail;
-                            }
-                            else
-                                return e2err_RICSubscriptionRequestRanranUeGroupDefItemParameterValueEmptyFail;
-
-                            if ((result = asn_set_add(pE2_RANueGroupDefinition__ranUEgroupDef_List, pE2_RANueGroupDef_Item)) != 0)
-                                return e2err_RICSubscriptionRequestAsn_set_addRANueGroupDef_ItemFail;
-                            pE2_RANueGroup_Item->ranUEgroupDefinition.ranUEgroupDef_List = pE2_RANueGroupDefinition__ranUEgroupDef_List;
-                        }
-                        else
-                            return e2err_RICSubscriptionRequestAllocE2_RANueGroupDef_ItemFail;
-                        index2++;
-                    }
-
-                    struct E2_RANimperativePolicy__ranImperativePolicy_List* pE2_RANimperativePolicy__ranImperativePolicy_List =
-                    calloc(1, sizeof (struct E2_RANimperativePolicy__ranImperativePolicy_List));
-
-                    uint64_t index3 = 0;
-                    while (index3 < pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterCount && index3 < E2_maxofRANParameters) {
-                        E2_RANParameter_Item_t* pE2_RANParameter_Item = calloc(1, sizeof(E2_RANParameter_Item_t));
-                        if (pE2_RANParameter_Item) {
-                            pE2_RANParameter_Item->ranParameter_ID = pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterID;
-                            if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueIntPresent) {
-                                pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueInt;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valueInt =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueInt;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnum) {
-                                pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueEnum;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valueEnum =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnum;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBoolPresent) {
-                                pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueBool;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valueBool =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBool;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitSPresent) {
-                                pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueBitS;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.size =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.byteLength;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.bits_unused =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.unusedBits;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.buf =
-                                calloc(pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.byteLength, 1);
-                                if (pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.buf) {
-                                    memcpy(pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.buf,
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.data,
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.byteLength);
-                                }
-                                else
-                                    return e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValueBitSFail;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctSPresent) {
-                                pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueOctS;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.size =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.length;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.buf =
-                                calloc(pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.length, 1);
-                                if (pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.buf) {
-                                    memcpy(pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.buf,
-                                            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.data,
-                                            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.length);
-                                }
-                                else
-                                    return e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValueOctSFail;
-                            }
-                            else if (pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtSPresent) {
-                                pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valuePrtS;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.size =
-                                pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.length;
-                                pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.buf =
-                                calloc(pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.length, 1);
-                                if (pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.buf) {
-                                    memcpy(pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.buf,
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.data,
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.length);
-                                }
-                                else
-                                    return e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValuePrtsSFail;
-                            }
-                            else
-                                return e2err_RICSubscriptionRequestRanParameterItemRanParameterValueEmptyFail;
-
-                            if ((result = asn_set_add(pE2_RANimperativePolicy__ranImperativePolicy_List, pE2_RANParameter_Item)) != 0)
-                                return e2err_RICSubscriptionRequestAsn_set_addE2_RANParameter_ItemFail;
-                            pE2_RANueGroup_Item->ranPolicy.ranImperativePolicy_List = pE2_RANimperativePolicy__ranImperativePolicy_List;
-                        }
-                        else
-                            return e2err_RICSubscriptionRequestAllocActionDefinitionFail;
-                        index3++;
-                    }
-
-                    const int result = asn_set_add(pE2_E2SM_gNB_X2_ActionDefinition_Format2__ranUEgroup_List, pE2_RANueGroup_Item);
-                    if (result != 0)
-                        sprintf(pLogBuffer,"asn_set_add() failed");
-                }
-                else
-                    return e2err_RICSubscriptionRequestAllocRANParameter_ItemFail;
-                index++;
-            }
-            pE2_E2SM_gNB_X2_ActionDefinitionChoice->choice.actionDefinition_Format2.ranUEgroup_List = pE2_E2SM_gNB_X2_ActionDefinition_Format2__ranUEgroup_List;
-        }
-    }
-    else {
-        return e2err_RICSubscriptionRequestRICActionDefinitionEmptyE2_E2SM_gNB_X2_actionDefinition;
-    }
-
-    // Debug print
-    if (debug)
-        asn_fprint(stdout, &asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-
-    // Encode
-    size_t bufferSize = sizeof(pRICActionDefinitionChoice->octetString.data);
-    asn_enc_rval_t rval;
-    rval = asn_encode_to_buffer(0, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice,
-                                pRICActionDefinitionChoice->octetString.data, bufferSize);
-    if(rval.encoded == -1) {
-        sprintf(pLogBuffer,"Serialization of %s failed", asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice.name);
-        return e2err_RICActionDefinitionChoicePackFail_1;
-    }
-    else if(rval.encoded > bufferSize) {
-       sprintf(pLogBuffer,"Buffer of size %zu is too small for %s, need %zu",bufferSize, asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice.name, rval.encoded);
-        return e2err_RICActionDefinitionChoicePackFail_2;
-    }
-    else
-    if (debug)
-           sprintf(pLogBuffer,"Successfully encoded %s. Buffer size %zu, encoded size %zu",asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice.name, bufferSize, rval.encoded);
-
-    ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-
-    pRICActionDefinitionChoice->octetString.contentLength = rval.encoded;
-    return e2err_OK;
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t packActionDefinitionNRTFormat(char* pLogBuffer, RICActionDefinitionChoice_t* pRICActionDefinitionChoice) {
-
-    // E2SM-gNB-NRT-actionDefinition
-    E2_E2SM_gNB_NRT_ActionDefinition_t* pE2_E2SM_gNB_NRT_ActionDefinition = calloc(1, sizeof(E2_E2SM_gNB_NRT_ActionDefinition_t));
-    if (pE2_E2SM_gNB_NRT_ActionDefinition == NULL)
-        return e2err_RICSubscriptionRequestAllocE2_E2SM_gNB_NRT_ActionDefinitionFail;
-
-    if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1Present) {
-
-        // E2SM-gNB-NRT-ActionDefinition-Format1
-        pE2_E2SM_gNB_NRT_ActionDefinition->present = E2_E2SM_gNB_NRT_ActionDefinition_PR_actionDefinition_Format1;
-
-        struct E2_E2SM_gNB_NRT_ActionDefinition_Format1__ranParameter_List* pE2_E2SM_gNB_NRT_ActionDefinition_Format1__ranParameter_List =
-          calloc(1, sizeof(struct E2_E2SM_gNB_NRT_ActionDefinition_Format1__ranParameter_List));
-
-        uint64_t index = 0;
-        while (index <  pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterCount && index < E2_maxofRANParameters) {
-            E2_RANParameter_Item_t* pE2_RANParameter_Item = calloc(1, sizeof(E2_RANParameter_Item_t));
-            if (pE2_RANParameter_Item) {
-                pE2_RANParameter_Item->ranParameter_ID = pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterID;
-                if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueIntPresent) {
-                    pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueInt;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valueInt =
-                      pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueInt;
-                }
-                else if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueEnum) {
-                    pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueEnum;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valueEnum =
-                      pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueEnum;
-                }
-                else if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBoolPresent) {
-                    pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueBool;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valueBool =
-                      pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBool;
-                }
-                else if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBitSPresent) {
-                    pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueBitS;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.size =
-                      pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBitS.byteLength;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.bits_unused =
-                      pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBitS.unusedBits;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.buf =
-                      calloc(pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBitS.byteLength, 1);
-                    if (pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.buf) {
-                        memcpy(pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.buf,
-                               pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBitS.data,
-                               pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBitS.byteLength);
-                      }
-                      else
-                        return e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValueBitSFail;
-                }
-                else if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueOctSPresent) {
-                    pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valueOctS;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.size =
-                      pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueOctS.length;
-                      pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.buf =
-                      calloc(pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueOctS.length, 1);
-                      if (pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.buf) {
-                          memcpy(pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.buf,
-                                 pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueOctS.data,
-                                 pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueOctS.length);
-                      }
-                      else
-                        return e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValueOctSFail;
-                }
-                else if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valuePrtSPresent) {
-                    pE2_RANParameter_Item->ranParameter_Value.present = E2_RANParameter_Value_PR_valuePrtS;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.size =
-                      pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valuePrtS.length;
-                    pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.buf =
-                      calloc(pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valuePrtS.length, 1);
-                    if (pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.buf) {
-                        memcpy(pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.buf,
-                               pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valuePrtS.data,
-                               pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valuePrtS.length);
-                      }
-                      else
-                        return e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValuePrtsSFail;
-                }
-                else
-                    return e2err_RICSubscriptionRequestRanParameterItemNRTRanParameterValueEmptyFail;
-
-                int result;
-                if ((result = asn_set_add(pE2_E2SM_gNB_NRT_ActionDefinition_Format1__ranParameter_List, pE2_RANParameter_Item)) != 0)
-                    return e2err_RICSubscriptionRequestAsn_set_addE2_NRTRANParameter_ItemFail;
-                pE2_E2SM_gNB_NRT_ActionDefinition->choice.actionDefinition_Format1.ranParameter_List = pE2_E2SM_gNB_NRT_ActionDefinition_Format1__ranParameter_List;
-            }
-            else
-                return e2err_RICSubscriptionRequestAllocNRTRANParameter_ItemFail;
-            index++;
-        }
-    }
-    else
-        return e2err_RICSubscriptionRequestRICActionDefinitionEmptyE2_E2SM_gNB_NRT_actionDefinition;
-
-    // Debug print
-    if (debug)
-        asn_fprint(stdout, &asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition, pE2_E2SM_gNB_NRT_ActionDefinition);
-
-    // Encode
-    size_t bufferSize = sizeof(pRICActionDefinitionChoice->octetString.data);
-    asn_enc_rval_t rval;
-    rval = asn_encode_to_buffer(0, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition, pE2_E2SM_gNB_NRT_ActionDefinition,
-                                pRICActionDefinitionChoice->octetString.data, bufferSize);
-    if(rval.encoded == -1) {
-        sprintf(pLogBuffer,"Serialization of %s failed", asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition.name);
-        return e2err_RICActionDefinitionChoicePackFail_1;
-    }
-    else if(rval.encoded > bufferSize) {
-       sprintf(pLogBuffer,"Buffer of size %zu is too small for %s, need %zu",bufferSize, asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition.name, rval.encoded);
-        return e2err_RICActionDefinitionChoicePackFail_2;
-    }
-    else
-    if (debug)
-           sprintf(pLogBuffer,"Successfully encoded %s. Buffer size %zu, encoded size %zu",asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition.name, bufferSize, rval.encoded);
-
-    ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition, pE2_E2SM_gNB_NRT_ActionDefinition);
-
-    pRICActionDefinitionChoice->octetString.contentLength = rval.encoded;
-    return e2err_OK;
-}
 
 //////////////////////////////////////////////////////////////////////
 uint64_t packRICSubscriptionResponse(size_t* pDataBufferSize, byte* pDataBuffer, char* pLogBuffer, RICSubscriptionResponse_t* pRICSubscriptionResponse) {
@@ -1450,7 +755,7 @@
 }
 
 //////////////////////////////////////////////////////////////////////
-uint64_t getRICSubscriptionRequestData(mem_track_hdr_t * pDynMemHead, e2ap_pdu_ptr_t* pE2AP_PDU_pointer, RICSubscriptionRequest_t* pRICSubscriptionRequest) {
+uint64_t getRICSubscriptionRequestData(e2ap_pdu_ptr_t* pE2AP_PDU_pointer, RICSubscriptionRequest_t* pRICSubscriptionRequest) {
 
     E2AP_PDU_t* pE2AP_PDU = (E2AP_PDU_t*)pE2AP_PDU_pointer;
 
@@ -1491,23 +796,6 @@
         pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.octetString.contentLength = pRICeventTriggerDefinition->size;
         memcpy(pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.octetString.data, pRICeventTriggerDefinition->buf, pRICeventTriggerDefinition->size);
 
-        // Workaroud to spec problem. E2AP spec does not specify what speck (gNB-X2 or gNB-NRT) should be used when decoded EventTriggerDefinition and ActionDefinition
-        // received received. Here we know that length of gNB-NRT EventTriggerDefinition octet string is always 1 at the moment.
-        if (pRICeventTriggerDefinition->size == 1) {
-            pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBNRTEventTriggerDefinitionPresent = true;
-            pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBX2EventTriggerDefinitionPresent = false;
-        }
-        else {
-            pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBNRTEventTriggerDefinitionPresent = false;
-            pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBX2EventTriggerDefinitionPresent = true;
-        }
-
-        uint64_t returnCode;
-        if ((returnCode = getRICEventTriggerDefinitionData(&pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition)) != e2err_OK) {
-            ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pE2AP_PDU);
-            return returnCode;
-        }
-
         // RICactions-ToBeSetup-List
         RICaction_ToBeSetup_ItemIEs_t* pRICaction_ToBeSetup_ItemIEs;
         uint64_t index = 0;
@@ -1532,18 +820,7 @@
                        pRICaction_ToBeSetup_ItemIEs->value.choice.RICaction_ToBeSetup_Item.ricActionDefinition->buf,
                        pRICaction_ToBeSetup_ItemIEs->value.choice.RICaction_ToBeSetup_Item.ricActionDefinition->size);
 
-                // Workaroud to spec problem. E2AP spec does not specify what speck (gNB-X2 or gNB-NRT) should be used when decoded EventTriggerDefinition and ActionDefinition
-                // received received. Here we know that length of gNB-NRT EventTriggerDefinition octet string is always 1 at the moment.
-                if (pRICeventTriggerDefinition->size == 1)
-                    pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present = true;
-                else
-                    pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present = false;
-
                 pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent = true;
-                if ((returnCode = getRICActionDefinitionData(pDynMemHead, &pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice)) != e2err_OK) {
-                    ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pE2AP_PDU);
-                    return returnCode;
-                }
             }
             else
                 pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent = false;
@@ -1574,536 +851,9 @@
     return e2err_OK;
 }
 
-//////////////////////////////////////////////////////////////////////
-uint64_t getRICEventTriggerDefinitionData(RICEventTriggerDefinition_t* pRICEventTriggerDefinition) {
-
-    if (pRICEventTriggerDefinition->E2SMgNBX2EventTriggerDefinitionPresent)
-        return getRICEventTriggerDefinitionDataX2Format(pRICEventTriggerDefinition);
-    else if (pRICEventTriggerDefinition->E2SMgNBNRTEventTriggerDefinitionPresent)
-        return getRICEventTriggerDefinitionDataNRTFormat(pRICEventTriggerDefinition);
-    else
-        return e2err_RICEventTriggerDefinitionEmptyDecodeDefaultFail;
-}
 
 //////////////////////////////////////////////////////////////////////
-uint64_t getRICEventTriggerDefinitionDataX2Format(RICEventTriggerDefinition_t* pRICEventTriggerDefinition) {
 
-    E2_E2SM_gNB_X2_eventTriggerDefinition_t* pE2SM_gNB_X2_eventTriggerDefinition = 0;
-    asn_dec_rval_t rval;
-    rval = asn_decode(0, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, (void **)&pE2SM_gNB_X2_eventTriggerDefinition,
-                      pRICEventTriggerDefinition->octetString.data, pRICEventTriggerDefinition->octetString.contentLength);
-    switch(rval.code) {
-    case RC_OK:
-        // Debug print
-        if (debug) {
-            printf("Successfully decoded E2SM_gNB_X2_eventTriggerDefinition\n");
-            asn_fprint(stdout, &asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition);
-        }
-
-        // InterfaceID, GlobalENB-ID or GlobalGNB-ID
-        if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.present == E2_Interface_ID_PR_global_eNB_ID) {
-
-            // GlobalENB-ID
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent = true;
-
-            // PLMN-Identity
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.contentLength =
-              pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.pLMN_Identity.size;
-            memcpy(pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal,
-              pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.pLMN_Identity.buf,
-              pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.contentLength);
-
-            //  ENB-ID
-            IdOctects_t eNBOctects;
-            memset(eNBOctects.octets, 0, sizeof(eNBOctects));
-            if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.present == E2_ENB_ID_PR_macro_eNB_ID) {
-                // BIT STRING, SIZE 20
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits = cMacroENBIDP_20Bits;
-                memcpy(eNBOctects.octets,pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.macro_eNB_ID.buf,
-                  pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.macro_eNB_ID.size);
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID = eNBOctects.nodeID;
-            }
-            else if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.present == E2_ENB_ID_PR_home_eNB_ID) {
-                // BIT STRING, SIZE 28
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits = cHomeENBID_28Bits;
-                memcpy(eNBOctects.octets,pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.home_eNB_ID.buf,
-                  pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.home_eNB_ID.size);
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID = eNBOctects.nodeID;
-            }
-            else if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.present == E2_ENB_ID_PR_short_Macro_eNB_ID) {
-                // BIT STRING, SIZE 18
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits = cShortMacroENBID_18Bits;
-                memcpy(eNBOctects.octets,pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.short_Macro_eNB_ID.buf,
-                  pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.short_Macro_eNB_ID.size);
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID = eNBOctects.nodeID;
-            }
-            else if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.present == E2_ENB_ID_PR_long_Macro_eNB_ID) {
-                // BIT STRING, SIZE 21
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits =  clongMacroENBIDP_21Bits;
-                memcpy(eNBOctects.octets,pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.long_Macro_eNB_ID.buf,
-                  pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.eNB_ID.choice.long_Macro_eNB_ID.size);
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID = eNBOctects.nodeID;
-            }
-            else {
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent = false;
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent = false;
-                ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition);
-                return e2err_RICEventTriggerDefinitionIEValueFail_5;
-            }
-        }
-        else if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.present == E2_Interface_ID_PR_global_gNB_ID) {
-            // GlobalGNB-ID
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent = true;
-
-            // PLMN-Identity
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.contentLength =
-              pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.pLMN_Identity.size;
-            memcpy(pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal,
-              pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_eNB_ID.pLMN_Identity.buf,
-              pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.contentLength);
-
-            // GNB-ID
-            IdOctects_t gNBOctects;
-            memset(gNBOctects.octets, 0, sizeof(gNBOctects));
-            if (pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.gNB_ID.present == E2_GNB_ID_PR_gNB_ID) {
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.nodeID.bits = pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.gNB_ID.choice.gNB_ID.size;
-                memcpy(gNBOctects.octets, pE2SM_gNB_X2_eventTriggerDefinition->interface_ID.choice.global_gNB_ID.gNB_ID.choice.gNB_ID.buf,
-                   pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.nodeID.bits);
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.nodeID.nodeID = gNBOctects.nodeID;
-            }
-            else {
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent = false;
-                pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent = false;
-                ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition);
-                return e2err_RICEventTriggerDefinitionIEValueFail_6;
-            }
-        }
-        else {
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent = false;
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent = false;
-            ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition);
-            return e2err_RICEventTriggerDefinitionIEValueFail_7;
-        }
-
-        // InterfaceDirection
-        pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceDirection = pE2SM_gNB_X2_eventTriggerDefinition->interfaceDirection;
-
-        // InterfaceMessageType
-        pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceMessageType.procedureCode = pE2SM_gNB_X2_eventTriggerDefinition->interfaceMessageType.procedureCode;
-
-        if (pE2SM_gNB_X2_eventTriggerDefinition->interfaceMessageType.typeOfMessage == E2_TypeOfMessage_initiating_message)
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage = cE2InitiatingMessage;
-        else if (pE2SM_gNB_X2_eventTriggerDefinition->interfaceMessageType.typeOfMessage == E2_TypeOfMessage_successful_outcome)
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage = cE2SuccessfulOutcome;
-        else if (pE2SM_gNB_X2_eventTriggerDefinition->interfaceMessageType.typeOfMessage == E2_TypeOfMessage_unsuccessful_outcome)
-            pRICEventTriggerDefinition->e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage = cE2UnsuccessfulOutcome;
-        else {
-            ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition);
-            return e2err_RICEventTriggerDefinitionIEValueFail_8;
-        }
-        ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition, pE2SM_gNB_X2_eventTriggerDefinition);
-        return e2err_OK;
-    case RC_WMORE:
-        if (debug)
-            printf("Decode failed. More data needed. Buffer size %zu, %s, consumed %zu\n",pRICEventTriggerDefinition->octetString.contentLength,
-                   asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition.name, rval.consumed);
-
-        return e2err_RICEventTriggerDefinitionDecodeWMOREFail;
-    case RC_FAIL:
-        if (debug)
-            printf("Decode failed. Buffer size %zu, %s, consumed %zu\n",pRICEventTriggerDefinition->octetString.contentLength,
-                   asn_DEF_E2_E2SM_gNB_X2_eventTriggerDefinition.name, rval.consumed);
-        return e2err_RICEventTriggerDefinitionDecodeFAIL;
-    default:
-        return e2err_RICEventTriggerDefinitionDecodeDefaultFail;
-    }
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t getRICEventTriggerDefinitionDataNRTFormat(RICEventTriggerDefinition_t* pRICEventTriggerDefinition) {
-
-    E2_E2SM_gNB_NRT_EventTriggerDefinition_t* pE2_E2SM_gNB_NRT_EventTriggerDefinition = 0;
-    asn_dec_rval_t rval;
-    rval = asn_decode(0, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition, (void **)&pE2_E2SM_gNB_NRT_EventTriggerDefinition,
-                      pRICEventTriggerDefinition->octetString.data, pRICEventTriggerDefinition->octetString.contentLength);
-    switch(rval.code) {
-    case RC_OK:
-        // Debug print
-        if (debug) {
-            printf("Successfully decoded E2SM_gNB_X2_eventTriggerDefinition\n");
-            asn_fprint(stdout, &asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition, pE2_E2SM_gNB_NRT_EventTriggerDefinition);
-        }
-
-        // NRT-TriggerNature
-        if (pE2_E2SM_gNB_NRT_EventTriggerDefinition->present == E2_E2SM_gNB_NRT_EventTriggerDefinition_PR_eventDefinition_Format1) {
-            pRICEventTriggerDefinition->E2SMgNBNRTEventTriggerDefinitionPresent = true;
-            pRICEventTriggerDefinition->e2SMgNBNRTEventTriggerDefinition.eventDefinitionFormat1.triggerNature =
-              pE2_E2SM_gNB_NRT_EventTriggerDefinition->choice.eventDefinition_Format1.triggerNature;
-        }
-        ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition, pE2_E2SM_gNB_NRT_EventTriggerDefinition);
-        return e2err_OK;
-    case RC_WMORE:
-        if (debug)
-            printf("Decode failed. More data needed. Buffer size %zu, %s, consumed %zu\n",pRICEventTriggerDefinition->octetString.contentLength,
-                   asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition.name, rval.consumed);
-
-        return e2err_RICNRTEventTriggerDefinitionDecodeWMOREFail;
-    case RC_FAIL:
-        if (debug)
-            printf("Decode failed. Buffer size %zu, %s, consumed %zu\n",pRICEventTriggerDefinition->octetString.contentLength,
-                   asn_DEF_E2_E2SM_gNB_NRT_EventTriggerDefinition.name, rval.consumed);
-        return e2err_RICNRTEventTriggerDefinitionDecodeFAIL;
-    default:
-        return e2err_RICNRTEventTriggerDefinitionDecodeDefaultFail;
-    }
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t getRICActionDefinitionData(mem_track_hdr_t *pDynMemHead, RICActionDefinitionChoice_t* pRICActionDefinitionChoice) {
-
-    if (pRICActionDefinitionChoice->actionDefinitionNRTFormat1Present)
-        return getRICActionDefinitionDataNRTFormat(pDynMemHead, pRICActionDefinitionChoice);
-//    if (pRICActionDefinitionChoice->actionDefinitionX2Format1Present || pRICActionDefinitionChoice->actionDefinitionX2Format2Present)
-    else
-        return getRICActionDefinitionDataX2Format(pDynMemHead, pRICActionDefinitionChoice);
-//    else
-//        return e2err_RICActionDefinitionChoiceEmptyFAIL;
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t getRICActionDefinitionDataX2Format(mem_track_hdr_t* pDynMemHead, RICActionDefinitionChoice_t* pRICActionDefinitionChoice) {
-
-    E2_E2SM_gNB_X2_ActionDefinitionChoice_t* pE2_E2SM_gNB_X2_ActionDefinitionChoice = 0;
-    asn_dec_rval_t rval;
-    rval = asn_decode(0, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, (void **)&pE2_E2SM_gNB_X2_ActionDefinitionChoice,
-                      pRICActionDefinitionChoice->octetString.data, pRICActionDefinitionChoice->octetString.contentLength);
-    switch(rval.code) {
-    case RC_OK:
-        // Debug print
-        if (debug) {
-            printf("Successfully decoded E2SM_gNB_X2_ActionDefinitionChoice\n");
-            asn_fprint(stdout, &asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-        }
-        // ActionDefinitionChoice
-        if (pE2_E2SM_gNB_X2_ActionDefinitionChoice->present == E2_E2SM_gNB_X2_ActionDefinitionChoice_PR_actionDefinition_Format1) {
-
-            // E2SM-gNB-X2-actionDefinition
-            uint64_t status;
-            if ((status = allocActionDefinitionX2Format1(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format1)) != e2err_OK)
-                return status;
-            pRICActionDefinitionChoice->actionDefinitionX2Format1Present = true;
-            pRICActionDefinitionChoice->actionDefinitionX2Format2Present = false;
-            pRICActionDefinitionChoice->actionDefinitionNRTFormat1Present = false;
-            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterCount = 0;
-            pRICActionDefinitionChoice->actionDefinitionX2Format1->styleID = pE2_E2SM_gNB_X2_ActionDefinitionChoice->choice.actionDefinition_Format1.style_ID;
-
-            uint64_t index = 0;
-            if (pE2_E2SM_gNB_X2_ActionDefinitionChoice->choice.actionDefinition_Format1.actionParameter_List) {
-                while (index < pE2_E2SM_gNB_X2_ActionDefinitionChoice->choice.actionDefinition_Format1.actionParameter_List->list.count) {
-                    E2_ActionParameter_Item_t* pE2_ActionParameter_Item = pE2_E2SM_gNB_X2_ActionDefinitionChoice->choice.actionDefinition_Format1.actionParameter_List->list.array[index];
-                    if (pE2_ActionParameter_Item) {
-                        pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].parameterID = pE2_ActionParameter_Item->actionParameter_ID;
-                        if (pE2_ActionParameter_Item->actionParameter_Value.present == E2_ActionParameter_Value_PR_valueInt) {
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueIntPresent = true;
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueInt =
-                            pE2_ActionParameter_Item->actionParameter_Value.choice.valueInt;
-                        }
-                        else if (pE2_ActionParameter_Item->actionParameter_Value.present == E2_ActionParameter_Value_PR_valueEnum) {
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueEnumPresent = true;
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueIntPresent =
-                            pE2_ActionParameter_Item->actionParameter_Value.choice.valueEnum;
-                        }
-                        else if (pE2_ActionParameter_Item->actionParameter_Value.present == E2_ActionParameter_Value_PR_valueBool) {
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBoolPresent = true;
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBool =
-                            pE2_ActionParameter_Item->actionParameter_Value.choice.valueBool;
-                        }
-                        else if (pE2_ActionParameter_Item->actionParameter_Value.present == E2_ActionParameter_Value_PR_valueBitS) {
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBitSPresent = true;
-                            addBitString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueBitS,
-                                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueBitS.size,
-                                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueBitS.buf,
-                                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueBitS.bits_unused);
-                        }
-                        else if (pE2_ActionParameter_Item->actionParameter_Value.present == E2_ActionParameter_Value_PR_valueOctS) {
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueOctSPresent = true;
-                            addOctetString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valueOctS,
-                                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueOctS.size,
-                                        pE2_ActionParameter_Item->actionParameter_Value.choice.valueOctS.buf);
-                        }
-                        else if (pE2_ActionParameter_Item->actionParameter_Value.present == E2_ActionParameter_Value_PR_valuePrtS) {
-                            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valuePrtSPresent = true;
-                            addOctetString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterItem[index].actionParameterValue.valuePrtS,
-                                        pE2_ActionParameter_Item->actionParameter_Value.choice.valuePrtS.size,
-                                        pE2_ActionParameter_Item->actionParameter_Value.choice.valuePrtS.buf);
-                        }
-                        else {
-                            ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-                            return e2err_RICSubscriptionRequestActionParameterItemFail;
-                        }
-                    }
-                    index++;
-                }
-            }
-            pRICActionDefinitionChoice->actionDefinitionX2Format1->actionParameterCount = index;
-        }
-        else if (pE2_E2SM_gNB_X2_ActionDefinitionChoice->present == E2_E2SM_gNB_X2_ActionDefinitionChoice_PR_actionDefinition_Format2) {
-
-            // E2SM-gNB-X2-ActionDefinition-Format2
-            uint64_t status;
-            if ((status = allocActionDefinitionX2Format2(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format2)) != e2err_OK)
-                return status;
-
-            pRICActionDefinitionChoice->actionDefinitionX2Format2Present = true;
-            pRICActionDefinitionChoice->actionDefinitionX2Format1Present = false;
-            pRICActionDefinitionChoice->actionDefinitionNRTFormat1Present = false;
-            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupCount = 0;
-            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem->ranUEgroupDefinition.ranUeGroupDefCount = 0;
-            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem->ranPolicy.ranParameterCount = 0;
-
-            E2_E2SM_gNB_X2_ActionDefinition_Format2_t* pE2SM_gNB_X2_actionDefinition = &pE2_E2SM_gNB_X2_ActionDefinitionChoice->choice.actionDefinition_Format2;
-            if(pE2SM_gNB_X2_actionDefinition) {
-                uint64_t index = 0;
-                if (pE2SM_gNB_X2_actionDefinition->ranUEgroup_List) {
-                    while (index < pE2SM_gNB_X2_actionDefinition->ranUEgroup_List->list.count) {
-                        E2_RANueGroup_Item_t* pE2_RANueGroup_Item = pE2SM_gNB_X2_actionDefinition->ranUEgroup_List->list.array[index];
-                        if (pE2_RANueGroup_Item) {
-                            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupID = pE2_RANueGroup_Item->ranUEgroupID;
-                            uint64_t index2 = 0;
-                            while (index2 < pE2_RANueGroup_Item->ranUEgroupDefinition.ranUEgroupDef_List->list.count) {
-                                E2_RANueGroupDef_Item_t* pE2_RANueGroupDef_Item = pE2_RANueGroup_Item->ranUEgroupDefinition.ranUEgroupDef_List->list.array[index2];
-                                if(pE2_RANueGroupDef_Item) {
-                                    pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterID = pE2_RANueGroupDef_Item->ranParameter_ID;
-                                    pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterTest = pE2_RANueGroupDef_Item->ranParameter_Test;
-                                    if (pE2_RANueGroupDef_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueInt) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueIntPresent = true;
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueInt =
-                                          pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueInt;
-                                    }
-                                    else if (pE2_RANueGroupDef_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueEnum) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueEnum = true;
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueEnum =
-                                          pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueEnum;
-                                    }
-                                    else if (pE2_RANueGroupDef_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueBool) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBoolPresent = true;
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBool =
-                                          pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBool;
-                                    }
-                                    else if (pE2_RANueGroupDef_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueBitS) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBitSPresent = true;
-                                        addBitString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueBitS,
-                                                     pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBitS.size,
-                                                     pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBitS.buf,
-                                                     pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueBitS.bits_unused);
-                                    }
-                                    else if (pE2_RANueGroupDef_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueOctS) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueOctSPresent = true;
-                                        addOctetString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valueOctS,
-                                                     pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueOctS.size,
-                                                     pE2_RANueGroupDef_Item->ranParameter_Value.choice.valueOctS.buf);
-                                    }
-                                    else if (pE2_RANueGroupDef_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valuePrtS) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valuePrtSPresent = true;
-                                        addOctetString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefItem[index2].ranParameterValue.valuePrtS,
-                                                     pE2_RANueGroupDef_Item->ranParameter_Value.choice.valuePrtS.size,
-                                                     pE2_RANueGroupDef_Item->ranParameter_Value.choice.valuePrtS.buf);
-                                    }
-                                    else {
-                                        ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-                                        return e2err_RICSubscriptionRequestRanranUeGroupDefItemParameterValueEmptyFail;
-                                    }
-                                }
-                                else {
-                                    ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-                                    return e2err_RICSubscriptionRequestAllocE2_RANueGroupDef_ItemFail;
-                                }
-                                index2++;
-                            }
-                            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranUEgroupDefinition.ranUeGroupDefCount = index2;
-
-                            uint64_t index3 = 0;
-                            while (index3 < pE2_RANueGroup_Item->ranPolicy.ranImperativePolicy_List->list.count) {
-                                E2_RANParameter_Item_t* pE2_RANParameter_Item = pE2_RANueGroup_Item->ranPolicy.ranImperativePolicy_List->list.array[index3];
-                                if (pE2_RANParameter_Item) {
-                                    pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterID = pE2_RANParameter_Item->ranParameter_ID;
-                                    if (pE2_RANParameter_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueInt) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueIntPresent = true;
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueInt =
-                                          pE2_RANParameter_Item->ranParameter_Value.choice.valueInt;
-                                    }
-                                    else if (pE2_RANParameter_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueEnum) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnum = true;
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnum =
-                                          pE2_RANParameter_Item->ranParameter_Value.choice.valueEnum;
-                                    }
-                                    else if (pE2_RANParameter_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueBool) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBoolPresent = true;
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBool =
-                                          pE2_RANParameter_Item->ranParameter_Value.choice.valueBool;
-                                    }
-                                    else if (pE2_RANParameter_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueBitS) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitSPresent = true;
-                                        addBitString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS,
-                                                     pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.size,
-                                                     pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.buf,
-                                                     pE2_RANParameter_Item->ranParameter_Value.choice.valueBitS.bits_unused);
-                                    }
-                                    else if (pE2_RANParameter_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valueOctS) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctSPresent = true;
-                                        addOctetString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS,
-                                                     pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.size,
-                                                     pE2_RANParameter_Item->ranParameter_Value.choice.valueOctS.buf);
-                                    }
-                                    else if (pE2_RANParameter_Item->ranParameter_Value.present == E2_RANParameter_Value_PR_valuePrtS) {
-                                        pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtSPresent = true;
-                                        addOctetString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS,
-                                                     pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.size,
-                                                     pE2_RANParameter_Item->ranParameter_Value.choice.valuePrtS.buf);
-                                    }
-                                    else {
-                                        ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-                                        return e2err_RICSubscriptionRequestRanParameterItemRanParameterValueEmptyFail;
-                                    }
-                                }
-                                else {
-                                    ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-                                    return e2err_RICSubscriptionRequestAllocActionDefinitionFail;
-                                }
-                                index3++;
-                            }
-                            pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupItem[index].ranPolicy.ranParameterCount = index3;
-                        }
-                        else {
-                            ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-                            return e2err_RICSubscriptionRequestAllocRANParameter_ItemFail;
-                        }
-                        index++;
-                    }
-               }
-               pRICActionDefinitionChoice->actionDefinitionX2Format2->ranUeGroupCount = index;
-            }
-        }
-        ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice, pE2_E2SM_gNB_X2_ActionDefinitionChoice);
-        return e2err_OK;
-    case RC_WMORE:
-        if (debug)
-            printf("Decode failed. More data needed. Buffer size %zu, %s, consumed %zu\n",pRICActionDefinitionChoice->octetString.contentLength,
-                   asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice.name, rval.consumed);
-
-        return e2err_RICActionDefinitionChoiceWMOREFail;
-    case RC_FAIL:
-        if (debug)
-            printf("Decode failed. Buffer size %zu, %s, consumed %zu\n",pRICActionDefinitionChoice->octetString.contentLength,
-                   asn_DEF_E2_E2SM_gNB_X2_ActionDefinitionChoice.name, rval.consumed);
-
-        return e2err_RICActionDefinitionChoiceDecodeFAIL;
-    default:
-        return e2err_RICActionDefinitionChoiceDecodeDefaultFail;
-    }
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t getRICActionDefinitionDataNRTFormat(mem_track_hdr_t* pDynMemHead, RICActionDefinitionChoice_t* pRICActionDefinitionChoice) {
-
-    E2_E2SM_gNB_NRT_ActionDefinition_t* pE2_E2SM_gNB_NRT_ActionDefinition = 0;
-    asn_dec_rval_t rval;
-    rval = asn_decode(0, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition, (void **)&pE2_E2SM_gNB_NRT_ActionDefinition,
-                      pRICActionDefinitionChoice->octetString.data, pRICActionDefinitionChoice->octetString.contentLength);
-    switch(rval.code) {
-    case RC_OK:
-        // Debug print
-        if (debug) {
-            printf("Successfully decoded E2SM_gNB_NRT_ActionDefinition\n");
-            asn_fprint(stdout, &asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition, pE2_E2SM_gNB_NRT_ActionDefinition);
-        }
-
-        // ActionDefinitionChoice
-        if (pE2_E2SM_gNB_NRT_ActionDefinition->present == E2_E2SM_gNB_NRT_ActionDefinition_PR_actionDefinition_Format1) {
-
-            // E2SM-gNB-NRT-actionDefinition
-            uint64_t status;
-            if ((status = allocActionDefinitionNRTFormat1(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionNRTFormat1)) != e2err_OK)
-                return status;
-
-            pRICActionDefinitionChoice->actionDefinitionNRTFormat1Present = true;
-            pRICActionDefinitionChoice->actionDefinitionX2Format1Present = false;
-            pRICActionDefinitionChoice->actionDefinitionX2Format2Present = false;
-            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterCount = 0;
-            if (pE2_E2SM_gNB_NRT_ActionDefinition->choice.actionDefinition_Format1.ranParameter_List) {            
-                uint64_t index = 0;
-                while (index < pE2_E2SM_gNB_NRT_ActionDefinition->choice.actionDefinition_Format1.ranParameter_List->list.count) {
-                    E2_RANparameter_Item_t* pE2_RANparameter_Item = pE2_E2SM_gNB_NRT_ActionDefinition->choice.actionDefinition_Format1.ranParameter_List->list.array[index];
-                    if (pE2_RANparameter_Item) {
-                        pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterID = pE2_RANparameter_Item->ranParameter_ID;
-
-                        if (pE2_RANparameter_Item->ranParameter_Value.present == E2_RANparameter_Value_PR_valueInt) {
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueIntPresent = true;
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueInt =
-                            pE2_RANparameter_Item->ranParameter_Value.choice.valueInt;
-                        }
-                        else if (pE2_RANparameter_Item->ranParameter_Value.present == E2_RANparameter_Value_PR_valueEnum) {
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueEnumPresent = true;
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueEnum =
-                            pE2_RANparameter_Item->ranParameter_Value.choice.valueEnum;
-                        }
-                        else if (pE2_RANparameter_Item->ranParameter_Value.present == E2_RANparameter_Value_PR_valueBool) {
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBoolPresent = true;
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBool =
-                            pE2_RANparameter_Item->ranParameter_Value.choice.valueBool;
-                        }
-                        else if (pE2_RANparameter_Item->ranParameter_Value.present == E2_RANparameter_Value_PR_valueBitS) {
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBitSPresent = true;
-                            addBitString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueBitS,
-                                        pE2_RANparameter_Item->ranParameter_Value.choice.valueBitS.size,
-                                        pE2_RANparameter_Item->ranParameter_Value.choice.valueBitS.buf,
-                                        pE2_RANparameter_Item->ranParameter_Value.choice.valueBitS.bits_unused);
-                        }
-                        else if (pE2_RANparameter_Item->ranParameter_Value.present == E2_RANparameter_Value_PR_valueOctS) {
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueOctSPresent = true;
-                            addOctetString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valueOctS,
-                                        pE2_RANparameter_Item->ranParameter_Value.choice.valueOctS.size,
-                                        pE2_RANparameter_Item->ranParameter_Value.choice.valueOctS.buf);
-                        }
-                        else if (pE2_RANparameter_Item->ranParameter_Value.present == E2_RANparameter_Value_PR_valuePrtS) {
-                            pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valuePrtSPresent = true;
-                            addOctetString(pDynMemHead, &pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterList[index].ranParameterValue.valuePrtS,
-                                        pE2_RANparameter_Item->ranParameter_Value.choice.valuePrtS.size,
-                                        pE2_RANparameter_Item->ranParameter_Value.choice.valuePrtS.buf);
-                        }
-                        else {
-                            ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition, pE2_E2SM_gNB_NRT_ActionDefinition);
-                            return e2err_RICSubscriptionRequestNRTRanParameterItemRanParameterValueEmptyFail;
-                        }
-                    }
-                    else {
-                        ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition, pE2_E2SM_gNB_NRT_ActionDefinition);
-                        return e2err_RICSubscriptionRequestNRTAllocActionDefinitionFail;
-                    }
-                    index++;
-                }
-                pRICActionDefinitionChoice->actionDefinitionNRTFormat1->ranParameterCount = index;
-            }
-        }
-        ASN_STRUCT_FREE(asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition, pE2_E2SM_gNB_NRT_ActionDefinition);
-        return e2err_OK;
-    case RC_WMORE:
-        if (debug)
-            printf("Decode failed. More data needed. Buffer size %zu, %s, consumed %zu\n",pRICActionDefinitionChoice->octetString.contentLength,
-                   asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition.name, rval.consumed);
-
-        return e2err_RICNRTActionDefinitionChoiceWMOREFail;
-    case RC_FAIL:
-        if (debug)
-            printf("Decode failed. Buffer size %zu, %s, consumed %zu\n",pRICActionDefinitionChoice->octetString.contentLength,
-                   asn_DEF_E2_E2SM_gNB_NRT_ActionDefinition.name, rval.consumed);
-
-        return e2err_RICNRTActionDefinitionChoiceDecodeFAIL;
-    default:
-        return e2err_RICNRTActionDefinitionChoiceDecodeDefaultFail;
-    }
-}
-//////////////////////////////////////////////////////////////////////
 uint64_t getRICSubscriptionResponseData(e2ap_pdu_ptr_t* pE2AP_PDU_pointer, RICSubscriptionResponse_t* pRICSubscriptionResponse) {
 
     E2AP_PDU_t* pE2AP_PDU = (E2AP_PDU_t*)pE2AP_PDU_pointer;
@@ -2435,91 +1185,3 @@
     return e2err_OK;
 }
 
-//////////////////////////////////////////////////////////////////////
-uint64_t allocActionDefinitionX2Format1(mem_track_hdr_t* pDynMemHead, E2SMgNBX2actionDefinition_t** pActionDefinition) {
-    *pActionDefinition = mem_track_alloc(pDynMemHead, sizeof(E2SMgNBX2actionDefinition_t));
-    if(*pActionDefinition)
-        return e2err_OK;
-    else
-        return e2err_RICSubscriptionRequestAllocactionDefinitionX2Format1Fail;
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t allocActionDefinitionX2Format2(mem_track_hdr_t* pDynMemHead, E2SMgNBX2ActionDefinitionFormat2_t** pActionDefinition) {
-    *pActionDefinition = mem_track_alloc(pDynMemHead, sizeof(E2SMgNBX2ActionDefinitionFormat2_t));
-    if(*pActionDefinition)
-        return e2err_OK;
-    else
-        return e2err_RICSubscriptionRequestAllocactionDefinitionX2Format2Fail;
-}
-
-//////////////////////////////////////////////////////////////////////
-uint64_t allocActionDefinitionNRTFormat1(mem_track_hdr_t* pDynMemHead, E2SMgNBNRTActionDefinitionFormat1_t** pActionDefinition) {
-    *pActionDefinition = mem_track_alloc(pDynMemHead, sizeof(E2SMgNBNRTActionDefinitionFormat1_t));
-    if(*pActionDefinition)
-        return e2err_OK;
-    else
-        return e2err_RICSubscriptionRequestAllocactionDefinitionNRTFormat1Fail;
-}
-
-//////////////////////////////////////////////////////////////////////
-bool addOctetString(mem_track_hdr_t* pDynMemHead, DynOctetString_t* pOctetString, uint64_t bufferSize, void* pData)
-{
-    pOctetString->data = mem_track_alloc(pDynMemHead, bufferSize);
-    if (pOctetString->data) {
-        pOctetString->length = bufferSize;
-        memcpy(pOctetString->data,pData,bufferSize);
-        return true;
-    }
-    else
-        return false;
-}
-
-//////////////////////////////////////////////////////////////////////
-bool addBitString(mem_track_hdr_t* pDynMemHead, DynBitString_t* pBitString, uint64_t bufferSize, void* pData, uint8_t unusedBits)
-{
-    pBitString->data = mem_track_alloc(pDynMemHead, bufferSize);
-    if (pBitString->data) {
-        pBitString->byteLength = bufferSize;
-        pBitString->unusedBits = unusedBits; // Unused trailing bits in the last octet (0..7)
-        memcpy(pBitString->data,pData,bufferSize);
-        return true;
-    }
-    else
-        return false;
-}
-
-//////////////////////////////////////////////////////////////////////
-void mem_track_init(mem_track_hdr_t *curr)
-{
-    *curr=(mem_track_hdr_t)MEM_TRACK_HDR_INIT;
-}
-
-//////////////////////////////////////////////////////////////////////
-void* mem_track_alloc(mem_track_hdr_t *curr, size_t sz)
-{
-    mem_track_t *newentry = (mem_track_t *)malloc(sizeof(mem_track_t)+sz);
-    newentry->next=0;
-    newentry->sz=sz;
-    memset(newentry->ptr,0,newentry->sz);
-
-    if (!curr->next) {
-        curr->next = newentry;
-    } else {
-        mem_track_t *iter=curr->next;
-        for(;iter->next;iter=iter->next);
-        iter->next = newentry;
-    }
-    return newentry->ptr;
-}
-
-//////////////////////////////////////////////////////////////////////
-void mem_track_free(mem_track_hdr_t *curr)
-{
-    mem_track_t *itecurr,*itenext;
-    for(itecurr=curr->next; itecurr; itecurr=itenext){
-        itenext = itecurr->next;
-        free(itecurr);
-    }
-    mem_track_init(curr);
-}
diff --git a/e2ap/libe2ap_wrapper/E2AP_if.h b/e2ap/libe2ap_wrapper/E2AP_if.h
index 2ccea5b..aab8aaa 100644
--- a/e2ap/libe2ap_wrapper/E2AP_if.h
+++ b/e2ap/libe2ap_wrapper/E2AP_if.h
@@ -27,8 +27,6 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <ProcedureCode.h>
-#include <PrintableString.h>
-#include "memtrack.h"
 
 #ifdef	__cplusplus
 extern "C" {
@@ -77,93 +75,6 @@
      RICActionType_policy
 };
 
-typedef uint64_t StyleID_t;
-
-typedef uint32_t ParameterID_t;  // 0..255 (maxofActionParameters)
-
-typedef struct { // CHOICE. Only one value can be present
-    bool valueIntPresent;
-	int64_t valueInt;
-	bool valueEnumPresent;
-	int64_t valueEnum;
-    bool valueBoolPresent;
-	bool valueBool;
-    bool valueBitSPresent;
-	DynBitString_t valueBitS;
-    bool valueOctSPresent;
-	DynOctetString_t valueOctS;
-	bool valuePrtSPresent;
-	DynOctetString_t valuePrtS;
-} ActionParameterValue_t;
-
-typedef struct {
-    ParameterID_t parameterID;
-    ActionParameterValue_t actionParameterValue;
-} ActionParameterItem_t;
-
-typedef struct {
-    StyleID_t styleID;
-    uint8_t actionParameterCount;
-    ActionParameterItem_t actionParameterItem[255]; // OPTIONAL. 1..255 (maxofRANParameters)
-} E2SMgNBX2actionDefinition_t;
-
-enum RANParameterTest_t {
-	RANParameterTest_equal,
-	RANParameterTest_greaterthan,
-	RANParameterTest_lessthan,
-	RANParameterTest_contains,
-	RANParameterTest_present
-};
-
-typedef struct {
-    bool valueIntPresent;
-	int64_t valueInt;
-	bool valueEnumPresent;
-	int64_t valueEnum;
-    bool valueBoolPresent;
-	bool valueBool;
-    bool valueBitSPresent;
-	DynBitString_t valueBitS;
-    bool valueOctSPresent;
-	DynOctetString_t valueOctS;
-	bool valuePrtSPresent;
-	DynOctetString_t valuePrtS;
-} RANParameterValue_t;
-
-typedef int64_t RANueGroupID_t; // INTEGER
-typedef uint32_t RANParameterID_t; // 0..255 (maxofRANParameters)
-
-typedef struct {
-	RANParameterID_t ranParameterID;
-	RANParameterValue_t ranParameterValue;
-} RANParameterItem_t;
-
-typedef struct {
-	RANParameterID_t ranParameterID;
-	uint8_t ranParameterTest;               // This is type of enum RANParameterTest_t
-	RANParameterValue_t ranParameterValue;
-} RANueGroupDefItem_t;
-
-typedef struct {
-    uint8_t ranUeGroupDefCount;
-	RANueGroupDefItem_t ranUeGroupDefItem[255]; //OPTIONAL. 1..255 (maxofRANParameters)
-} RANueGroupDefinition_t;
-
-typedef struct {
-    uint8_t ranParameterCount;
-	RANParameterItem_t ranParameterItem[255]; //OPTIONAL. 1..255 (maxofRANParameters)
-} RANimperativePolicy_t;
-
-typedef struct {
-    RANueGroupID_t ranUEgroupID;
-	RANueGroupDefinition_t ranUEgroupDefinition;
-	RANimperativePolicy_t ranPolicy;
-} RANueGroupItem_t;
-
-typedef struct {
-    uint8_t ranUeGroupCount;
-    RANueGroupItem_t ranUeGroupItem[15]; // OPTIONAL. 1..15 (maxofUEgroup)
-} E2SMgNBX2ActionDefinitionFormat2_t;
 
 enum RICSubsequentActionType_t {
 	RICSubsequentActionType_Continue,
@@ -171,19 +82,7 @@
 };
 
 typedef struct {
-    uint8_t ranParameterCount;
-	RANParameterItem_t ranParameterList[255];	// OPTIONAL. 1..255 (maxofRANParameters)
-} E2SMgNBNRTActionDefinitionFormat1_t;
-
-typedef struct {
     OctetString_t octetString;   // This element is E2AP spec format
-    // CHOICE. Only one value can be present
-    bool actionDefinitionX2Format1Present;
-	E2SMgNBX2actionDefinition_t* actionDefinitionX2Format1; // This element is E2SM-gNB-X2 format
-	bool actionDefinitionX2Format2Present;
-	E2SMgNBX2ActionDefinitionFormat2_t* actionDefinitionX2Format2; // This element is E2SM-gNB-X2 format
-	bool actionDefinitionNRTFormat1Present;
-    E2SMgNBNRTActionDefinitionFormat1_t* actionDefinitionNRTFormat1; // This element is E2SM-gNB-NRT format
 } RICActionDefinitionChoice_t;
 
 enum RICTimeToWait_t {
@@ -263,81 +162,11 @@
 
 typedef uint8_t ProcedureCode__t;
 
-enum TypeOfMessage_t {
-    TypeOfMessage_nothing,
-    TypeOfMessage_InitiatingMessage,
-    TypeOfMessage_SuccessfulOutcome,
-    TypeOfMessage_UnsuccessfulOutcome
-};
-
-typedef struct  {
-	ProcedureCode__t procedureCode;
-	uint8_t typeOfMessage;  // This is type of enum TypeOfMessage_t
-} InterfaceMessageType_t;
-
-typedef uint32_t InterfaceProtocolIEID_t;
-
-enum InterfaceProtocolIETest_t {
-	ProtocolIEtestCondition_equal,
-	ProtocolIEtestCondition_greaterthan,
-	ProtocolIEtestCondition_lessthan,
-	ProtocolIEtestCondition_contains,
-	ProtocolIEtestCondition_present
-};
-
-typedef struct {   // CHOICE. Only one value can be present
-    bool valueIntPresent;
-	int64_t valueInt;
-	bool valueEnumPresent;
-	int64_t valueEnum;
-    bool valueBoolPresent;
-	bool valueBool;
-    bool valueBitStringPresent;
-	DynBitString_t valueBitString;
-    bool octetstringPresent;
-	DynOctetString_t octetString;
-} InterfaceProtocolIEValue_t;
-
-typedef struct {
-    InterfaceProtocolIEID_t interfaceProtocolIEID;
-    uint8_t interfaceProtocolIETest;                        // This is type of enum InterfaceProtocolIETest_t
-    InterfaceProtocolIEValue_t  interfaceProtocolIEValue;
-} InterfacProtocolIE_t;
 
 static const uint64_t cMaxofProtocolIE = 15;
 
 typedef struct {
-    InterfacProtocolIE_t InterfacProtocolIE[15]; // Table size is const cMaxofProtocolIE
-} InterfaceProtocolIEList_t;
-
-typedef struct {
-    InterfaceID_t interfaceID;
-    uint8_t interfaceDirection;  // This is type of enum InterfaceDirection_t
-    InterfaceMessageType_t interfaceMessageType;
-    bool interfaceProtocolIEListPresent;
-    InterfaceProtocolIEList_t interfaceProtocolIEList;  // OPTIONAL. Not used in RIC currently
-} E2SMgNBX2eventTriggerDefinition_t;
-
-enum NRTTriggerNature_t {
-    NRTTriggerNature_t_now,
-    NRTTriggerNature_t_onchange
-};
-
-typedef struct {
-	uint8_t triggerNature;  // This is type of enum NRTTriggerNature_t
-} E2SMgNBNRTEventTriggerDefinitionFormat1_t;
-
-typedef struct {
-    E2SMgNBNRTEventTriggerDefinitionFormat1_t eventDefinitionFormat1;
-} E2SMgNBNRTEventTriggerDefinition_t;
-
-typedef struct {
     OctetString_t octetString;   // This element is E2AP spec format
-    // CHOICE. Only one value can be present.
-    bool E2SMgNBX2EventTriggerDefinitionPresent;
-    E2SMgNBX2eventTriggerDefinition_t e2SMgNBX2eventTriggerDefinition;  // This element is E2SM-gNB-X2 spec format
-    bool E2SMgNBNRTEventTriggerDefinitionPresent;
-    E2SMgNBNRTEventTriggerDefinition_t e2SMgNBNRTEventTriggerDefinition; // This element is E2SM-gNB-NRT spec format
 } RICEventTriggerDefinition_t;
 
 typedef struct {
@@ -424,78 +253,12 @@
     e2err_RICSubscriptionRequestAllocRANfunctionIDFail,
     e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail,
     e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail,
-    e2err_RICSubscriptionRequestAllocactionParameterValueValueBitSFail,
-    e2err_RICSubscriptionRequestAllocactionParameterValueValueOctSFail,
-    e2err_RICSubscriptionRequestAllocactionParameterValueValuePrtsSFail,
-    e2err_RICSubscriptionRequestAllocactionRanParameterValueValueBitSFail,
-    e2err_RICSubscriptionRequestAllocactionRanParameterValueValueOctSFail,
-    e2err_RICSubscriptionRequestAllocactionRanParameterValueValuePrtsSFail,
-    e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValueBitSFail,
-    e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValueOctSFail,
-    e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValuePrtsSFail,
-    e2err_RICSubscriptionRequestAllocactionDefinitionX2Format1Fail,
-    e2err_RICSubscriptionRequestAllocactionDefinitionX2Format2Fail,
-    e2err_RICSubscriptionRequestAllocactionDefinitionNRTFormat1Fail,
     e2err_RICSubscriptionRequestAllocRICactionDefinitionBufFail,
     e2err_RICSubscriptionRequestAllocRICactionDefinitionFail,
-    e2err_RICSubscriptionRequestRICActionDefinitionEmpty,
-    e2err_RICSubscriptionRequestRICActionDefinitionEmptyE2_E2SM_gNB_X2_actionDefinition,
-    e2err_RICSubscriptionRequestRICActionDefinitionEmptyE2_E2SM_gNB_NRT_actionDefinition,
-    e2err_RICSubscriptionRequestActionParameterItemFail,
-    e2err_RICActionDefinitionChoicePackFail_1,
-    e2err_RICActionDefinitionChoicePackFail_2,
-    e2err_RICSubscriptionRequestAllocE2_RANueGroupDef_ItemFail,
-    e2err_RICSubscriptionRequestAllocRANParameter_ItemFail,
-    e2err_RICSubscriptionRequestRanranUeGroupDefItemParameterValueEmptyFail,
-    e2err_RICSubscriptionRequestRanParameterItemRanParameterValueEmptyFail,
-    e2err_RICSubscriptionRequestAllocActionDefinitionFail,
-    e2err_RICSubscriptionRequestAllocNRTRANParameter_ItemFail,
-    e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValueBitSFail,
-    e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValueOctSFail,
-    e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValuePrtsSFail,
-    e2err_RICSubscriptionRequestRanParameterItemNRTRanParameterValueEmptyFail,
-    e2err_RICSubscriptionRequestAsn_set_addE2_ActionParameter_ItemFail,
-    e2err_RICSubscriptionRequestAsn_set_addRANueGroupDef_ItemFail,
-    e2err_RICSubscriptionRequestAsn_set_addE2_RANParameter_ItemFail,
-    e2err_RICSubscriptionRequestAsn_set_addE2_NRTRANParameter_ItemFail,
-    e2err_RICActionDefinitionChoiceWMOREFail,
-    e2err_RICActionDefinitionChoiceDecodeFAIL,
-    e2err_RICActionDefinitionChoiceDecodeDefaultFail,
-    e2err_RICNRTActionDefinitionChoiceWMOREFail,
-    e2err_RICNRTActionDefinitionChoiceDecodeFAIL,
-    e2err_RICNRTActionDefinitionChoiceDecodeDefaultFail,
-    e2err_RICActionDefinitionChoiceEmptyFAIL,
-    e2err_RICNRTEventTriggerDefinitionDecodeWMOREFail,
-    e2err_RICNRTEventTriggerDefinitionDecodeFAIL,
-    e2err_RICNRTEventTriggerDefinitionDecodeDefaultFail,
-    e2err_RICEventTriggerDefinitionEmptyDecodeDefaultFail,
-    e2err_RICSubscriptionRequestAllocE2_E2SM_gNB_X2_ActionDefinitionChoiceFail,
-    e2err_RICSubscriptionRequestAllocE2_E2SM_gNB_NRT_ActionDefinitionFormat1Fail,
-    e2err_RICSubscriptionRequestNRTRanParameterItemRanParameterValueEmptyFail,
-    e2err_RICSubscriptionRequestNRTAllocActionDefinitionFail,
-    e2err_RICSubscriptionRequestAllocE2_E2SM_gNB_NRT_ActionDefinitionFail,
     e2err_RICSubscriptionRequestAllocRICsubsequentActionFail,
     e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail,
     e2err_RICSubscriptionRequestEncodeFail,
     e2err_RICSubscriptionRequestAllocE2AP_PDUFail,
-    e2err_RICEventTriggerDefinitionIEValueFail_1,
-    e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDpLMN_IdentityBufFail,
-    e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail,
-    e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDhome_eNB_IDBufFail,
-    e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail,
-    e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail,
-    e2err_RICEventTriggerDefinitionIEValueFail_2,
-    e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDpLMN_IdentityBufFail,
-    e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDgNB_IDBufFail,
-    e2err_RICEventTriggerDefinitionIEValueFail_3,
-    e2err_RICEventTriggerDefinitionIEValueFail_4,
-    e2err_RICEventTriggerDefinitionPackFail_1,
-    e2err_RICEventTriggerDefinitionPackFail_2,
-    e2err_RICENRTventTriggerDefinitionPackFail_1,
-    e2err_RICNRTEventTriggerDefinitionPackFail_2,
-    e2err_RICEventTriggerDefinitionAllocE2SM_gNB_X2_eventTriggerDefinitionFail,
-    e2err_RICEventTriggerDefinitionAllocE2SM_gNB_NRT_eventTriggerDefinitionFail,
-    e2err_RICEventTriggerDefinitionAllocEventTriggerDefinitionEmptyFail,
     e2err_RICSubscriptionResponseAllocRICrequestIDFail,
     e2err_RICSubscriptionResponseAllocRANfunctionIDFail,
     e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail,
@@ -509,7 +272,6 @@
     e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail,
     e2err_RICSubscriptionFailureEncodeFail,
     e2err_RICSubscriptionFailureAllocE2AP_PDUFail,
-    e2err_E2SM_gNB_X2_indicationMessageAllocE2AP_PDUFail,
     e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail,
     e2err_RICSubscriptionDeleteRequestAllocRANfunctionIDFail,
     e2err_RICSubscriptionDeleteRequestEncodeFail,
@@ -526,22 +288,12 @@
     e2err_RICsubscriptionRequestRICrequestIDMissing,
     e2err_RICsubscriptionRequestRANfunctionIDMissing,
     e2err_RICsubscriptionRequestICsubscriptionMissing,
-    e2err_RICEventTriggerDefinitionIEValueFail_5,
-    e2err_RICEventTriggerDefinitionIEValueFail_6,
-    e2err_RICEventTriggerDefinitionIEValueFail_7,
-    e2err_RICEventTriggerDefinitionIEValueFail_8,
-    e2err_RICEventTriggerDefinitionDecodeWMOREFail,
-    e2err_RICEventTriggerDefinitionDecodeFAIL,
-    e2err_RICEventTriggerDefinitionDecodeDefaultFail,
     e2err_RICsubscriptionResponseRICrequestIDMissing,
     e2err_RICsubscriptionResponseRANfunctionIDMissing,
     e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing,
     e2err_RICsubscriptionFailureRICrequestIDMissing,
     e2err_RICsubscriptionFailureRANfunctionIDMissing,
     e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing,
-    e2err_RICEventTriggerDefinitionIEValueFail_9,
-    e2err_RICEventTriggerDefinitionIEValueFail_10,
-    e2err_RICEventTriggerDefinitionIEValueFail_11,
     e2err_RICsubscriptionDeleteRequestRICrequestIDMissing,
     e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing,
     e2err_RICsubscriptionDeleteResponseRICrequestIDMissing,
@@ -557,78 +309,12 @@
     "e2err_RICSubscriptionRequestAllocRANfunctionIDFail",
     "e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail",
     "e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail",
-    "e2err_RICSubscriptionRequestAllocactionParameterValueValueBitSFail",
-    "e2err_RICSubscriptionRequestAllocactionParameterValueValueOctSFail",
-    "e2err_RICSubscriptionRequestAllocactionParameterValueValuePrtsSFail",
-    "e2err_RICSubscriptionRequestAllocactionRanParameterValueValueBitSFail",
-    "e2err_RICSubscriptionRequestAllocactionRanParameterValueValueOctSFail",
-    "e2err_RICSubscriptionRequestAllocactionRanParameterValueValuePrtsSFail",
-    "e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValueBitSFail",
-    "e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValueOctSFail",
-    "e2err_RICSubscriptionRequestAllocactionRanParameterValue2ValuePrtsSFail",
-    "e2err_RICSubscriptionRequestAllocactionDefinitionX2Format1Fail",
-    "e2err_RICSubscriptionRequestAllocactionDefinitionX2Format2Fail",
-    "e2err_RICSubscriptionRequestAllocactionDefinitionNRTFormat1Fail",
     "e2err_RICSubscriptionRequestAllocRICactionDefinitionBufFail",
     "e2err_RICSubscriptionRequestAllocRICactionDefinitionFail",
-    "e2err_RICSubscriptionRequestRICActionDefinitionEmpty",
-    "e2err_RICSubscriptionRequestRICActionDefinitionEmptyE2_E2SM_gNB_X2_actionDefinition",
-    "e2err_RICSubscriptionRequestRICActionDefinitionEmptyE2_E2SM_gNB_NRT_actionDefinition",
-    "e2err_RICSubscriptionRequestActionParameterItemFail",
-    "e2err_RICActionDefinitionChoicePackFail_1",
-    "e2err_RICActionDefinitionChoicePackFail_2",
-    "e2err_RICSubscriptionRequestAllocE2_RANueGroupDef_ItemFail",
-    "e2err_RICSubscriptionRequestAllocRANParameter_ItemFail",
-    "e2err_RICSubscriptionRequestRanranUeGroupDefItemParameterValueEmptyFail",
-    "e2err_RICSubscriptionRequestRanParameterItemRanParameterValueEmptyFail",
-    "e2err_RICSubscriptionRequestAllocActionDefinitionFail",
-    "e2err_RICSubscriptionRequestAllocNRTRANParameter_ItemFail",
-    "e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValueBitSFail",
-    "e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValueOctSFail",
-    "e2err_RICSubscriptionRequestAllocactionNRTRanParameterValue2ValuePrtsSFail",
-    "e2err_RICSubscriptionRequestRanParameterItemNRTRanParameterValueEmptyFail",
-    "e2err_RICSubscriptionRequestAsn_set_addE2_ActionParameter_ItemFail",
-    "e2err_RICSubscriptionRequestAsn_set_addRANueGroupDef_ItemFail",
-    "e2err_RICSubscriptionRequestAsn_set_addE2_RANParameter_ItemFail",
-    "e2err_RICSubscriptionRequestAsn_set_addE2_NRTRANParameter_ItemFail",
-    "e2err_RICActionDefinitionChoiceWMOREFail",
-    "e2err_RICActionDefinitionChoiceDecodeFAIL",
-    "e2err_RICActionDefinitionChoiceDecodeDefaultFail",
-    "e2err_RICNRTActionDefinitionChoiceWMOREFail",
-    "e2err_RICNRTActionDefinitionChoiceDecodeFAIL",
-    "e2err_RICNRTActionDefinitionChoiceDecodeDefaultFail",
-    "e2err_RICActionDefinitionChoiceEmptyFAIL",
-    "e2err_RICNRTEventTriggerDefinitionDecodeWMOREFail",
-    "e2err_RICNRTEventTriggerDefinitionDecodeFAIL",
-    "e2err_RICNRTEventTriggerDefinitionDecodeDefaultFail",
-    "e2err_RICEventTriggerDefinitionEmptyDecodeDefaultFail",
-    "e2err_RICSubscriptionRequestAllocE2_E2SM_gNB_X2_ActionDefinitionChoiceFail",
-    "e2err_RICSubscriptionRequestAllocE2_E2SM_gNB_NRT_ActionDefinitionFormat1Fail",
-    "e2err_RICSubscriptionRequestNRTRanParameterItemRanParameterValueEmptyFail",
-    "e2err_RICSubscriptionRequestNRTAllocActionDefinitionFail",
-    "e2err_RICSubscriptionRequestAllocE2_E2SM_gNB_NRT_ActionDefinitionFail",
     "e2err_RICSubscriptionRequestAllocRICsubsequentActionFail",
     "e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail",
     "e2err_RICSubscriptionRequestEncodeFail",
     "e2err_RICSubscriptionRequestAllocE2AP_PDUFail",
-    "e2err_RICEventTriggerDefinitionIEValueFail_1",
-    "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDpLMN_IdentityBufFail",
-    "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail",
-    "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDhome_eNB_IDBufFail",
-    "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail",
-    "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail",
-    "e2err_RICEventTriggerDefinitionIEValueFail_2",
-    "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDpLMN_IdentityBufFail",
-    "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDgNB_IDBufFail",
-    "e2err_RICEventTriggerDefinitionIEValueFail_3",
-    "e2err_RICEventTriggerDefinitionIEValueFail_4",
-    "e2err_RICEventTriggerDefinitionPackFail_1",
-    "e2err_RICEventTriggerDefinitionPackFail_2",
-    "e2err_RICENRTventTriggerDefinitionPackFail_1",
-    "e2err_RICNRTEventTriggerDefinitionPackFail_2",
-    "e2err_RICEventTriggerDefinitionAllocE2SM_gNB_X2_eventTriggerDefinitionFail",
-    "e2err_RICEventTriggerDefinitionAllocE2SM_gNB_NRT_eventTriggerDefinitionFail",
-    "e2err_RICEventTriggerDefinitionAllocEventTriggerDefinitionEmptyFail",
     "e2err_RICSubscriptionResponseAllocRICrequestIDFail",
     "e2err_RICSubscriptionResponseAllocRANfunctionIDFail",
     "e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail",
@@ -642,7 +328,6 @@
     "e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail",
     "e2err_RICSubscriptionFailureEncodeFail",
     "e2err_RICSubscriptionFailureAllocE2AP_PDUFail",
-    "e2err_E2SM_gNB_X2_indicationMessageAllocE2AP_PDUFail",
     "e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail",
     "e2err_RICSubscriptionDeleteRequestAllocRANfunctionIDFail",
     "e2err_RICSubscriptionDeleteRequestEncodeFail",
@@ -659,22 +344,12 @@
     "e2err_RICsubscriptionRequestRICrequestIDMissing",
     "e2err_RICsubscriptionRequestRANfunctionIDMissing",
     "e2err_RICsubscriptionRequestICsubscriptionMissing",
-    "e2err_RICEventTriggerDefinitionIEValueFail_5",
-    "e2err_RICEventTriggerDefinitionIEValueFail_6",
-    "e2err_RICEventTriggerDefinitionIEValueFail_7",
-    "e2err_RICEventTriggerDefinitionIEValueFail_8",
-    "e2err_RICEventTriggerDefinitionDecodeWMOREFail",
-    "e2err_RICEventTriggerDefinitionDecodeFAIL",
-    "e2err_RICEventTriggerDefinitionDecodeDefaultFail",
     "e2err_RICsubscriptionResponseRICrequestIDMissing",
     "e2err_RICsubscriptionResponseRANfunctionIDMissing",
     "e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing",
     "e2err_RICsubscriptionFailureRICrequestIDMissing",
     "e2err_RICsubscriptionFailureRANfunctionIDMissing",
     "e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing",
-    "e2err_RICEventTriggerDefinitionIEValueFail_9",
-    "e2err_RICEventTriggerDefinitionIEValueFail_10",
-    "e2err_RICEventTriggerDefinitionIEValueFail_11",
     "e2err_RICsubscriptionDeleteRequestRICrequestIDMissing",
     "e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing",
     "e2err_RICsubscriptionDeleteResponseRICrequestIDMissing",
@@ -759,12 +434,6 @@
 typedef void* e2ap_pdu_ptr_t;
 
 uint64_t packRICSubscriptionRequest(size_t*, byte*, char*,RICSubscriptionRequest_t*);
-uint64_t packRICEventTriggerDefinition(char*,RICEventTriggerDefinition_t*);
-uint64_t packRICActionDefinition(char*, RICActionDefinitionChoice_t*);
-uint64_t packRICEventTriggerDefinitionX2Format(char* pLogBuffer, RICEventTriggerDefinition_t*);
-uint64_t packRICEventTriggerDefinitionNRTFormat(char* pLogBuffer, RICEventTriggerDefinition_t*);
-uint64_t packActionDefinitionX2Format(char*, RICActionDefinitionChoice_t*);
-uint64_t packActionDefinitionNRTFormat(char*, RICActionDefinitionChoice_t*);
 uint64_t packRICSubscriptionResponse(size_t*, byte*, char*,RICSubscriptionResponse_t*);
 uint64_t packRICSubscriptionFailure(size_t*, byte*, char*,RICSubscriptionFailure_t*);
 uint64_t packRICSubscriptionDeleteRequest(size_t*, byte*, char*,RICSubscriptionDeleteRequest_t*);
@@ -772,29 +441,13 @@
 uint64_t packRICSubscriptionDeleteFailure(size_t*, byte*, char*,RICSubscriptionDeleteFailure_t*);
 
 e2ap_pdu_ptr_t* unpackE2AP_pdu(const size_t, const byte*, char*, E2MessageInfo_t*);
-uint64_t getRICSubscriptionRequestData(mem_track_hdr_t *, e2ap_pdu_ptr_t*, RICSubscriptionRequest_t*);
-uint64_t getRICEventTriggerDefinitionData(RICEventTriggerDefinition_t*);
-uint64_t getRICEventTriggerDefinitionDataX2Format(RICEventTriggerDefinition_t*);
-uint64_t getRICEventTriggerDefinitionDataNRTFormat(RICEventTriggerDefinition_t*);
-uint64_t getRICActionDefinitionData(mem_track_hdr_t *, RICActionDefinitionChoice_t*);
-uint64_t getRICActionDefinitionDataX2Format(mem_track_hdr_t*, RICActionDefinitionChoice_t*);
-uint64_t getRICActionDefinitionDataNRTFormat(mem_track_hdr_t*, RICActionDefinitionChoice_t*);
+uint64_t getRICSubscriptionRequestData(e2ap_pdu_ptr_t*, RICSubscriptionRequest_t*);
 uint64_t getRICSubscriptionResponseData(e2ap_pdu_ptr_t*, RICSubscriptionResponse_t*);
 uint64_t getRICSubscriptionFailureData(e2ap_pdu_ptr_t*, RICSubscriptionFailure_t*);
 uint64_t getRICSubscriptionDeleteRequestData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteRequest_t*);
 uint64_t getRICSubscriptionDeleteResponseData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteResponse_t*);
 uint64_t getRICSubscriptionDeleteFailureData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteFailure_t*);
 
-void* allocDynMem(mem_track_hdr_t*, size_t);
-bool addOctetString(mem_track_hdr_t *, DynOctetString_t*, uint64_t, void*);
-bool addBitString(mem_track_hdr_t *, DynBitString_t*, uint64_t, void*, uint8_t);
-
-uint64_t allocActionDefinitionX2Format1(mem_track_hdr_t*, E2SMgNBX2actionDefinition_t**);
-uint64_t allocActionDefinitionX2Format2(mem_track_hdr_t*, E2SMgNBX2ActionDefinitionFormat2_t**);
-uint64_t allocActionDefinitionNRTFormat1(mem_track_hdr_t*, E2SMgNBNRTActionDefinitionFormat1_t**);
-
-uint64_t allocateOctetStringBuffer(DynOctetString_t*, uint64_t);
-uint64_t allocateBitStringBuffer(mem_track_hdr_t *, DynBitString_t*, uint64_t);
 
 #if DEBUG
 bool TestRICSubscriptionRequest();
diff --git a/e2ap/libe2ap_wrapper/memtrack.h b/e2ap/libe2ap_wrapper/memtrack.h
deleted file mode 100644
index 0ff1126..0000000
--- a/e2ap/libe2ap_wrapper/memtrack.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-==================================================================================
-  Copyright (c) 2019 AT&T Intellectual Property.
-  Copyright (c) 2019 Nokia
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================================
-*/
-
-#ifndef __MEMTRACK_H__
-#define __MEMTRACK_H__
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-	
-/*
- *
- */
-typedef struct mem_track_s{
-    struct mem_track_s *next;
-    size_t  sz;
-    unsigned char ptr[];
-}mem_track_t;
-
-
-/*
- *
- */
-typedef struct mem_track_hdr_s{
-    struct mem_track_s *next;
-}mem_track_hdr_t;
-
-#define MEM_TRACK_HDR_INIT {0}
-
-
-/*
- *
- */
-void mem_track_init(mem_track_hdr_t *curr);
-
-void* mem_track_alloc(mem_track_hdr_t *curr, size_t sz);
-
-void mem_track_free(mem_track_hdr_t *curr);
-
-
-/*
- *
- */
-#define MEM_TRACK_ALLOC(__hdr,__id) (__id*)mem_track_alloc(__hdr,sizeof(__id))
-
-#define MEM_TRACK_ALLOC_LIST(__hdr,__id,__n) (__id**)mem_track_alloc(__hdr,sizeof(__id)*__n)
-
-#define MEM_TRACK_ALLOC_PTR_LIST(__hdr,__id,__n) (__id**)mem_track_alloc(__hdr,sizeof(__id*)*__n)
-
-#define MEM_TRACK_ALLOC_BUFFER(__hdr,__id,__n) (__id*)mem_track_alloc(__hdr,sizeof(__id)*__n)
-
-#define MEM_TRACK_ALLOC_INIT(__val, __hdr,__id,__init) __id* __val=MEM_TRACK_ALLOC(__hdr,__id); *__val=(__id)__init
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/e2ap/pkg/e2ap/e2ap_tests/msg_e2ap_subscription.go b/e2ap/pkg/e2ap/e2ap_tests/msg_e2ap_subscription.go
index fbb92e4..67a5858 100644
--- a/e2ap/pkg/e2ap/e2ap_tests/msg_e2ap_subscription.go
+++ b/e2ap/pkg/e2ap/e2ap_tests/msg_e2ap_subscription.go
@@ -50,6 +50,7 @@
 		return
 	}
 	testCtxt.testPrint("print:\n%s", e2SubsReq.String())
+
 	testCtxt.testValueEquality(t, "msg", areqenc, areqdec)
 	testCtxt.testValueEquality(t, "EventTriggerDefinition", &areqenc.EventTriggerDefinition, &areqdec.EventTriggerDefinition)
 }
@@ -60,41 +61,14 @@
 	areqenc.RequestId.InstanceId = 22
 	areqenc.FunctionId = 33
 
-	areqenc.EventTriggerDefinition.NBX2EventTriggerDefinitionPresent = msgContent.NBX2EventTriggerDefinitionPresent
-	areqenc.EventTriggerDefinition.NBNRTEventTriggerDefinitionPresent = msgContent.NBNRTEventTriggerDefinitionPresent
-
-	if areqenc.EventTriggerDefinition.NBX2EventTriggerDefinitionPresent {
-		//Bits 20, 28(works), 18, 21 (asn1 problems)
-		//		if msgContent.
-		areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.Present = true
-		areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.PlmnIdentity.Set("310150")
-		areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Bits = e2ap.E2AP_ENBIDHomeBits28
-		areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Id = 202251
-		testCtxt.SetDesc("SubsReq-28bit")
-
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.Present = true
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.PlmnIdentity.Set("310150")
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Bits = e2ap.E2AP_ENBIDShortMacroits18
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Id = 55
-		//testCtxt.SetDesc("SubsReq-18bit")
-
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.Present = true
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.PlmnIdentity.Set("310150")
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Bits = e2ap.E2AP_ENBIDMacroPBits20
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Id = 55
-		//testCtxt.SetDesc("SubsReq-20bit")
-
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.Present = true
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.PlmnIdentity.Set("310150")
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Bits = e2ap.E2AP_ENBIDlongMacroBits21
-		//areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Id = 55
-		//testCtxt.SetDesc("SubsReq-21bit")
-
-		areqenc.EventTriggerDefinition.X2EventTriggerDefinition.InterfaceDirection = e2ap.E2AP_InterfaceDirectionIncoming
-		areqenc.EventTriggerDefinition.X2EventTriggerDefinition.ProcedureCode = 35
-		areqenc.EventTriggerDefinition.X2EventTriggerDefinition.TypeOfMessage = e2ap.E2AP_InitiatingMessage
-	} else if areqenc.EventTriggerDefinition.NBNRTEventTriggerDefinitionPresent == true {
-		areqenc.EventTriggerDefinition.NBNRTEventTriggerDefinition.TriggerNature = e2ap.NRTTriggerNature_now
+	if msgContent.NBX2EventTriggerDefinitionPresent {
+		areqenc.EventTriggerDefinition.Data.Length = 1
+		areqenc.EventTriggerDefinition.Data.Data = make([]uint8, areqenc.EventTriggerDefinition.Data.Length)
+		areqenc.EventTriggerDefinition.Data.Data[0] = 1
+	} else if msgContent.NBNRTEventTriggerDefinitionPresent {
+		areqenc.EventTriggerDefinition.Data.Length = 1
+		areqenc.EventTriggerDefinition.Data.Data = make([]uint8, areqenc.EventTriggerDefinition.Data.Length)
+		areqenc.EventTriggerDefinition.Data.Data[0] = 100
 	}
 
 	for index := 0; index < 1; /*16*/ index++ {
@@ -103,155 +77,20 @@
 		item.ActionType = e2ap.E2AP_ActionTypeInsert
 
 		item.RicActionDefinitionPresent = true
-		item.ActionDefinitionChoice.ActionDefinitionX2Format1Present = msgContent.ActionDefinitionX2Format1Present
-		item.ActionDefinitionChoice.ActionDefinitionX2Format2Present = msgContent.ActionDefinitionX2Format2Present
-		item.ActionDefinitionChoice.ActionDefinitionNRTFormat1Present = msgContent.ActionDefinitionNRTFormat1Present
 
 		if item.RicActionDefinitionPresent {
-			if item.ActionDefinitionChoice.ActionDefinitionX2Format1Present {
-				item.ActionDefinitionChoice.ActionDefinitionX2Format1.StyleID = 99
-				// 1..255
-				for index2 := 0; index2 < 1; index2++ {
-					actionParameterItem := e2ap.ActionParameterItem{}
-					actionParameterItem.ParameterID = 11
-					if msgContent.ActionParameterValueIntPresent {
-						actionParameterItem.ActionParameterValue.ValueIntPresent = true
-						actionParameterItem.ActionParameterValue.ValueInt = 100
-					} else if msgContent.ActionParameterValueEnumPresent {
-						actionParameterItem.ActionParameterValue.ValueEnumPresent = true
-						actionParameterItem.ActionParameterValue.ValueEnum = 100
-					} else if msgContent.ActionParameterValueBoolPresent {
-						actionParameterItem.ActionParameterValue.ValueBoolPresent = true
-						actionParameterItem.ActionParameterValue.ValueBool = true
-					} else if msgContent.ActionParameterValueBitSPresent {
-						actionParameterItem.ActionParameterValue.ValueBitSPresent = true
-						actionParameterItem.ActionParameterValue.ValueBitS.UnusedBits = 0
-						actionParameterItem.ActionParameterValue.ValueBitS.Length = 3
-						actionParameterItem.ActionParameterValue.ValueBitS.Data =
-							append(actionParameterItem.ActionParameterValue.ValueBitS.Data, 1, 2, 3)
-					} else if msgContent.ActionParameterValueOctSPresent {
-						actionParameterItem.ActionParameterValue.ValueOctSPresent = true
-						actionParameterItem.ActionParameterValue.ValueOctS.Length = 3
-						actionParameterItem.ActionParameterValue.ValueOctS.Data =
-							append(actionParameterItem.ActionParameterValue.ValueOctS.Data, 1, 2, 3)
-					} else if msgContent.ActionParameterValuePrtSPresent {
-						actionParameterItem.ActionParameterValue.ValuePrtSPresent = true
-						actionParameterItem.ActionParameterValue.ValuePrtS.Length = 3
-						actionParameterItem.ActionParameterValue.ValuePrtS.Data =
-							append(actionParameterItem.ActionParameterValue.ValuePrtS.Data, 1, 2, 3)
-					}
-					item.ActionDefinitionChoice.ActionDefinitionX2Format1.ActionParameterItems =
-						append(item.ActionDefinitionChoice.ActionDefinitionX2Format1.ActionParameterItems, actionParameterItem)
-				}
-			} else if item.ActionDefinitionChoice.ActionDefinitionX2Format2Present {
-				// 1..15
-				for index2 := 0; index2 < 1; index2++ {
-					ranUEgroupItem := e2ap.RANueGroupItem{}
-					// 1..255
-					for index3 := 0; index3 < 1; index3++ {
-						ranUEGroupDefItem := e2ap.RANueGroupDefItem{}
-						ranUEGroupDefItem.RanParameterID = 22
-						ranUEGroupDefItem.RanParameterTest = e2ap.RANParameterTest_equal
-						if msgContent.RANParameterValueIntPresent {
-							ranUEGroupDefItem.RanParameterValue.ValueIntPresent = true
-							ranUEGroupDefItem.RanParameterValue.ValueInt = 100
-						} else if msgContent.RANParameterValueEnumPresent {
-							ranUEGroupDefItem.RanParameterValue.ValueEnumPresent = true
-							ranUEGroupDefItem.RanParameterValue.ValueEnum = 100
-						} else if msgContent.RANParameterValueBoolPresent {
-							ranUEGroupDefItem.RanParameterValue.ValueBoolPresent = true
-							ranUEGroupDefItem.RanParameterValue.ValueBool = true
-						} else if msgContent.RANParameterValueBitSPresent {
-							ranUEGroupDefItem.RanParameterValue.ValueBitSPresent = true
-							ranUEGroupDefItem.RanParameterValue.ValueBitS.UnusedBits = 0
-							ranUEGroupDefItem.RanParameterValue.ValueBitS.Length = 3
-							ranUEGroupDefItem.RanParameterValue.ValueBitS.Data =
-								append(ranUEGroupDefItem.RanParameterValue.ValueBitS.Data, 1, 2, 3)
-						} else if msgContent.RANParameterValueOctSPresent {
-							ranUEGroupDefItem.RanParameterValue.ValueOctSPresent = true
-							ranUEGroupDefItem.RanParameterValue.ValueOctS.Length = 3
-							ranUEGroupDefItem.RanParameterValue.ValueOctS.Data =
-								append(ranUEGroupDefItem.RanParameterValue.ValueOctS.Data, 1, 2, 3)
-						} else if msgContent.RANParameterValuePrtSPresent {
-							ranUEGroupDefItem.RanParameterValue.ValuePrtSPresent = true
-							ranUEGroupDefItem.RanParameterValue.ValuePrtS.Length = 3
-							ranUEGroupDefItem.RanParameterValue.ValuePrtS.Data =
-								append(ranUEGroupDefItem.RanParameterValue.ValuePrtS.Data, 1, 2, 3)
-						}
-						ranUEgroupItem.RanUEgroupDefinition.RanUEGroupDefItems =
-							append(ranUEgroupItem.RanUEgroupDefinition.RanUEGroupDefItems, ranUEGroupDefItem)
-					}
-					// 1..255
-					for index4 := 0; index4 < 1; index4++ {
-						ranParameterItem := e2ap.RANParameterItem{}
-						ranParameterItem.RanParameterID = 33
-						if msgContent.RANParameterValueIntPresent {
-							ranParameterItem.RanParameterValue.ValueIntPresent = true
-							ranParameterItem.RanParameterValue.ValueInt = 100
-						} else if msgContent.RANParameterValueEnumPresent {
-							ranParameterItem.RanParameterValue.ValueEnumPresent = true
-							ranParameterItem.RanParameterValue.ValueEnum = 100
-						} else if msgContent.RANParameterValueBoolPresent {
-							ranParameterItem.RanParameterValue.ValueBoolPresent = true
-							ranParameterItem.RanParameterValue.ValueBool = true
-						} else if msgContent.RANParameterValueBitSPresent {
-							ranParameterItem.RanParameterValue.ValueBitSPresent = true
-							ranParameterItem.RanParameterValue.ValueBitS.UnusedBits = 0
-							ranParameterItem.RanParameterValue.ValueBitS.Length = 3
-							ranParameterItem.RanParameterValue.ValueBitS.Data =
-								append(ranParameterItem.RanParameterValue.ValueBitS.Data, 1, 2, 3)
-						} else if msgContent.RANParameterValueOctSPresent {
-							ranParameterItem.RanParameterValue.ValueOctSPresent = true
-							ranParameterItem.RanParameterValue.ValueOctS.Length = 3
-							ranParameterItem.RanParameterValue.ValueOctS.Data =
-								append(ranParameterItem.RanParameterValue.ValueOctS.Data, 1, 2, 3)
-						} else if msgContent.RANParameterValuePrtSPresent {
-							ranParameterItem.RanParameterValue.ValuePrtSPresent = true
-							ranParameterItem.RanParameterValue.ValuePrtS.Length = 3
-							ranParameterItem.RanParameterValue.ValuePrtS.Data =
-								append(ranParameterItem.RanParameterValue.ValuePrtS.Data, 1, 2, 3)
-						}
-						ranUEgroupItem.RanPolicy.RanParameterItems =
-							append(ranUEgroupItem.RanPolicy.RanParameterItems, ranParameterItem)
-					}
-					ranUEgroupItem.RanUEgroupID = 2
-					item.ActionDefinitionChoice.ActionDefinitionX2Format2.RanUEgroupItems =
-						append(item.ActionDefinitionChoice.ActionDefinitionX2Format2.RanUEgroupItems, ranUEgroupItem)
-				}
-			} else if item.ActionDefinitionChoice.ActionDefinitionNRTFormat1Present {
-				// 1..255
-				for index2 := 0; index2 < 1; index2++ {
-					ranParameterItem := e2ap.RANParameterItem{}
-					ranParameterItem.RanParameterID = 33
-					if msgContent.RANParameterValueIntPresent {
-						ranParameterItem.RanParameterValue.ValueIntPresent = true
-						ranParameterItem.RanParameterValue.ValueInt = 100
-					} else if msgContent.RANParameterValueEnumPresent {
-						ranParameterItem.RanParameterValue.ValueEnumPresent = true
-						ranParameterItem.RanParameterValue.ValueEnum = 100
-					} else if msgContent.RANParameterValueBoolPresent {
-						ranParameterItem.RanParameterValue.ValueBoolPresent = true
-						ranParameterItem.RanParameterValue.ValueBool = true
-					} else if msgContent.RANParameterValueBitSPresent {
-						ranParameterItem.RanParameterValue.ValueBitSPresent = true
-						ranParameterItem.RanParameterValue.ValueBitS.UnusedBits = 0
-						ranParameterItem.RanParameterValue.ValueBitS.Length = 3
-						ranParameterItem.RanParameterValue.ValueBitS.Data =
-							append(ranParameterItem.RanParameterValue.ValueBitS.Data, 1, 2, 3)
-					} else if msgContent.RANParameterValueOctSPresent {
-						ranParameterItem.RanParameterValue.ValueOctSPresent = true
-						ranParameterItem.RanParameterValue.ValueOctS.Length = 3
-						ranParameterItem.RanParameterValue.ValueOctS.Data =
-							append(ranParameterItem.RanParameterValue.ValueOctS.Data, 1, 2, 3)
-					} else if msgContent.RANParameterValuePrtSPresent {
-						ranParameterItem.RanParameterValue.ValuePrtSPresent = true
-						ranParameterItem.RanParameterValue.ValuePrtS.Length = 3
-						ranParameterItem.RanParameterValue.ValuePrtS.Data =
-							append(ranParameterItem.RanParameterValue.ValuePrtS.Data, 1, 2, 3)
-					}
-					item.ActionDefinitionChoice.ActionDefinitionNRTFormat1.RanParameterList =
-						append(item.ActionDefinitionChoice.ActionDefinitionNRTFormat1.RanParameterList, ranParameterItem)
-				}
+			if msgContent.ActionDefinitionX2Format1Present {
+				item.ActionDefinitionChoice.Data.Length = 1
+				item.ActionDefinitionChoice.Data.Data = make([]uint8, item.ActionDefinitionChoice.Data.Length)
+				item.ActionDefinitionChoice.Data.Data[0] = 1
+			} else if msgContent.ActionDefinitionX2Format2Present {
+				item.ActionDefinitionChoice.Data.Length = 1
+				item.ActionDefinitionChoice.Data.Data = make([]uint8, item.ActionDefinitionChoice.Data.Length)
+				item.ActionDefinitionChoice.Data.Data[0] = 2
+			} else if msgContent.ActionDefinitionNRTFormat1Present {
+				item.ActionDefinitionChoice.Data.Length = 1
+				item.ActionDefinitionChoice.Data.Data = make([]uint8, item.ActionDefinitionChoice.Data.Length)
+				item.ActionDefinitionChoice.Data.Data[0] = 3
 			}
 		}
 		item.SubsequentAction.Present = true
diff --git a/e2ap/pkg/e2ap/msg_e2ap.go b/e2ap/pkg/e2ap/msg_e2ap.go
index 2ce2c17..96ef099 100644
--- a/e2ap/pkg/e2ap/msg_e2ap.go
+++ b/e2ap/pkg/e2ap/msg_e2ap.go
@@ -183,34 +183,9 @@
 )
 
 type EventTriggerDefinition struct {
-	NBX2EventTriggerDefinitionPresent bool
-	X2EventTriggerDefinition
-	NBNRTEventTriggerDefinitionPresent bool
-	NBNRTEventTriggerDefinition
+	Data OctetString
 }
 
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type X2EventTriggerDefinition struct {
-	InterfaceId
-	InterfaceDirection uint32
-	ProcedureCode      uint32
-	TypeOfMessage      uint64
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type NBNRTEventTriggerDefinition struct {
-	TriggerNature uint8
-}
-
-const ( // enum NRTTriggerNature
-	NRTTriggerNature_now = iota
-	NRTTriggerNature_onchange
-)
-
 /*
 //-----------------------------------------------------------------------------
 //
@@ -221,129 +196,7 @@
 */
 
 type ActionDefinitionChoice struct {
-	ActionDefinitionX2Format1Present  bool
-	ActionDefinitionX2Format1         E2SMgNBX2actionDefinition
-	ActionDefinitionX2Format2Present  bool
-	ActionDefinitionX2Format2         ActionDefinitionFormat2
-	ActionDefinitionNRTFormat1Present bool
-	ActionDefinitionNRTFormat1        E2SMgNBNRTActionDefinitionFormat1
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type E2SMgNBNRTActionDefinitionFormat1 struct {
-	RanParameterList []RANParameterItem // 1..255
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type E2SMgNBX2actionDefinition struct {
-	StyleID              uint64
-	ActionParameterItems []ActionParameterItem // 1..255
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type ActionParameterItem struct {
-	ParameterID          uint32 // 1..255
-	ActionParameterValue ActionParameterValue
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type ActionParameterValue struct {
-	ValueIntPresent  bool
-	ValueInt         int64
-	ValueEnumPresent bool
-	ValueEnum        int64
-	ValueBoolPresent bool
-	ValueBool        bool
-	ValueBitSPresent bool
-	ValueBitS        BitString
-	ValueOctSPresent bool
-	ValueOctS        OctetString
-	ValuePrtSPresent bool
-	ValuePrtS        OctetString
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type ActionDefinitionFormat2 struct {
-	RanUEgroupItems []RANueGroupItem // 1..15
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type RANueGroupItem struct {
-	RanUEgroupID         int64
-	RanUEgroupDefinition RANueGroupDefinition
-	RanPolicy            RANimperativePolicy
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type RANueGroupDefinition struct {
-	RanUEGroupDefItems []RANueGroupDefItem // 1..255
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type RANimperativePolicy struct {
-	RanParameterItems []RANParameterItem // 1..255
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type RANueGroupDefItem struct {
-	RanParameterID    uint32 // 1..255
-	RanParameterTest  uint8
-	RanParameterValue RANParameterValue
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type RANParameterItem struct {
-	RanParameterID    uint8 // 1..255
-	RanParameterValue RANParameterValue
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-const ( // enum RANParameterTest
-	RANParameterTest_equal = iota
-	RANParameterTest_greaterthan
-	RANParameterTest_lessthan
-	RANParameterTest_contains
-	RANParameterTest_present
-)
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type RANParameterValue struct {
-	ValueIntPresent  bool
-	ValueInt         int64
-	ValueEnumPresent bool
-	ValueEnum        int64
-	ValueBoolPresent bool
-	ValueBool        bool
-	ValueBitSPresent bool
-	ValueBitS        BitString
-	ValueOctSPresent bool
-	ValueOctS        OctetString
-	ValuePrtSPresent bool
-	ValuePrtS        OctetString
+	Data OctetString
 }
 
 //-----------------------------------------------------------------------------
diff --git a/e2ap/pkg/e2ap_wrapper/packer_e2ap.go b/e2ap/pkg/e2ap_wrapper/packer_e2ap.go
index fafa141..dafac42 100644
--- a/e2ap/pkg/e2ap_wrapper/packer_e2ap.go
+++ b/e2ap/pkg/e2ap_wrapper/packer_e2ap.go
@@ -19,11 +19,10 @@
 
 package e2ap_wrapper
 
-// #cgo LDFLAGS: -le2ap_wrapper -le2ap -lgnbx2 -lgnbnrt -lstdc++
+// #cgo LDFLAGS: -le2ap_wrapper -le2ap  -lstdc++
 // #include <stdlib.h>
 // #include <c_types.h>
 // #include <E2AP_if.h>
-// #include <memtrack.h>
 // #include <strings.h>
 //
 // void initSubsRequest(RICSubscriptionRequest_t *data){
@@ -128,13 +127,13 @@
 	entry *C.RICActionToBeSetupItem_t
 }
 
-func (e2Item *e2apEntryActionToBeSetupItem) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.ActionToBeSetupItem) error {
+func (e2Item *e2apEntryActionToBeSetupItem) set(id *e2ap.ActionToBeSetupItem) error {
 
 	e2Item.entry.ricActionID = (C.ulong)(id.ActionId)
 	e2Item.entry.ricActionType = (C.uint64_t)(id.ActionType)
 	if id.RicActionDefinitionPresent {
 		e2Item.entry.ricActionDefinitionPresent = true
-		if err := (&e2apEntryActionDefinitionChoice{entry: &e2Item.entry.ricActionDefinitionChoice}).set(dynMemHead, &id.ActionDefinitionChoice); err != nil {
+		if err := (&e2apEntryActionDefinitionChoice{entry: &e2Item.entry.ricActionDefinitionChoice}).set(&id.ActionDefinitionChoice); err != nil {
 			return err
 		}
 	}
@@ -171,462 +170,19 @@
 	entry *C.RICActionDefinitionChoice_t
 }
 
-func (e2Item *e2apEntryActionDefinitionChoice) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.ActionDefinitionChoice) error {
-
-	if id.ActionDefinitionX2Format1Present {
-		e2Item.entry.actionDefinitionX2Format1Present = true
-		errorNro := C.allocActionDefinitionX2Format1(dynMemHead, &e2Item.entry.actionDefinitionX2Format1)
-		if errorNro != C.e2err_OK {
-			return fmt.Errorf("e2err(%s)", C.GoString(C.getE2ErrorString(errorNro)))
-		}
-		if err := (&e2apEntryE2SMgNBX2actionDefinition{entry: e2Item.entry.actionDefinitionX2Format1}).set(dynMemHead, &id.ActionDefinitionX2Format1); err != nil {
-			return err
-		}
-
-	} else if id.ActionDefinitionX2Format2Present {
-		e2Item.entry.actionDefinitionX2Format2Present = true
-		errorNro := C.allocActionDefinitionX2Format2(dynMemHead, &e2Item.entry.actionDefinitionX2Format2)
-		if errorNro != C.e2err_OK {
-			return fmt.Errorf("e2err(%s)", C.GoString(C.getE2ErrorString(errorNro)))
-		}
-		if err := (&e2apEntryActionDefinitionFormat2{entry: e2Item.entry.actionDefinitionX2Format2}).set(dynMemHead, &id.ActionDefinitionX2Format2); err != nil {
-			return err
-		}
-	} else if id.ActionDefinitionNRTFormat1Present {
-		e2Item.entry.actionDefinitionNRTFormat1Present = true
-		errorNro := C.allocActionDefinitionNRTFormat1(dynMemHead, &e2Item.entry.actionDefinitionNRTFormat1)
-		if errorNro != C.e2err_OK {
-			return fmt.Errorf("e2err(%s)", C.GoString(C.getE2ErrorString(errorNro)))
-		}
-		if err := (&e2apEntryE2SMgNBNRTactionDefinitionFormat1{entry: e2Item.entry.actionDefinitionNRTFormat1}).set(dynMemHead, &id.ActionDefinitionNRTFormat1); err != nil {
-			return err
-		}
-	} else {
-		return fmt.Errorf("Set() Missing mandatory ActionDefinition element")
+func (e2Item *e2apEntryActionDefinitionChoice) set(id *e2ap.ActionDefinitionChoice) error {
+	if id.Data.Length > 0 {
+		e2Item.entry.octetString.contentLength = C.size_t(id.Data.Length)
+		C.memcpy(unsafe.Pointer(&e2Item.entry.octetString.data[0]), unsafe.Pointer(&id.Data.Data[0]), C.size_t(e2Item.entry.octetString.contentLength))
 	}
 	return nil
 }
 
 func (e2Item *e2apEntryActionDefinitionChoice) get(id *e2ap.ActionDefinitionChoice) error {
-	if e2Item.entry.actionDefinitionX2Format1Present {
-		id.ActionDefinitionX2Format1Present = true
-		if err := (&e2apEntryE2SMgNBX2actionDefinition{entry: e2Item.entry.actionDefinitionX2Format1}).get(&id.ActionDefinitionX2Format1); err != nil {
-			return err
-		}
-	} else if e2Item.entry.actionDefinitionX2Format2Present {
-		id.ActionDefinitionX2Format2Present = true
-		if err := (&e2apEntryActionDefinitionFormat2{entry: e2Item.entry.actionDefinitionX2Format2}).get(&id.ActionDefinitionX2Format2); err != nil {
-			return err
-		}
-	} else if e2Item.entry.actionDefinitionNRTFormat1Present {
-		id.ActionDefinitionNRTFormat1Present = true
-		if err := (&e2apEntryE2SMgNBNRTactionDefinitionFormat1{entry: e2Item.entry.actionDefinitionNRTFormat1}).get(&id.ActionDefinitionNRTFormat1); err != nil {
-			return err
-		}
-	} else {
-		return fmt.Errorf("Get() Missing mandatory ActionDefinition element")
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryE2SMgNBX2actionDefinition struct {
-	entry *C.E2SMgNBX2actionDefinition_t
-}
-
-func (e2Item *e2apEntryE2SMgNBX2actionDefinition) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.E2SMgNBX2actionDefinition) error {
-
-	e2Item.entry.styleID = (C.uint64_t)(id.StyleID)
-	// 1..255
-	e2Item.entry.actionParameterCount = 0
-	for i := 0; i < len(id.ActionParameterItems); i++ {
-		if err := (&e2apEntryActionParameterItem{entry: &e2Item.entry.actionParameterItem[i]}).set(dynMemHead, &id.ActionParameterItems[i]); err != nil {
-			return err
-		}
-		e2Item.entry.actionParameterCount++
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryE2SMgNBX2actionDefinition) get(id *e2ap.E2SMgNBX2actionDefinition) error {
-
-	id.StyleID = (uint64)(e2Item.entry.styleID)
-
-	// 1..255
-	length := (int)(e2Item.entry.actionParameterCount)
-	id.ActionParameterItems = make([]e2ap.ActionParameterItem, length)
-	for i := 0; i < length; i++ {
-		if err := (&e2apEntryActionParameterItem{entry: &e2Item.entry.actionParameterItem[i]}).get(&id.ActionParameterItems[i]); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryE2SMgNBNRTactionDefinitionFormat1 struct {
-	entry *C.E2SMgNBNRTActionDefinitionFormat1_t
-}
-
-func (e2Item *e2apEntryE2SMgNBNRTactionDefinitionFormat1) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.E2SMgNBNRTActionDefinitionFormat1) error {
-	// 1..255
-	e2Item.entry.ranParameterCount = 0
-	for i := 0; i < len(id.RanParameterList); i++ {
-		if err := (&e2apEntryRANParameterItem{entry: &e2Item.entry.ranParameterList[i]}).set(dynMemHead, &id.RanParameterList[i]); err != nil {
-			return err
-		}
-		e2Item.entry.ranParameterCount++
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryE2SMgNBNRTactionDefinitionFormat1) get(id *e2ap.E2SMgNBNRTActionDefinitionFormat1) error {
-	// 1..255
-	length := (int)(e2Item.entry.ranParameterCount)
-	id.RanParameterList = make([]e2ap.RANParameterItem, length)
-	for i := 0; i < length; i++ {
-		if err := (&e2apEntryRANParameterItem{entry: &e2Item.entry.ranParameterList[i]}).get(&id.RanParameterList[i]); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryActionParameterItem struct {
-	entry *C.ActionParameterItem_t
-}
-
-func (e2Item *e2apEntryActionParameterItem) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.ActionParameterItem) error {
-
-	e2Item.entry.parameterID = (C.uint32_t)(id.ParameterID)
-	if err := (&e2apEntryActionParameterValue{entry: &e2Item.entry.actionParameterValue}).set(dynMemHead, &id.ActionParameterValue); err != nil {
-		return err
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryActionParameterItem) get(id *e2ap.ActionParameterItem) error {
-
-	id.ParameterID = (uint32)(e2Item.entry.parameterID)
-	if err := (&e2apEntryActionParameterValue{entry: &e2Item.entry.actionParameterValue}).get(&id.ActionParameterValue); err != nil {
-		return err
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryActionParameterValue struct {
-	entry *C.ActionParameterValue_t
-}
-
-func (e2Item *e2apEntryActionParameterValue) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.ActionParameterValue) error {
-
-	if id.ValueIntPresent {
-		e2Item.entry.valueInt = (C.int64_t)(id.ValueInt)
-		e2Item.entry.valueIntPresent = true
-	} else if id.ValueEnumPresent {
-		e2Item.entry.valueEnum = (C.int64_t)(id.ValueEnum)
-		e2Item.entry.valueEnumPresent = true
-	} else if id.ValueBoolPresent {
-		e2Item.entry.valueBool = (C.bool)(id.ValueBool)
-		e2Item.entry.valueBoolPresent = true
-	} else if id.ValueBitSPresent {
-		if C.addBitString(dynMemHead, &e2Item.entry.valueBitS, (C.uint64_t)(id.ValueBitS.Length), unsafe.Pointer(&id.ValueBitS.Data[0]), (C.uint8_t)(id.ValueBitS.UnusedBits)) == false {
-			return fmt.Errorf("Alloc valueBitS fail")
-		}
-		e2Item.entry.valueBitSPresent = true
-	} else if id.ValueOctSPresent {
-		if C.addOctetString(dynMemHead, &e2Item.entry.valueOctS, (C.uint64_t)(id.ValueOctS.Length), unsafe.Pointer(&id.ValueOctS.Data[0])) == false {
-			return fmt.Errorf("Alloc valueOctS fail")
-		}
-		e2Item.entry.valueOctSPresent = true
-	} else if id.ValuePrtSPresent {
-		if C.addOctetString(dynMemHead, &e2Item.entry.valuePrtS, (C.uint64_t)(id.ValuePrtS.Length), unsafe.Pointer(&id.ValuePrtS.Data[0])) == false {
-			return fmt.Errorf("Alloc valuePrtS fail")
-		}
-		e2Item.entry.valuePrtSPresent = true
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryActionParameterValue) get(id *e2ap.ActionParameterValue) error {
-
-	if e2Item.entry.valueIntPresent {
-		id.ValueInt = (int64)(e2Item.entry.valueInt)
-		id.ValueIntPresent = true
-	} else if e2Item.entry.valueEnumPresent {
-		id.ValueEnum = (int64)(e2Item.entry.valueEnum)
-		id.ValueEnumPresent = true
-	} else if e2Item.entry.valueBoolPresent {
-		id.ValueBool = (bool)(e2Item.entry.valueBool)
-		id.ValueBoolPresent = true
-	} else if e2Item.entry.valueBitSPresent {
-		id.ValueBitSPresent = true
-		id.ValueBitS.Length = (uint64)(e2Item.entry.valueBitS.byteLength)
-		id.ValueBitS.UnusedBits = (uint8)(e2Item.entry.valueBitS.unusedBits)
-		id.ValueBitS.Data = make([]uint8, id.ValueBitS.Length)
-		C.memcpy(unsafe.Pointer(&id.ValueBitS.Data[0]), unsafe.Pointer(e2Item.entry.valueBitS.data), C.size_t(e2Item.entry.valueBitS.byteLength))
-	} else if e2Item.entry.valueOctSPresent {
-		id.ValueOctSPresent = true
-		id.ValueOctS.Length = (uint64)(e2Item.entry.valueOctS.length)
-		id.ValueOctS.Data = make([]uint8, id.ValueOctS.Length)
-		C.memcpy(unsafe.Pointer(&id.ValueOctS.Data[0]), unsafe.Pointer(e2Item.entry.valueOctS.data), C.size_t(e2Item.entry.valueOctS.length))
-	} else if e2Item.entry.valuePrtSPresent {
-		id.ValuePrtSPresent = true
-		id.ValuePrtS.Length = (uint64)(e2Item.entry.valuePrtS.length)
-		id.ValuePrtS.Data = make([]uint8, id.ValuePrtS.Length)
-		C.memcpy(unsafe.Pointer(&id.ValuePrtS.Data[0]), unsafe.Pointer(e2Item.entry.valuePrtS.data), C.size_t(e2Item.entry.valuePrtS.length))
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryActionDefinitionFormat2 struct {
-	entry *C.E2SMgNBX2ActionDefinitionFormat2_t
-}
-
-func (e2Item *e2apEntryActionDefinitionFormat2) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.ActionDefinitionFormat2) error {
-	// 1..15
-	e2Item.entry.ranUeGroupCount = 0
-	for i := 0; i < len(id.RanUEgroupItems); i++ {
-		if err := (&e2apEntryRANueGroupItem{entry: &e2Item.entry.ranUeGroupItem[i]}).set(dynMemHead, &id.RanUEgroupItems[i]); err != nil {
-			return err
-		}
-		e2Item.entry.ranUeGroupCount++
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryActionDefinitionFormat2) get(id *e2ap.ActionDefinitionFormat2) error {
-	// 1..15
-	length := (int)(e2Item.entry.ranUeGroupCount)
-	id.RanUEgroupItems = make([]e2ap.RANueGroupItem, length)
-	for i := 0; i < length; i++ {
-		if err := (&e2apEntryRANueGroupItem{entry: &e2Item.entry.ranUeGroupItem[i]}).get(&id.RanUEgroupItems[i]); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryRANueGroupItem struct {
-	entry *C.RANueGroupItem_t
-}
-
-func (e2Item *e2apEntryRANueGroupItem) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.RANueGroupItem) error {
-	e2Item.entry.ranUEgroupID = (C.int64_t)(id.RanUEgroupID)
-	if err := (&e2apEntryRANueGroupDefinition{entry: &e2Item.entry.ranUEgroupDefinition}).set(dynMemHead, &id.RanUEgroupDefinition); err != nil {
-		return err
-	}
-	if err := (&e2apEntryRANimperativePolicy{entry: &e2Item.entry.ranPolicy}).set(dynMemHead, &id.RanPolicy); err != nil {
-		return err
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryRANueGroupItem) get(id *e2ap.RANueGroupItem) error {
-	id.RanUEgroupID = (int64)(e2Item.entry.ranUEgroupID)
-	if err := (&e2apEntryRANueGroupDefinition{entry: &e2Item.entry.ranUEgroupDefinition}).get(&id.RanUEgroupDefinition); err != nil {
-		return err
-	}
-	if err := (&e2apEntryRANimperativePolicy{entry: &e2Item.entry.ranPolicy}).get(&id.RanPolicy); err != nil {
-		return err
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryRANueGroupDefinition struct {
-	entry *C.RANueGroupDefinition_t
-}
-
-func (e2Item *e2apEntryRANueGroupDefinition) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.RANueGroupDefinition) error {
-	// 1..255
-	e2Item.entry.ranUeGroupDefCount = 0
-	for i := 0; i < len(id.RanUEGroupDefItems); i++ {
-		if err := (&e2apEntryRANueGroupDefItem{entry: &e2Item.entry.ranUeGroupDefItem[i]}).set(dynMemHead, &id.RanUEGroupDefItems[i]); err != nil {
-			return err
-		}
-		e2Item.entry.ranUeGroupDefCount++
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryRANueGroupDefinition) get(id *e2ap.RANueGroupDefinition) error {
-	// 1..255
-	length := (int)(e2Item.entry.ranUeGroupDefCount)
-	id.RanUEGroupDefItems = make([]e2ap.RANueGroupDefItem, length)
-	for i := 0; i < length; i++ {
-		if err := (&e2apEntryRANueGroupDefItem{entry: &e2Item.entry.ranUeGroupDefItem[i]}).get(&id.RanUEGroupDefItems[i]); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryRANimperativePolicy struct {
-	entry *C.RANimperativePolicy_t
-}
-
-func (e2Item *e2apEntryRANimperativePolicy) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.RANimperativePolicy) error {
-	// 1..255
-	e2Item.entry.ranParameterCount = 0
-	for i := 0; i < len(id.RanParameterItems); i++ {
-		if err := (&e2apEntryRANParameterItem{entry: &e2Item.entry.ranParameterItem[i]}).set(dynMemHead, &id.RanParameterItems[i]); err != nil {
-			return err
-		}
-		e2Item.entry.ranParameterCount++
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryRANimperativePolicy) get(id *e2ap.RANimperativePolicy) error {
-	// 1..255
-	length := (int)(e2Item.entry.ranParameterCount)
-	id.RanParameterItems = make([]e2ap.RANParameterItem, length)
-	for i := 0; i < length; i++ {
-		if err := (&e2apEntryRANParameterItem{entry: &e2Item.entry.ranParameterItem[i]}).get(&id.RanParameterItems[i]); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryRANueGroupDefItem struct {
-	entry *C.RANueGroupDefItem_t
-}
-
-func (e2Item *e2apEntryRANueGroupDefItem) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.RANueGroupDefItem) error {
-
-	e2Item.entry.ranParameterID = (C.uint32_t)(id.RanParameterID)
-	e2Item.entry.ranParameterTest = (C.uint8_t)(id.RanParameterTest)
-	if err := (&e2apEntryRANParameterValue{entry: &e2Item.entry.ranParameterValue}).set(dynMemHead, &id.RanParameterValue); err != nil {
-		return err
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryRANueGroupDefItem) get(id *e2ap.RANueGroupDefItem) error {
-
-	id.RanParameterID = (uint32)(e2Item.entry.ranParameterID)
-	id.RanParameterTest = (uint8)(e2Item.entry.ranParameterTest)
-	if err := (&e2apEntryRANParameterValue{entry: &e2Item.entry.ranParameterValue}).get(&id.RanParameterValue); err != nil {
-		return err
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryRANParameterItem struct {
-	entry *C.RANParameterItem_t
-}
-
-func (e2Item *e2apEntryRANParameterItem) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.RANParameterItem) error {
-
-	e2Item.entry.ranParameterID = (C.uint32_t)(id.RanParameterID)
-	if err := (&e2apEntryRANParameterValue{entry: &e2Item.entry.ranParameterValue}).set(dynMemHead, &id.RanParameterValue); err != nil {
-		return err
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryRANParameterItem) get(id *e2ap.RANParameterItem) error {
-
-	id.RanParameterID = (uint8)(e2Item.entry.ranParameterID)
-	if err := (&e2apEntryRANParameterValue{entry: &e2Item.entry.ranParameterValue}).get(&id.RanParameterValue); err != nil {
-		return err
-	}
-	return nil
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryRANParameterValue struct {
-	entry *C.RANParameterValue_t
-}
-
-func (e2Item *e2apEntryRANParameterValue) set(dynMemHead *C.mem_track_hdr_t, id *e2ap.RANParameterValue) error {
-
-	if id.ValueIntPresent {
-		e2Item.entry.valueInt = (C.int64_t)(id.ValueInt)
-		e2Item.entry.valueIntPresent = true
-	} else if id.ValueEnumPresent {
-		e2Item.entry.valueEnum = (C.int64_t)(id.ValueEnum)
-		e2Item.entry.valueEnumPresent = true
-	} else if id.ValueBoolPresent {
-		e2Item.entry.valueBool = (C.bool)(id.ValueBool)
-		e2Item.entry.valueBoolPresent = true
-	} else if id.ValueBitSPresent {
-		if C.addBitString(dynMemHead, &e2Item.entry.valueBitS, (C.uint64_t)(id.ValueBitS.Length), unsafe.Pointer(&id.ValueBitS.Data[0]), (C.uint8_t)(id.ValueBitS.UnusedBits)) == false {
-			return fmt.Errorf("Alloc valueBitS fail")
-		}
-		e2Item.entry.valueBitSPresent = true
-	} else if id.ValueOctSPresent {
-		if C.addOctetString(dynMemHead, &e2Item.entry.valueOctS, (C.uint64_t)(id.ValueOctS.Length), unsafe.Pointer(&id.ValueOctS.Data[0])) == false {
-			return fmt.Errorf("Alloc valueOctS fail")
-		}
-		e2Item.entry.valueOctSPresent = true
-	} else if id.ValuePrtSPresent {
-		if C.addOctetString(dynMemHead, &e2Item.entry.valuePrtS, (C.uint64_t)(id.ValuePrtS.Length), unsafe.Pointer(&id.ValuePrtS.Data[0])) == false {
-			return fmt.Errorf("Alloc valuePrtS fail")
-		}
-		e2Item.entry.valuePrtSPresent = true
-	}
-	return nil
-}
-
-func (e2Item *e2apEntryRANParameterValue) get(id *e2ap.RANParameterValue) error {
-
-	if e2Item.entry.valueIntPresent {
-		id.ValueInt = (int64)(e2Item.entry.valueInt)
-		id.ValueIntPresent = true
-	} else if e2Item.entry.valueEnumPresent {
-		id.ValueEnum = (int64)(e2Item.entry.valueEnum)
-		id.ValueEnumPresent = true
-	} else if e2Item.entry.valueBoolPresent {
-		id.ValueBool = (bool)(e2Item.entry.valueBool)
-		id.ValueBoolPresent = true
-	} else if e2Item.entry.valueBitSPresent {
-		id.ValueBitSPresent = true
-		id.ValueBitS.Length = (uint64)(e2Item.entry.valueBitS.byteLength)
-		id.ValueBitS.UnusedBits = (uint8)(e2Item.entry.valueBitS.unusedBits)
-		id.ValueBitS.Data = make([]uint8, id.ValueBitS.Length)
-		C.memcpy(unsafe.Pointer(&id.ValueBitS.Data[0]), unsafe.Pointer(e2Item.entry.valueBitS.data), C.size_t(e2Item.entry.valueBitS.byteLength))
-	} else if e2Item.entry.valueOctSPresent {
-		id.ValueOctSPresent = true
-		id.ValueOctS.Length = (uint64)(e2Item.entry.valueOctS.length)
-		id.ValueOctS.Data = make([]uint8, id.ValueOctS.Length)
-		C.memcpy(unsafe.Pointer(&id.ValueOctS.Data[0]), unsafe.Pointer(e2Item.entry.valueOctS.data), C.size_t(e2Item.entry.valueOctS.length))
-	} else if e2Item.entry.valuePrtSPresent {
-		id.ValuePrtSPresent = true
-		id.ValuePrtS.Length = (uint64)(e2Item.entry.valuePrtS.length)
-		id.ValuePrtS.Data = make([]uint8, id.ValuePrtS.Length)
-		C.memcpy(unsafe.Pointer(&id.ValuePrtS.Data[0]), unsafe.Pointer(e2Item.entry.valuePrtS.data), C.size_t(e2Item.entry.valuePrtS.length))
+	id.Data.Length = (uint64)(e2Item.entry.octetString.contentLength)
+	if id.Data.Length > 0 {
+		id.Data.Data = make([]uint8, id.Data.Length)
+		C.memcpy(unsafe.Pointer(&id.Data.Data[0]), unsafe.Pointer(&e2Item.entry.octetString.data[0]), C.size_t(e2Item.entry.octetString.contentLength))
 	}
 	return nil
 }
@@ -781,64 +337,21 @@
 }
 
 func (evtTrig *e2apEntryEventTrigger) set(id *e2ap.EventTriggerDefinition) error {
-	if id.NBX2EventTriggerDefinitionPresent {
-		evtTrig.entry.E2SMgNBX2EventTriggerDefinitionPresent = true
-		return (&e2apEntryX2EventTrigger{entry: &evtTrig.entry.e2SMgNBX2eventTriggerDefinition}).set(&id.X2EventTriggerDefinition)
 
-	} else if id.NBNRTEventTriggerDefinitionPresent {
-		evtTrig.entry.E2SMgNBNRTEventTriggerDefinitionPresent = true
-		return (&e2apEntryNRTEventTrigger{entry: &evtTrig.entry.e2SMgNBNRTEventTriggerDefinition}).set(&id.NBNRTEventTriggerDefinition)
+	if id.Data.Length > 0 {
+		evtTrig.entry.octetString.contentLength = C.size_t(id.Data.Length)
+		C.memcpy(unsafe.Pointer(&evtTrig.entry.octetString.data[0]), unsafe.Pointer(&id.Data.Data[0]), C.size_t(evtTrig.entry.octetString.contentLength))
 	}
-	return fmt.Errorf("Set() empty EventTriggerDefinition")
-}
-
-func (evtTrig *e2apEntryEventTrigger) get(id *e2ap.EventTriggerDefinition) error {
-	if evtTrig.entry.E2SMgNBX2EventTriggerDefinitionPresent {
-		id.NBX2EventTriggerDefinitionPresent = true
-		return (&e2apEntryX2EventTrigger{entry: &evtTrig.entry.e2SMgNBX2eventTriggerDefinition}).get(&id.X2EventTriggerDefinition)
-
-	} else if evtTrig.entry.E2SMgNBNRTEventTriggerDefinitionPresent {
-		id.NBNRTEventTriggerDefinitionPresent = true
-		return (&e2apEntryNRTEventTrigger{entry: &evtTrig.entry.e2SMgNBNRTEventTriggerDefinition}).get(&id.NBNRTEventTriggerDefinition)
-	}
-	return fmt.Errorf("Get() empty EventTriggerDefinition")
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryX2EventTrigger struct {
-	entry *C.E2SMgNBX2eventTriggerDefinition_t
-}
-
-func (evtTrig *e2apEntryX2EventTrigger) set(id *e2ap.X2EventTriggerDefinition) error {
-	evtTrig.entry.interfaceDirection = (C.uint8_t)(id.InterfaceDirection)
-	evtTrig.entry.interfaceMessageType.procedureCode = (C.uint8_t)(id.ProcedureCode)
-	evtTrig.entry.interfaceMessageType.typeOfMessage = (C.uint8_t)(id.TypeOfMessage)
-	return (&e2apEntryInterfaceId{entry: &evtTrig.entry.interfaceID}).set(&id.InterfaceId)
-}
-
-func (evtTrig *e2apEntryX2EventTrigger) get(id *e2ap.X2EventTriggerDefinition) error {
-	id.InterfaceDirection = (uint32)(evtTrig.entry.interfaceDirection)
-	id.ProcedureCode = (uint32)(evtTrig.entry.interfaceMessageType.procedureCode)
-	id.TypeOfMessage = (uint64)(evtTrig.entry.interfaceMessageType.typeOfMessage)
-	return (&e2apEntryInterfaceId{entry: &evtTrig.entry.interfaceID}).get(&id.InterfaceId)
-}
-
-//-----------------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------------
-type e2apEntryNRTEventTrigger struct {
-	entry *C.E2SMgNBNRTEventTriggerDefinition_t
-}
-
-func (evtTrig *e2apEntryNRTEventTrigger) set(id *e2ap.NBNRTEventTriggerDefinition) error {
-	evtTrig.entry.eventDefinitionFormat1.triggerNature = (C.uint8_t)(id.TriggerNature)
 	return nil
 }
 
-func (evtTrig *e2apEntryNRTEventTrigger) get(id *e2ap.NBNRTEventTriggerDefinition) error {
-	id.TriggerNature = (uint8)(evtTrig.entry.eventDefinitionFormat1.triggerNature)
+func (evtTrig *e2apEntryEventTrigger) get(id *e2ap.EventTriggerDefinition) error {
+
+	id.Data.Length = (uint64)(evtTrig.entry.octetString.contentLength)
+	if id.Data.Length > 0 {
+		id.Data.Data = make([]uint8, id.Data.Length)
+		C.memcpy(unsafe.Pointer(&id.Data.Data[0]), unsafe.Pointer(&evtTrig.entry.octetString.data[0]), C.size_t(evtTrig.entry.octetString.contentLength))
+	}
 	return nil
 }
 
@@ -1078,10 +591,6 @@
 	defer e2apMsg.fini()
 	e2apMsg.msgG = data
 
-	var dynMemHead C.mem_track_hdr_t
-	C.mem_track_init(&dynMemHead)
-	defer C.mem_track_free(&dynMemHead)
-
 	e2apMsg.msgC.ranFunctionID = (C.uint16_t)(e2apMsg.msgG.FunctionId)
 	if err := (&e2apEntryRequestID{entry: &e2apMsg.msgC.ricRequestID}).set(&e2apMsg.msgG.RequestId); err != nil {
 		return err, nil
@@ -1096,7 +605,7 @@
 	for i := 0; i < len(e2apMsg.msgG.ActionSetups); i++ {
 		item := &e2apEntryActionToBeSetupItem{entry: &e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.contentLength]}
 		e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.contentLength += 1
-		if err := item.set(&dynMemHead, &e2apMsg.msgG.ActionSetups[i]); err != nil {
+		if err := item.set(&e2apMsg.msgG.ActionSetups[i]); err != nil {
 			return err, nil
 		}
 	}
@@ -1116,11 +625,7 @@
 		return err, e2apMsg.msgG
 	}
 
-	var dynMemHead C.mem_track_hdr_t
-	C.mem_track_init(&dynMemHead)
-	defer C.mem_track_free(&dynMemHead)
-
-	errorNro := C.getRICSubscriptionRequestData(&dynMemHead, e2apMsg.e2apMessagePacker.pdu, e2apMsg.msgC)
+	errorNro := C.getRICSubscriptionRequestData(e2apMsg.e2apMessagePacker.pdu, e2apMsg.msgC)
 	if err := e2apMsg.checkerr(errorNro); err != nil {
 		return err, e2apMsg.msgG
 	}
@@ -1152,29 +657,6 @@
 	fmt.Fprintln(&b, "     ricInstanceID =", e2apMsg.msgC.ricRequestID.ricInstanceID)
 	fmt.Fprintln(&b, "  ranFunctionID =", e2apMsg.msgC.ranFunctionID)
 	fmt.Fprintln(&b, "  ricSubscriptionDetails.")
-	fmt.Fprintln(&b, "    ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.")
-	fmt.Fprintln(&b, "      contentLength =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.octetString.contentLength)
-	fmt.Fprintln(&b, "      interfaceID.globalENBIDPresent =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent)
-	if e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent {
-		fmt.Fprintln(&b, "      interfaceID.globalENBID.pLMNIdentity.contentLength =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.contentLength)
-		fmt.Fprintln(&b, "      interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0] =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0])
-		fmt.Fprintln(&b, "      interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1] =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1])
-		fmt.Fprintln(&b, "      interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2] =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2])
-		fmt.Fprintln(&b, "      interfaceID.globalENBID.nodeID.bits =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits)
-		fmt.Fprintln(&b, "      interfaceID.globalENBID.nodeID.nodeID =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID)
-	}
-	fmt.Fprintln(&b, "      interfaceID.globalGNBIDPresent =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent)
-	if e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent {
-		fmt.Fprintln(&b, "      interfaceID.globalGNBID.pLMNIdentity.contentLength =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.contentLength)
-		fmt.Fprintln(&b, "      interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[0] =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[0])
-		fmt.Fprintln(&b, "      interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[1] =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[1])
-		fmt.Fprintln(&b, "      interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[2] =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[2])
-		fmt.Fprintln(&b, "      interfaceID.globalGNBID.nodeID.bits =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.nodeID.bits)
-		fmt.Fprintln(&b, "      interfaceID.globalGNBID.nodeID.nodeID =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBID.nodeID.nodeID)
-	}
-	fmt.Fprintln(&b, "      interfaceDirection = ", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceDirection)
-	fmt.Fprintln(&b, "      interfaceMessageType.procedureCode =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceMessageType.procedureCode)
-	fmt.Fprintln(&b, "      interfaceMessageType.typeOfMessage =", e2apMsg.msgC.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage)
 	fmt.Fprintln(&b, "    ricActionToBeSetupItemIEs.")
 	fmt.Fprintln(&b, "      contentLength =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.contentLength)
 	var index uint8
@@ -1182,15 +664,7 @@
 	for (C.uchar)(index) < e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.contentLength {
 		fmt.Fprintln(&b, "      ricActionToBeSetupItem[index].ricActionID =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionID)
 		fmt.Fprintln(&b, "      ricActionToBeSetupItem[index].ricActionType =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionType)
-
 		fmt.Fprintln(&b, "      ricActionToBeSetupItem[index].ricActionDefinitionPresent =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent)
-		if e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent {
-			fmt.Fprintln(&b, "      ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1Present =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1Present)
-			fmt.Fprintln(&b, "      ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2Present =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2Present)
-			fmt.Fprintln(&b, "      ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present)
-			// Dynamically allocated C-structs are already freed. Can't print those.
-		}
-
 		fmt.Fprintln(&b, "      ricActionToBeSetupItem[index].ricSubsequentActionPresent =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentActionPresent)
 		if e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentActionPresent {
 			fmt.Fprintln(&b, "      ricActionToBeSetupItem[index].ricSubsequentAction.ricSubsequentActionType =", e2apMsg.msgC.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricSubsequentActionType)
