Commit f35f1277 authored by ChenWeiTai's avatar ChenWeiTai
Browse files

Add the function RCconfig_nr_gtpu

parent 302aea2f
......@@ -62,7 +62,7 @@
extern uint16_t sf_ahead;
void RCconfig_NR_flexran()
void RCconfig_nr_flexran()
{
uint16_t i;
uint16_t num_gnbs;
......@@ -2573,6 +2573,51 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
}//End RCconfig_NRRRC function
int RCconfig_nr_gtpu(void ) {
int num_gnbs = 0;
char* enb_interface_name_for_S1U = NULL;
char* enb_ipv4_address_for_S1U = NULL;
uint32_t enb_port_for_S1U = 0;
char *address = NULL;
char *cidr = NULL;
char gtpupath[MAX_OPTNAME_SIZE*2 + 8];
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
paramdef_t GTPUParams[] = GTPUPARAMS_DESC;
LOG_I(GTPU,"Configuring GTPu\n");
/* get number of active eNodeBs */
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
AssertFatal (num_gnbs >0,
"Failed to parse config file no active gNodeBs in %s \n", GNB_CONFIG_STRING_ACTIVE_GNBS);
sprintf(gtpupath,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
config_get( GTPUParams,sizeof(GTPUParams)/sizeof(paramdef_t),gtpupath);
cidr = enb_ipv4_address_for_S1U;
address = strtok(cidr, "/");
if (address) {
IPV4_STR_ADDR_TO_INT_NWBO ( address, RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up);
}
RC.gtpv1u_data_g->enb_port_for_S1u_S12_S4_up = enb_port_for_S1U;
return 0;
}
int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i) {
int j,k = 0;
......
......@@ -92,17 +92,17 @@ typedef struct ru_config_s {
} ru_config_t;
*/
extern void RCconfig_RU(void);
extern void RCconfig_NR_flexran(void);
extern void RCconfig_nr_flexran(void);
extern void RCconfig_NR_L1(void);
extern void RCconfig_nr_macrlc(void);
extern int RCconfig_gtpu(void );
extern int RCconfig_nr_gtpu(void );
extern void NRRCConfig(void);
//void enb_config_display(void);
//void ru_config_display(void);
int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc);
int RCconfig_S1(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i);
#endif /* GNB_CONFIG_H_ */
/** @} */
......@@ -551,7 +551,7 @@ static void get_options(void) {
NRRCConfig();
NB_gNB_INST = RC.nb_nr_inst;
NB_RU = RC.nb_RU;
printf("Configuration: nb_rrc_inst %d, nb_L1_inst %d, nb_ru %d\n",NB_gNB_INST,RC.nb_L1_inst,NB_RU);
printf("Configuration: nb_rrc_inst %d, nb_nr_L1_inst %d, nb_ru %d\n",NB_gNB_INST,RC.nb_nr_L1_inst,NB_RU);
}
}
......@@ -1045,7 +1045,7 @@ int main( int argc, char **argv )
#if defined(ENABLE_ITTI)
if (RC.nb_inst > 0) {
if (RC.nb_nr_inst > 0) {
// don't create if node doesn't connect to RRC/S1/GTP
if (create_gNB_tasks(1) < 0) {
......@@ -1061,7 +1061,7 @@ int main( int argc, char **argv )
#endif
/* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_NR_flexran();
RCconfig_nr_flexran();
for (i = 0; i < RC.nb_L1_inst; i++) {
flexran_agent_start(i);
}
......@@ -1150,7 +1150,7 @@ int main( int argc, char **argv )
// start the main threads
number_of_cards = 1;
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
printf("RC.nb_nr_L1_inst:%d\n", RC.nb_nr_L1_inst);
if (RC.nb_L1_inst > 0) {
printf("Initializing gNB threads single_thread_flag:%d wait_for_sync:%d\n", single_thread_flag,wait_for_sync);
init_gNB(single_thread_flag,wait_for_sync);
......
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