From bb3d8b82015eba1dcaf71f500b878a801e14da7a Mon Sep 17 00:00:00 2001 From: mir Date: Mon, 19 Jun 2023 16:20:22 +0200 Subject: [PATCH] near_ric_ip_addr added. The config needs to be defined in OAI's config file --- executables/nr-softmodem.c | 10 ++++++---- openair2/ENB_APP/enb_paramdef.h | 2 +- openair2/GNB_APP/gnb_config.c | 9 ++++++--- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 8f55024ef4..1b0ff90708 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -697,14 +697,16 @@ int main( int argc, char **argv ) { ////////////////////////////////// ////////////////////////////////// //// Init the E2 Agent - + sm_io_ag_ran_t io = init_ran_func_ag(); - fr_args_t args = init_fr_args(0, NULL); // OAI Wrapper e2_agent_args_t oai_args = RCconfig_NR_E2agent(); - if(oai_args.sm_dir != NULL) - memcpy(args.libs_dir, oai_args.sm_dir, 128); + AssertFatal(oai_args.sm_dir != NULL , "Please, specify the directory where the SMs are located in the config file, i.e., e2_agent = {near_ric_ip_addr = \"127.0.0.1\"; sm_dir = \"/usr/local/lib/flexric/\");} "); + AssertFatal(oai_args.ip != NULL , "Please, specify the IP address of the nearRT-RIC in the config file, i.e., e2_agent = {near_ric_ip_addr = \"127.0.0.1\"; sm_dir = \"/usr/local/lib/flexric/\""); + + fr_args_t args = {.ip = oai_args.ip}; // init_fr_args(0, NULL); + memcpy(args.libs_dir, oai_args.sm_dir, 128); sleep(1); const gNB_RRC_INST* rrc = RC.nrrrc[0]; diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 34fcc6ad2c..58eebba278 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -1322,7 +1322,7 @@ typedef struct srb1_params_s { /* E2 Agent configuration */ #define CONFIG_STRING_E2AGENT "e2_agent" -#define E2AGENT_CONFIG_IP "ip" +#define E2AGENT_CONFIG_IP "near_ric_ip_addr" //#define E2AGENT_CONFIG_PORT "port" #define E2AGENT_CONFIG_SMDIR "sm_dir" diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 87f2c07d21..2314cd2bf2 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2271,10 +2271,13 @@ e2_agent_args_t RCconfig_NR_E2agent(void) return (e2_agent_args_t) { 0 }; } e2_agent_args_t dst = {0}; - if(e2agent_params[E2AGENT_CONFIG_IP_IDX].strptr != NULL) - dst.ip = *e2agent_params[E2AGENT_CONFIG_IP_IDX].strptr; - if(e2agent_params[E2AGENT_CONFIG_SMDIR_IDX].strptr != NULL) + + if (e2agent_params[E2AGENT_CONFIG_SMDIR_IDX].strptr != NULL) dst.sm_dir = *e2agent_params[E2AGENT_CONFIG_SMDIR_IDX].strptr; + + if (e2agent_params[E2AGENT_CONFIG_IP_IDX].strptr != NULL) + dst.ip = *e2agent_params[E2AGENT_CONFIG_IP_IDX].strptr; + return dst; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 01210a0663..3b7fadf3bc 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -267,7 +267,7 @@ log_config : }; e2_agent = { - address = "127.0.0.1"; + near_ric_ip_addr = "127.0.0.1"; #sm_dir = "/path/where/the/SMs/are/located/" sm_dir = "/usr/local/lib/flexric/" };