Commit 816fee39 authored by David Kim's avatar David Kim

removed hard coded server(PNF) ip address

additionally, added a config file for proxy connection.
parent e2866e68
This diff is collapsed.
......@@ -1150,6 +1150,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,
......@@ -1166,7 +1169,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;
......@@ -1182,7 +1185,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);
......@@ -1205,6 +1208,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);
......@@ -1214,13 +1218,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));
......
......@@ -151,7 +151,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);
......
......@@ -1702,7 +1702,8 @@ rrc_ue_process_ueCapabilityEnquiry(
xer_fprint(stdout, &asn_DEF_LTE_UL_DCCH_Message, (void *)&ul_dcch_msg);
}
LOG_A(RRC,"UECapabilityInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
LOG_A(RRC, "%s: UECapabilityInformation Encoded %zd bits (%zd bytes)\n",
__FUNCTION__, enc_rval.encoded,(enc_rval.encoded+7)/8);
rrc_data_req_ue (
ctxt_pP,
DCCH,
......
......@@ -428,10 +428,9 @@ void init_UE_stub_single_thread(int nb_inst,
void init_UE_standalone_thread(int ue_idx)
{
const char *standalone_addr = "127.0.0.1"; // these two lines go into init
int standalone_tx_port = 3211 + ue_idx*2;
int standalone_rx_port = 3212 + ue_idx*2;
ue_init_standalone_socket(standalone_addr, standalone_tx_port, standalone_rx_port);
ue_init_standalone_socket(standalone_tx_port, standalone_rx_port);
pthread_t thread;
if (pthread_create(&thread, NULL, ue_standalone_pnf_task, NULL) != 0) {
......
......@@ -729,7 +729,7 @@ int main( int argc, char **argv ) {
exit(-1); // need a softer mode
}
if (NFAPI_MODE==NFAPI_UE_STUB_PNF) { // UE-STUB-PNF
if (NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { // UE-STUB-PNF
UE_config_stub_pnf();
}
......
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