Commit c739058c authored by Laurent THOMAS's avatar Laurent THOMAS

enhanced macros for asn1c

parent fefeb169
......@@ -38,6 +38,7 @@
#define F1AP_COMMON_H_
#include "openairinterface5g_limits.h"
#include <openair2/RRC/NR/MESSAGES/asn1_msg.h>
#define F1AP_UE_IDENTIFIER_NUMBER 3
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
......@@ -479,10 +480,6 @@ static inline f1ap_setup_req_t *f1ap_req(F1_t isCu, instance_t instanceP) {
return &getCxt(isCu, instanceP)->setupReq;
}
#define asn1cCalloc(VaR, TyPe, lOcPtr) TyPe *lOcPtr=VaR=(TyPe*) calloc(1,sizeof(TyPe));
#define asn1cCallocOne(VaR, TyPe, VaLue) VaR=(TyPe*) calloc(1,sizeof(TyPe)); *VaR=VaLue;
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) TyPe *lOcPtr=(TyPe*) calloc(1,sizeof(TyPe)); ASN_SEQUENCE_ADD(&VaR,lOcPtr);
#define TASK_F1APP f1ap_req(false, instance)->cell_type==CELL_MACRO_GNB?TASK_GNB_APP:TASK_ENB_APP
//lts: C struct type is not homogeneous, so we need macros instead of functions
......
......@@ -241,7 +241,7 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
asn1cCalloc(pdu.choice.successfulOutcome, F1AP_SuccessfulOutcome_t, tmp);
asn1cCalloc(pdu.choice.successfulOutcome, tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_F1Setup;
tmp->criticality = F1AP_Criticality_reject;
tmp->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
......@@ -345,7 +345,7 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
uint32_t len=0;
/* Create */
/* 0. Message Type */
asn1cCalloc(pdu.choice.unsuccessfulOutcome, F1AP_UnsuccessfulOutcome_t, UnsuccessfulOutcome);
asn1cCalloc(pdu.choice.unsuccessfulOutcome, UnsuccessfulOutcome);
pdu.present = F1AP_F1AP_PDU_PR_unsuccessfulOutcome;
UnsuccessfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
UnsuccessfulOutcome->criticality = F1AP_Criticality_reject;
......@@ -385,13 +385,13 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
ie4->criticality = F1AP_Criticality_ignore;
ie4->value.present = F1AP_F1SetupFailureIEs__value_PR_CriticalityDiagnostics;
asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.procedureCode,
F1AP_ProcedureCode_t, F1AP_ProcedureCode_id_UEContextSetup);
F1AP_ProcedureCode_id_UEContextSetup);
asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.triggeringMessage,
F1AP_TriggeringMessage_t, F1AP_TriggeringMessage_initiating_message);
F1AP_TriggeringMessage_initiating_message);
asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.procedureCriticality,
F1AP_Criticality_t, F1AP_Criticality_reject);
F1AP_Criticality_reject);
asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.transactionID,
F1AP_TransactionID_t, 0);
0);
}
/* encode */
......@@ -438,7 +438,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, initMsg);
asn1cCalloc(pdu.choice.initiatingMessage, initMsg);
initMsg->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
initMsg->criticality = F1AP_Criticality_reject;
initMsg->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate;
......@@ -472,7 +472,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
addnRCGI(cells_to_be_activated_list_item->nRCGI, f1ap_gnb_cu_configuration_update->cells_to_activate+i);
// optional
// -nRPCI
asn1cCalloc(cells_to_be_activated_list_item->nRPCI, F1AP_NRPCI_t, tmp);
asn1cCalloc(cells_to_be_activated_list_item->nRPCI, tmp);
*tmp = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007
// optional
// 3.1.2 gNB-CUSystem Information
......
......@@ -148,7 +148,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, tmp);
asn1cCalloc(pdu.choice.initiatingMessage, tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_DLRRCMessageTransfer;
tmp->criticality = F1AP_Criticality_ignore;
tmp->value.present = F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer;
......
......@@ -102,7 +102,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* Create */
/* 0. pdu Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, initMsg);
asn1cCalloc(pdu.choice.initiatingMessage, initMsg);
initMsg->procedureCode = F1AP_ProcedureCode_id_F1Setup;
initMsg->criticality = F1AP_Criticality_reject;
initMsg->value.present = F1AP_InitiatingMessage__value_PR_F1SetupRequest;
......@@ -159,7 +159,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
served_cell_information->nRPCI = cell->nr_pci; // int 0..1007
/* - fiveGS_TAC */
uint32_t tac=htonl(cell->tac);
asn1cCalloc(served_cell_information->fiveGS_TAC, F1AP_FiveGS_TAC_t, netOrder);
asn1cCalloc(served_cell_information->fiveGS_TAC, netOrder);
OCTET_STRING_fromBuf(netOrder, ((char *)&tac)+1, 3);
/* - Configured_EPS_TAC */
......@@ -176,14 +176,14 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
if (f1ap_req(false, instance)->fdd_flag) { // FDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
asn1cCalloc(nR_Mode_Info->choice.fDD, F1AP_FDD_Info_t, fDD_Info);
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
/* FDD.1 UL NRFreqInfo */
/* FDD.1.1 UL NRFreqInfo ARFCN */
fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_req(false,instance)->nr_mode_info[i].fdd.ul_nr_arfcn; // Integer
/* FDD.1.2 F1AP_SUL_Information */
if(0) { // Optional
asn1cCalloc(fDD_Info->uL_NRFreqInfo.sul_Information, F1AP_SUL_Information_t, fdd_sul_info);
asn1cCalloc(fDD_Info->uL_NRFreqInfo.sul_Information, fdd_sul_info);
fdd_sul_info->sUL_NRARFCN = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
......@@ -247,7 +247,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
fDD_Info->dL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_req(false,instance)->nr_mode_info[i].fdd.dl_nrb);
} else { // TDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
asn1cCalloc(nR_Mode_Info->choice.tDD, F1AP_TDD_Info_t, tDD_Info);
asn1cCalloc(nR_Mode_Info->choice.tDD, tDD_Info);
/* TDD.1 nRFreqInfo */
/* TDD.1.1 nRFreqInfo ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = f1ap_req(false,instance)->nr_mode_info[i].tdd.nr_arfcn; // Integer
......@@ -289,7 +289,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
OCTET_STRING_fromBuf(&served_cell_information->measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
asn1cCalloc(gnb_du_served_cells_item->gNB_DU_System_Information, F1AP_GNB_DU_System_Information_t, gNB_DU_System_Information);
asn1cCalloc(gnb_du_served_cells_item->gNB_DU_System_Information, gNB_DU_System_Information);
/* 4.1.2 gNB-DU System Information */
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
(const char *)f1ap_req(false,instance)->mib[i], //f1ap_du_data->mib,
......@@ -535,7 +535,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage,F1AP_InitiatingMessage_t, initMsg);
asn1cCalloc(pdu.choice.initiatingMessage, initMsg);
initMsg->procedureCode = F1AP_ProcedureCode_id_gNBDUConfigurationUpdate;
initMsg->criticality = F1AP_Criticality_reject;
initMsg->value.present = F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
......@@ -587,7 +587,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
if (f1ap_setup_req->fdd_flag) {
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */
asn1cCalloc(nR_Mode_Info->choice.fDD, F1AP_FDD_Info_t, fDD_Info);
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
/* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, ul_freqBandNrItem);
......@@ -609,7 +609,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
} else { // TDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
/* > TDD >> TDD Info */
asn1cCalloc(nR_Mode_Info->choice.tDD, F1AP_TDD_Info_t, tDD_Info);
asn1cCalloc(nR_Mode_Info->choice.tDD, tDD_Info);
/* >>> ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
......@@ -626,7 +626,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
/* 2.1.2 gNB-DU System Information */
asn1cCalloc(served_cells_to_add_item->gNB_DU_System_Information, F1AP_GNB_DU_System_Information_t, gNB_DU_System_Information);
asn1cCalloc(served_cells_to_add_item->gNB_DU_System_Information, gNB_DU_System_Information);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
sizeof("1"));
......@@ -659,14 +659,14 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* - nRPCI */
served_cell_information->nRPCI = f1ap_setup_req->cell[i].nr_pci; // int 0..1007
/* - fiveGS_TAC */
asn1cCalloc(served_cell_information->fiveGS_TAC,F1AP_FiveGS_TAC_t, tac );
asn1cCalloc(served_cell_information->fiveGS_TAC, tac );
OCTET_STRING_fromBuf(tac,
(const char *) &f1ap_setup_req->cell[i].tac,
3);
/* - Configured_EPS_TAC */
if(1) {
asn1cCalloc(served_cell_information->configured_EPS_TAC, F1AP_Configured_EPS_TAC_t, tmp2);
asn1cCalloc(served_cell_information->configured_EPS_TAC, tmp2);
OCTET_STRING_fromBuf(tmp2,
"2",
2);
......@@ -680,7 +680,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
if (f1ap_setup_req->fdd_flag) {
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */
asn1cCalloc(nR_Mode_Info->choice.fDD, F1AP_FDD_Info_t, fDD_Info);
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
/* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, ul_freqBandNrItem);
......@@ -703,7 +703,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
} else { // TDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
/* > TDD >> TDD Info */
asn1cCalloc(nR_Mode_Info->choice.tDD, F1AP_TDD_Info_t, tDD_Info);
asn1cCalloc(nR_Mode_Info->choice.tDD, tDD_Info);
/* >>> ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
......@@ -720,7 +720,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
/* 3.2.2 gNB-DU System Information */
asn1cCalloc( served_cells_to_modify_item->gNB_DU_System_Information, F1AP_GNB_DU_System_Information_t, gNB_DU_System_Information);
asn1cCalloc( served_cells_to_modify_item->gNB_DU_System_Information, gNB_DU_System_Information);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
sizeof("1"));
......@@ -949,7 +949,7 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
/* Create */
/* 0. pdu Type */
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
asn1cCalloc(pdu.choice.successfulOutcome, F1AP_SuccessfulOutcome_t, tmp);
asn1cCalloc(pdu.choice.successfulOutcome, tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
tmp->criticality = F1AP_Criticality_reject;
tmp->value.present = F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge;
......
......@@ -767,7 +767,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, tmp);
asn1cCalloc(pdu.choice.initiatingMessage, tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_InitialULRRCMessageTransfer;
tmp->criticality = F1AP_Criticality_ignore;
tmp->value.present = F1AP_InitiatingMessage__value_PR_InitialULRRCMessageTransfer;
......@@ -841,7 +841,7 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, tmp);
asn1cCalloc(pdu.choice.initiatingMessage, tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_ULRRCMessageTransfer;
tmp->criticality = F1AP_Criticality_ignore;
tmp->value.present = F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer;
......
......@@ -249,7 +249,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
asn1cCalloc(pdu.choice.successfulOutcome, F1AP_SuccessfulOutcome_t,tmp);
asn1cCalloc(pdu.choice.successfulOutcome, tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
tmp->criticality = F1AP_Criticality_reject;
tmp->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextSetupResponse;
......@@ -284,16 +284,14 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
/* OPTIONAL */
/* measGapConfig */
if (0) {
asn1cCalloc(ie3->value.choice.DUtoCURRCInformation.measGapConfig,
F1AP_MeasGapConfig_t, tmp);
asn1cCalloc(ie3->value.choice.DUtoCURRCInformation.measGapConfig, tmp);
OCTET_STRING_fromBuf(tmp, "asdsa", strlen("asdsa"));
}
/* OPTIONAL */
/* requestedP_MaxFR1 */
if (0) {
asn1cCalloc(ie3->value.choice.DUtoCURRCInformation.requestedP_MaxFR1,
OCTET_STRING_t, tmp);
asn1cCalloc(ie3->value.choice.DUtoCURRCInformation.requestedP_MaxFR1, tmp);
OCTET_STRING_fromBuf(tmp, "asdsa", strlen("asdsa"));
}
}
......@@ -362,8 +360,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
F1AP_DLUPTNLInformation_ToBeSetup_Item_t, dLUPTNLInformation_ToBeSetup_Item);
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
/* gTPTunnel */
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel,
F1AP_GTPTunnel_t, gTPTunnel);
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel,gTPTunnel);
/* transportLayerAddress */
struct sockaddr_in addr= {0};
inet_pton(AF_INET, getCxt(false,instance)->setupReq.DU_f1_ip_address.ipv4_address,
......@@ -396,7 +393,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
/* sRBID */
srbs_failedToBeSetup_item->sRBID = 13L;
/* cause */
asn1cCalloc(srbs_failedToBeSetup_item->cause, F1AP_Cause_t,tmp);
asn1cCalloc(srbs_failedToBeSetup_item->cause, tmp);
// dummy value
tmp->present = F1AP_Cause_PR_radioNetwork;
......@@ -445,7 +442,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
/* dRBID */
drbs_failedToBeSetup_item->dRBID = 14;
/* cause */
asn1cCalloc(drbs_failedToBeSetup_item->cause, F1AP_Cause_t,tmp);
asn1cCalloc(drbs_failedToBeSetup_item->cause,tmp);
// dummy value
tmp->present = F1AP_Cause_PR_radioNetwork;
......@@ -493,7 +490,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
/* sCell_ID */
addnRCGI(sCell_FailedtoSetup_item->sCell_ID,f1ap_req(false, instance)->cell+i);
/* cause */
asn1cCalloc(sCell_FailedtoSetup_item->cause, F1AP_Cause_t, tmp);
asn1cCalloc(sCell_FailedtoSetup_item->cause, tmp);
// dummy value
tmp->present = F1AP_Cause_PR_radioNetwork;
......@@ -559,13 +556,13 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
ie12->criticality = F1AP_Criticality_ignore;
ie12->value.present = F1AP_UEContextSetupResponseIEs__value_PR_CriticalityDiagnostics;
asn1cCallocOne(ie12->value.choice.CriticalityDiagnostics.procedureCode,
F1AP_ProcedureCode_t, F1AP_ProcedureCode_id_UEContextSetup);
F1AP_ProcedureCode_id_UEContextSetup);
asn1cCallocOne(ie12->value.choice.CriticalityDiagnostics.triggeringMessage,
F1AP_TriggeringMessage_t, F1AP_TriggeringMessage_initiating_message);
F1AP_TriggeringMessage_initiating_message);
asn1cCallocOne(ie12->value.choice.CriticalityDiagnostics.procedureCriticality,
F1AP_Criticality_t, F1AP_Criticality_reject);
F1AP_Criticality_reject);
asn1cCallocOne(ie12->value.choice.CriticalityDiagnostics.transactionID,
F1AP_TransactionID_t, 0);
0);
}
/* encode */
......@@ -592,7 +589,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, tmp);
asn1cCalloc(pdu.choice.initiatingMessage, tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_UEContextReleaseRequest;
tmp->criticality = F1AP_Criticality_reject;
tmp->value.present = F1AP_InitiatingMessage__value_PR_UEContextReleaseRequest;
......@@ -806,7 +803,7 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
asn1cCalloc(pdu.choice.successfulOutcome, F1AP_SuccessfulOutcome_t, tmp);
asn1cCalloc(pdu.choice.successfulOutcome, tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_UEContextRelease;
tmp->criticality = F1AP_Criticality_reject;
tmp->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextReleaseComplete;
......@@ -904,7 +901,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
/* Create */
/* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
asn1cCalloc(pdu.choice.successfulOutcome,F1AP_SuccessfulOutcome_t, tmp);
asn1cCalloc(pdu.choice.successfulOutcome,tmp);
tmp->procedureCode = F1AP_ProcedureCode_id_UEContextModification;
tmp->criticality = F1AP_Criticality_reject;
tmp->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse;
......@@ -981,7 +978,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
F1AP_DLUPTNLInformation_ToBeSetup_Item_t, dLUPTNLInformation_ToBeSetup_Item);
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel,
F1AP_GTPTunnel_t, gTPTunnel);
gTPTunnel);
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
strlen("1204"));
......@@ -1014,10 +1011,9 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
/* DLTunnels_Modified_Item */
asn1cSequenceAdd(drbs_modified_item->dLUPTNLInformation_ToBeSetup_List.list,
F1AP_DLUPTNLInformation_ToBeSetup_Item_t, dLUPTNLInformation_ToBeSetup_Item);
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item, F1AP_DLUPTNLInformation_ToBeSetup_Item_t, tmp);
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item, tmp);
tmp->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel,
F1AP_GTPTunnel_t, gTPTunnel);
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel, gTPTunnel);
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204", strlen("1204"));
}
......@@ -1042,7 +1038,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
&srbs_failedToBeSetupMod_item_ies->value.choice.SRBs_FailedToBeSetupMod_Item;
/* - sRBID */
srbs_failedToBeSetupMod_item->sRBID = 50L;
asn1cCalloc(srbs_failedToBeSetupMod_item->cause, F1AP_Cause_t, tmp)
asn1cCalloc(srbs_failedToBeSetupMod_item->cause, tmp)
tmp->present = F1AP_Cause_PR_radioNetwork;
tmp->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id;
}
......@@ -1089,7 +1085,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
F1AP_SCell_FailedtoSetupMod_Item_t *scell_failedtoSetupMod_item=&scell_failedtoSetupMod_item_ies->value.choice.SCell_FailedtoSetupMod_Item;
/* - sCell_ID */
addnRCGI(scell_failedtoSetupMod_item->sCell_ID, &f1ap_req(false, instance)->cell[i]);
asn1cCalloc(scell_failedtoSetupMod_item->cause, F1AP_Cause_t, tmp);
asn1cCalloc(scell_failedtoSetupMod_item->cause, tmp);
tmp->present = F1AP_Cause_PR_radioNetwork;
tmp->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id;
}
......@@ -1113,7 +1109,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
&drbs_failedToBeModified_item_ies->value.choice.DRBs_FailedToBeModified_Item ;
/* dRBID */
drbs_failedToBeModified_item->dRBID = 30L;
asn1cCalloc(drbs_failedToBeModified_item->cause, F1AP_Cause_t, tmp);
asn1cCalloc(drbs_failedToBeModified_item->cause, tmp);
tmp->present = F1AP_Cause_PR_radioNetwork;
tmp->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id;
}
......
......@@ -52,6 +52,14 @@
*/
int xer_sprint(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr);
#define asn1cCallocOne(VaR, VaLue) \
VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue;
#define asn1cCalloc(VaR, lOcPtr) \
typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR));
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \
TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \
ASN_SEQUENCE_ADD(&VaR,lOcPtr);
uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index);
uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId);
......
......@@ -153,6 +153,15 @@ typedef struct xer_sprint_string_s {
size_t string_index;
} xer_sprint_string_t;
#define asn1cCallocOne(VaR, VaLue) \
VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue;
#define asn1cCalloc(VaR, lOcPtr) \
typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR));
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \
TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \
ASN_SEQUENCE_ADD(&VaR,lOcPtr);
//replace LTE
//extern unsigned char NB_eNB_INST;
extern unsigned char NB_gNB_INST;
......
......@@ -53,6 +53,15 @@
*/
int xer_sprint_NR(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr);
#define asn1cCallocOne(VaR, VaLue) \
VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue;
#define asn1cCalloc(VaR, lOcPtr) \
typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR));
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \
TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \
ASN_SEQUENCE_ADD(&VaR,lOcPtr);
uint8_t do_MIB_NR(gNB_RRC_INST *rrc,
uint32_t frame);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment