Commit 8baf3e7e authored by Xenofon Foukas's avatar Xenofon Foukas
Browse files

Changed naming convention for flexran related calls

parent 0cee514c
...@@ -621,7 +621,7 @@ add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequenc ...@@ -621,7 +621,7 @@ add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequenc
add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams")
add_boolean_option(ENB_AGENT_SB_IF True "enable eNB agent to inteface with a SDN contrller") add_boolean_option(FLEXRAN_AGENT_SB_IF True "enable FlexRAN agent to inteface with a SDN contrller")
######################## ########################
# Include order # Include order
...@@ -838,7 +838,7 @@ include_directories("${OPENAIR_DIR}") ...@@ -838,7 +838,7 @@ include_directories("${OPENAIR_DIR}")
# Utilities Library # Utilities Library
################ ################
if (ENB_AGENT_SB_IF) if (FLEXRAN_AGENT_SB_IF)
# set the version of protobuf messages, V3 not supported yet # set the version of protobuf messages, V3 not supported yet
add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3) add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3)
...@@ -899,18 +899,18 @@ if (ENB_AGENT_SB_IF) ...@@ -899,18 +899,18 @@ if (ENB_AGENT_SB_IF)
set(ASYNC_IF_LIB ASYNC_IF) set(ASYNC_IF_LIB ASYNC_IF)
include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF) include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF)
add_library(ENB_AGENT add_library(FLEXRAN_AGENT
${OPENAIR2_DIR}/ENB_APP/enb_agent_handler.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_handler.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_common.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_common.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_common_internal.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_common_internal.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_mac.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_mac.c
${OPENAIR2_DIR}/ENB_APP/enb_agent.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_task_manager.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_task_manager.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_net_comm.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_net_comm.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_async.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_async.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_mac_internal.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_mac_internal.c
) )
set(ENB_AGENT_LIB ENB_AGENT) set(FLEXRAN_AGENT_LIB FLEXRAN_AGENT)
#include_directories(${OPENAIR2_DIR}/ENB_APP) #include_directories(${OPENAIR2_DIR}/ENB_APP)
set(PROTOBUF_LIB "protobuf-c") set(PROTOBUF_LIB "protobuf-c")
...@@ -1184,9 +1184,9 @@ set (MAC_SRC ...@@ -1184,9 +1184,9 @@ set (MAC_SRC
${MAC_DIR}/eNB_scheduler_RA.c ${MAC_DIR}/eNB_scheduler_RA.c
${MAC_DIR}/pre_processor.c ${MAC_DIR}/pre_processor.c
${MAC_DIR}/config.c ${MAC_DIR}/config.c
${MAC_DIR}/eNB_agent_scheduler_dlsch_ue.c ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue.c
${MAC_DIR}/eNB_agent_scheduler_dataplane.c ${MAC_DIR}/flexran_agent_scheduler_dataplane.c
${MAC_DIR}/eNB_agent_scheduler_dlsch_ue_remote.c ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue_remote.c
) )
set (ENB_APP_SRC set (ENB_APP_SRC
...@@ -1201,8 +1201,8 @@ add_library(L2 ...@@ -1201,8 +1201,8 @@ add_library(L2
# ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c) # ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
#Test for adding a shared library #Test for adding a shared library
add_library(default_sched SHARED ${MAC_DIR}/eNB_agent_scheduler_dlsch_ue.c) add_library(default_sched SHARED ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue.c)
add_library(remote_sched SHARED ${MAC_DIR}/eNB_agent_scheduler_dlsch_ue_remote.c) add_library(remote_sched SHARED ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue_remote.c)
# L3 Libs # L3 Libs
########################## ##########################
...@@ -1757,7 +1757,7 @@ add_executable(lte-softmodem ...@@ -1757,7 +1757,7 @@ add_executable(lte-softmodem
target_link_libraries (lte-softmodem -ldl target_link_libraries (lte-softmodem -ldl
-Wl,--start-group -Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7 RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
-Wl,--end-group ) -Wl,--end-group )
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
...@@ -1791,7 +1791,7 @@ add_executable(lte-softmodem-nos1 ...@@ -1791,7 +1791,7 @@ add_executable(lte-softmodem-nos1
) )
target_link_libraries (lte-softmodem-nos1 target_link_libraries (lte-softmodem-nos1
-Wl,--start-group -Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7 RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
-Wl,--end-group ) -Wl,--end-group )
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES}) target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
...@@ -1936,7 +1936,7 @@ add_executable(oaisim_nos1 ...@@ -1936,7 +1936,7 @@ add_executable(oaisim_nos1
target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim_nos1 target_link_libraries (oaisim_nos1
-Wl,--start-group -Wl,--start-group
RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ENB_AGENT_LIB} LFDS7 RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
-Wl,--end-group ) -Wl,--end-group )
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES}) target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
......
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
//Agent-related headers //Agent-related headers
#include "ENB_APP/enb_agent_extern.h" #include "ENB_APP/flexran_agent_extern.h"
#include "ENB_APP/enb_agent_mac.h" #include "ENB_APP/flexran_agent_mac.h"
#include "LAYER2/MAC/enb_agent_mac_proto.h" #include "LAYER2/MAC/flexran_agent_mac_proto.h"
//#define DIAG_PHY //#define DIAG_PHY
...@@ -1372,7 +1372,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1372,7 +1372,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
#ifndef DISABLE_SF_TRIGGER #ifndef DISABLE_SF_TRIGGER
//Send subframe trigger to the controller //Send subframe trigger to the controller
if (mac_agent_registered[eNB->Mod_id]) { if (mac_agent_registered[eNB->Mod_id]) {
agent_mac_xface[eNB->Mod_id]->enb_agent_send_sf_trigger(eNB->Mod_id); agent_mac_xface[eNB->Mod_id]->flexran_agent_send_sf_trigger(eNB->Mod_id);
} }
#endif #endif
......
...@@ -56,7 +56,7 @@ TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200) ...@@ -56,7 +56,7 @@ TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200)
/// eNB APP task /// eNB APP task
TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200)
/// eNB Agent task /// eNB Agent task
TASK_DEF(TASK_ENB_AGENT, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200)
// UE tasks and sub-tasks: // UE tasks and sub-tasks:
//// Layer 2 and Layer 1 sub-tasks //// Layer 2 and Layer 1 sub-tasks
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
# include "gtpv1u_eNB_task.h" # include "gtpv1u_eNB_task.h"
# endif # endif
#if defined(ENB_AGENT_SB_IF) #if defined(FLEXRAN_AGENT_SB_IF)
# include "enb_agent.h" # include "flexran_agent.h"
#endif #endif
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
...@@ -314,11 +314,11 @@ void *eNB_app_task(void *args_p) ...@@ -314,11 +314,11 @@ void *eNB_app_task(void *args_p)
configure_rrc(enb_id, enb_properties_p); configure_rrc(enb_id, enb_properties_p);
} }
#if defined (ENB_AGENT_SB_IF) #if defined (FLEXRAN_AGENT_SB_IF)
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) { for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
printf("\n start enb agent %d\n", enb_id); printf("\n start enb agent %d\n", enb_id);
enb_agent_start(enb_id, enb_properties_p); flexran_agent_start(enb_id, enb_properties_p);
} }
#endif #endif
......
...@@ -191,10 +191,10 @@ ...@@ -191,10 +191,10 @@
#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U"
#define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER" #define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER"
#define ENB_CONFIG_STRING_ENB_AGENT_INTERFACE_NAME "ENB_AGENT_INTERFACE_NAME" #define ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME"
#define ENB_CONFIG_STRING_ENB_AGENT_IPV4_ADDRESS "ENB_AGENT_IPV4_ADDRESS" #define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS"
#define ENB_CONFIG_STRING_ENB_AGENT_PORT "ENB_AGENT_PORT" #define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT"
#define ENB_CONFIG_STRING_ENB_AGENT_CACHE "ENB_AGENT_CACHE" #define ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE "FLEXRAN_AGENT_CACHE"
#define ENB_CONFIG_STRING_RRH_GW_CONFIG "rrh_gw_config" #define ENB_CONFIG_STRING_RRH_GW_CONFIG "rrh_gw_config"
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME "local_if_name" #define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME "local_if_name"
...@@ -341,12 +341,12 @@ void enb_config_display(void) ...@@ -341,12 +341,12 @@ void enb_config_display(void)
} }
} }
#if defined(ENB_AGENT_SB_IF) #if defined(FLEXRAN_AGENT_SB_IF)
printf( "\nENB AGENT CONFIG : \n\n"); printf( "\nFLEXRAN AGENT CONFIG : \n\n");
printf( "\tInterface name: \t%s:\n",enb_properties.properties[i]->enb_agent_interface_name); printf( "\tInterface name: \t%s:\n",enb_properties.properties[i]->flexran_agent_interface_name);
printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->enb_agent_ipv4_address); printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->flexran_agent_ipv4_address);
printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->enb_agent_port); printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->flexran_agent_port);
printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->enb_agent_cache); printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->flexran_agent_cache);
#endif #endif
...@@ -674,10 +674,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -674,10 +674,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
char *address = NULL; char *address = NULL;
char *cidr = NULL; char *cidr = NULL;
char *astring = NULL; char *astring = NULL;
char* enb_agent_interface_name = NULL; char* flexran_agent_interface_name = NULL;
char* enb_agent_ipv4_address = NULL; char* flexran_agent_ipv4_address = NULL;
libconfig_int enb_agent_port = 0; libconfig_int flexran_agent_port = 0;
char* enb_agent_cache = NULL; char* flexran_agent_cache = NULL;
libconfig_int otg_ue_id = 0; libconfig_int otg_ue_id = 0;
char* otg_app_type = NULL; char* otg_app_type = NULL;
char* otg_bg_traffic = NULL; char* otg_bg_traffic = NULL;
...@@ -2481,26 +2481,26 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -2481,26 +2481,26 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
if (subsetting != NULL) { if (subsetting != NULL) {
if ( ( if ( (
config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_AGENT_INTERFACE_NAME, config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME,
(const char **)&enb_agent_interface_name) (const char **)&flexran_agent_interface_name)
&& config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_AGENT_IPV4_ADDRESS, && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS,
(const char **)&enb_agent_ipv4_address) (const char **)&flexran_agent_ipv4_address)
&& config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_AGENT_PORT, && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT,
&enb_agent_port) &flexran_agent_port)
&& config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_AGENT_CACHE, && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE,
(const char **)&enb_agent_cache) (const char **)&flexran_agent_cache)
) )
) { ) {
enb_properties.properties[enb_properties_index]->enb_agent_interface_name = strdup(enb_agent_interface_name); enb_properties.properties[enb_properties_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name);
cidr = enb_agent_ipv4_address; cidr = flexran_agent_ipv4_address;
address = strtok(cidr, "/"); address = strtok(cidr, "/");
enb_properties.properties[enb_properties_index]->enb_agent_ipv4_address = strdup(address); enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address = strdup(address);
/* if (address) { /* if (address) {
IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties.properties[enb_properties_index]->enb_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" ); IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" );
}*/ }*/
enb_properties.properties[enb_properties_index]->enb_agent_port = enb_agent_port; enb_properties.properties[enb_properties_index]->flexran_agent_port = flexran_agent_port;
enb_properties.properties[enb_properties_index]->enb_agent_cache = strdup(enb_agent_cache); enb_properties.properties[enb_properties_index]->flexran_agent_cache = strdup(flexran_agent_cache);
} }
} }
......
...@@ -228,10 +228,10 @@ typedef struct Enb_properties_s { ...@@ -228,10 +228,10 @@ typedef struct Enb_properties_s {
char *enb_interface_name_for_S1_MME; char *enb_interface_name_for_S1_MME;
in_addr_t enb_ipv4_address_for_S1_MME; in_addr_t enb_ipv4_address_for_S1_MME;
char *enb_agent_interface_name; char *flexran_agent_interface_name;
in_addr_t enb_agent_ipv4_address; in_addr_t flexran_agent_ipv4_address;
tcp_udp_port_t enb_agent_port; tcp_udp_port_t flexran_agent_port;
char *enb_agent_cache; char *flexran_agent_cache;
/* Nb of RRH to connect to */ /* Nb of RRH to connect to */
uint8_t nb_rrh_gw; uint8_t nb_rrh_gw;
......
...@@ -27,28 +27,28 @@ ...@@ -27,28 +27,28 @@
*******************************************************************************/ *******************************************************************************/
/*! \file enb_agent.h /*! \file flexran_agent.h
* \brief top level enb agent receive thread and itti task * \brief top level flexran agent receive thread and itti task
* \author Xenofon Foukas and Navid Nikaein * \author Xenofon Foukas and Navid Nikaein
* \date 2016 * \date 2016
* \version 0.1 * \version 0.1
*/ */
#include "enb_agent_common.h" #include "flexran_agent_common.h"
#include "log.h" #include "log.h"
#include "enb_agent.h" #include "flexran_agent.h"
#include "enb_agent_mac_defs.h" #include "flexran_agent_mac_defs.h"
#include "enb_agent_extern.h" #include "flexran_agent_extern.h"
#include "assertions.h" #include "assertions.h"
#include "enb_agent_net_comm.h" #include "flexran_agent_net_comm.h"
#include "enb_agent_async.h" #include "flexran_agent_async.h"
//#define TEST_TIMER //#define TEST_TIMER
enb_agent_instance_t enb_agent[NUM_MAX_ENB]; flexran_agent_instance_t flexran_agent[NUM_MAX_ENB];
char in_ip[40]; char in_ip[40];
static uint16_t in_port; static uint16_t in_port;
...@@ -57,7 +57,7 @@ char local_cache[40]; ...@@ -57,7 +57,7 @@ char local_cache[40];
void *send_thread(void *args); void *send_thread(void *args);
void *receive_thread(void *args); void *receive_thread(void *args);
pthread_t new_thread(void *(*f)(void *), void *b); pthread_t new_thread(void *(*f)(void *), void *b);
Protocol__FlexranMessage *enb_agent_timeout(void* args); Protocol__FlexranMessage *flexran_agent_timeout(void* args);
int agent_task_created = 0; int agent_task_created = 0;
...@@ -65,9 +65,9 @@ int agent_task_created = 0; ...@@ -65,9 +65,9 @@ int agent_task_created = 0;
* enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller * enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller
* and can interact with other itti tasks * and can interact with other itti tasks
*/ */
void *enb_agent_task(void *args){ void *flexran_agent_task(void *args){
//enb_agent_instance_t *d = (enb_agent_instance_t *) args; //flexran_agent_instance_t *d = (flexran_agent_instance_t *) args;
Protocol__FlexranMessage *msg; Protocol__FlexranMessage *msg;
void *data; void *data;
int size; int size;
...@@ -78,13 +78,13 @@ void *enb_agent_task(void *args){ ...@@ -78,13 +78,13 @@ void *enb_agent_task(void *args){
const char *msg_name = NULL; const char *msg_name = NULL;
instance_t instance; instance_t instance;
int result; int result;
struct enb_agent_timer_element_s * elem = NULL; struct flexran_agent_timer_element_s * elem = NULL;
itti_mark_task_ready(TASK_ENB_AGENT); itti_mark_task_ready(TASK_FLEXRAN_AGENT);
do { do {
// Wait for a message // Wait for a message
itti_receive_msg (TASK_ENB_AGENT, &msg_p); itti_receive_msg (TASK_FLEXRAN_AGENT, &msg_p);
DevAssert(msg_p != NULL); DevAssert(msg_p != NULL);
msg_name = ITTI_MSG_NAME (msg_p); msg_name = ITTI_MSG_NAME (msg_p);
instance = ITTI_MSG_INSTANCE (msg_p); instance = ITTI_MSG_INSTANCE (msg_p);
...@@ -95,25 +95,25 @@ void *enb_agent_task(void *args){ ...@@ -95,25 +95,25 @@ void *enb_agent_task(void *args){
break; break;
case MESSAGE_TEST: case MESSAGE_TEST:
LOG_I(ENB_AGENT, "Received %s\n", ITTI_MSG_NAME(msg_p)); LOG_I(FLEXRAN_AGENT, "Received %s\n", ITTI_MSG_NAME(msg_p));
break; break;
case TIMER_HAS_EXPIRED: case TIMER_HAS_EXPIRED:
msg = enb_agent_process_timeout(msg_p->ittiMsg.timer_has_expired.timer_id, msg_p->ittiMsg.timer_has_expired.arg); msg = flexran_agent_process_timeout(msg_p->ittiMsg.timer_has_expired.timer_id, msg_p->ittiMsg.timer_has_expired.arg);
if (msg != NULL){ if (msg != NULL){
data=enb_agent_pack_message(msg,&size); data=flexran_agent_pack_message(msg,&size);
elem = get_timer_entry(msg_p->ittiMsg.timer_has_expired.timer_id); elem = get_timer_entry(msg_p->ittiMsg.timer_has_expired.timer_id);
if (enb_agent_msg_send(elem->agent_id, ENB_AGENT_DEFAULT, data, size, priority)) { if (flexran_agent_msg_send(elem->agent_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) {
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING; err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error; goto error;
} }
LOG_D(ENB_AGENT,"sent message with size %d\n", size); LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
} }
break; break;
default: default:
LOG_E(ENB_AGENT, "Received unexpected message %s\n", msg_name); LOG_E(FLEXRAN_AGENT, "Received unexpected message %s\n", msg_name);
break; break;
} }
...@@ -121,7 +121,7 @@ void *enb_agent_task(void *args){ ...@@ -121,7 +121,7 @@ void *enb_agent_task(void *args){
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
continue; continue;
error: error:
LOG_E(ENB_AGENT,"enb_agent_task: error %d occured\n",err_code); LOG_E(FLEXRAN_AGENT,"flexran_agent_task: error %d occured\n",err_code);
} while (1); } while (1);
return NULL; return NULL;
...@@ -129,7 +129,7 @@ void *enb_agent_task(void *args){ ...@@ -129,7 +129,7 @@ void *enb_agent_task(void *args){
void *receive_thread(void *args) { void *receive_thread(void *args) {
enb_agent_instance_t *d = args; flexran_agent_instance_t *d = args;
void *data; void *data;
int size; int size;
int priority; int priority;
...@@ -139,25 +139,25 @@ void *receive_thread(void *args) { ...@@ -139,25 +139,25 @@ void *receive_thread(void *args) {
while (1) { while (1) {
while (enb_agent_msg_recv(d->enb_id, ENB_AGENT_DEFAULT, &data, &size, &priority) == 0) { while (flexran_agent_msg_recv(d->enb_id, FLEXRAN_AGENT_DEFAULT, &data, &size, &priority) == 0) {
LOG_D(ENB_AGENT,"received message with size %d\n", size); LOG_D(FLEXRAN_AGENT,"received message with size %d\n", size);
// Invoke the message handler // Invoke the message handler
msg=enb_agent_handle_message(d->enb_id, data, size); msg=flexran_agent_handle_message(d->enb_id, data, size);
free(data); free(data);
// check if there is something to send back to the controller // check if there is something to send back to the controller
if (msg != NULL){ if (msg != NULL){
data=enb_agent_pack_message(msg,&size); data=flexran_agent_pack_message(msg,&size);
if (enb_agent_msg_send(d->enb_id, ENB_AGENT_DEFAULT, data, size, priority)) { if (flexran_agent_msg_send(d->enb_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) {
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING; err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
goto error; goto error;
} }
LOG_D(ENB_AGENT,"sent message with size %d\n", size); LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
} }
} }
} }
...@@ -165,7 +165,7 @@ void *receive_thread(void *args) { ...@@ -165,7 +165,7 @@ void *receive_thread(void *args) {
return NULL; return NULL;
error: error:
LOG_E(ENB_AGENT,"receive_thread: error %d occured\n",err_code); LOG_E(FLEXRAN_AGENT,"receive_thread: error %d occured\n",err_code);
return NULL; return NULL;
} }
...@@ -203,37 +203,37 @@ pthread_t new_thread(void *(*f)(void *), void *b) { ...@@ -203,37 +203,37 @@ pthread_t new_thread(void *(*f)(void *), void *b) {
} }
int channel_container_init = 0; int channel_container_init = 0;
int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
int channel_id; int channel_id;
set_enb_vars(mod_id, RAN_LTE_OAI); flexran_set_enb_vars(mod_id, RAN_LTE_OAI);
enb_agent[mod_id].enb_id = mod_id; flexran_agent[mod_id].enb_id = mod_id;
/* /*
* check the configuration * check the configuration
*/ */
if (enb_properties->properties[mod_id]->enb_agent_cache != NULL) { if (enb_properties->properties[mod_id]->flexran_agent_cache != NULL) {
strncpy(local_cache, enb_properties->properties[mod_id]->enb_agent_cache, sizeof(local_cache)); strncpy(local_cache, enb_properties->properties[mod_id]->flexran_agent_cache, sizeof(local_cache));
local_cache[sizeof(local_cache) - 1] = 0; local_cache[sizeof(local_cache) - 1] = 0;
} else { } else {