Commit 219b5bc9 authored by Robert Schmidt's avatar Robert Schmidt

make FlexRAN Agent activation configurable

parent adec4e39
...@@ -119,19 +119,16 @@ void RCconfig_flexran() ...@@ -119,19 +119,16 @@ void RCconfig_flexran()
AssertFatal(RC.flexran[i] != NULL, AssertFatal(RC.flexran[i] != NULL,
"can't ALLOCATE %zu Bytes for flexran agent info (iteration %d/%d)\n", "can't ALLOCATE %zu Bytes for flexran agent info (iteration %d/%d)\n",
sizeof(flexran_agent_info_t), i + 1, RC.nb_L1_inst); sizeof(flexran_agent_info_t), i + 1, RC.nb_L1_inst);
/* if config says "yes", enable Agent, in all other cases it's like "no" */
RC.flexran[i]->enabled = strcmp(*(flexranParams[FLEXRAN_ENABLED].strptr), "yes") == 0;
RC.flexran[i]->interface_name = strdup(*(flexranParams[FLEXRAN_INTERFACE_NAME_IDX].strptr)); RC.flexran[i]->interface_name = strdup(*(flexranParams[FLEXRAN_INTERFACE_NAME_IDX].strptr));
//inet_ntop(AF_INET, &(enb_properties->properties[mod_id]->flexran_agent_ipv4_address), in_ip, INET_ADDRSTRLEN); //inet_ntop(AF_INET, &(enb_properties->properties[mod_id]->flexran_agent_ipv4_address), in_ip, INET_ADDRSTRLEN);
//strcpy(in_ip, DEFAULT_FLEXRAN_AGENT_IPv4_ADDRESS );
RC.flexran[i]->remote_ipv4_addr = strdup(*(flexranParams[FLEXRAN_IPV4_ADDRESS_IDX].strptr)); RC.flexran[i]->remote_ipv4_addr = strdup(*(flexranParams[FLEXRAN_IPV4_ADDRESS_IDX].strptr));
// DEFAULT_FLEXRAN_AGENT_PORT
RC.flexran[i]->remote_port = *(flexranParams[FLEXRAN_PORT_IDX].uptr); RC.flexran[i]->remote_port = *(flexranParams[FLEXRAN_PORT_IDX].uptr);
// DEFAULT_FLEXRAN_AGENT_CACHE
RC.flexran[i]->cache_name = strdup(*(flexranParams[FLEXRAN_CACHE_IDX].strptr)); RC.flexran[i]->cache_name = strdup(*(flexranParams[FLEXRAN_CACHE_IDX].strptr));
RC.flexran[i]->node_ctrl_state = strcmp(*(flexranParams[FLEXRAN_AWAIT_RECONF_IDX].strptr), "yes") == 0 ? ENB_WAIT : ENB_NORMAL_OPERATION; RC.flexran[i]->node_ctrl_state = strcmp(*(flexranParams[FLEXRAN_AWAIT_RECONF_IDX].strptr), "yes") == 0 ? ENB_WAIT : ENB_NORMAL_OPERATION;
RC.flexran[i]->enb_id = i; RC.flexran[i]->enb_id = i;
} }
/* TODO: show FlexRAN config now? */
} }
void RCconfig_L1(void) { void RCconfig_L1(void) {
......
...@@ -613,19 +613,22 @@ static int DEFENBS[] = {0}; ...@@ -613,19 +613,22 @@ static int DEFENBS[] = {0};
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER" #define CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER"
#define CONFIG_STRING_FLEXRAN_ENABLED "FLEXRAN_ENABLED"
#define CONFIG_STRING_FLEXRAN_INTERFACE_NAME "FLEXRAN_INTERFACE_NAME" #define CONFIG_STRING_FLEXRAN_INTERFACE_NAME "FLEXRAN_INTERFACE_NAME"
#define CONFIG_STRING_FLEXRAN_IPV4_ADDRESS "FLEXRAN_IPV4_ADDRESS" #define CONFIG_STRING_FLEXRAN_IPV4_ADDRESS "FLEXRAN_IPV4_ADDRESS"
#define CONFIG_STRING_FLEXRAN_PORT "FLEXRAN_PORT" #define CONFIG_STRING_FLEXRAN_PORT "FLEXRAN_PORT"
#define CONFIG_STRING_FLEXRAN_CACHE "FLEXRAN_CACHE" #define CONFIG_STRING_FLEXRAN_CACHE "FLEXRAN_CACHE"
#define CONFIG_STRING_FLEXRAN_AWAIT_RECONF "FLEXRAN_AWAIT_RECONF" #define CONFIG_STRING_FLEXRAN_AWAIT_RECONF "FLEXRAN_AWAIT_RECONF"
#define FLEXRAN_INTERFACE_NAME_IDX 0 #define FLEXRAN_ENABLED 0
#define FLEXRAN_IPV4_ADDRESS_IDX 1 #define FLEXRAN_INTERFACE_NAME_IDX 1
#define FLEXRAN_PORT_IDX 2 #define FLEXRAN_IPV4_ADDRESS_IDX 2
#define FLEXRAN_CACHE_IDX 3 #define FLEXRAN_PORT_IDX 3
#define FLEXRAN_AWAIT_RECONF_IDX 4 #define FLEXRAN_CACHE_IDX 4
#define FLEXRAN_AWAIT_RECONF_IDX 5
#define FLEXRANPARAMS_DESC { \ #define FLEXRANPARAMS_DESC { \
{CONFIG_STRING_FLEXRAN_ENABLED, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_INTERFACE_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ {CONFIG_STRING_FLEXRAN_INTERFACE_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_IPV4_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ {CONFIG_STRING_FLEXRAN_IPV4_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_PORT, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \ {CONFIG_STRING_FLEXRAN_PORT, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
......
...@@ -185,6 +185,12 @@ int flexran_agent_start(mid_t mod_id) ...@@ -185,6 +185,12 @@ int flexran_agent_start(mid_t mod_id)
char *in_ip = flexran->remote_ipv4_addr; char *in_ip = flexran->remote_ipv4_addr;
uint16_t in_port = flexran->remote_port; uint16_t in_port = flexran->remote_port;
/* if this agent is disabled, return and don't do anything */
if (!flexran->enabled) {
LOG_I(FLEXRAN_AGENT, "FlexRAN Agent for eNB %d is DISABLED\n", mod_id);
return 100;
}
flexran->enb_id = mod_id; flexran->enb_id = mod_id;
/* assume for the moment the monolithic case, i.e. agent can provide /* assume for the moment the monolithic case, i.e. agent can provide
* information for all layers */ * information for all layers */
......
...@@ -153,6 +153,7 @@ typedef enum { ...@@ -153,6 +153,7 @@ typedef enum {
typedef struct { typedef struct {
/* general info */ /* general info */
int enabled;
char *interface_name; char *interface_name;
char *remote_ipv4_addr; char *remote_ipv4_addr;
uint16_t remote_port; uint16_t remote_port;
......
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