e2_agent: add parameters for local IP and port to bind for RIC connection

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent 2fc1114167
commit 82d2fd1973

@ -375,6 +375,8 @@ enable = false
enable = true
#ric_ip = 127.0.0.1
#ric_port = 36421
#ric_bind_ip = 127.0.0.1
#ric_bind_port = 36425
#####################################################################
# Expert configuration options

@ -232,6 +232,8 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("e2_agent.enable", bpo::value<bool>(&args->e2_agent.enable)->default_value(false), "Enables the E2 agent")
("e2_agent.ric_ip", bpo::value<string>(&args->e2_agent.ric_ip)->default_value("127.0.0.1"), "RIC IP address")
("e2_agent.ric_port", bpo::value<uint32_t>(&args->e2_agent.ric_port)->default_value(36421), "RIC port")
("e2_agent.ric_bind_ip", bpo::value<string>(&args->e2_agent.ric_bind_ip)->default_value("127.0.0.1"), "Local IP address to bind for RIC connection")
("e2_agent.ric_bind_port", bpo::value<uint32_t>(&args->e2_agent.ric_bind_port)->default_value(36425), "Local port to bind for RIC connection")
/* Expert section */
("expert.metrics_period_secs", bpo::value<float>(&args->general.metrics_period_secs)->default_value(1.0), "Periodicity for metrics in seconds.")

@ -21,7 +21,6 @@
#include "srsran/interfaces/e2_metrics_interface.h"
#include "srsran/srsran.h"
static const int e2ap_ppid = 70;
static const int e2ap_port = 36421;
enum e2_msg_type_t {
E2_SETUP_REQUEST,
@ -36,6 +35,8 @@ struct e2_agent_args_t {
bool enable;
std::string ric_ip;
uint32_t ric_port;
std::string ric_bind_ip;
uint32_t ric_bind_port;
};
namespace srsenb {

@ -35,7 +35,7 @@ bool e2_agent::init(e2_agent_args_t args)
}
// Bind socket
if (not ric_socket.bind_addr("127.0.0.1", 36425)) {
if (not ric_socket.bind_addr(args.ric_bind_ip.c_str(), args.ric_bind_port)) {
ric_socket.close();
return false;
}

Loading…
Cancel
Save