Commit 7cde9f7a authored by Laurent THOMAS's avatar Laurent THOMAS

DU sends packet in UL over F1-U

parent 1f346f1b
......@@ -91,7 +91,7 @@ int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpat
static int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
config_setting_t *setting;
char *str;
int i,u;
......@@ -122,7 +122,7 @@ static int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *pre
switch(cfgoptions[i].type) {
case TYPE_STRING:
if ( config_lookup_string(&(libconfig_privdata.cfg), cfgpath, &str)) {
if ( config_lookup_string(&(libconfig_privdata.cfg), cfgpath, (const char**)&str)) {
if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
cfgpath,str,cfgoptions[i].numelt);
......
......@@ -153,7 +153,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
rnti_t ue_rnti = (f1ap_ue_context_setup_req->gNB_DU_ue_id!=NULL) ?
f1ap_get_rnti_by_du_id(false, instance, *f1ap_ue_context_setup_req->gNB_DU_ue_id):
f1ap_get_rnti_by_cu_id(false, instance, f1ap_ue_context_setup_req->gNB_CU_ue_id);
teid_t t=newGtpuCreateTunnel(instance,
teid_t t=newGtpuCreateTunnel(INSTANCE_DEFAULT,
ue_rnti,
drb_p->drb_id ,
drb_p->drb_id,
......
......@@ -240,6 +240,8 @@ void *gNB_app_task(void *args_p)
RCconfig_NR_DU_F1(msg_p, 0);
itti_send_msg_to_task (TASK_DU_F1, GNB_MODULE_ID_TO_INSTANCE(0), msg_p);
//start F1-U
RCconfig_nr_gtpu();
}
}
do {
......
......@@ -139,10 +139,11 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
to.sin_addr.s_addr = peerIp ;
LOG_D(GTPU,"sending packet size: %d to %s\n",fullSize, inet_ntoa(to.sin_addr) );
if (sendto(h, (void *)buffer, (size_t)fullSize, 0,(struct sockaddr *)&to, sizeof(to) ) != fullSize ) {
int ret;
if ((ret=sendto(h, (void *)buffer, (size_t)fullSize, 0,(struct sockaddr *)&to, sizeof(to) )) != fullSize ) {
LOG_E(GTPU,
"[SD %d] Failed to send data to " IPV4_ADDR " on port %d, buffer size %u\n",
h, IPV4_ADDR_FORMAT(peerIp), peerPort, fullSize);
"[SD %d] Failed to send data to " IPV4_ADDR " on port %d, buffer size %u, ret: %d, errno: %d\n",
h, IPV4_ADDR_FORMAT(peerIp), peerPort, fullSize, ret, errno);
free(buffer);
return GTPNOK;
}
......@@ -390,6 +391,7 @@ instance_t ocp_gtpv1Init(openAddr_t context) {
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
pthread_mutex_lock(&globGtp.gtp_lock);
instance=compatInst(instance);
auto inst=&globGtp.instances[instance];
auto it=inst->ue2te_mapping.find(rnti);
......@@ -465,7 +467,7 @@ int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
"From legacy code not clear, seems impossible (bearer=%d)\n",
create_tunnel_req->eps_bearer_id[i]);
int incoming_rb_id=create_tunnel_req->eps_bearer_id[i]-4;
teid_t teid=newGtpuCreateTunnel(compatInst(instance), create_tunnel_req->rnti,
teid_t teid=newGtpuCreateTunnel(instance, create_tunnel_req->rnti,
incoming_rb_id,
create_tunnel_req->eps_bearer_id[i],
create_tunnel_req->sgw_S1u_teid[i],
......@@ -527,7 +529,7 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance,
create_tunnel_req->outgoing_teid[0]);
for (int i = 0; i < create_tunnel_req->num_tunnels; i++) {
teid_t teid=newGtpuCreateTunnel(compatInst(instance), create_tunnel_req->rnti,
teid_t teid=newGtpuCreateTunnel(instance, create_tunnel_req->rnti,
create_tunnel_req->incoming_rb_id[i],
create_tunnel_req->pdusession_id[i],
create_tunnel_req->outgoing_teid[i],
......
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