Setting UE and nrUE IP address in config file.

1. Removed hard coded IP address in the code for UE and nrUE's remote address.
2. Read IP address from config file for UE and nrUE's remote address.
This commit is contained in:
David Kim
2021-09-02 13:33:42 -07:00
parent 233e567a4a
commit 6342e67c33
9 changed files with 51 additions and 30 deletions
+7 -10
View File
@@ -75,6 +75,7 @@ extern nfapi_tx_request_pdu_t* tx_request_pdu[1023][NUM_NFAPI_SUBFRAME][10]; //T
extern UE_RRC_INST *UE_rrc_inst;
extern uint16_t sf_ahead;
static eth_params_t stub_eth_params;
void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
@@ -1147,7 +1148,6 @@ void UE_config_stub_pnf(void) {
int j;
paramdef_t L1_Params[] = L1PARAMS_DESC;
paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST, NULL, 0};
eth_params_t stub_eth_params;
config_getlist(&L1_ParamList, L1_Params, sizeof(L1_Params) / sizeof(paramdef_t), NULL);
if (L1_ParamList.numelt > 0) {
@@ -1179,6 +1179,9 @@ void UE_config_stub_pnf(void) {
*(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr);
stub_eth_params.transp_preference = ETH_UDP_MODE;
if (NFAPI_MODE!=NFAPI_UE_STUB_PNF)
continue;
sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2
// configure_nfapi_pnf(UE_mac_inst[0].eth_params_n.remote_addr,
// UE_mac_inst[0].eth_params_n.remote_portc,
@@ -1195,7 +1198,7 @@ void UE_config_stub_pnf(void) {
}
}
void ue_init_standalone_socket(const char *addr, int tx_port, int rx_port)
void ue_init_standalone_socket(int tx_port, int rx_port)
{
{
struct sockaddr_in server_address;
@@ -1211,7 +1214,7 @@ void ue_init_standalone_socket(const char *addr, int tx_port, int rx_port)
return;
}
if (inet_pton(server_address.sin_family, addr, &server_address.sin_addr) <= 0)
if (inet_pton(server_address.sin_family, stub_eth_params.remote_addr, &server_address.sin_addr) <= 0)
{
LOG_E(MAC, "Invalid standalone PNF Address\n");
close(sd);
@@ -1234,6 +1237,7 @@ void ue_init_standalone_socket(const char *addr, int tx_port, int rx_port)
int addr_len = sizeof(server_address);
memset(&server_address, 0, addr_len);
server_address.sin_family = AF_INET;
server_address.sin_addr.s_addr = INADDR_ANY;
server_address.sin_port = htons(rx_port);
int sd = socket(server_address.sin_family, SOCK_DGRAM, 0);
@@ -1243,13 +1247,6 @@ void ue_init_standalone_socket(const char *addr, int tx_port, int rx_port)
return;
}
if (inet_pton(server_address.sin_family, addr, &server_address.sin_addr) <= 0)
{
LOG_E(MAC, "Invalid standalone PNF Address\n");
close(sd);
return;
}
if (bind(sd, (struct sockaddr *)&server_address, addr_len) < 0)
{
LOG_E(MAC, "Connection to standalone PNF failed: %s\n", strerror(errno));
+1 -1
View File
@@ -182,7 +182,7 @@ void *memcpy_tx_req_standalone(nfapi_tx_request_t *tx_req);
void *memcpy_dl_config_req_standalone(nfapi_dl_config_request_t *dl_config_req);
// open an SCTP socket with a standalone PNF module
void ue_init_standalone_socket(const char *addr, int tx_port, int rx_port);
void ue_init_standalone_socket(int tx_port, int rx_port);
// read from standalone pnf socket call corresponding memcpy functions
void *ue_standalone_pnf_task(void *context);