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,
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,
ENB_AGENT_MAX=9,
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,7 +89,7 @@ static const char *enb_agent_direction2String[] = {
};
Protocol__FlexranMessage* enb_agent_handle_message (mid_t mod_id,
Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id,
uint8_t *data,