Commit df45820f authored by Cedric Roux's avatar Cedric Roux Committed by Raymond Knopp

f1 du: get IP address for UL UP GTP tunnel from the right place

parent d2f456e0
......@@ -96,15 +96,6 @@ void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_dat
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, char *DUaddr, uint16_t DUport) {
openAddr_t tmp= {0};
strncpy(tmp.originHost, DUaddr, sizeof(tmp.originHost)-1);
strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1);
sprintf(tmp.originService, "%d", DUport);
sprintf(tmp.destinationService, "%d", CUport);
return gtpv1Init(tmp);
}
void *F1AP_DU_task(void *arg) {
//sctp_cu_init();
LOG_I(F1AP, "Starting F1AP at DU\n");
......@@ -126,15 +117,6 @@ 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(DUtype, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address, //"172.21.6.9", //"172.21.10.9",//"172.21.9.5", //msgSetup->CU_f1_ip_address.ipv4_address, //"192.168.18.91"
msgSetup->CUport,
msgSetup->DU_f1_ip_address.ipv4_address,
msgSetup->DUport);
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 = DUuniqInstance = getCxt(DUtype, myInstance)->gtpInst;
du_task_send_sctp_association_req(myInstance,msgSetup);
break;
......
......@@ -1078,6 +1078,17 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
f1ap_remove_ue(DUtype, instance, cplt->rnti);
return 0;
}
static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, char *DUaddr, uint16_t DUport)
{
openAddr_t tmp;
strncpy(tmp.originHost, DUaddr, sizeof(tmp.originHost)-1);
strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1);
sprintf(tmp.originService, "%d", DUport);
sprintf(tmp.destinationService, "%d", CUport);
return gtpv1Init(tmp);
}
int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
......@@ -1160,6 +1171,26 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
// 3GPP assumes GTP-U is on port 2152, but OAI is configurable
drb_p->up_ul_tnl[0].port=getCxt(false,instance)->setupReq.CUport;
extern instance_t DUuniqInstance;
if (DUuniqInstance == 0) {
char gtp_tunnel_ip_address[128];
sprintf(gtp_tunnel_ip_address, "%d.%d.%d.%d",
drb_p->up_ul_tnl[0].tl_address & 0xff,
(drb_p->up_ul_tnl[0].tl_address >> 8) & 0xff,
(drb_p->up_ul_tnl[0].tl_address >> 16) & 0xff,
(drb_p->up_ul_tnl[0].tl_address >> 24) & 0xff);
getCxt(DUtype, instance)->gtpInst=du_create_gtpu_instance_to_cu(
gtp_tunnel_ip_address,
getCxt(false,instance)->setupReq.CUport,
getCxt(false,instance)->setupReq.DU_f1_ip_address.ipv4_address,
getCxt(false,instance)->setupReq.DUport);
AssertFatal(getCxt(DUtype, instance)->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 = DUuniqInstance = getCxt(DUtype, instance)->gtpInst;
}
switch (drbs_tobesetupmod_item_p->rLCMode) {
case F1AP_RLCMode_rlc_am:
drb_p->rlc_mode = RLC_MODE_AM;
......
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