Commit b94aee2e authored by Laurent THOMAS's avatar Laurent THOMAS

fixing F1-U

parent a455ce7c
......@@ -103,7 +103,9 @@ pthread_mutex_t sync_mutex;
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
int config_sync_var=-1;
// not used in UE
instance_t CUuniqInstance=0;
instance_t DUuniqInstance=0;
RAN_CONTEXT_t RC;
volatile int oai_exit = 0;
......
......@@ -64,17 +64,17 @@ uint8_t F1AP_get_next_transaction_identifier(instance_t enb_mod_idP, instance_t
return transaction_identifier[enb_mod_idP+cu_mod_idP];
}
f1ap_cudu_inst_t *getCxt(bool isCU, instance_t instanceP) {
f1ap_cudu_inst_t *getCxt(F1_t isCU, instance_t instanceP) {
static pid_t t=-1;
pid_t tNew=gettid();
AssertFatal ( t==-1 || t==tNew, "This is not thread safe\n");
t=tNew;
AssertFatal( instanceP < sizeofArray(f1_cu_inst), "");
return isCU? f1_cu_inst[ instanceP]: f1_du_inst[ instanceP];
return isCU == CUtype ? f1_cu_inst[ instanceP]: f1_du_inst[ instanceP];
}
void createF1inst(bool isCU, instance_t instanceP, f1ap_setup_req_t *req) {
if (isCU) {
void createF1inst(F1_t isCU, instance_t instanceP, f1ap_setup_req_t *req) {
if (isCU == CUtype) {
AssertFatal(f1_cu_inst[instanceP] == NULL, "Double call to F1 CU init\n");
f1_cu_inst[instanceP]=( f1ap_cudu_inst_t *) calloc(1, sizeof( f1ap_cudu_inst_t));
//memcpy(f1_cu_inst[instanceP]->setupReq, req, sizeof(f1ap_setup_req_t) );
......@@ -85,7 +85,7 @@ void createF1inst(bool isCU, instance_t instanceP, f1ap_setup_req_t *req) {
}
}
int f1ap_add_ue(bool isCu,
int f1ap_add_ue(F1_t isCu,
instance_t instanceP,
rnti_t rntiP) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
......@@ -114,7 +114,7 @@ int f1ap_add_ue(bool isCu,
}
int f1ap_remove_ue(bool isCu, instance_t instanceP,
int f1ap_remove_ue(F1_t isCu, instance_t instanceP,
rnti_t rntiP) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
......@@ -129,7 +129,7 @@ int f1ap_remove_ue(bool isCu, instance_t instanceP,
return 0;
}
int f1ap_get_du_ue_f1ap_id(bool isCu, instance_t instanceP,
int f1ap_get_du_ue_f1ap_id(F1_t isCu, instance_t instanceP,
rnti_t rntiP) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
......@@ -142,7 +142,7 @@ int f1ap_get_du_ue_f1ap_id(bool isCu, instance_t instanceP,
return -1;
}
int f1ap_get_cu_ue_f1ap_id(bool isCu, instance_t instanceP,
int f1ap_get_cu_ue_f1ap_id(F1_t isCu, instance_t instanceP,
rnti_t rntiP) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
......@@ -155,7 +155,7 @@ int f1ap_get_cu_ue_f1ap_id(bool isCu, instance_t instanceP,
return -1;
}
int f1ap_get_rnti_by_du_id(bool isCu, instance_t instanceP,
int f1ap_get_rnti_by_du_id(F1_t isCu, instance_t instanceP,
instance_t du_ue_f1ap_id ) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
......@@ -168,7 +168,7 @@ int f1ap_get_rnti_by_du_id(bool isCu, instance_t instanceP,
return -1;
}
int f1ap_get_rnti_by_cu_id(bool isCu, instance_t instanceP,
int f1ap_get_rnti_by_cu_id(F1_t isCu, instance_t instanceP,
instance_t cu_ue_f1ap_id ) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
......@@ -181,51 +181,19 @@ int f1ap_get_rnti_by_cu_id(bool isCu, instance_t instanceP,
return -1;
}
int f1ap_get_du_uid(bool isCu, instance_t instanceP,
instance_t du_ue_f1ap_id ) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
int f1ap_du_add_cu_ue_id(instance_t instanceP,
instance_t du_ue_f1ap_id,
instance_t cu_ue_f1ap_id) {
f1ap_cudu_inst_t *f1_inst=getCxt(DUtype, instanceP);
instance_t f1ap_uid=-1;
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
return i;
f1ap_uid=i;
break;
}
}
return -1;
}
int f1ap_get_cu_uid(bool isCu, instance_t instanceP,
instance_t cu_ue_f1ap_id ) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
return i;
}
}
return -1;
}
int f1ap_get_uid_by_rnti(bool isCu, instance_t instanceP,
rnti_t rntiP ) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return i;
}
}
return -1;
}
int f1ap_du_add_cu_ue_id(bool isCu, instance_t instanceP,
instance_t du_ue_f1ap_id,
instance_t cu_ue_f1ap_id) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
instance_t f1ap_uid = f1ap_get_du_uid(isCu, instanceP,du_ue_f1ap_id);
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB)
return -1;
......@@ -234,21 +202,7 @@ int f1ap_du_add_cu_ue_id(bool isCu, instance_t instanceP,
return 0;
}
int f1ap_cu_add_du_ue_id(bool isCu, instance_t instanceP,
instance_t cu_ue_f1ap_id,
instance_t du_ue_f1ap_id) {
f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
instance_t f1ap_uid = f1ap_get_cu_uid(isCu,instanceP,cu_ue_f1ap_id);
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB)
return -1;
f1_inst->f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
LOG_I(F1AP, "Adding du_ue_f1ap_id %ld for UE with RNTI %x\n", du_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
return 0;
}
int f1ap_assoc_id(bool isCu, instance_t instanceP) {
int f1ap_assoc_id(F1_t isCu, instance_t instanceP) {
f1ap_setup_req_t *f1_inst=f1ap_req(isCu, instanceP);
return f1_inst->assoc_id;
}
......@@ -437,55 +437,45 @@ typedef struct f1ap_cudu_inst_s {
f1ap_cudu_ue_t f1ap_ue[MAX_MOBILES_PER_ENB];
} f1ap_cudu_inst_t;
typedef enum {
DUtype=0,
CUtype
} F1_t;
uint8_t F1AP_get_next_transaction_identifier(instance_t enb_mod_idP, instance_t cu_mod_idP);
f1ap_cudu_inst_t *getCxt(bool isCU, instance_t instanceP);
f1ap_cudu_inst_t *getCxt(F1_t isCU, instance_t instanceP);
void createF1inst(bool isCU, instance_t instanceP, f1ap_setup_req_t *req);
int f1ap_add_ue(bool isCu,
void createF1inst(F1_t isCU, instance_t instanceP, f1ap_setup_req_t *req);
int f1ap_add_ue(F1_t isCu,
instance_t instanceP,
rnti_t rntiP);
int f1ap_remove_ue(bool isCu, instance_t instanceP,
int f1ap_remove_ue(F1_t isCu, instance_t instanceP,
rnti_t rntiP);
int f1ap_get_du_ue_f1ap_id (bool isCu, instance_t instanceP,
int f1ap_get_du_ue_f1ap_id (F1_t isCu, instance_t instanceP,
rnti_t rntiP);
int f1ap_get_cu_ue_f1ap_id (bool isCu, instance_t instanceP,
int f1ap_get_cu_ue_f1ap_id (F1_t isCu, instance_t instanceP,
rnti_t rntiP);
int f1ap_get_rnti_by_du_id(bool isCu, instance_t instanceP,
int f1ap_get_rnti_by_du_id(F1_t isCu, instance_t instanceP,
instance_t du_ue_f1ap_id );
int f1ap_get_rnti_by_cu_id(bool isCu, instance_t instanceP,
int f1ap_get_rnti_by_cu_id(F1_t isCu, instance_t instanceP,
instance_t cu_ue_f1ap_id );
int f1ap_get_du_uid(bool isCu, instance_t instanceP,
instance_t du_ue_f1ap_id );
int f1ap_get_cu_uid(bool isCu, instance_t instanceP,
instance_t cu_ue_f1ap_id );
int f1ap_get_uid_by_rnti(bool isCu, instance_t instanceP,
rnti_t rntiP );
int f1ap_du_add_cu_ue_id(bool isCu, instance_t instanceP,
int f1ap_du_add_cu_ue_id(instance_t instanceP,
instance_t du_ue_f1ap_id,
instance_t cu_ue_f1ap_id);
int f1ap_cu_add_du_ue_id(bool isCu, instance_t instanceP,
instance_t cu_ue_f1ap_id,
instance_t du_ue_f1ap_id);
int f1ap_assoc_id(bool isCu, instance_t instanceP);
int f1ap_assoc_id(F1_t isCu, instance_t instanceP);
static inline f1ap_setup_req_t *f1ap_req(bool isCu, instance_t instanceP) {
static inline f1ap_setup_req_t *f1ap_req(F1_t isCu, instance_t instanceP) {
return &getCxt(isCu, instanceP)->setupReq;
}
......
......@@ -120,7 +120,7 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie->value.choice.DUtoCURRCContainer.size);
}
int f1ap_uid = f1ap_add_ue(true, instance, rnti);
int f1ap_uid = f1ap_add_ue(CUtype, instance, rnti);
if (f1ap_uid < 0 ) {
LOG_E(F1AP, "Failed to add UE \n");
......@@ -164,7 +164,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(true, instance, f1ap_dl_rrc->rnti);
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(CUtype, instance, f1ap_dl_rrc->rnti);
LOG_I(F1AP, "Setting GNB_CU_UE_F1AP_ID %llu associated with UE RNTI %x (instance %ld)\n",
(unsigned long long int)ie1->value.choice.GNB_CU_UE_F1AP_ID, f1ap_dl_rrc->rnti, instance);
/* mandatory */
......@@ -173,7 +173,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(true, instance, f1ap_dl_rrc->rnti);
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(CUtype, instance, f1ap_dl_rrc->rnti);
LOG_I(F1AP, "GNB_DU_UE_F1AP_ID %llu associated with UE RNTI %x \n", (unsigned long long int)ie2->value.choice.GNB_DU_UE_F1AP_ID, f1ap_dl_rrc->rnti);
/* optional */
/* c3. oldgNB_DU_UE_F1AP_ID */
......@@ -271,13 +271,13 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
LOG_D(F1AP, "cu_ue_f1ap_id %lu associated with RNTI %x\n",
cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(true, instance, cu_ue_f1ap_id));
cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(CUtype, instance, cu_ue_f1ap_id));
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with RNTI %x\n",
du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(true, instance, du_ue_f1ap_id));
du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(CUtype, instance, du_ue_f1ap_id));
/* mandatory */
/* SRBID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
......@@ -307,7 +307,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie->value.choice.RRCContainer.size);
RRC_DCCH_DATA_IND (message_p).dcch_index = srb_id;
RRC_DCCH_DATA_IND (message_p).rnti = f1ap_get_rnti_by_cu_id(true, instance, cu_ue_f1ap_id);
RRC_DCCH_DATA_IND (message_p).rnti = f1ap_get_rnti_by_cu_id(CUtype, instance, cu_ue_f1ap_id);
RRC_DCCH_DATA_IND (message_p).instance = instance;
RRC_DCCH_DATA_IND (message_p).eNB_index = instance; // not needed for CU
......@@ -316,7 +316,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
protocol_ctxt_t ctxt;
ctxt.instance = instance;
ctxt.instance = instance;
ctxt.rnti = f1ap_get_rnti_by_cu_id(true, instance, cu_ue_f1ap_id);
ctxt.rnti = f1ap_get_rnti_by_cu_id(CUtype, instance, cu_ue_f1ap_id);
ctxt.enb_flag = 1;
ctxt.eNB_index = 0;
mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__);
......
......@@ -38,6 +38,9 @@
#include "proto_agent.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
instance_t CUuniqInstance=0;
static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) {
openAddr_t tmp={0};
strncpy(tmp.originHost, IPaddrs->my_addr, sizeof(tmp.originHost)-1);
......@@ -56,9 +59,11 @@ static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_as
f1ap_cu_data->sctp_in_streams = sctp_new_association_ind->in_streams;
f1ap_cu_data->sctp_out_streams = sctp_new_association_ind->out_streams;
f1ap_cu_data->default_sctp_stream_id = 0;
getCxt(true, instance)->gtpInst=cu_task_create_gtpu_instance_to_du(IPaddrs);
AssertFatal(getCxt(true, instance)->gtpInst>0,"Failed to create CU F1-U UDP listener");
// Nothing
getCxt(CUtype, instance)->gtpInst=cu_task_create_gtpu_instance_to_du(IPaddrs);
AssertFatal(getCxt(CUtype, instance)->gtpInst>0,"Failed to create CU F1-U UDP listener");
// Fixme: fully inconsistent instances management
// dirty global var is a bad fix
CUuniqInstance=getCxt(CUtype, instance)->gtpInst;
}
static void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
......
......@@ -88,7 +88,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(true, instance, f1ap_ue_context_setup_req->rnti); //f1ap_ue_context_setup_req->gNB_CU_ue_id;
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(CUtype, instance, f1ap_ue_context_setup_req->rnti); //f1ap_ue_context_setup_req->gNB_CU_ue_id;
/* optional */
/* c2. GNB_DU_UE_F1AP_ID */
......@@ -97,7 +97,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie2->criticality = F1AP_Criticality_ignore;
ie2->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(true, instance, f1ap_ue_context_setup_req->rnti); //*f1ap_ue_context_setup_req->gNB_DU_ue_id;
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(CUtype, instance, f1ap_ue_context_setup_req->rnti); //*f1ap_ue_context_setup_req->gNB_DU_ue_id;
}
/* mandatory */
......@@ -520,7 +520,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
addr.length = sz*8;
f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].teid=
newGtpuCreateTunnel(getCxt(true, instance)->gtpInst,
newGtpuCreateTunnel(getCxt(CUtype, instance)->gtpInst,
f1ap_ue_context_setup_req->rnti,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
......@@ -668,7 +668,7 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
LOG_D(F1AP, "f1ap_ue_context_setup_resp->gNB_DU_ue_id is: %d \n", f1ap_ue_context_setup_resp->gNB_DU_ue_id);
f1ap_ue_context_setup_resp->rnti =
f1ap_get_rnti_by_du_id(true, instance, f1ap_ue_context_setup_resp->gNB_DU_ue_id);
f1ap_get_rnti_by_du_id(CUtype, instance, f1ap_ue_context_setup_resp->gNB_DU_ue_id);
// DUtoCURRCInformation
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
......@@ -705,7 +705,7 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
F1AP_GTPTunnel_t *dl_up_tnl0 = dl_up_tnl_info_p->dLUPTNLInformation.choice.gTPTunnel;
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&dl_up_tnl0->transportLayerAddress, drb_p->up_dl_tnl[0].tl_address);
OCTET_STRING_TO_INT32(&dl_up_tnl0->gTP_TEID, drb_p->up_dl_tnl[0].teid);
GtpuUpdateTunnelOutgoingTeid(getCxt(true, instance)->gtpInst,
GtpuUpdateTunnelOutgoingTeid(getCxt(CUtype, instance)->gtpInst,
f1ap_ue_context_setup_resp->rnti,
(ebi_t)drbs_setup_item_p->dRBID,
drb_p->up_dl_tnl[0].teid);
......@@ -793,7 +793,7 @@ int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
const rnti_t rnti2 = f1ap_get_rnti_by_du_id(true, instance,
const rnti_t rnti2 = f1ap_get_rnti_by_du_id(CUtype, instance,
ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(rnti == rnti2, "RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti2, rnti);
......@@ -859,14 +859,14 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(true, instance, cmd->rnti);
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(CUtype, instance, cmd->rnti);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextReleaseCommandIEs_t, ie2);
ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(true, instance, cmd->rnti);
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(CUtype, instance, cmd->rnti);
/* mandatory */
/* c3. Cause */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextReleaseCommandIEs_t, ie3);
......@@ -930,12 +930,12 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCompleteIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
const rnti_t rnti = f1ap_get_rnti_by_cu_id(true, instance,
const rnti_t rnti = f1ap_get_rnti_by_cu_id(CUtype, instance,
ie->value.choice.GNB_CU_UE_F1AP_ID);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCompleteIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
const rnti_t rnti2 = f1ap_get_rnti_by_du_id(true, instance,
const rnti_t rnti2 = f1ap_get_rnti_by_du_id(CUtype, instance,
ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(rnti == rnti2, "RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti2, rnti);
......@@ -1011,7 +1011,7 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
instance, rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
LOG_I(F1AP, "Received UE CONTEXT RELEASE COMPLETE: Removing CU UE entry for RNTI %x\n", rnti);
f1ap_remove_ue(true, instance, rnti);
f1ap_remove_ue(CUtype, instance, rnti);
return 0;
}
//void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) {
......
......@@ -101,10 +101,10 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with UE RNTI %x \n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id));
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id));
// this should be the one transmitted via initial ul rrc message transfer
if (f1ap_du_add_cu_ue_id(false, instance,du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
if (f1ap_du_add_cu_ue_id(instance,du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
LOG_E(F1AP, "Failed to find the F1AP UID \n");
//return -1;
}
......@@ -164,7 +164,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
// decode RRC Container and act on the message type
AssertFatal(srb_id<3,"illegal srb_id\n");
protocol_ctxt_t ctxt;
ctxt.rnti = f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id);
ctxt.rnti = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
ctxt.instance = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
......@@ -206,7 +206,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionSetup DU_ID %lx/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id));
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id));
// Get configuration
LTE_RRCConnectionSetup_t *rrcConnectionSetup = &dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup;
AssertFatal(rrcConnectionSetup!=NULL,"rrcConnectionSetup is null\n");
......@@ -245,7 +245,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
// This should be somewhere in the f1ap_cudu_ue_inst_t
/*int macrlc_instance = 0;
rnti_t rnti = f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id);
rnti_t rnti = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[macrlc_instance],rnti);
*/
eNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
......@@ -342,7 +342,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
LOG_I(F1AP,
"Logical Channel DL-DCCH (SRB1), Received RRCConnectionReconfiguration DU_ID %lx/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id));
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id));
LTE_RRCConnectionReconfiguration_t *rrcConnectionReconfiguration = &dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration;
if (rrcConnectionReconfiguration->criticalExtensions.present == LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1) {
......@@ -601,7 +601,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(false, instance, rnti);
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(DUtype, instance, rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
......@@ -609,7 +609,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(false, instance, rnti);
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(DUtype, instance, rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. SRBID */
......@@ -740,7 +740,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
}
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(false, instance, buffer, len, getCxt(false, instance)->default_sctp_stream_id);
f1ap_itti_send_sctp_data_req(false, instance, buffer, len, getCxt(DUtype, instance)->default_sctp_stream_id);
return 0;
}
......@@ -758,7 +758,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
F1AP_InitialULRRCMessageTransfer_t *out;
uint8_t *buffer=NULL;
uint32_t len=0;
int f1ap_uid = f1ap_add_ue (false, instanceP, rntiP);
int f1ap_uid = f1ap_add_ue (DUtype, instanceP, rntiP);
if (f1ap_uid < 0 ) {
LOG_E(F1AP, "Failed to add UE \n");
......@@ -779,7 +779,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
ie1->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie1->value.choice.GNB_DU_UE_F1AP_ID = getCxt(false, instanceP)->f1ap_ue[f1ap_uid].du_ue_f1ap_id;
ie1->value.choice.GNB_DU_UE_F1AP_ID = getCxt(DUtype, instanceP)->f1ap_ue[f1ap_uid].du_ue_f1ap_id;
/* mandatory */
/* c2. NRCGI */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_InitialULRRCMessageTransferIEs_t, ie2);
......@@ -787,7 +787,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI;
//Fixme: takes always the first cell
addnRCGI(ie2->value.choice.NRCGI, getCxt(false, instanceP)->setupReq.cell);
addnRCGI(ie2->value.choice.NRCGI, getCxt(DUtype, instanceP)->setupReq.cell);
/* mandatory */
/* c3. C_RNTI */ // 16
asn1cSequenceAdd(out->protocolIEs.list, F1AP_InitialULRRCMessageTransferIEs_t, ie3);
......@@ -821,7 +821,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
return -1;
}
f1ap_itti_send_sctp_data_req(false, instanceP, buffer, len, getCxt(false, instanceP)->default_sctp_stream_id);
f1ap_itti_send_sctp_data_req(false, instanceP, buffer, len, getCxt(DUtype, instanceP)->default_sctp_stream_id);
return 0;
}
......@@ -853,14 +853,14 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(false, instance, rnti);
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(DUtype, instance, rnti);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_ULRRCMessageTransferIEs_t, ie2);
ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(false, instance, rnti);
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(DUtype, instance, rnti);
/* mandatory */
/* c3. SRBID */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_ULRRCMessageTransferIEs_t, ie3);
......@@ -885,7 +885,7 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
return -1;
}
f1ap_itti_send_sctp_data_req(false, instance, buffer, len, getCxt(false, instance)->default_sctp_stream_id);
f1ap_itti_send_sctp_data_req(false, instance, buffer, len, getCxt(DUtype, instance)->default_sctp_stream_id);
return 0;
}
......@@ -915,9 +915,9 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with UE RNTI %x \n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
if (f1ap_du_add_cu_ue_id(false, instance,du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
if (f1ap_du_add_cu_ue_id(instance,du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
LOG_E(F1AP, "Failed to find the F1AP UID \n");
//return -1;
}
......@@ -988,7 +988,7 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
AssertFatal(srb_id<3,"illegal srb_id\n");
MessageDef * msg = itti_alloc_new_message(TASK_DU_F1, 0, NR_DU_RRC_DL_INDICATION);
NRDuDlReq_t * req=&NRDuDlReq(msg);
req->rnti=f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id);
req->rnti=f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
req->srb_id=srb_id;
req->buf= get_free_mem_block( ie->value.choice.RRCContainer.size, __func__);
memcpy(req->buf->data, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
......
......@@ -38,6 +38,9 @@
#include "proto_agent.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
instance_t DUuniqInstance=0;
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
DevAssert(f1ap_setup_req != NULL);
MessageDef *message_p = NULL;
......@@ -133,15 +136,14 @@ void *F1AP_DU_task(void *arg) {
LOG_I(F1AP, "DU Task Received F1AP_SETUP_REQ\n");
f1ap_setup_req_t * msgSetup=&F1AP_SETUP_REQ(msg);
createF1inst(false, myInstance, msgSetup);
getCxt(false, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address,
getCxt(DUtype, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address,
msgSetup->CUport,
msgSetup->DU_f1_ip_address.ipv4_address,
msgSetup->DUport);
AssertFatal(getCxt(false, myInstance)->gtpInst>0,"Failed to create CU F1-U UDP listener");
AssertFatal(getCxt(DUtype, myInstance)->gtpInst>0,"Failed to create CU F1-U UDP listener");
// Fixme: fully inconsistent instances management
// dirty global var is a bad fix
extern instance_t legacyInstanceMapping;
legacyInstanceMapping=getCxt(false, myInstance)->gtpInst;
DUuniqInstance=getCxt(DUtype, myInstance)->gtpInst;
du_task_send_sctp_association_req(myInstance,msgSetup);
break;
......
......@@ -69,11 +69,11 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->gNB_DU_ue_id =
ieDU_UE->value.choice.GNB_DU_UE_F1AP_ID;
f1ap_ue_context_setup_req->rnti =
f1ap_get_rnti_by_du_id(false, instance, f1ap_ue_context_setup_req->gNB_DU_ue_id);
f1ap_get_rnti_by_du_id(DUtype, instance, f1ap_ue_context_setup_req->gNB_DU_ue_id);
} else {
f1ap_ue_context_setup_req->gNB_DU_ue_id = -1;
f1ap_ue_context_setup_req->rnti =
f1ap_get_rnti_by_cu_id(false, instance, f1ap_ue_context_setup_req->gNB_CU_ue_id);
f1ap_get_rnti_by_cu_id(DUtype, instance, f1ap_ue_context_setup_req->gNB_CU_ue_id);
}
if(f1ap_ue_context_setup_req->rnti<0)
......@@ -198,7 +198,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
protocol_ctxt_t ctxt;
// decode RRC Container and act on the message type
//FIXME
//rnti_t rnti = f1ap_get_rnti_by_du_id(false, instance, du_ue_f1ap_id);
//rnti_t rnti = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
ctxt.instance = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
......@@ -237,14 +237,14 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_UEContextSetupResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie1->value.choice.GNB_CU_UE_F1AP_ID = req->gNB_CU_ue_id; //f1ap_get_cu_ue_f1ap_id(true, instance, req->rnti);
ie1->value.choice.GNB_CU_UE_F1AP_ID = req->gNB_CU_ue_id;
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupResponseIEs_t, ie2);
ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(false, instance, req->rnti);
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(DUtype, instance, req->rnti);
/* mandatory */
/* c3. DUtoCURRCInformation */
......@@ -580,14 +580,14 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_UEContextReleaseRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(false, instance, req->rnti);
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(DUtype, instance, req->rnti);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextReleaseRequestIEs_t, ie2);
ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_UEContextReleaseRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(false, instance, req->rnti);
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(DUtype, instance, req->rnti);
/* mandatory */
/* c3. Cause */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextReleaseRequestIEs_t, ie3);
......@@ -646,14 +646,14 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
ctxt.rnti = f1ap_get_rnti_by_cu_id(false, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
ctxt.rnti = f1ap_get_rnti_by_cu_id(DUtype, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
ctxt.instance = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
const rnti_t rnti = f1ap_get_rnti_by_du_id(false, instance,
const rnti_t rnti = f1ap_get_rnti_by_du_id(DUtype, instance,
ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(ctxt.rnti == rnti,
"RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
......@@ -792,14 +792,14 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_UEContextReleaseCompleteIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(false, instance, cplt->rnti);
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(DUtype, instance, cplt->rnti);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
asn1cSequenceAdd(out->protocolIEs.list,F1AP_UEContextReleaseCompleteIEs_t, ie2);
ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_UEContextReleaseCompleteIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(false, instance, cplt->rnti);
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(DUtype, instance, cplt->rnti);
/* optional -> currently not used */
/* c3. CriticalityDiagnostics */
//if (0) {
......@@ -861,7 +861,7 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
buffer,
len,
getCxt(false, instance)->default_sctp_stream_id);
f1ap_remove_ue(false, instance, cplt->rnti);
f1ap_remove_ue(DUtype, instance, cplt->rnti);
return 0;
}
int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
......
......@@ -534,7 +534,8 @@ rb_found:
req->pdusession_id = rb_id;
LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n",
__func__, rb_id, size);
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
extern instance_t CUuniqInstance;
itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p);
return;
}
......
......@@ -508,7 +508,8 @@ rb_found:
req->rnti=ue->rnti;
req->pdusession_id=rb_id;
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
itti_send_msg_to_task(OCP_GTPV1_U, 0, msg);
extern instance_t DUuniqInstance;
itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg);
return;
}
}
......
......@@ -1381,8 +1381,10 @@ rrc_gNB_process_RRCReconfigurationComplete(
DRBs[i].drb_id = DRB_configList->list.array[i]->drb_Identity;
DRBs[i].rlc_mode = RLC_MODE_AM;
DRBs[i].up_ul_tnl[0].tl_address = inet_addr(rrc->eth_params_s.my_addr);
DRBs[i].up_ul_tnl[0].port=rrc->eth_params_s.my_portd;
DRBs[i].up_ul_tnl_length = 1;
DRBs[i].up_dl_tnl[0].tl_address = inet_addr(rrc->eth_params_s.remote_addr);
DRBs[i].up_dl_tnl[0].port=rrc->eth_params_s.remote_portd;
DRBs[i].up_dl_tnl_length = 1;
}
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_CU_ue_id = 0;
......@@ -3184,7 +3186,8 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
transport_layer_addr_t addr;
memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address));
addr.length=sizeof(drb_p.up_ul_tnl[0].tl_address)*8;
incoming_teid=newGtpuCreateTunnel(INSTANCE_DEFAULT,
extern instance_t DUuniqInstance;
incoming_teid=newGtpuCreateTunnel(DUuniqInstance,
req->rnti,
drb_p.drb_id,
drb_p.drb_id,
......
......@@ -95,7 +95,7 @@ static teid_t gtpv1uNewTeid(void) {
#endif
}
instance_t legacyInstanceMapping=0;
static instance_t legacyInstanceMapping=0;
#define compatInst(a) ((a)==0 || (a)==INSTANCE_DEFAULT?legacyInstanceMapping:a)
#define GTPV1U_HEADER_SIZE (8)
......
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