Make subscription manager independent of E2SMs
Issue-ID: RIC-628
Change-Id: Ia9e37863c0a5b76f535867b5aa127a8748d0a1d9
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
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)