Commit 62a2f833 authored by winckel's avatar winckel

Added some physical parameters into the configuration file.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4994 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent ca5b92c9
...@@ -60,7 +60,7 @@ int enb_config_init(char* lib_config_file_name_pP) { ...@@ -60,7 +60,7 @@ int enb_config_init(char* lib_config_file_name_pP) {
config_setting_t *setting_mme_addresses; config_setting_t *setting_mme_addresses;
config_setting_t *setting_mme_address; config_setting_t *setting_mme_address;
config_setting_t *setting_enb; config_setting_t *setting_enb;
int num_enbs, num_mme_address, i, j, parse_error, enb_properties_index; int num_enbs, num_mme_address, i, j, parse_error = 0, enb_properties_index;
long int enb_id; long int enb_id;
const char* cell_type; const char* cell_type;
long int tac; long int tac;
...@@ -68,11 +68,15 @@ int enb_config_init(char* lib_config_file_name_pP) { ...@@ -68,11 +68,15 @@ int enb_config_init(char* lib_config_file_name_pP) {
long int mcc; long int mcc;
long int mnc; long int mnc;
const char* default_drx; const char* default_drx;
const char* frame_type;
const char* prefix_type;
long int downlink_frequency;
long int uplink_frequency_offset;
char* ipv4; char* ipv4;
char* ipv6; char* ipv6;
char* active; char* active;
char* preference; char* preference;
char* active_enb[MAX_ENB]; const char* active_enb[MAX_ENB];
memset((char*)g_enb_properties, 0 , MAX_ENB * sizeof(Enb_properties_t*)); memset((char*)g_enb_properties, 0 , MAX_ENB * sizeof(Enb_properties_t*));
...@@ -87,7 +91,7 @@ int enb_config_init(char* lib_config_file_name_pP) { ...@@ -87,7 +91,7 @@ int enb_config_init(char* 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)); LOG_E(ENB_APP, "%s:%d - %s\n", lib_config_file_name_pP, config_error_line(&cfg), config_error_text(&cfg));
config_destroy(&cfg); config_destroy(&cfg);
AssertFatal (1 == 0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP); AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP);
} }
} }
else else
...@@ -133,8 +137,7 @@ int enb_config_init(char* lib_config_file_name_pP) { ...@@ -133,8 +137,7 @@ int enb_config_init(char* lib_config_file_name_pP) {
&& config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_DEFAULT_PAGING_DRX, &default_drx) && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_DEFAULT_PAGING_DRX, &default_drx)
) )
) { ) {
parse_error = 1; AssertError (0, parse_error ++,
AssertFatal (parse_error == 0,
"Failed to parse eNB configuration file %s, %u th enb\n", "Failed to parse eNB configuration file %s, %u th enb\n",
lib_config_file_name_pP, i); lib_config_file_name_pP, i);
} }
...@@ -149,9 +152,9 @@ int enb_config_init(char* lib_config_file_name_pP) { ...@@ -149,9 +152,9 @@ int enb_config_init(char* lib_config_file_name_pP) {
} else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) {
g_enb_properties[enb_properties_index]->cell_type = CELL_HOME_ENB; g_enb_properties[enb_properties_index]->cell_type = CELL_HOME_ENB;
} else { } else {
AssertFatal (1 == 0, AssertError (0, parse_error ++,
"Failed to parse eNB configuration 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 \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
lib_config_file_name_pP, i); lib_config_file_name_pP, i, cell_type);
} }
g_enb_properties[enb_properties_index]->eNB_name = strdup(enb_name); g_enb_properties[enb_properties_index]->eNB_name = strdup(enb_name);
g_enb_properties[enb_properties_index]->tac = (uint16_t)tac; g_enb_properties[enb_properties_index]->tac = (uint16_t)tac;
...@@ -167,11 +170,51 @@ int enb_config_init(char* lib_config_file_name_pP) { ...@@ -167,11 +170,51 @@ int enb_config_init(char* lib_config_file_name_pP) {
} else if (strcmp(default_drx, "PAGING_DRX_256") == 0) { } else if (strcmp(default_drx, "PAGING_DRX_256") == 0) {
g_enb_properties[enb_properties_index]->default_drx = PAGING_DRX_256; g_enb_properties[enb_properties_index]->default_drx = PAGING_DRX_256;
} else { } else {
AssertFatal (1 == 0, AssertError (0, parse_error ++,
"Failed to parse eNB configuration 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 \"%s\" for default_drx choice: PAGING_DRX_32..PAGING_DRX_256 !\n",
lib_config_file_name_pP, i); lib_config_file_name_pP, i, default_drx);
}
// Parse optional physical parameters
if(config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type)) {
if (strcmp(frame_type, "FDD") == 0) {
g_enb_properties[enb_properties_index]->frame_type = FDD;
} else if (strcmp(frame_type, "TDD") == 0) {
g_enb_properties[enb_properties_index]->frame_type = TDD;
} else {
AssertError (0, parse_error ++,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for frame_type choice: FDD or TDD !\n",
lib_config_file_name_pP, i, frame_type);
}
} else {
g_enb_properties[enb_properties_index]->frame_type = FDD; // Default frame type
}
if(config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_PREFIX_TYPE, &prefix_type)) {
if (strcmp(prefix_type, "NORMAL") == 0) {
g_enb_properties[enb_properties_index]->prefix_type = NORMAL;
} else if (strcmp(prefix_type, "EXTENDED") == 0) {
g_enb_properties[enb_properties_index]->prefix_type = EXTENDED;
} else {
AssertError (0, parse_error ++,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n",
lib_config_file_name_pP, i, prefix_type);
}
} else {
g_enb_properties[enb_properties_index]->prefix_type = NORMAL; // Default prefix type
}
if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency)) {
g_enb_properties[enb_properties_index]->downlink_frequency = downlink_frequency;
} else {
g_enb_properties[enb_properties_index]->downlink_frequency = 2680000000; // Default downlink frequency
}
if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset)) {
g_enb_properties[enb_properties_index]->uplink_frequency_offset = uplink_frequency_offset;
} else {
g_enb_properties[enb_properties_index]->uplink_frequency_offset = -120000000; // Default uplink frequency offset
} }
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); setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS);
num_mme_address = config_setting_length(setting_mme_addresses); num_mme_address = config_setting_length(setting_mme_addresses);
...@@ -185,9 +228,8 @@ int enb_config_init(char* lib_config_file_name_pP) { ...@@ -185,9 +228,8 @@ int enb_config_init(char* lib_config_file_name_pP) {
&& config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference) && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference)
) )
) { ) {
parse_error = 1; AssertError (0, parse_error ++,
AssertFatal (parse_error == 0, "Failed to parse eNB configuration 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); lib_config_file_name_pP, i, j);
} }
g_enb_properties[enb_properties_index]->nb_mme += 1; g_enb_properties[enb_properties_index]->nb_mme += 1;
...@@ -216,8 +258,12 @@ int enb_config_init(char* lib_config_file_name_pP) { ...@@ -216,8 +258,12 @@ int enb_config_init(char* lib_config_file_name_pP) {
} }
} }
} }
AssertFatal (enb_properties_index == g_num_enb_properties, AssertError (enb_properties_index == g_num_enb_properties, parse_error ++,
"Failed to parse eNB configuration 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); lib_config_file_name_pP, g_num_enb_properties, enb_properties_index);
AssertFatal (parse_error == 0,
"Failed to parse eNB configuration file %s, found %d error%s !\n",
lib_config_file_name_pP, parse_error, parse_error > 1 ? "s" : "");
return 0; return 0;
} }
...@@ -32,26 +32,33 @@ ...@@ -32,26 +32,33 @@
#define ENB_CONFIG_H_ #define ENB_CONFIG_H_
#include "commonDef.h" #include "commonDef.h"
#include "PHY/impl_defs_lte.h"
#include "s1ap_messages_types.h" #include "s1ap_messages_types.h"
#define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" #define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs"
#define ENB_CONFIG_STRING_ENB_LIST "eNBs" #define ENB_CONFIG_STRING_ENB_LIST "eNBs"
#define ENB_CONFIG_STRING_ENB_ID "eNB_ID" #define ENB_CONFIG_STRING_ENB_ID "eNB_ID"
#define ENB_CONFIG_STRING_CELL_TYPE "cell_type" #define ENB_CONFIG_STRING_CELL_TYPE "cell_type"
#define ENB_CONFIG_STRING_ENB_NAME "eNB_name" #define ENB_CONFIG_STRING_ENB_NAME "eNB_name"
#define ENB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code" #define ENB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code"
#define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE "mobile_country_code" #define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE "mobile_country_code"
#define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE "mobile_network_code" #define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE "mobile_network_code"
#define ENB_CONFIG_STRING_DEFAULT_PAGING_DRX "default_paging_drx" #define ENB_CONFIG_STRING_DEFAULT_PAGING_DRX "default_paging_drx"
#define ENB_CONFIG_STRING_FRAME_TYPE "frame_type"
#define ENB_CONFIG_STRING_PREFIX_TYPE "prefix_type"
#define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency"
#define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" #define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address"
#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" #define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4"
#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" #define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" #define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" #define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference"
typedef struct mme_ip_address_s { typedef struct mme_ip_address_s {
unsigned ipv4:1; unsigned ipv4:1;
unsigned ipv6:1; unsigned ipv6:1;
...@@ -65,33 +72,39 @@ typedef struct Enb_properties_s { ...@@ -65,33 +72,39 @@ typedef struct Enb_properties_s {
* For macro eNB ids this field should be 20 bits long. * For macro eNB ids this field should be 20 bits long.
* For home eNB ids this field should be 28 bits long. * For home eNB ids this field should be 28 bits long.
*/ */
uint32_t eNB_id; uint32_t eNB_id;
/* The type of the cell */ /* The type of the cell */
enum cell_type_e cell_type; enum cell_type_e cell_type;
/* Optional name for the cell /* Optional name for the cell
* NOTE: the name can be NULL (i.e no name) and will be cropped to 150 * NOTE: the name can be NULL (i.e no name) and will be cropped to 150
* characters. * characters.
*/ */
char *eNB_name; char *eNB_name;
/* Tracking area code */ /* Tracking area code */
uint16_t tac; uint16_t tac;
/* Mobile Country Code /* Mobile Country Code
* Mobile Network Code * Mobile Network Code
*/ */
uint16_t mcc; uint16_t mcc;
uint16_t mnc; uint16_t mnc;
/* Default Paging DRX of the eNB as defined in TS 36.304 */ /* Default Paging DRX of the eNB as defined in TS 36.304 */
paging_drx_t default_drx; paging_drx_t default_drx;
/* Physical parameters */
lte_frame_type_t frame_type;
lte_prefix_type_t prefix_type;
uint32_t downlink_frequency;
uint32_t uplink_frequency_offset;
/* Nb of MME to connect to */ /* Nb of MME to connect to */
uint8_t nb_mme; uint8_t nb_mme;
/* List of MME to connect to */ /* List of MME to connect to */
mme_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; mme_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
} Enb_properties_t; } Enb_properties_t;
......
...@@ -3,6 +3,7 @@ Active_eNBs = ( "eNB_Eurecom_0"); ...@@ -3,6 +3,7 @@ Active_eNBs = ( "eNB_Eurecom_0");
eNBs = eNBs =
( (
{ {
////////// Identification parameters:
eNB_ID = 347472; eNB_ID = 347472;
cell_type = "CELL_MACRO_ENB"; cell_type = "CELL_MACRO_ENB";
...@@ -16,9 +17,17 @@ eNBs = ...@@ -16,9 +17,17 @@ eNBs =
mobile_network_code = 92; mobile_network_code = 92;
////////// Channel parameters:
// Default Paging DRX of the eNB as defined in TS 36.304 // Default Paging DRX of the eNB as defined in TS 36.304
default_paging_drx = "PAGING_DRX_256"; default_paging_drx = "PAGING_DRX_256";
////////// Physical parameters:
frame_type = "FDD";
prefix_type = "NORMAL";
downlink_frequency = 2680000000;
uplink_frequency_offset = -120000000;
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.31"; mme_ip_address = ( { ipv4 = "192.168.12.31";
ipv6 = "2192:168:30::17"; ipv6 = "2192:168:30::17";
active = "yes"; active = "yes";
......
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