Commit 76ea8181 authored by Robert Schmidt's avatar Robert Schmidt

Use char * for DU/CU IP address

The previously used net_ip_address_t type is limited to some bytes, but
the CU name might be longer. Use char * to allow longer DNS names.

Also, this type separates IPv4/v6, which is not necessary, as it is now
handled by the same C API (getaddrinfo()), since !2635.
parent 8a3c329e
......@@ -74,11 +74,9 @@
#define F1AP_MAX_NO_OF_TNL_ASSOCIATIONS 32
#define F1AP_MAX_NO_UE_ID 1024
typedef net_ip_address_t f1ap_net_ip_address_t;
typedef struct f1ap_net_config_t {
f1ap_net_ip_address_t CU_f1_ip_address;
f1ap_net_ip_address_t DU_f1c_ip_address;
char *CU_f1_ip_address;
char *DU_f1c_ip_address;
char *DU_f1u_ip_address;
uint16_t CUport;
uint16_t DUport;
......
......@@ -44,7 +44,7 @@ static instance_t du_create_gtpu_instance_to_cu(const f1ap_net_config_t *nc)
{
openAddr_t tmp = {0};
strncpy(tmp.originHost, nc->DU_f1u_ip_address, sizeof(tmp.originHost) - 1);
strncpy(tmp.destinationHost, nc->CU_f1_ip_address.ipv4_address, sizeof(tmp.destinationHost) - 1);
strncpy(tmp.destinationHost, nc->CU_f1_ip_address, sizeof(tmp.destinationHost) - 1);
sprintf(tmp.originService, "%d", nc->DUport);
sprintf(tmp.destinationService, "%d", nc->CUport);
return gtpv1Init(tmp);
......
......@@ -33,20 +33,16 @@ static f1ap_net_config_t read_DU_IP_config(const eth_params_t* f1_params, const
{
f1ap_net_config_t nc = {0};
nc.CU_f1_ip_address.ipv6 = 0;
nc.CU_f1_ip_address.ipv4 = 1;
strcpy(nc.CU_f1_ip_address.ipv4_address, f1_params->remote_addr);
nc.CU_f1_ip_address= strdup(f1_params->remote_addr);
nc.CUport = f1_params->remote_portd;
nc.DU_f1c_ip_address.ipv6 = 0;
nc.DU_f1c_ip_address.ipv4 = 1;
strcpy(nc.DU_f1c_ip_address.ipv4_address, f1_params->my_addr);
nc.DU_f1c_ip_address = strdup(f1_params->my_addr);
nc.DU_f1u_ip_address = strdup(f1u_ip_addr);
nc.DUport = f1_params->my_portd;
LOG_I(F1AP,
"F1-C DU IPaddr %s, connect to F1-C CU %s, binding GTP to %s\n",
nc.DU_f1c_ip_address.ipv4_address,
nc.CU_f1_ip_address.ipv4_address,
nc.DU_f1c_ip_address,
nc.CU_f1_ip_address,
nc.DU_f1u_ip_address);
// sctp_in_streams/sctp_out_streams are given by SCTP layer
......
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