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;
......
......@@ -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
* \brief channel implementation for async interface
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef ENB_AGENT_ASYNC_H_
#define ENB_AGENT_ASYNC_H_
#ifndef FLEXRAN_AGENT_ASYNC_H_
#define FLEXRAN_AGENT_ASYNC_H_
#include "enb_agent_net_comm.h"
#include "flexran_agent_net_comm.h"
typedef struct {
mid_t enb_id;
......@@ -45,19 +45,19 @@ typedef struct {
message_queue_t *send_queue;
message_queue_t *receive_queue;
link_manager_t *manager;
} enb_agent_async_channel_t;
} flexran_agent_async_channel_t;
/* Create a new channel for a given destination ip and destination port */
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);
/* Send a message to the given channel */
int enb_agent_async_msg_send(void *data, int size, int priority, void *channel_info);
int flexran_agent_async_msg_send(void *data, int size, int priority, void *channel_info);
/* Receive a message from a given channel */
int enb_agent_async_msg_recv(void **data, int *size, int *priority, void *channel_info);
int flexran_agent_async_msg_recv(void **data, int *size, int *priority, void *channel_info);
/* Release a channel */
void enb_agent_async_release(enb_agent_channel_t *channel);
void flexran_agent_async_release(flexran_agent_channel_t *channel);
#endif /*ENB_AGENT_ASYNC_H_*/
#endif /*FLEXRAN_AGENT_ASYNC_H_*/
......@@ -27,7 +27,7 @@
*******************************************************************************/
/*! \file enb_agent_common_internal.c
/*! \file flexran_agent_common_internal.c
* \brief internal functions for common message primitves and utilities
* \author Xenofon Foukas
* \date 2016
......@@ -37,8 +37,8 @@
#include <stdlib.h>
#include <string.h>
#include "enb_agent_common_internal.h"
#include "enb_agent_mac_internal.h"
#include "flexran_agent_common_internal.h"
#include "flexran_agent_mac_internal.h"
int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length) {
......
......@@ -27,19 +27,19 @@
*******************************************************************************/
/*! \file enb_agent_common_internal.h
/*! \file flexran_agent_common_internal.h
* \brief internal agent functions for common message primitves and utilities
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef ENB_AGENT_COMMON_INTERNAL_H_
#define ENB_AGENT_COMMON_INTERNAL_H_
#ifndef FLEXRAN_AGENT_COMMON_INTERNAL_H_
#define FLEXRAN_AGENT_COMMON_INTERNAL_H_
#include <yaml.h>
#include "enb_agent_defs.h"
#include "flexran_agent_defs.h"
int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length);
......
......@@ -27,14 +27,14 @@
*******************************************************************************/
/*! \file enb_agent_defs.h
* \brief enb agent common definitions
/*! \file flexran_agent_defs.h
* \brief FlexRAN agent common definitions
* \author Navid Nikaein and Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef ENB_AGENT_DEFS_H_
#define ENB_AGENT_DEFS_H_
#ifndef FLEXRAN_AGENT_DEFS_H_
#define FLEXRAN_AGENT_DEFS_H_
#include <stdio.h>
#include <stdlib.h>
......@@ -45,54 +45,54 @@
#define NUM_MAX_ENB 2
#define NUM_MAX_UE 2048
#define DEFAULT_ENB_AGENT_IPv4_ADDRESS "127.0.0.1"
#define DEFAULT_ENB_AGENT_PORT 2210
#define DEFAULT_ENB_AGENT_CACHE "/mnt/oai_agent_cache"
#define DEFAULT_FLEXRAN_AGENT_IPv4_ADDRESS "127.0.0.1"
#define DEFAULT_FLEXRAN_AGENT_PORT 2210
#define DEFAULT_FLEXRAN_AGENT_CACHE "/mnt/oai_agent_cache"
typedef enum {
ENB_AGENT_DEFAULT=0,
FLEXRAN_AGENT_DEFAULT=0,
ENB_AGENT_PHY=1,
ENB_AGENT_MAC=2,
ENB_AGENT_RLC=3,
ENB_AGENT_PDCP=4,
ENB_AGENT_RRC=5,
ENB_AGENT_S1AP=6,
ENB_AGENT_GTP=7,
ENB_AGENT_X2AP=8,
ENB_AGENT_MAX=9,
FLEXRAN_AGENT_PHY=1,
FLEXRAN_AGENT_MAC=2,
FLEXRAN_AGENT_RLC=3,
FLEXRAN_AGENT_PDCP=4,
FLEXRAN_AGENT_RRC=5,
FLEXRAN_AGENT_S1AP=6,
FLEXRAN_AGENT_GTP=7,
FLEXRAN_AGENT_X2AP=8,
FLEXRAN_AGENT_MAX=9,
} agent_id_t;
typedef enum {
/* no action */
ENB_AGENT_ACTION_NONE = 0x0,
FLEXRAN_AGENT_ACTION_NONE = 0x0,
/* send action */
ENB_AGENT_ACTION_SEND = 0x1,
FLEXRAN_AGENT_ACTION_SEND = 0x1,
/* apply action */
ENB_AGENT_ACTION_APPLY = 0x2,
FLEXRAN_AGENT_ACTION_APPLY = 0x2,
/* clear action */
ENB_AGENT_ACTION_CLEAR = 0x4,
FLEXRAN_AGENT_ACTION_CLEAR = 0x4,
/* write action */
ENB_AGENT_ACTION_WRITE = 0x8,
FLEXRAN_AGENT_ACTION_WRITE = 0x8,
/* filter action */
ENB_AGENT_ACTION_FILTER = 0x10,
FLEXRAN_AGENT_ACTION_FILTER = 0x10,
/* preprocess action */
ENB_AGENT_ACTION_PREPROCESS = 0x20,
FLEXRAN_AGENT_ACTION_PREPROCESS = 0x20,
/* meter action */
ENB_AGENT_ACTION_METER = 0x40,
FLEXRAN_AGENT_ACTION_METER = 0x40,
/* Max number of states available */
ENB_AGENT_ACTION_MAX = 0x7f,
FLEXRAN_AGENT_ACTION_MAX = 0x7f,
} agent_action_t;
......@@ -122,12 +122,12 @@ typedef struct {
uint32_t rx_msg[NUM_MAX_ENB];
uint32_t tx_msg[NUM_MAX_ENB];
}enb_agent_info_t;
} flexran_agent_info_t;
typedef struct {
mid_t enb_id;
enb_agent_info_t agent_info;
flexran_agent_info_t agent_info;
}enb_agent_instance_t;
} flexran_agent_instance_t;
#endif
......@@ -28,21 +28,21 @@
*******************************************************************************/
/*! \file ENB_APP/extern.h
* \brief enb agent - mac interface primitives
* \brief FlexRAN agent - mac interface primitives
* \author Xenofon Foukas
* \date 2016
* \version 0.1
* \mail x.foukas@sms.ed.ac.uk
*/
#ifndef __ENB_AGENT_EXTERN_H__
#define __ENB_AGENT_EXTERN_H__
#ifndef __FLEXRAN_AGENT_EXTERN_H__
#define __FLEXRAN_AGENT_EXTERN_H__
#include "enb_agent_defs.h"
#include "enb_agent_mac_defs.h"
#include "flexran_agent_defs.h"
#include "flexran_agent_mac_defs.h"
//extern msg_context_t shared_ctxt[NUM_MAX_ENB][ENB_AGENT_MAX];
//extern msg_context_t shared_ctxt[NUM_MAX_ENB][FLEXRAN_AGENT_MAX];
/* full path of the local cache for storing VSFs */
extern char local_cache[40];
......
......@@ -27,61 +27,61 @@
*******************************************************************************/
/*! \file enb_agent_handler.c
* \brief enb agent tx and rx message handler
/*! \file flexran_agent_handler.c
* \brief FlexRAN agent tx and rx message handler
* \author Xenofon Foukas and Navid Nikaein
* \date 2016
* \version 0.1
*/
#include "enb_agent_common.h"
#include "enb_agent_mac.h"
#include "flexran_agent_common.h"
#include "flexran_agent_mac.h"
#include "log.h"
#include "assertions.h"
enb_agent_message_decoded_callback agent_messages_callback[][3] = {
{enb_agent_hello, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_HELLO_MSG*/
{enb_agent_echo_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REQUEST_MSG*/
flexran_agent_message_decoded_callback agent_messages_callback[][3] = {
{flexran_agent_hello, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_HELLO_MSG*/
{flexran_agent_echo_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ECHO_REPLY_MSG*/ //Must add handler when receiving echo reply
{enb_agent_mac_handle_stats, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG*/
{flexran_agent_mac_handle_stats, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG*/
{0, 0, 0}, /*PROTOCOK__FLEXRAN_MESSAGE__MSG_SF_TRIGGER_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_SR_INFO_MSG*/
{enb_agent_enb_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG*/
{flexran_agent_enb_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG*/
{enb_agent_ue_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REQUEST_MSG*/
{flexran_agent_ue_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG*/
{enb_agent_lc_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REQUEST_MSG*/
{flexran_agent_lc_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REQUEST_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG*/
{enb_agent_mac_handle_dl_mac_config, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG*/
{flexran_agent_mac_handle_dl_mac_config, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG*/
{enb_agent_control_delegation, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_CONTROL_DELEGATION_MSG*/
{enb_agent_reconfiguration, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_AGENT_RECONFIGURATION_MSG*/
{flexran_agent_control_delegation, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_CONTROL_DELEGATION_MSG*/
{flexran_agent_reconfiguration, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_AGENT_RECONFIGURATION_MSG*/
};
enb_agent_message_destruction_callback message_destruction_callback[] = {
enb_agent_destroy_hello,
enb_agent_destroy_echo_request,
enb_agent_destroy_echo_reply,
enb_agent_mac_destroy_stats_request,
enb_agent_mac_destroy_stats_reply,
enb_agent_mac_destroy_sf_trigger,
enb_agent_mac_destroy_sr_info,
enb_agent_destroy_enb_config_request,
enb_agent_destroy_enb_config_reply,
enb_agent_destroy_ue_config_request,
enb_agent_destroy_ue_config_reply,
enb_agent_destroy_lc_config_request,
enb_agent_destroy_lc_config_reply,
enb_agent_mac_destroy_dl_config,
enb_agent_destroy_ue_state_change,
enb_agent_destroy_control_delegation,
enb_agent_destroy_agent_reconfiguration,
flexran_agent_message_destruction_callback message_destruction_callback[] = {
flexran_agent_destroy_hello,
flexran_agent_destroy_echo_request,
flexran_agent_destroy_echo_reply,
flexran_agent_mac_destroy_stats_request,
flexran_agent_mac_destroy_stats_reply,
flexran_agent_mac_destroy_sf_trigger,
flexran_agent_mac_destroy_sr_info,
flexran_agent_destroy_enb_config_request,
flexran_agent_destroy_enb_config_reply,
flexran_agent_destroy_ue_config_request,
flexran_agent_destroy_ue_config_reply,
flexran_agent_destroy_lc_config_request,
flexran_agent_destroy_lc_config_reply,
flexran_agent_mac_destroy_dl_config,
flexran_agent_destroy_ue_state_change,
flexran_agent_destroy_control_delegation,
flexran_agent_destroy_agent_reconfiguration,
};
static const char *enb_agent_direction2String[] = {
static const char *flexran_agent_direction2String[] = {
"", /* not_set */
"originating message", /* originating message */
"successfull outcome", /* successfull outcome */
......@@ -89,23 +89,23 @@ static const char *enb_agent_direction2String[] = {
};
Protocol__FlexranMessage* enb_agent_handle_message (mid_t mod_id,
uint8_t *data,
uint32_t size){
Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id,
uint8_t *data,
uint32_t size){
Protocol__FlexranMessage *decoded_message, *reply_message;
err_code_t err_code;
DevAssert(data != NULL);
if (enb_agent_deserialize_message(data, size, &decoded_message) < 0) {
if (flexran_agent_deserialize_message(data, size, &decoded_message) < 0) {
err_code= PROTOCOL__FLEXRAN_ERR__MSG_DECODING;
goto error;
}
if ((decoded_message->msg_case > sizeof(agent_messages_callback) / (3*sizeof(enb_agent_message_decoded_callback))) ||
if ((decoded_message->msg_case > sizeof(agent_messages_callback) / (3 * sizeof(flexran_agent_message_decoded_callback))) ||
(decoded_message->msg_dir > PROTOCOL__FLEXRAN_DIRECTION__UNSUCCESSFUL_OUTCOME)){
err_code= PROTOCOL__FLEXRAN_ERR__MSG_NOT_HANDLED;
goto error;
goto error;
}
if (agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1] == NULL) {
......@@ -123,20 +123,20 @@ Protocol__FlexranMessage* enb_agent_handle_message (mid_t mod_id,
return reply_message;
error:
LOG_E(ENB_AGENT,"errno %d occured\n",err_code);
LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code);
return NULL;
}
void * enb_agent_pack_message(Protocol__FlexranMessage *msg,
uint32_t * size){
void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
uint32_t * size){
void * buffer;
err_code_t err_code = PROTOCOL__FLEXRAN_ERR__NO_ERR;
if (enb_agent_serialize_message(msg, &buffer, size) < 0 ) {
if (flexran_agent_serialize_message(msg, &buffer, size) < 0 ) {
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENCODING;
goto error;
}
......@@ -147,23 +147,23 @@ void * enb_agent_pack_message(Protocol__FlexranMessage *msg,
DevAssert(buffer !=NULL);
LOG_D(ENB_AGENT,"Serilized the enb mac stats reply (size %d)\n", *size);
LOG_D(FLEXRAN_AGENT,"Serilized the enb mac stats reply (size %d)\n", *size);
return buffer;
error :
LOG_E(ENB_AGENT,"errno %d occured\n",err_code);
LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code);
return NULL;
}
Protocol__FlexranMessage *enb_agent_handle_timed_task(void *args) {
Protocol__FlexranMessage *flexran_agent_handle_timed_task(void *args) {
err_code_t err_code;
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;
Protocol__FlexranMessage *timed_task, *reply_message;
timed_task = timer_args->msg;
err_code = ((*agent_messages_callback[timed_task->msg_case-1][timed_task->msg_dir-1])(timer_args->mod_id, (void *) timed_task, &reply_message));
err_code = ((*agent_messages_callback[timed_task->msg_case-1][timed_task->msg_dir-1])(timer_args->mod_id, (void *) timed_task, &reply_message));
if ( err_code < 0 ){
goto error;
}
......@@ -171,27 +171,27 @@ Protocol__FlexranMessage *enb_agent_handle_timed_task(void *args) {
return reply_message;
error:
LOG_E(ENB_AGENT,"errno %d occured\n",err_code);
LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code);
return NULL;
}
Protocol__FlexranMessage* enb_agent_process_timeout(long timer_id, void* timer_args){
Protocol__FlexranMessage* flexran_agent_process_timeout(long timer_id, void* timer_args){
struct enb_agent_timer_element_s *found = get_timer_entry(timer_id);
struct flexran_agent_timer_element_s *found = get_timer_entry(timer_id);
if (found == NULL ) goto error;
LOG_I(ENB_AGENT, "Found the entry (%p): timer_id is 0x%lx 0x%lx\n", found, timer_id, found->timer_id);
LOG_I(FLEXRAN_AGENT, "Found the entry (%p): timer_id is 0x%lx 0x%lx\n", found, timer_id, found->timer_id);
if (timer_args == NULL)
LOG_W(ENB_AGENT,"null timer args\n");
LOG_W(FLEXRAN_AGENT,"null timer args\n");
return found->cb(timer_args);
error:
LOG_E(ENB_AGENT, "can't get the timer element\n");
LOG_E(FLEXRAN_AGENT, "can't get the timer element\n");
return TIMER_ELEMENT_NOT_FOUND;
}
err_code_t enb_agent_destroy_flexran_message(Protocol__FlexranMessage *msg) {
err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg) {
return ((*message_destruction_callback[msg->msg_case-1])(msg));
}
......@@ -27,23 +27,23 @@
*******************************************************************************/
/*! \file enb_agent_mac.h
* \brief enb agent message handler APIs for MAC layer
/*! \file flexran_agent_mac.h
* \brief FlexRAN agent message handler APIs for MAC layer
* \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein
* \date 2016
* \version 0.1
*/
#ifndef ENB_AGENT_MAC_H_
#define ENB_AGENT_MAC_H_
#ifndef FLEXRAN_AGENT_MAC_H_
#define FLEXRAN_AGENT_MAC_H_
#include "header.pb-c.h"
#include "flexran.pb-c.h"
#include "stats_messages.pb-c.h"
#include "stats_common.pb-c.h"
#include "enb_agent_common.h"
#include "enb_agent_extern.h"
#include "flexran_agent_common.h"
#include "flexran_agent_extern.h"
/* These types will be used to give
instructions for the type of stats reports
......@@ -77,54 +77,54 @@ typedef struct stats_request_config_s{
} stats_request_config_t;
/* Initialization function for the agent structures etc */
void enb_agent_init_mac_agent(mid_t mod_id);
void flexran_agent_init_mac_agent(mid_t mod_id);
int enb_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
/* Statistics request protocol message constructor and destructor */
int enb_agent_mac_stats_request(mid_t mod_id, xid_t xid, const stats_request_config_t *report_config, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_stats_request(Protocol__FlexranMessage *msg);
int flexran_agent_mac_stats_request(mid_t mod_id, xid_t xid, const stats_request_config_t *report_config, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_stats_request(Protocol__FlexranMessage *msg);
/* Statistics reply protocol message constructor and destructor */
int enb_agent_mac_stats_reply(mid_t mod_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
int flexran_agent_mac_stats_reply(mid_t mod_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
/* Scheduling request information protocol message constructor and estructor */
int enb_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg);
int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg);
/* Subframe trigger protocol msssage constructor and destructor */
int enb_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg);
int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg);
/* DL MAC scheduling decision protocol message constructor (empty command) and destructor */
int enb_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg);
int enb_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg);
int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg);
int enb_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
/**********************************
* eNB agent - technology mac API
* FlexRAN agent - technology mac API
**********************************/
/*Inform controller about received scheduling requests during a subframe*/
void enb_agent_send_sr_info(mid_t mod_id);
void flexran_agent_send_sr_info(mid_t mod_id);
/*Inform the controller about the current UL/DL subframe*/
void enb_agent_send_sf_trigger(mid_t mod_id);
void flexran_agent_send_sf_trigger(mid_t mod_id);
/// Send to the controller all the mac stat updates that occured during this subframe
/// based on the stats request configuration
void enb_agent_send_update_mac_stats(mid_t mod_id);
void flexran_agent_send_update_mac_stats(mid_t mod_id);
/// Provide to the scheduler a pending dl_mac_config message
void enb_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg);
void flexran_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg);
/*Register technology specific interface callbacks*/
int enb_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface);
int flexran_agent_register_mac_xface(mid_t mod_id, AGENT_MAC_xface *xface);
/*Unregister technology specific callbacks*/
int enb_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface*xface);
int flexran_agent_unregister_mac_xface(mid_t mod_id, AGENT_MAC_xface*xface);
#endif
......@@ -27,52 +27,52 @@
*******************************************************************************/
/*! \file enb_agent_mac_defs.h
* \brief enb agent - mac interface primitives
/*! \file flexran_agent_mac_defs.h
* \brief FlexRAN agent - mac interface primitives
* \author Xenofon Foukas
* \date 2016
* \version 0.1
* \mail x.foukas@sms.ed.ac.uk
*/
#ifndef __ENB_AGENT_MAC_PRIMITIVES_H__
#define __ENB_AGENT_MAC_PRIMITIVES_H__
#ifndef __FLEXRAN_AGENT_MAC_PRIMITIVES_H__
#define __FLEXRAN_AGENT_MAC_PRIMITIVES_H__
#include "enb_agent_defs.h"
#include "flexran_agent_defs.h"
#include "flexran.pb-c.h"
#include "header.pb-c.h"
#define RINGBUFFER_SIZE 100
/* ENB AGENT-MAC Interface */
/* FLEXRAN AGENT-MAC Interface */
typedef struct {
//msg_context_t *agent_ctxt;
/// Inform the controller about the scheduling requests received during the subframe
void (*enb_agent_send_sr_info)(mid_t mod_id);
void (*flexran_agent_send_sr_info)(mid_t mod_id);
/// Inform the controller about the current UL/DL subframe
void (*enb_agent_send_sf_trigger)(mid_t mod_id);
void (*flexran_agent_send_sf_trigger)(mid_t mod_id);
/// Send to the controller all the mac stat updates that occured during this subframe
/// based on the stats request configuration
void (*enb_agent_send_update_mac_stats)(mid_t mod_id);
void (*flexran_agent_send_update_mac_stats)(mid_t mod_id);
/// Provide to the scheduler a pending dl_mac_config message
void (*enb_agent_get_pending_dl_mac_config)(mid_t mod_id,
Protocol__FlexranMessage **msg);
void (*flexran_agent_get_pending_dl_mac_config)(mid_t mod_id,
Protocol__FlexranMessage **msg);
/// Run the UE DL scheduler and fill the Protocol__FlexranMessage. Assumes that
/// dl_info is already initialized as flex_dl_mac_config and fills the
/// flex_dl_data part of it
void (*enb_agent_schedule_ue_spec)(mid_t mod_id, uint32_t frame, uint32_t subframe,
int *mbsfn_flag, Protocol__FlexranMessage **dl_info);
void (*flexran_agent_schedule_ue_spec)(mid_t mod_id, uint32_t frame, uint32_t subframe,
int *mbsfn_flag, Protocol__FlexranMessage **dl_info);
/// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
void (*enb_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint32_t state_change);
void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint32_t state_change);
void *dl_scheduler_loaded_lib;
......
......@@ -27,7 +27,7 @@
*******************************************************************************/
/*! \file enb_agent_mac_internal.c
/*! \file flexran_agent_mac_internal.c
* \brief Helper functions for the MAC agent
* \author Xenofon Foukas
* \date 2016
......@@ -37,10 +37,10 @@
#include <string.h>
#include <dlfcn.h>
#include "enb_agent_mac_internal.h"
#include "flexran_agent_mac_internal.h"
Protocol__FlexranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_message,
Protocol__FlexranMessage *old_message) {
Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_message,
Protocol__FlexranMessage *old_message) {
int i, j;
......@@ -131,7 +131,7 @@ Protocol__FlexranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__Fl
/*Create header*/
int xid = old_report->header->xid;
Protocol__FlexHeader *header;
if (flex_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) {
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) {
goto error;
}
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
......@@ -780,7 +780,7 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name) {
void *loaded_scheduler = dlsym(lib, function_name);
if (loaded_scheduler) {
if (mac_agent_registered[mod_id]) {
agent_mac_xface[mod_id]->enb_agent_schedule_ue_spec = loaded_scheduler;
agent_mac_xface[mod_id]->flexran_agent_schedule_ue_spec = loaded_scheduler;
if (agent_mac_xface[mod_id]->dl_scheduler_loaded_lib != NULL) {
dlclose(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib);
}
......
......@@ -27,23 +27,23 @@
*******************************************************************************/
/*! \file enb_agent_mac_internal.h
* \brief Implementation specific definitions for the eNB MAC agent
/*! \file flexran_agent_mac_internal.h
* \brief Implementation specific definitions for the FlexRAN MAC agent
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef ENB_AGENT_MAC_INTERNAL_H_
#define ENB_AGENT_MAC_INTERNAL_H_
#ifndef FLEXRAN_AGENT_MAC_INTERNAL_H_
#define FLEXRAN_AGENT_MAC_INTERNAL_H_
#include <pthread.h>
#include <yaml.h>
#include "enb_agent_mac.h"
#include "enb_agent_common.h"
#include "enb_agent_defs.h"
#include "flexran_agent_mac.h"
#include "flexran_agent_common.h"
#include "flexran_agent_defs.h"
/*This will be used for producing continuous status updates for the MAC
*Needs to be thread-safe
......@@ -64,18 +64,18 @@ mac_stats_updates_context_t mac_stats_context[NUM_MAX_ENB];
/*Functions to initialize and destroy the struct required for the
*continuous stats update report*/
err_code_t enb_agent_init_cont_mac_stats_update(mid_t mod_id);
err_code_t flexran_agent_init_cont_mac_stats_update(mid_t mod_id);
err_code_t enb_agent_destroy_cont_mac_stats_update(mid_t mod_id);
err_code_t flexran_agent_destroy_cont_mac_stats_update(mid_t mod_id);
/*Enable/Disable the continuous stats update service for the MAC*/
err_code_t enb_agent_enable_cont_mac_stats_update(mid_t mod_id, xid_t xid,
err_code_t flexran_agent_enable_cont_mac_stats_update(mid_t mod_id, xid_t xid,
stats_request_config_t *stats_req);
err_code_t enb_agent_disable_cont_mac_stats_update(mid_t mod_id);
err_code_t flexran_agent_disable_cont_mac_stats_update(mid_t mod_id);
Protocol__FlexranMessage * enb_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_report,
Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_report,
Protocol__FlexranMessage *old_report);
Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport * original);
......@@ -111,4 +111,4 @@ int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser);
int load_dl_scheduler_function(mid_t mod_id, const char *function_name);
#endif /*ENB_AGENT_MAC_INTERNAL_H_*/
#endif /*FLEXRAN_AGENT_MAC_INTERNAL_H_*/
......@@ -27,26 +27,26 @@
*******************************************************************************/
/*! \file enb_agent_net_comm.c
* \brief enb agent network interface abstraction
/*! \file flexran_agent_net_comm.c
* \brief FlexRAN agent network interface abstraction
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#include "enb_agent_net_comm.h"
#include "flexran_agent_net_comm.h"
#include "log.h"
enb_agent_channel_t *agent_channel[NUM_MAX_ENB][ENB_AGENT_MAX];
enb_agent_channel_instance_t channel_instance;
int enb_agent_channel_id = 0;
flexran_agent_channel_t *agent_channel[NUM_MAX_ENB][FLEXRAN_AGENT_MAX];
flexran_agent_channel_instance_t channel_instance;
int flexran_agent_channel_id = 0;
int enb_agent_msg_send(mid_t mod_id, agent_id_t agent_id, void *data, int size, int priority) {
int flexran_agent_msg_send(mid_t mod_id, agent_id_t agent_id, void *data, int size, int priority) {
/*Check if agent id is valid*/
if (agent_id >= ENB_AGENT_MAX || agent_id < 0) {
if (agent_id >= FLEXRAN_AGENT_MAX || agent_id < 0) {
goto error;
}
enb_agent_channel_t *channel;
flexran_agent_channel_t *channel;
channel = agent_channel[mod_id][agent_id];
/*Check if agent has a channel registered*/
......@@ -57,16 +57,16 @@ int enb_agent_msg_send(mid_t mod_id, agent_id_t agent_id, void *data, int size,
return channel->msg_send(data, size, priority, channel->channel_info);
error:
LOG_E(ENB_AGENT, "No channel registered for agent with id %d\n", agent_id);
LOG_E(FLEXRAN_AGENT, "No channel registered for agent with id %d\n", agent_id);
return -1;
}
int enb_agent_msg_recv(mid_t mod_id, agent_id_t agent_id, void **data, int *size, int *priority) {
int flexran_agent_msg_recv(mid_t mod_id, agent_id_t agent_id, void **data, int *size, int *priority) {
/*Check if agent id is valid*/
if (agent_id >= ENB_AGENT_MAX || agent_id < 0) {
if (agent_id >= FLEXRAN_AGENT_MAX || agent_id < 0) {
goto error;
}
enb_agent_channel_t *channel;
flexran_agent_channel_t *channel;
channel = agent_channel[mod_id][agent_id];
/*Check if agent has a channel registered*/
......@@ -77,19 +77,19 @@ int enb_agent_msg_recv(mid_t mod_id, agent_id_t agent_id, void **data, int *size
return channel->msg_recv(data, size, priority, channel->channel_info);
error:
LOG_E(ENB_AGENT, "No channel registered for agent with id %d\n", agent_id);
LOG_E(FLEXRAN_AGENT, "No channel registered for agent with id %d\n", agent_id);
return -1;
}
int enb_agent_register_channel(mid_t mod_id, enb_agent_channel_t *channel, agent_id_t agent_id) {
int flexran_agent_register_channel(mid_t mod_id, flexran_agent_channel_t *channel, agent_id_t agent_id) {
int i;
if (channel == NULL) {
return -1;
}
if (agent_id == ENB_AGENT_MAX) {
for (i = 0; i < ENB_AGENT_MAX; i++) {
if (agent_id == FLEXRAN_AGENT_MAX) {
for (i = 0; i < FLEXRAN_AGENT_MAX; i++) {
agent_channel[mod_id][i] = channel;
}
} else {
......@@ -98,11 +98,11 @@ int enb_agent_register_channel(mid_t mod_id, enb_agent_channel_t *channel, agent
return 0;
}
void enb_agent_unregister_channel(mid_t mod_id, agent_id_t agent_id) {
void flexran_agent_unregister_channel(mid_t mod_id, agent_id_t agent_id) {
int i;
if (agent_id == ENB_AGENT_MAX) {
for (i = 0; i < ENB_AGENT_MAX; i++) {
if (agent_id == FLEXRAN_AGENT_MAX) {
for (i = 0; i < FLEXRAN_AGENT_MAX; i++) {
agent_channel[mod_id][i] = NULL;
}
} else {
......@@ -110,13 +110,13 @@ void enb_agent_unregister_channel(mid_t mod_id, agent_id_t agent_id) {
}
}
int enb_agent_create_channel(void *channel_info,
int (*msg_send)(void *data, int size, int priority, void *channel_info),
int (*msg_recv)(void **data, int *size, int *priority, void *channel_info),
void (*release)(enb_agent_channel_t *channel)) {
int flexran_agent_create_channel(void *channel_info,
int (*msg_send)(void *data, int size, int priority, void *channel_info),
int (*msg_recv)(void **data, int *size, int *priority, void *channel_info),
void (*release)(flexran_agent_channel_t *channel)) {
int channel_id = ++enb_agent_channel_id;
enb_agent_channel_t *channel = (enb_agent_channel_t *) malloc(sizeof(enb_agent_channel_t));
int channel_id = ++flexran_agent_channel_id;
flexran_agent_channel_t *channel = (flexran_agent_channel_t *) malloc(sizeof(flexran_agent_channel_t));
channel->channel_id = channel_id;
channel->channel_info = channel_info;
channel->msg_send = msg_send;
......@@ -124,22 +124,22 @@ int enb_agent_create_channel(void *channel_info,
channel->release = release;
/*element should be a real pointer*/
RB_INSERT(enb_agent_channel_map, &channel_instance.enb_agent_head, channel);
RB_INSERT(flexran_agent_channel_map, &channel_instance.flexran_agent_head, channel);
LOG_I(ENB_AGENT,"Created a new channel with id 0x%lx\n", channel->channel_id);
LOG_I(FLEXRAN_AGENT,"Created a new channel with id 0x%lx\n", channel->channel_id);
return channel_id;
}
int enb_agent_destroy_channel(int channel_id) {
int flexran_agent_destroy_channel(int channel_id) {
int i, j;
/*Check to see if channel exists*/
struct enb_agent_channel_s *e = NULL;
struct enb_agent_channel_s search;
memset(&search, 0, sizeof(struct enb_agent_channel_s));
struct flexran_agent_channel_s *e = NULL;
struct flexran_agent_channel_s search;
memset(&search, 0, sizeof(struct flexran_agent_channel_s));
e = RB_FIND(enb_agent_channel_map, &channel_instance.enb_agent_head, &search);
e = RB_FIND(flexran_agent_channel_map, &channel_instance.flexran_agent_head, &search);
if (e == NULL) {
return -1;
......@@ -147,7 +147,7 @@ int enb_agent_destroy_channel(int channel_id) {
/*Unregister the channel from all agents*/
for (i = 0; i < NUM_MAX_ENB; i++) {
for (j = 0; j < ENB_AGENT_MAX; j++) {
for (j = 0; j < FLEXRAN_AGENT_MAX; j++) {
if (agent_channel[i][j] != NULL) {
if (agent_channel[i][j]->channel_id == e->channel_id) {
agent_channel[i][j] == NULL;
......@@ -157,21 +157,21 @@ int enb_agent_destroy_channel(int channel_id) {
}
/*Remove the channel from the tree and free memory*/
RB_REMOVE(enb_agent_channel_map, &channel_instance.enb_agent_head, e);
RB_REMOVE(flexran_agent_channel_map, &channel_instance.flexran_agent_head, e);
e->release(e);
free(e);
return 0;
}
err_code_t enb_agent_init_channel_container(void) {
err_code_t flexran_agent_init_channel_container(void) {
int i, j;
LOG_I(ENB_AGENT, "init RB tree for channel container\n");
LOG_I(FLEXRAN_AGENT, "init RB tree for channel container\n");
RB_INIT(&channel_instance.enb_agent_head);
RB_INIT(&channel_instance.flexran_agent_head);
for (i = 0; i < NUM_MAX_ENB; i++) {
for (j = 0; j < ENB_AGENT_MAX; j++) {
for (j = 0; j < FLEXRAN_AGENT_MAX; j++) {
agent_channel[i][j] == NULL;
}
}
......@@ -179,9 +179,9 @@ err_code_t enb_agent_init_channel_container(void) {
return 0;
}
RB_GENERATE(enb_agent_channel_map,enb_agent_channel_s, entry, enb_agent_compare_channel);
RB_GENERATE(flexran_agent_channel_map, flexran_agent_channel_s, entry, flexran_agent_compare_channel);
int enb_agent_compare_channel(struct enb_agent_channel_s *a, struct enb_agent_channel_s *b) {
int flexran_agent_compare_channel(struct flexran_agent_channel_s *a, struct flexran_agent_channel_s *b) {
if (a->channel_id < b->channel_id) return -1;
if (a->channel_id > b->channel_id) return 1;
......@@ -189,12 +189,12 @@ int enb_agent_compare_channel(struct enb_agent_channel_s *a, struct enb_agent_ch
return 0;
}
enb_agent_channel_t * get_channel(int channel_id) {
flexran_agent_channel_t * get_channel(int channel_id) {
struct enb_agent_channel_s search;
memset(&search, 0, sizeof(struct enb_agent_channel_s));
struct flexran_agent_channel_s search;
memset(&search, 0, sizeof(struct flexran_agent_channel_s));
search.channel_id = channel_id;
return RB_FIND(enb_agent_channel_map, &channel_instance.enb_agent_head, &search);
return RB_FIND(flexran_agent_channel_map, &channel_instance.flexran_agent_head, &search);
}
......@@ -27,63 +27,63 @@
*******************************************************************************/
/*! \file enb_agent_net_comm.h
* \brief enb agent network interface abstraction
/*! \file flexran_agent_net_comm.h
* \brief FlexRAN agent network interface abstraction
* \autho Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef ENB_AGENT_NET_COMM_H_
#define ENB_AGENT_NET_COMM_H_
#ifndef FLEXRAN_AGENT_NET_COMM_H_
#define FLEXRAN_AGENT_NET_COMM_H_
#include "enb_agent_defs.h"
#include "flexran_agent_defs.h"
#include "tree.h"
/*Channel related information used for Tx/Rx of protocol messages*/
typedef struct enb_agent_channel_s {
RB_ENTRY(enb_agent_channel_s) entry;
typedef struct flexran_agent_channel_s {
RB_ENTRY(flexran_agent_channel_s) entry;
int channel_id;
void *channel_info;
/*Callbacks for channel message Tx and Rx*/
int (*msg_send)(void *data, int size, int priority, void *channel_info);
int (*msg_recv)(void **data, int *size, int *priority, void *channel_info);
void (*release)(struct enb_agent_channel_s *channel);
} enb_agent_channel_t;
void (*release)(struct flexran_agent_channel_s *channel);
} flexran_agent_channel_t;
typedef struct enb_agent_channel_instance_s{
RB_HEAD(enb_agent_channel_map, enb_agent_channel_s) enb_agent_head;
} enb_agent_channel_instance_t;
typedef struct flexran_agent_channel_instance_s{
RB_HEAD(flexran_agent_channel_map, flexran_agent_channel_s) flexran_agent_head;
} flexran_agent_channel_instance_t;
/*Send and receive messages using the channel registered for a specific agent*/
int enb_agent_msg_send(mid_t mod_id, agent_id_t agent_id, void *data, int size, int priority);
int enb_agent_msg_recv(mid_t mod_id, agent_id_t agent_id, void **data, int *size, int *priority);
int flexran_agent_msg_send(mid_t mod_id, agent_id_t agent_id, void *data, int size, int priority);
int flexran_agent_msg_recv(mid_t mod_id, agent_id_t agent_id, void **data, int *size, int *priority);
/*Register a channel to an agent. Use ENB_AGENT_MAX to register the
/*Register a channel to an agent. Use FLEXRAN_AGENT_MAX to register the
*same channel to all agents*/
int enb_agent_register_channel(mid_t mod_id, enb_agent_channel_t *channel, agent_id_t agent_id);
int flexran_agent_register_channel(mid_t mod_id, flexran_agent_channel_t *channel, agent_id_t agent_id);
/*Unregister the current channel of an agent. Use ENB_AGENT_MAX to unregister all channels*/
void enb_agent_unregister_channel(mid_t mod_id, agent_id_t agent_id);
/*Unregister the current channel of an agent. Use FLEXRAN_AGENT_MAX to unregister all channels*/
void flexran_agent_unregister_channel(mid_t mod_id, agent_id_t agent_id);
/*Create a new channel. Returns the id of the new channel or negative number otherwise*/
int enb_agent_create_channel(void *channel_info,
int (*msg_send)(void *data, int size, int priority, void *channel_info),
int (*msg_recv)(void **data, int *size, int *priority, void *channel_info),
void (*release)(enb_agent_channel_t *channel));
int flexran_agent_create_channel(void *channel_info,
int (*msg_send)(void *data, int size, int priority, void *channel_info),
int (*msg_recv)(void **data, int *size, int *priority, void *channel_info),
void (*release)(flexran_agent_channel_t *channel));
/*Unregister a channel from all agents and destroy it. Returns 0 in case of success*/
int enb_agent_destroy_channel(int channel_id);
int flexran_agent_destroy_channel(int channel_id);
/*Return an agent communication channel based on its id*/
enb_agent_channel_t * get_channel(int channel_id);
flexran_agent_channel_t * get_channel(int channel_id);
/*Should be called before performing any channel operations*/
err_code_t enb_agent_init_channel_container(void);
err_code_t flexran_agent_init_channel_container(void);
int enb_agent_compare_channel(struct enb_agent_channel_s *a, struct enb_agent_channel_s *b);
int flexran_agent_compare_channel(struct flexran_agent_channel_s *a, struct flexran_agent_channel_s *b);
/* RB_PROTOTYPE is for .h files */
RB_PROTOTYPE(enb_agent_channel_map, enb_agent_channel_s, entry, enb_agent_compare_channel);
RB_PROTOTYPE(flexran_agent_channel_map, flexran_agent_channel_s, entry, flexran_agent_compare_channel);
#endif /*ENB_AGENT_COMM_H_*/
#endif /*FLEXRAN_AGENT_COMM_H_*/
This diff is collapsed.
......@@ -27,7 +27,7 @@
*******************************************************************************/
/*! \file eNB_agent_scheduler_dlsch_ue_remote.h
/*! \file flexran_agent_scheduler_dlsch_ue_remote.h
* \brief Local stub for remote scheduler used by the controller
* \author Xenofon Foukas
* \date 2016
......@@ -37,15 +37,15 @@
*/
#ifndef __LAYER2_MAC_ENB_AGENT_SCHEDULER_DLSCH_UE_REMOTE_H__
#define __LAYER2_MAC_ENB_AGENT_SCHEDULER_DLSCH_UE_REMOTE_H___
#ifndef __LAYER2_MAC_FLEXRAN_AGENT_SCHEDULER_DLSCH_UE_REMOTE_H__
#define __LAYER2_MAC_FLEXRAN_AGENT_SCHEDULER_DLSCH_UE_REMOTE_H___
#include "flexran.pb-c.h"
#include "header.pb-c.h"
#include "ENB_APP/enb_agent_defs.h"
#include "enb_agent_mac.h"
#include "LAYER2/MAC/enb_agent_mac_proto.h"
#include "ENB_APP/flexran_agent_defs.h"
#include "flexran_agent_mac.h"
#include "LAYER2/MAC/flexran_agent_mac_proto.h"
#include <sys/queue.h>
......@@ -63,7 +63,7 @@ TAILQ_HEAD(DlMacConfigHead, dl_mac_config_element_s);
/*
* Default scheduler used by the eNB agent
*/
void schedule_ue_spec_remote(mid_t mod_id, uint32_t frame, uint32_t subframe,
void flexran_schedule_ue_spec_remote(mid_t mod_id, uint32_t frame, uint32_t subframe,
int *mbsfn_flag, Protocol__FlexranMessage **dl_info);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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