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

Changed naming convention for flexran related calls

parent 0cee514c
......@@ -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_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
......@@ -838,7 +838,7 @@ include_directories("${OPENAIR_DIR}")
# Utilities Library
################
if (ENB_AGENT_SB_IF)
if (FLEXRAN_AGENT_SB_IF)
# set the version of protobuf messages, V3 not supported yet
add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3)
......@@ -899,18 +899,18 @@ if (ENB_AGENT_SB_IF)
set(ASYNC_IF_LIB ASYNC_IF)
include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF)
add_library(ENB_AGENT
${OPENAIR2_DIR}/ENB_APP/enb_agent_handler.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_common.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_common_internal.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_mac.c
${OPENAIR2_DIR}/ENB_APP/enb_agent.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_task_manager.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_net_comm.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_async.c
${OPENAIR2_DIR}/ENB_APP/enb_agent_mac_internal.c
add_library(FLEXRAN_AGENT
${OPENAIR2_DIR}/ENB_APP/flexran_agent_handler.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_common.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_common_internal.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_mac.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_task_manager.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_net_comm.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_async.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)
set(PROTOBUF_LIB "protobuf-c")
......@@ -1184,9 +1184,9 @@ set (MAC_SRC
${MAC_DIR}/eNB_scheduler_RA.c
${MAC_DIR}/pre_processor.c
${MAC_DIR}/config.c
${MAC_DIR}/eNB_agent_scheduler_dlsch_ue.c
${MAC_DIR}/eNB_agent_scheduler_dataplane.c
${MAC_DIR}/eNB_agent_scheduler_dlsch_ue_remote.c
${MAC_DIR}/flexran_agent_scheduler_dlsch_ue.c
${MAC_DIR}/flexran_agent_scheduler_dataplane.c
${MAC_DIR}/flexran_agent_scheduler_dlsch_ue_remote.c
)
set (ENB_APP_SRC
......@@ -1201,8 +1201,8 @@ add_library(L2
# ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
#Test for adding a shared library
add_library(default_sched SHARED ${MAC_DIR}/eNB_agent_scheduler_dlsch_ue.c)
add_library(remote_sched SHARED ${MAC_DIR}/eNB_agent_scheduler_dlsch_ue_remote.c)
add_library(default_sched SHARED ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue.c)
add_library(remote_sched SHARED ${MAC_DIR}/flexran_agent_scheduler_dlsch_ue_remote.c)
# L3 Libs
##########################
......@@ -1757,7 +1757,7 @@ add_executable(lte-softmodem
target_link_libraries (lte-softmodem -ldl
-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 )
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
......@@ -1791,7 +1791,7 @@ add_executable(lte-softmodem-nos1
)
target_link_libraries (lte-softmodem-nos1
-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 )
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
......@@ -1936,7 +1936,7 @@ add_executable(oaisim_nos1
target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim_nos1
-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 )
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
......
......@@ -63,9 +63,9 @@
//Agent-related headers
#include "ENB_APP/enb_agent_extern.h"
#include "ENB_APP/enb_agent_mac.h"
#include "LAYER2/MAC/enb_agent_mac_proto.h"
#include "ENB_APP/flexran_agent_extern.h"
#include "ENB_APP/flexran_agent_mac.h"
#include "LAYER2/MAC/flexran_agent_mac_proto.h"
//#define DIAG_PHY
......@@ -1372,7 +1372,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
#ifndef DISABLE_SF_TRIGGER
//Send subframe trigger to the controller
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
......
......@@ -56,7 +56,7 @@ TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200)
/// eNB APP task
TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200)
/// 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:
//// Layer 2 and Layer 1 sub-tasks
......
......@@ -49,8 +49,8 @@
# include "gtpv1u_eNB_task.h"
# endif
#if defined(ENB_AGENT_SB_IF)
# include "enb_agent.h"
#if defined(FLEXRAN_AGENT_SB_IF)
# include "flexran_agent.h"
#endif
extern unsigned char NB_eNB_INST;
......@@ -314,11 +314,11 @@ void *eNB_app_task(void *args_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++) {
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
......
......@@ -191,10 +191,10 @@
#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_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_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT"
#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_LOCAL_IF_NAME "local_if_name"
......@@ -341,12 +341,12 @@ void enb_config_display(void)
}
}
#if defined(ENB_AGENT_SB_IF)
printf( "\nENB AGENT CONFIG : \n\n");
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);
#if defined(FLEXRAN_AGENT_SB_IF)
printf( "\nFLEXRAN AGENT CONFIG : \n\n");
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]->flexran_agent_ipv4_address);
printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->flexran_agent_port);
printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->flexran_agent_cache);
#endif
......@@ -674,10 +674,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
char *address = NULL;
char *cidr = NULL;
char *astring = NULL;
char* enb_agent_interface_name = NULL;
char* enb_agent_ipv4_address = NULL;
libconfig_int enb_agent_port = 0;
char* enb_agent_cache = NULL;
char* flexran_agent_interface_name = NULL;
char* flexran_agent_ipv4_address = NULL;
libconfig_int flexran_agent_port = 0;
char* flexran_agent_cache = NULL;
libconfig_int otg_ue_id = 0;
char* otg_app_type = NULL;
char* otg_bg_traffic = NULL;
......@@ -2481,26 +2481,26 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
if (subsetting != NULL) {
if ( (
config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_AGENT_INTERFACE_NAME,
(const char **)&enb_agent_interface_name)
&& config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_AGENT_IPV4_ADDRESS,
(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)
config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME,
(const char **)&flexran_agent_interface_name)
&& config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS,
(const char **)&flexran_agent_ipv4_address)
&& config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT,
&flexran_agent_port)
&& config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE,
(const char **)&flexran_agent_cache)
)
) {
enb_properties.properties[enb_properties_index]->enb_agent_interface_name = strdup(enb_agent_interface_name);
cidr = enb_agent_ipv4_address;
enb_properties.properties[enb_properties_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name);
cidr = flexran_agent_ipv4_address;
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) {
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]->enb_agent_cache = strdup(enb_agent_cache);
enb_properties.properties[enb_properties_index]->flexran_agent_port = flexran_agent_port;
enb_properties.properties[enb_properties_index]->flexran_agent_cache = strdup(flexran_agent_cache);
}
}
......
......@@ -228,10 +228,10 @@ typedef struct Enb_properties_s {
char *enb_interface_name_for_S1_MME;
in_addr_t enb_ipv4_address_for_S1_MME;
char *enb_agent_interface_name;
in_addr_t enb_agent_ipv4_address;
tcp_udp_port_t enb_agent_port;
char *enb_agent_cache;
char *flexran_agent_interface_name;
in_addr_t flexran_agent_ipv4_address;
tcp_udp_port_t flexran_agent_port;
char *flexran_agent_cache;
/* Nb of RRH to connect to */
uint8_t nb_rrh_gw;
......
......@@ -27,28 +27,28 @@
*******************************************************************************/
/*! \file enb_agent.h
* \brief top level enb agent receive thread and itti task
/*! \file flexran_agent.h
* \brief top level flexran agent receive thread and itti task
* \author Xenofon Foukas and Navid Nikaein
* \date 2016
* \version 0.1
*/
#include "enb_agent_common.h"
#include "flexran_agent_common.h"
#include "log.h"
#include "enb_agent.h"
#include "enb_agent_mac_defs.h"
#include "flexran_agent.h"
#include "flexran_agent_mac_defs.h"
#include "enb_agent_extern.h"
#include "flexran_agent_extern.h"
#include "assertions.h"
#include "enb_agent_net_comm.h"
#include "enb_agent_async.h"
#include "flexran_agent_net_comm.h"
#include "flexran_agent_async.h"
//#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];
static uint16_t in_port;
......@@ -57,7 +57,7 @@ char local_cache[40];
void *send_thread(void *args);
void *receive_thread(void *args);
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;
......@@ -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
* 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;
void *data;
int size;
......@@ -78,13 +78,13 @@ void *enb_agent_task(void *args){
const char *msg_name = NULL;
instance_t instance;
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 {
// Wait for a message
itti_receive_msg (TASK_ENB_AGENT, &msg_p);
itti_receive_msg (TASK_FLEXRAN_AGENT, &msg_p);
DevAssert(msg_p != NULL);
msg_name = ITTI_MSG_NAME (msg_p);
instance = ITTI_MSG_INSTANCE (msg_p);
......@@ -95,25 +95,25 @@ void *enb_agent_task(void *args){
break;
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;
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){
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);
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;
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;
default:
LOG_E(ENB_AGENT, "Received unexpected message %s\n", msg_name);
LOG_E(FLEXRAN_AGENT, "Received unexpected message %s\n", msg_name);
break;
}
......@@ -121,7 +121,7 @@ void *enb_agent_task(void *args){
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
continue;
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);
return NULL;
......@@ -129,7 +129,7 @@ void *enb_agent_task(void *args){
void *receive_thread(void *args) {
enb_agent_instance_t *d = args;
flexran_agent_instance_t *d = args;
void *data;
int size;
int priority;
......@@ -139,25 +139,25 @@ void *receive_thread(void *args) {
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
msg=enb_agent_handle_message(d->enb_id, data, size);
msg=flexran_agent_handle_message(d->enb_id, data, size);
free(data);
// check if there is something to send back to the controller
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;
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) {
return NULL;
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;
}
......@@ -203,37 +203,37 @@ pthread_t new_thread(void *(*f)(void *), void *b) {
}
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;
set_enb_vars(mod_id, RAN_LTE_OAI);
enb_agent[mod_id].enb_id = mod_id;
flexran_set_enb_vars(mod_id, RAN_LTE_OAI);
flexran_agent[mod_id].enb_id = mod_id;
/*
* 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));
if (enb_properties->properties[mod_id]->flexran_agent_cache != NULL) {
strncpy(local_cache, enb_properties->properties[mod_id]->flexran_agent_cache, sizeof(local_cache));
local_cache[sizeof(local_cache) - 1] = 0;
} else {
strcpy(local_cache, DEFAULT_ENB_AGENT_CACHE);
strcpy(local_cache, DEFAULT_FLEXRAN_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) );
if (enb_properties->properties[mod_id]->flexran_agent_ipv4_address != NULL) {
strncpy(in_ip, enb_properties->properties[mod_id]->flexran_agent_ipv4_address, sizeof(in_ip) );
in_ip[sizeof(in_ip) - 1] = 0; // terminate string
} else {
strcpy(in_ip, DEFAULT_ENB_AGENT_IPv4_ADDRESS );
strcpy(in_ip, DEFAULT_FLEXRAN_AGENT_IPv4_ADDRESS );
}
if (enb_properties->properties[mod_id]->enb_agent_port != 0 ) {
in_port = enb_properties->properties[mod_id]->enb_agent_port;
if (enb_properties->properties[mod_id]->flexran_agent_port != 0 ) {
in_port = enb_properties->properties[mod_id]->flexran_agent_port;
} else {
in_port = DEFAULT_ENB_AGENT_PORT ;
in_port = DEFAULT_FLEXRAN_AGENT_PORT ;
}
LOG_I(ENB_AGENT,"starting enb agent client for module id %d on ipv4 %s, port %d\n",
enb_agent[mod_id].enb_id,
LOG_I(FLEXRAN_AGENT,"starting enb agent client for module id %d on ipv4 %s, port %d\n",
flexran_agent[mod_id].enb_id,
in_ip,
in_port);
......@@ -241,87 +241,87 @@ int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties){
* Initialize the channel container
*/
if (!channel_container_init) {
enb_agent_init_channel_container();
flexran_agent_init_channel_container();
channel_container_init = 1;
}
/*Create the async channel info*/
enb_agent_instance_t *channel_info = enb_agent_async_channel_info(mod_id, in_ip, in_port);
flexran_agent_instance_t *channel_info = flexran_agent_async_channel_info(mod_id, in_ip, in_port);
/*Create a channel using the async channel info*/
channel_id = enb_agent_create_channel((void *) channel_info,
enb_agent_async_msg_send,
enb_agent_async_msg_recv,
enb_agent_async_release);
channel_id = flexran_agent_create_channel((void *) channel_info,
flexran_agent_async_msg_send,
flexran_agent_async_msg_recv,
flexran_agent_async_release);
if (channel_id <= 0) {
goto error;
}
enb_agent_channel_t *channel = get_channel(channel_id);
flexran_agent_channel_t *channel = get_channel(channel_id);
if (channel == NULL) {
goto error;
}
/*Register the channel for all underlying agents (use ENB_AGENT_MAX)*/
enb_agent_register_channel(mod_id, channel, ENB_AGENT_MAX);
/*Register the channel for all underlying agents (use FLEXRAN_AGENT_MAX)*/
flexran_agent_register_channel(mod_id, channel, FLEXRAN_AGENT_MAX);
/*Example of registration for a specific agent(MAC):
*enb_agent_register_channel(mod_id, channel, ENB_AGENT_MAC);
*flexran_agent_register_channel(mod_id, channel, FLEXRAN_AGENT_MAC);
*/
/*Initialize the continuous MAC stats update mechanism*/
enb_agent_init_cont_mac_stats_update(mod_id);
flexran_agent_init_cont_mac_stats_update(mod_id);
new_thread(receive_thread, &enb_agent[mod_id]);
new_thread(receive_thread, &flexran_agent[mod_id]);
/*Initialize and register the mac xface. Must be modified later
*for more flexibility in agent management */
AGENT_MAC_xface *mac_agent_xface = (AGENT_MAC_xface *) malloc(sizeof(AGENT_MAC_xface));
enb_agent_register_mac_xface(mod_id, mac_agent_xface);
flexran_agent_register_mac_xface(mod_id, mac_agent_xface);
/*
* initilize a timer
*/
enb_agent_init_timer();
flexran_agent_init_timer();
/*
* Initialize the mac agent
*/
enb_agent_init_mac_agent(mod_id);
flexran_agent_init_mac_agent(mod_id);
/*
* start the enb agent task for tx and interaction with the underlying network function
*/
if (!agent_task_created) {
if (itti_create_task (TASK_ENB_AGENT, enb_agent_task, (void *) &enb_agent[mod_id]) < 0) {
LOG_E(ENB_AGENT, "Create task for eNB Agent failed\n");
if (itti_create_task (TASK_FLEXRAN_AGENT, flexran_agent_task, (void *) &flexran_agent[mod_id]) < 0) {
LOG_E(FLEXRAN_AGENT, "Create task for FlexRAN Agent failed\n");
return -1;
}
agent_task_created = 1;
}
LOG_I(ENB_AGENT,"client ends\n");
LOG_I(FLEXRAN_AGENT,"client ends\n");
return 0;
error:
LOG_I(ENB_AGENT,"there was an error\n");
LOG_I(FLEXRAN_AGENT,"there was an error\n");
return 1;
}
Protocol__FlexranMessage *enb_agent_timeout(void* args){
Protocol__FlexranMessage *flexran_agent_timeout(void* args){
// enb_agent_timer_args_t *timer_args = calloc(1, sizeof(*timer_args));
// flexran_agent_timer_args_t *timer_args = calloc(1, sizeof(*timer_args));
//memcpy (timer_args, args, sizeof(*timer_args));
enb_agent_timer_args_t *timer_args = (enb_agent_timer_args_t *) args;
flexran_agent_timer_args_t *timer_args = (flexran_agent_timer_args_t *) args;
LOG_I(ENB_AGENT, "enb_agent %d timeout\n", timer_args->mod_id);
//LOG_I(ENB_AGENT, "eNB action %d ENB flags %d \n", timer_args->cc_actions,timer_args->cc_report_flags);
//LOG_I(ENB_AGENT, "UE action %d UE flags %d \n", timer_args->ue_actions,timer_args->ue_report_flags);
LOG_I(FLEXRAN_AGENT, "flexran_agent %d timeout\n", timer_args->mod_id);
//LOG_I(FLEXRAN_AGENT, "eNB action %d ENB flags %d \n", timer_args->cc_actions,timer_args->cc_report_flags);
//LOG_I(FLEXRAN_AGENT, "UE action %d UE flags %d \n", timer_args->ue_actions,timer_args->ue_report_flags);
return NULL;
}
......@@ -28,28 +28,28 @@
*******************************************************************************/
/*! \file enb_agent.h
* \brief top level enb agent
/*! \file flexran_agent.h
* \brief top level flexran agent
* \author Navid Nikaein and Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef ENB_AGENT_H_
#define ENB_AGENT_H_
#ifndef FLEXRAN_AGENT_H_
#define FLEXRAN_AGENT_H_
#include "enb_config.h" // for enb properties
#include "enb_agent_common.h"
#include "flexran_agent_common.h"
/* Initiation and termination of the eNodeB agent */
int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties);
int enb_agent_stop(mid_t mod_id);
int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties);
int flexran_agent_stop(mid_t mod_id);
/*
* enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller
* and can interact with other itti tasks
*/
void *enb_agent_task(void *args);
void *flexran_agent_task(void *args);
#endif
......@@ -27,22 +27,22 @@
*******************************************************************************/
/*! \file enb_agent_async.c
/*! \file flexran_agent_async.c
* \brief channel implementation for async interface
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#include "enb_agent_async.h"
#include "enb_agent_defs.h"
#include "flexran_agent_async.h"
#include "flexran_agent_defs.h"
#include "log.h"
enb_agent_async_channel_t * enb_agent_async_channel_info(mid_t mod_id, char *dst_ip, uint16_t dst_port) {
flexran_agent_async_channel_t * flexran_agent_async_channel_info(mid_t mod_id, char *dst_ip, uint16_t dst_port) {
enb_agent_async_channel_t *channel;
channel = (enb_agent_async_channel_t *) malloc(sizeof(enb_agent_channel_t));
flexran_agent_async_channel_t *channel;
channel = (flexran_agent_async_channel_t *) malloc(sizeof(flexran_agent_channel_t));
if (channel == NULL)
goto error;
......@@ -52,7 +52,7 @@ enb_agent_async_channel_t * enb_agent_async_channel_info(mid_t mod_id, char *dst
channel->link = new_link_client(dst_ip, dst_port);
if (channel->link == NULL) goto error;
LOG_I(ENB_AGENT,"starting enb agent client for module id %d on ipv4 %s, port %d\n",
LOG_I(FLEXRAN_AGENT,"starting enb agent client for module id %d on ipv4 %s, port %d\n",
channel->enb_id,
dst_ip,
dst_port);
......@@ -75,27 +75,27 @@ enb_agent_async_channel_t * enb_agent_async_channel_info(mid_t mod_id, char *dst
return channel;
error:
LOG_I(ENB_AGENT,"there was an error\n");
LOG_I(FLEXRAN_AGENT,"there was an error\n");
return 1;
}
int enb_agent_async_msg_send(void *data, int size, int priority, void *channel_info) {
enb_agent_async_channel_t *channel;
channel = (enb_agent_channel_t *)channel_info;
int flexran_agent_async_msg_send(void *data, int size, int priority, void *channel_info) {
flexran_agent_async_channel_t *channel;
channel = (flexran_agent_channel_t *)channel_info;
return message_put(channel->send_queue, data, size, priority);
}
int enb_agent_async_msg_recv(void **data, int *size, int *priority, void *channel_info) {
enb_agent_async_channel_t *channel;
channel = (enb_agent_async_channel_t *)channel_info;
int flexran_agent_async_msg_recv(void **data, int *size, int *priority, void *channel_info) {
flexran_agent_async_channel_t *channel;
channel = (flexran_agent_async_channel_t *)channel_info;
return message_get(channel->receive_queue, data, size, priority);
}
void enb_agent_async_release(enb_agent_channel_t *channel) {
enb_agent_async_channel_t *channel_info;
channel_info = (enb_agent_async_channel_t *) channel->channel_info;
void flexran_agent_async_release(flexran_agent_channel_t *channel) {
flexran_agent_async_channel_t *channel_info;
channel_info = (flexran_agent_async_channel_t *) channel->channel_info;
destroy_link_manager(channel_info->manager);
......
......@@ -27,17 +27,17 @@
*******************************************************************************/
/*! \file enb_agent_async.h
/*! \file flexran_agent_async.h