diff --git a/openair2/ENB_APP/enb_agent.c b/openair2/ENB_APP/enb_agent.c index c9c42a41d9c984b12bbb7c6003ea8149437c2180..7d2029b37f89c21c3540a44d6330af5f9af056fe 100644 --- a/openair2/ENB_APP/enb_agent.c +++ b/openair2/ENB_APP/enb_agent.c @@ -52,6 +52,7 @@ enb_agent_instance_t enb_agent[NUM_MAX_ENB]; char in_ip[40]; static uint16_t in_port; +char local_cache[40]; void *send_thread(void *args); void *receive_thread(void *args); @@ -203,6 +204,13 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){ /* * check the configuration */ + if (enb_properties->properties[mod_id]->enb_agent_cache != NULL) { + strncpy(local_cache, enb_properties->properties[mod_id]->enb_agent_cache, sizeof(local_cache)); + local_cache[sizeof(local_cache) - 1] = 0; + } else { + strcpy(local_cache, DEFAULT_ENB_AGENT_CACHE); + } + if (enb_properties->properties[mod_id]->enb_agent_ipv4_address != NULL) { strncpy(in_ip, enb_properties->properties[mod_id]->enb_agent_ipv4_address, sizeof(in_ip) ); in_ip[sizeof(in_ip) - 1] = 0; // terminate string diff --git a/openair2/ENB_APP/enb_agent_defs.h b/openair2/ENB_APP/enb_agent_defs.h index 020c631ff1f4cec5daee5311234533c99b2e1081..9d1e3f75fc37684d1c0e6e7bf2b487fc6c5f6034 100644 --- a/openair2/ENB_APP/enb_agent_defs.h +++ b/openair2/ENB_APP/enb_agent_defs.h @@ -47,6 +47,7 @@ #define NUM_MAX_UE 2048 #define DEFAULT_ENB_AGENT_IPv4_ADDRESS "127.0.0.1" #define DEFAULT_ENB_AGENT_PORT 2210 +#define DEFAULT_ENB_AGENT_CACHE "/mnt/tmpfs" typedef enum { diff --git a/openair2/ENB_APP/enb_agent_extern.h b/openair2/ENB_APP/enb_agent_extern.h index 1ef22504830499ce2501becec554b733fd577246..0dd7cfb90f92bdb72ace244ad4c2e06e42c2ea0c 100644 --- a/openair2/ENB_APP/enb_agent_extern.h +++ b/openair2/ENB_APP/enb_agent_extern.h @@ -44,6 +44,8 @@ //extern msg_context_t shared_ctxt[NUM_MAX_ENB][ENB_AGENT_MAX]; +extern char local_cache[40]; + extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; extern unsigned int mac_agent_registered[NUM_MAX_ENB]; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index d5a70734fde2b296248c58a3579eee69b880dff4..6983b8c2c69c9f5a45133451eca597c054fa9d4b 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -174,6 +174,7 @@ #define ENB_CONFIG_STRING_ENB_AGENT_INTERFACE_NAME "ENB_AGENT_INTERFACE_NAME" #define ENB_CONFIG_STRING_ENB_AGENT_IPV4_ADDRESS "ENB_AGENT_IPV4_ADDRESS" #define ENB_CONFIG_STRING_ENB_AGENT_PORT "ENB_AGENT_PORT" +#define ENB_CONFIG_STRING_ENB_AGENT_CACHE "ENB_AGENT_CACHE" #define ENB_CONFIG_STRING_RRH_GW_CONFIG "rrh_gw_config" #define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME "local_if_name" @@ -325,6 +326,7 @@ static void enb_config_display(void) printf( "\tInterface name: \t%s:\n",enb_properties.properties[i]->enb_agent_interface_name); printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->enb_agent_ipv4_address); printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->enb_agent_port); + printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->enb_agent_cache); #endif @@ -641,6 +643,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) char* enb_agent_interface_name = NULL; char* enb_agent_ipv4_address = NULL; libconfig_int enb_agent_port = 0; + char* enb_agent_cache = NULL; libconfig_int otg_ue_id = 0; char* otg_app_type = NULL; char* otg_bg_traffic = NULL; @@ -2363,6 +2366,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) (const char **)&enb_agent_ipv4_address) && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_AGENT_PORT, &enb_agent_port) + && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_AGENT_CACHE, + (const char **)&enb_agent_cache) ) ) { enb_properties.properties[enb_properties_index]->enb_agent_interface_name = strdup(enb_agent_interface_name); @@ -2374,7 +2379,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) }*/ enb_properties.properties[enb_properties_index]->enb_agent_port = enb_agent_port; - + enb_properties.properties[enb_properties_index]->enb_agent_cache = strdup(enb_agent_cache); } } diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index 25b6c88479906c718f009c62512ed065f1f55cf1..2e873fdf529e0ad9e27d36ce72b243d218a02f72 100755 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -224,6 +224,7 @@ typedef struct Enb_properties_s { char *enb_agent_interface_name; in_addr_t enb_agent_ipv4_address; tcp_udp_port_t enb_agent_port; + char *enb_agent_cache; /* Nb of RRH to connect to */ uint8_t nb_rrh_gw; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.agent.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.agent.oaisim.local_no_mme.conf index 045a2855a09313676d252bea466c2b42177e81a9..578a2e3f2ce39d7603bdd7bc6fdfd2d467338bba 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.agent.oaisim.local_no_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.agent.oaisim.local_no_mme.conf @@ -123,6 +123,7 @@ eNBs = ENB_AGENT_INTERFACE_NAME = "eth0"; ENB_AGENT_IPV4_ADDRESS = "127.0.0.1/24"; ENB_AGENT_PORT = 2210; + ENB_AGENT_CACHE = "/mnt/tmpfs"; }; log_config :