Modified eNB configuration.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4963 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
winckel
2014-01-27 16:01:04 +00:00
parent b150244c68
commit 547a3a65cf
3 changed files with 39 additions and 40 deletions
+1 -7
View File
@@ -126,12 +126,6 @@ static uint32_t eNB_app_register()
hash = s1ap_generate_eNB_id ();
g_enb_properties[eNB_id]->eNB_id = eNB_id + (hash & 0xFFFF8);
if (EPC_MODE_ENABLED)
{
/* Overwrite default IP v4 address by value from command line */
g_enb_properties[eNB_id]->mme_ip_address[0].ipv4_address = EPC_MODE_MME_ADDRESS;
}
/* note: there is an implicit relationship between the data structure and the message name */
msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
@@ -191,9 +185,9 @@ void *eNB_app_task(void *args_p)
# if defined(ENABLE_USE_MME)
# if defined(OAI_EMU)
enb_nb = oai_emulation.info.nb_enb_local;
enb_config_init(g_conf_config_file_name);
# endif
# endif
enb_config_init(g_conf_config_file_name);
configure_rrc();
+26 -11
View File
@@ -34,6 +34,10 @@
#include "log.h"
#include "assertions.h"
#include "enb_config.h"
#if defined(OAI_EMU)
# include "OCG.h"
# include "OCG_extern.h"
#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
@@ -76,14 +80,22 @@ int enb_config_init(char* lib_config_file_name_pP) {
config_init(&cfg);
/* Read the file. If there is an error, report it and exit. */
if(! config_read_file(&cfg, lib_config_file_name_pP))
if(lib_config_file_name_pP != NULL)
{
LOG_E(ENB_APP, "%s:%d - %s\n", lib_config_file_name_pP, config_error_line(&cfg), config_error_text(&cfg));
/* Read the file. If there is an error, report it and exit. */
if(! config_read_file(&cfg, lib_config_file_name_pP))
{
LOG_E(ENB_APP, "%s:%d - %s\n", lib_config_file_name_pP, config_error_line(&cfg), config_error_text(&cfg));
config_destroy(&cfg);
AssertFatal (1 == 0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP);
}
}
else
{
LOG_E(ENB_APP, "No eNB configuration file provided!\n");
config_destroy(&cfg);
AssertFatal (1 == 0, "Failed to parse config file %s!\n", lib_config_file_name_pP);
AssertFatal (0, "No eNB configuration file provided!\n");
}
// Get list of active eNBs, (only these will be configured)
g_num_enb_properties = 0;
@@ -123,7 +135,7 @@ int enb_config_init(char* lib_config_file_name_pP) {
) {
parse_error = 1;
AssertFatal (parse_error == 0,
"Failed to parse config file %s, %u th enb\n",
"Failed to parse eNB configuration file %s, %u th enb\n",
lib_config_file_name_pP, i);
}
// search if in active list
@@ -138,7 +150,7 @@ int enb_config_init(char* lib_config_file_name_pP) {
g_enb_properties[enb_properties_index]->cell_type = CELL_HOME_ENB;
} else {
AssertFatal (1 == 0,
"Failed to parse config file %s, enb %d unknown value for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
"Failed to parse eNB configuration file %s, enb %d unknown value for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
lib_config_file_name_pP, i);
}
g_enb_properties[enb_properties_index]->eNB_name = strdup(enb_name);
@@ -156,10 +168,10 @@ int enb_config_init(char* lib_config_file_name_pP) {
g_enb_properties[enb_properties_index]->default_drx = PAGING_DRX_256;
} else {
AssertFatal (1 == 0,
"Failed to parse config file %s, enb %d unknown value for default_drx choice: PAGING_DRX_32..PAGING_DRX_256 !\n",
"Failed to parse eNB configuration file %s, enb %d unknown value for default_drx choice: PAGING_DRX_32..PAGING_DRX_256 !\n",
lib_config_file_name_pP, i);
}
AssertFatal (parse_error == 0, "Failed to parse config file %s, enb %d\n", lib_config_file_name_pP, i);
AssertFatal (parse_error == 0, "Failed to parse eNB configuration file %s, enb %d\n", lib_config_file_name_pP, i);
setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS);
num_mme_address = config_setting_length(setting_mme_addresses);
@@ -175,7 +187,7 @@ int enb_config_init(char* lib_config_file_name_pP) {
) {
parse_error = 1;
AssertFatal (parse_error == 0,
"Failed to parse config file %s, %u th enb %u th mme address\n",
"Failed to parse eNB configuration file %s, %u th enb %u th mme address\n",
lib_config_file_name_pP, i, j);
}
g_enb_properties[enb_properties_index]->nb_mme += 1;
@@ -184,6 +196,9 @@ int enb_config_init(char* lib_config_file_name_pP) {
g_enb_properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6);
if (strcmp(active, "yes") == 0) {
g_enb_properties[enb_properties_index]->mme_ip_address[j].active = 1;
#if defined(ENABLE_USE_MME)
EPC_MODE_ENABLED = 1;
#endif
} // else { (calloc)
if (strcmp(preference, "ipv4") == 0) {
@@ -202,7 +217,7 @@ int enb_config_init(char* lib_config_file_name_pP) {
}
}
AssertFatal (enb_properties_index == g_num_enb_properties,
"Failed to parse config file %s, mismatch between %u active eNBs and %u corresponding defined eNBs!\n",
"Failed to parse eNB configuration file %s, mismatch between %u active eNBs and %u corresponding defined eNBs!\n",
lib_config_file_name_pP, g_num_enb_properties, enb_properties_index);
return 0;
}