Commit 6d565bae authored by Lionel Gauthier's avatar Lionel Gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5060 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent f4e67761
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
*******************************************************************************/ *******************************************************************************/
#include <string.h> #include <string.h>
#include <stdio.h>
#include "enb_app.h" #include "enb_app.h"
#include "enb_config.h" #include "enb_config.h"
...@@ -101,6 +102,8 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con ...@@ -101,6 +102,8 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
uint32_t mme_id; uint32_t mme_id;
MessageDef *msg_p; MessageDef *msg_p;
uint32_t register_enb_pending = 0; uint32_t register_enb_pending = 0;
char *str = NULL;
struct in_addr addr;
# if defined(OAI_EMU) # if defined(OAI_EMU)
...@@ -143,6 +146,12 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con ...@@ -143,6 +146,12 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address)); sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address));
} }
s1ap_register_eNB->enb_ip_address.ipv6 = 0;
s1ap_register_eNB->enb_ip_address.ipv4 = 1;
addr.s_addr = enb_properties->properties[enb_id]->enb_ipv4_address_for_S1_MME;
str = inet_ntoa(addr);
strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str);
itti_send_msg_to_task (TASK_S1AP, enb_id, msg_p); itti_send_msg_to_task (TASK_S1AP, enb_id, msg_p);
register_enb_pending++; register_enb_pending++;
......
...@@ -427,13 +427,13 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -427,13 +427,13 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
if(subsetting != NULL) { if(subsetting != NULL) {
if( ( if( (
config_setting_lookup_string( setting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME,
(const char **)&enb_interface_name_for_S1_MME) (const char **)&enb_interface_name_for_S1_MME)
&& config_setting_lookup_string( setting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME,
(const char **)&enb_ipv4_address_for_S1_MME) (const char **)&enb_ipv4_address_for_S1_MME)
&& config_setting_lookup_string( setting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U,
(const char **)&enb_interface_name_for_S1U) (const char **)&enb_interface_name_for_S1U)
&& config_setting_lookup_string( setting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U,
(const char **)&enb_ipv4_address_for_S1U) (const char **)&enb_ipv4_address_for_S1U)
) )
){ ){
...@@ -441,7 +441,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -441,7 +441,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
cidr = enb_ipv4_address_for_S1U; cidr = enb_ipv4_address_for_S1U;
address = strtok(cidr, "/"); address = strtok(cidr, "/");
if (address) { if (address) {
address = strdup(address);
IPV4_STR_ADDR_TO_INT_NWBO ( address, enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); IPV4_STR_ADDR_TO_INT_NWBO ( address, enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
} }
...@@ -449,7 +448,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -449,7 +448,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
cidr = enb_ipv4_address_for_S1_MME; cidr = enb_ipv4_address_for_S1_MME;
address = strtok(cidr, "/"); address = strtok(cidr, "/");
if (address) { if (address) {
address = strdup(address);
IPV4_STR_ADDR_TO_INT_NWBO ( address, enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); IPV4_STR_ADDR_TO_INT_NWBO ( address, enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" );
} }
} }
......
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