Remove FlexRAN
- Remove any FlexRAN code - Cleanup config files - Remove LFDS7, libyaml dependencies
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,147 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \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 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 "flexran_agent_common.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
// for flexran_agent_get_mac_xface()
|
||||
#include "flexran_agent_extern.h"
|
||||
|
||||
/* Type for a list of shared objects used in the user plane (schedulers) */
|
||||
typedef struct flexran_agent_so_handle_s {
|
||||
char *name; // name of the object
|
||||
void *dl_handle; // handle of associated objects
|
||||
SLIST_ENTRY (flexran_agent_so_handle_s) entries;
|
||||
} flexran_agent_so_handle_t;
|
||||
|
||||
/* Initialization function for the agent structures etc */
|
||||
void flexran_agent_init_mac_agent(mid_t mod_id);
|
||||
|
||||
/* Scheduling request information protocol message constructor and estructor */
|
||||
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 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);
|
||||
|
||||
/* Statistics reply protocol message constructors (for UE and cell stats) and destructor */
|
||||
int flexran_agent_mac_stats_reply_ue(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags);
|
||||
int flexran_agent_mac_stats_reply_cell(mid_t mod_id,
|
||||
Protocol__FlexCellStatsReport **cell_report,
|
||||
int n_cc,
|
||||
uint32_t cc_flags);
|
||||
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexStatsReply *reply);
|
||||
|
||||
/* DL MAC scheduling decision protocol message constructor (empty command) and destructor */
|
||||
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);
|
||||
|
||||
/* UL MAC scheduling decision protocol message constructor (empty command) and destructor */
|
||||
int flexran_agent_mac_create_empty_ul_config(mid_t mod_id, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_mac_destroy_ul_config(Protocol__FlexranMessage *msg);
|
||||
|
||||
int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
|
||||
|
||||
/**********************************
|
||||
* FlexRAN agent - technology mac API
|
||||
**********************************/
|
||||
|
||||
/*Inform controller about received scheduling requests during a subframe*/
|
||||
void flexran_agent_send_sr_info(mid_t mod_id);
|
||||
|
||||
/*Inform the controller about the current UL/DL subframe*/
|
||||
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 flexran_agent_send_update_mac_stats(mid_t mod_id);
|
||||
|
||||
/// Provide to the scheduler a pending dl_mac_config message
|
||||
void flexran_agent_get_pending_dl_mac_config(mid_t mod_id, Protocol__FlexranMessage **msg);
|
||||
|
||||
/* Fill the MAC part of an cell_config message */
|
||||
void flexran_agent_fill_mac_cell_config(mid_t mod_id, uint8_t cc_id,
|
||||
Protocol__FlexCellConfig *conf);
|
||||
|
||||
/* Fill the MAC part of a ue_config message */
|
||||
void flexran_agent_fill_mac_ue_config(mid_t mod_id, mid_t ue_id,
|
||||
Protocol__FlexUeConfig *ue_conf);
|
||||
|
||||
/* Fill the lc_ue_config->lc_config message */
|
||||
void flexran_agent_fill_mac_lc_ue_config(mid_t mod_id, mid_t ue_id,
|
||||
Protocol__FlexLcUeConfig *lc_ue_conf);
|
||||
|
||||
/*Register technology specific interface callbacks*/
|
||||
int flexran_agent_register_mac_xface(mid_t mod_id);
|
||||
|
||||
/*Unregister technology specific callbacks*/
|
||||
int flexran_agent_unregister_mac_xface(mid_t mod_id);
|
||||
|
||||
/***************************************
|
||||
* FlexRAN agent - slice configuration *
|
||||
***************************************/
|
||||
|
||||
/* Inform controller about possibility to update slice configuration */
|
||||
void flexran_agent_slice_update(mid_t mod_id);
|
||||
|
||||
/* marks slice_config so that it can be applied later. Takes ownership of the
|
||||
* FlexSliceConfig message */
|
||||
void prepare_update_slice_config(mid_t mod_id,
|
||||
Protocol__FlexSliceConfig **slice,
|
||||
int request_objects);
|
||||
|
||||
/* inserts a new ue_config into the structure keeping ue to slice association
|
||||
* updates and marks so it can be applied. Takes ownership of the FlexUeConfig message */
|
||||
void prepare_ue_slice_assoc_update(mid_t mod_id, Protocol__FlexUeConfig **ue_config);
|
||||
|
||||
/* free slice_config part of flexCellConfig, filled in
|
||||
* flexran_agent_fill_mac_cell_config() */
|
||||
void flexran_agent_destroy_mac_slice_config(Protocol__FlexCellConfig *conf);
|
||||
|
||||
/* information about a new (potentially relevant) control delegation message */
|
||||
void flexran_agent_mac_inform_delegation(mid_t mod_id,
|
||||
Protocol__FlexControlDelegation *cdm);
|
||||
|
||||
/* fill the enb_config_reply with the shared objects in use by the MAC sublayer */
|
||||
void flexran_agent_mac_fill_loaded_mac_objects(
|
||||
mid_t mod_id,
|
||||
Protocol__FlexEnbConfigReply *reply);
|
||||
|
||||
#endif
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \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 __FLEXRAN_AGENT_MAC_PRIMITIVES_H__
|
||||
#define __FLEXRAN_AGENT_MAC_PRIMITIVES_H__
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "header.pb-c.h"
|
||||
|
||||
#define RINGBUFFER_SIZE 100
|
||||
|
||||
/* FLEXRAN AGENT-MAC Interface */
|
||||
typedef struct {
|
||||
//msg_context_t *agent_ctxt;
|
||||
|
||||
/// Inform the controller about the scheduling requests received during the subframe
|
||||
void (*flexran_agent_send_sr_info)(mid_t mod_id);
|
||||
|
||||
/// Inform the controller about the current UL/DL subframe
|
||||
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 (*flexran_agent_send_update_mac_stats)(mid_t mod_id);
|
||||
|
||||
/// Provide to the scheduler a pending dl_mac_config message
|
||||
void (*flexran_agent_get_pending_dl_mac_config)(mid_t mod_id,
|
||||
Protocol__FlexranMessage **msg);
|
||||
|
||||
/// Notify the controller of another (RU) tick, i.e. new subframe. Used to
|
||||
/// synchronize the eNB and the agent.
|
||||
void (*flexran_agent_notify_tick)(mid_t mod_id);
|
||||
|
||||
|
||||
void *dl_scheduler_loaded_lib;
|
||||
void *ul_scheduler_loaded_lib;
|
||||
/*TODO: Fill in with the rest of the MAC layer technology specific callbacks (UL/DL scheduling, RACH info etc)*/
|
||||
|
||||
} AGENT_MAC_xface;
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_mac_internal.h
|
||||
* \brief Implementation specific definitions for the FlexRAN MAC agent
|
||||
* \author Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_MAC_INTERNAL_H_
|
||||
#define FLEXRAN_AGENT_MAC_INTERNAL_H_
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include <yaml.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
|
||||
*/
|
||||
typedef struct {
|
||||
/*Flag showing if continuous mac stats update is enabled*/
|
||||
uint8_t is_initialized;
|
||||
volatile uint8_t cont_update;
|
||||
xid_t xid;
|
||||
Protocol__FlexranMessage *stats_req;
|
||||
Protocol__FlexranMessage *prev_stats_reply;
|
||||
|
||||
pthread_mutex_t *mutex;
|
||||
} mac_stats_updates_context_t;
|
||||
|
||||
|
||||
/*Functions to initialize and destroy the struct required for the
|
||||
*continuous stats update report*/
|
||||
err_code_t flexran_agent_init_cont_mac_stats_update(mid_t mod_id);
|
||||
|
||||
err_code_t flexran_agent_destroy_cont_mac_stats_update(mid_t mod_id);
|
||||
|
||||
|
||||
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);
|
||||
|
||||
Protocol__FlexCellStatsReport * copy_cell_stats_report(Protocol__FlexCellStatsReport *original);
|
||||
|
||||
Protocol__FlexRlcBsr * copy_rlc_report(Protocol__FlexRlcBsr * original);
|
||||
|
||||
Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * original);
|
||||
|
||||
Protocol__FlexDlCqiReport * copy_dl_cqi_report(Protocol__FlexDlCqiReport * original);
|
||||
|
||||
Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagingBufferReport *original);
|
||||
|
||||
Protocol__FlexDlCsi * copy_csi_report(Protocol__FlexDlCsi * original);
|
||||
|
||||
Protocol__FlexNoiseInterferenceReport * copy_noise_inter_report(Protocol__FlexNoiseInterferenceReport *original);
|
||||
|
||||
int compare_ue_stats_reports(Protocol__FlexUeStatsReport *rep1,
|
||||
Protocol__FlexUeStatsReport *rep2);
|
||||
|
||||
int compare_cell_stats_reports(Protocol__FlexCellStatsReport *rep1,
|
||||
Protocol__FlexCellStatsReport *rep2);
|
||||
|
||||
|
||||
/* Functions for parsing the MAC agent policy reconfiguration command */
|
||||
|
||||
int parse_mac_config(mid_t mod_id, yaml_parser_t *parser);
|
||||
|
||||
int parse_dl_scheduler_config(mid_t mod_id, yaml_parser_t *parser);
|
||||
|
||||
int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser);
|
||||
|
||||
int parse_ul_scheduler_config(mid_t mod_id, yaml_parser_t *parser);
|
||||
|
||||
int parse_ul_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser);
|
||||
|
||||
int load_dl_scheduler_function(mid_t mod_id, const char *function_name);
|
||||
|
||||
/*** Functions for handling a slice config ***/
|
||||
|
||||
/* Prepare the application of a slicing config */
|
||||
void apply_update_dl_slice_config(mid_t mod_id, Protocol__FlexSliceDlUlConfig *slice);
|
||||
void apply_update_ul_slice_config(mid_t mod_id, Protocol__FlexSliceDlUlConfig *slice);
|
||||
|
||||
/* apply a new association between a UE and a slice (both DL and UL) */
|
||||
int apply_ue_slice_assoc_update(mid_t mod_id, Protocol__FlexUeConfig *ue_config);
|
||||
|
||||
#endif /*FLEXRAN_AGENT_MAC_INTERNAL_H_*/
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_mac_slice_verification.c
|
||||
* \brief MAC Agent slice verification helper functions
|
||||
* \author Robert Schmidt
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
#include "flexran_agent_mac_slice_verification.h"
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_mac_slice_verification.h
|
||||
* \brief MAC Agent slice verification helper functions
|
||||
* \author Robert Schmidt
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_common_internal.h"
|
||||
#include "flexran_agent_mac_internal.h"
|
||||
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_pdcp.c
|
||||
* \brief FlexRAN agent Control Module PDCP
|
||||
* \author Navid Nikaein and shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_pdcp.h"
|
||||
|
||||
/*Array containing the Agent-PDCP interfaces*/
|
||||
AGENT_PDCP_xface *agent_pdcp_xface[NUM_MAX_ENB];
|
||||
|
||||
// MAX_MOBILES_PER_ENB
|
||||
|
||||
void flexran_agent_pdcp_aggregate_stats(const mid_t mod_id,
|
||||
uint16_t uid,
|
||||
Protocol__FlexPdcpStats *pdcp_aggr_stats){
|
||||
|
||||
int lcid=0;
|
||||
/* only calculate the DRBs */
|
||||
//LOG_I(FLEXRAN_AGENT, "enb %d ue %d \n", mod_id, uid);
|
||||
|
||||
for (lcid=NUM_MAX_SRB ; lcid < NUM_MAX_SRB + NUM_MAX_DRB; lcid++){
|
||||
|
||||
pdcp_aggr_stats->pkt_tx += flexran_get_pdcp_tx(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_tx_bytes += flexran_get_pdcp_tx_bytes(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_tx_w += flexran_get_pdcp_tx_w(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_tx_bytes_w += flexran_get_pdcp_tx_bytes_w(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_tx_aiat += flexran_get_pdcp_tx_aiat(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_tx_aiat_w += flexran_get_pdcp_tx_aiat_w(mod_id, uid, lcid);
|
||||
|
||||
|
||||
pdcp_aggr_stats->pkt_rx += flexran_get_pdcp_rx(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_rx_bytes += flexran_get_pdcp_rx_bytes(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_rx_w += flexran_get_pdcp_rx_w(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_rx_bytes_w += flexran_get_pdcp_rx_bytes_w(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_rx_aiat += flexran_get_pdcp_rx_aiat(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_rx_aiat_w += flexran_get_pdcp_rx_aiat_w(mod_id, uid, lcid);
|
||||
pdcp_aggr_stats->pkt_rx_oo += flexran_get_pdcp_rx_oo(mod_id, uid, lcid);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int flexran_agent_pdcp_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags) {
|
||||
if (n_ue > 0) {
|
||||
|
||||
for (int i = 0; i < n_ue; i++) {
|
||||
const rnti_t rnti = ue_report[i]->rnti;
|
||||
const uint16_t uid = flexran_get_pdcp_uid_from_rnti(mod_id, rnti);
|
||||
|
||||
/* Check flag for creation of buffer status report */
|
||||
if (ue_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PDCP_STATS) {
|
||||
|
||||
Protocol__FlexPdcpStats *pdcp_aggr_stats;
|
||||
pdcp_aggr_stats = malloc(sizeof(Protocol__FlexPdcpStats));
|
||||
if (pdcp_aggr_stats == NULL)
|
||||
goto error;
|
||||
protocol__flex_pdcp_stats__init(pdcp_aggr_stats);
|
||||
|
||||
flexran_agent_pdcp_aggregate_stats(mod_id, uid, pdcp_aggr_stats);
|
||||
|
||||
pdcp_aggr_stats->has_pkt_tx=1;
|
||||
pdcp_aggr_stats->has_pkt_tx_bytes =1;
|
||||
pdcp_aggr_stats->has_pkt_tx_w=1;
|
||||
pdcp_aggr_stats->has_pkt_tx_bytes_w =1;
|
||||
pdcp_aggr_stats->has_pkt_tx_aiat =1;
|
||||
pdcp_aggr_stats->has_pkt_tx_aiat_w =1;
|
||||
|
||||
pdcp_aggr_stats->pkt_tx_sn = flexran_get_pdcp_tx_sn(mod_id, uid, DEFAULT_DRB);
|
||||
pdcp_aggr_stats->has_pkt_tx_sn =1;
|
||||
|
||||
pdcp_aggr_stats->has_pkt_rx =1;
|
||||
pdcp_aggr_stats->has_pkt_rx_bytes =1;
|
||||
pdcp_aggr_stats->has_pkt_rx_w =1;
|
||||
pdcp_aggr_stats->has_pkt_rx_bytes_w =1;
|
||||
pdcp_aggr_stats->has_pkt_rx_aiat =1;
|
||||
pdcp_aggr_stats->has_pkt_rx_aiat_w =1;
|
||||
pdcp_aggr_stats->has_pkt_rx_oo =1;
|
||||
|
||||
pdcp_aggr_stats->pkt_rx_sn = flexran_get_pdcp_rx_sn(mod_id, uid, DEFAULT_DRB);
|
||||
pdcp_aggr_stats->has_pkt_rx_sn =1;
|
||||
|
||||
pdcp_aggr_stats->sfn = flexran_get_pdcp_sfn(mod_id);
|
||||
pdcp_aggr_stats->has_sfn =1;
|
||||
|
||||
ue_report[i]->pdcp_stats = pdcp_aggr_stats;
|
||||
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PDCP_STATS;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LOG_D(FLEXRAN_AGENT, "no UE\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
LOG_W(FLEXRAN_AGENT, "Can't allocate PDCP stats\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int flexran_agent_pdcp_destroy_stats_reply(Protocol__FlexStatsReply *reply)
|
||||
{
|
||||
for (int i = 0; i < reply->n_ue_report; ++i) {
|
||||
if (reply->ue_report[i]->pdcp_stats)
|
||||
free(reply->ue_report[i]->pdcp_stats);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int flexran_agent_register_pdcp_xface(mid_t mod_id)
|
||||
{
|
||||
if (agent_pdcp_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "PDCP agent CM for eNB %d is already registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
AGENT_PDCP_xface *xface = malloc(sizeof(AGENT_PDCP_xface));
|
||||
if (!xface) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not allocate memory for PDCP agent xface %d\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//xface->flexran_pdcp_stats_measurement = NULL;
|
||||
|
||||
agent_pdcp_xface[mod_id] = xface;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_unregister_pdcp_xface(mid_t mod_id)
|
||||
{
|
||||
if (!agent_pdcp_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "PDCP agent CM for eNB %d is not registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
//xface->agent_ctxt = NULL;
|
||||
//xface->flexran_pdcp_stats_measurement = NULL;
|
||||
|
||||
free(agent_pdcp_xface[mod_id]);
|
||||
agent_pdcp_xface[mod_id] = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AGENT_PDCP_xface *flexran_agent_get_pdcp_xface(mid_t mod_id)
|
||||
{
|
||||
return agent_pdcp_xface[mod_id];
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_pdcp.h
|
||||
* \brief FlexRAN agent Control Module PDCP header
|
||||
* \author shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_PDCP_H_
|
||||
#define FLEXRAN_AGENT_PDCP_H_
|
||||
|
||||
#include "header.pb-c.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "stats_messages.pb-c.h"
|
||||
#include "stats_common.pb-c.h"
|
||||
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_pdcp_defs.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
// for flexran_agent_get_pdcp_xface()
|
||||
#include "flexran_agent_extern.h"
|
||||
|
||||
/**********************************
|
||||
* FlexRAN agent - technology PDCP API
|
||||
**********************************/
|
||||
|
||||
/* Send to the controller all the pdcp stat updates that occured during this subframe*/
|
||||
int flexran_agent_pdcp_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags);
|
||||
int flexran_agent_pdcp_destroy_stats_reply(Protocol__FlexStatsReply *reply);
|
||||
|
||||
/* Get the stats from RAN API and aggregate them per USER*/
|
||||
void flexran_agent_pdcp_aggregate_stats(const mid_t mod_id,
|
||||
uint16_t uid,
|
||||
Protocol__FlexPdcpStats *pdcp_aggr_stats);
|
||||
|
||||
/*Register technology specific interface callbacks*/
|
||||
int flexran_agent_register_pdcp_xface(mid_t mod_id);
|
||||
|
||||
/*Unregister technology specific callbacks*/
|
||||
int flexran_agent_unregister_pdcp_xface(mid_t mod_id);
|
||||
|
||||
#endif
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#ifndef __FLEXRAN_AGENT_PDCP_PRIMITIVES_H__
|
||||
#define __FLEXRAN_AGENT_PDCP_PRIMITIVES_H__
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "header.pb-c.h"
|
||||
|
||||
/*PDCP aggregated Packet stats */
|
||||
/*
|
||||
typedef struct pdcp_aggr_stats_s {
|
||||
int32_t rnti;
|
||||
|
||||
int32_t pkt_tx;
|
||||
int32_t pkt_tx_bytes;
|
||||
int32_t pkt_tx_sn;
|
||||
int32_t pkt_tx_rate_s;
|
||||
int32_t pkt_tx_throughput_s;
|
||||
int32_t pkt_tx_aiat;
|
||||
int32_t pkt_tx_aiat_s;
|
||||
|
||||
int32_t pkt_rx;
|
||||
int32_t pkt_rx_bytes;
|
||||
int32_t pkt_rx_sn;
|
||||
int32_t pkt_rx_rate_s;
|
||||
int32_t pkt_rx_goodput_s;
|
||||
int32_t pkt_rx_aiat;
|
||||
int32_t pkt_rx_aiat_s;
|
||||
int32_t pkt_rx_oo;
|
||||
|
||||
|
||||
} pdcp_aggr_stats_t;
|
||||
*/
|
||||
|
||||
/* FLEXRAN AGENT-PDCP Interface */
|
||||
typedef struct {
|
||||
|
||||
|
||||
// PDCP statistics
|
||||
void (*flexran_pdcp_stats_measurement)(mid_t mod_id, uint16_t rnti, uint16_t seq_num, uint32_t size);
|
||||
|
||||
} AGENT_PDCP_xface;
|
||||
|
||||
#endif
|
||||
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_phy.c
|
||||
* \brief FlexRAN agent Control Module PHY
|
||||
* \author Robert Schmidt
|
||||
* \date Oct 2018
|
||||
*/
|
||||
|
||||
#include "flexran_agent_phy.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
|
||||
/* Array containing the Agent-PHY interfaces */
|
||||
AGENT_PHY_xface *agent_phy_xface[NUM_MAX_ENB];
|
||||
|
||||
void flexran_agent_fill_phy_cell_config(mid_t mod_id, uint8_t cc_id,
|
||||
Protocol__FlexCellConfig *conf) {
|
||||
conf->phy_cell_id = flexran_get_cell_id(mod_id, cc_id);
|
||||
conf->has_phy_cell_id = 1;
|
||||
|
||||
conf->pusch_hopping_offset = flexran_get_hopping_offset(mod_id, cc_id);
|
||||
conf->has_pusch_hopping_offset = 1;
|
||||
|
||||
conf->hopping_mode = flexran_get_hopping_mode(mod_id, cc_id);
|
||||
conf->has_hopping_mode = 1;
|
||||
|
||||
conf->n_sb = flexran_get_n_SB(mod_id, cc_id);
|
||||
conf->has_n_sb = 1;
|
||||
|
||||
conf->phich_resource = flexran_get_phich_resource(mod_id, cc_id);
|
||||
conf->has_phich_resource = 1;
|
||||
|
||||
conf->phich_duration = flexran_get_phich_duration(mod_id, cc_id);
|
||||
conf->has_phich_duration = 1;
|
||||
|
||||
conf->init_nr_pdcch_ofdm_sym = flexran_get_num_pdcch_symb(mod_id, cc_id);
|
||||
conf->has_init_nr_pdcch_ofdm_sym = 1;
|
||||
|
||||
conf->dl_bandwidth = flexran_get_N_RB_DL(mod_id, cc_id);
|
||||
conf->has_dl_bandwidth = 1;
|
||||
|
||||
conf->ul_bandwidth = flexran_get_N_RB_UL(mod_id, cc_id);
|
||||
conf->has_ul_bandwidth = 1;
|
||||
|
||||
conf->ul_cyclic_prefix_length = flexran_get_ul_cyclic_prefix_length(mod_id, cc_id);
|
||||
conf->has_ul_cyclic_prefix_length = 1;
|
||||
|
||||
conf->dl_cyclic_prefix_length = flexran_get_dl_cyclic_prefix_length(mod_id, cc_id);
|
||||
conf->has_dl_cyclic_prefix_length = 1;
|
||||
|
||||
conf->antenna_ports_count = flexran_get_antenna_ports(mod_id, cc_id);
|
||||
conf->has_antenna_ports_count = 1;
|
||||
|
||||
conf->duplex_mode = flexran_get_duplex_mode(mod_id, cc_id);
|
||||
conf->has_duplex_mode = 1;
|
||||
|
||||
conf->subframe_assignment = flexran_get_subframe_assignment(mod_id, cc_id);
|
||||
conf->has_subframe_assignment = 1;
|
||||
|
||||
conf->special_subframe_patterns = flexran_get_special_subframe_assignment(mod_id, cc_id);
|
||||
conf->has_special_subframe_patterns = 1;
|
||||
|
||||
//TODO: Fill in with actual value, The MBSFN radio frame period
|
||||
conf->n_mbsfn_subframe_config_rfperiod = 0;
|
||||
uint32_t *elem_rfperiod = malloc(sizeof(uint32_t) * conf->n_mbsfn_subframe_config_rfperiod);
|
||||
if (elem_rfperiod)
|
||||
for(int j = 0; j < conf->n_mbsfn_subframe_config_rfperiod; j++)
|
||||
elem_rfperiod[j] = 1;
|
||||
conf->mbsfn_subframe_config_rfperiod = elem_rfperiod;
|
||||
|
||||
//TODO: Fill in with actual value, The MBSFN radio frame offset
|
||||
conf->n_mbsfn_subframe_config_rfoffset = 0;
|
||||
uint32_t *elem_rfoffset = malloc(sizeof(uint32_t) * conf->n_mbsfn_subframe_config_rfoffset);
|
||||
if (elem_rfoffset)
|
||||
for(int j = 0; j < conf->n_mbsfn_subframe_config_rfoffset; j++)
|
||||
elem_rfoffset[j] = 1;
|
||||
conf->mbsfn_subframe_config_rfoffset = elem_rfoffset;
|
||||
|
||||
//TODO: Fill in with actual value, Bitmap indicating the MBSFN subframes
|
||||
conf->n_mbsfn_subframe_config_sfalloc = 0;
|
||||
uint32_t *elem_sfalloc = malloc(sizeof(uint32_t) * conf->n_mbsfn_subframe_config_sfalloc);
|
||||
if (elem_sfalloc)
|
||||
for(int j = 0; j < conf->n_mbsfn_subframe_config_sfalloc; j++)
|
||||
elem_sfalloc[j] = 1;
|
||||
conf->mbsfn_subframe_config_sfalloc = elem_sfalloc;
|
||||
|
||||
conf->prach_config_index = flexran_get_prach_ConfigIndex(mod_id, cc_id);
|
||||
conf->has_prach_config_index = 1;
|
||||
|
||||
conf->prach_freq_offset = flexran_get_prach_FreqOffset(mod_id, cc_id);
|
||||
conf->has_prach_freq_offset = 1;
|
||||
|
||||
conf->max_harq_msg3tx = flexran_get_maxHARQ_Msg3Tx(mod_id, cc_id);
|
||||
conf->has_max_harq_msg3tx = 1;
|
||||
|
||||
conf->n1pucch_an = flexran_get_n1pucch_an(mod_id, cc_id);
|
||||
conf->has_n1pucch_an = 1;
|
||||
|
||||
conf->deltapucch_shift = flexran_get_deltaPUCCH_Shift(mod_id, cc_id);
|
||||
conf->has_deltapucch_shift = 1;
|
||||
|
||||
conf->nrb_cqi = flexran_get_nRB_CQI(mod_id, cc_id);
|
||||
conf->has_nrb_cqi = 1;
|
||||
|
||||
conf->srs_subframe_config = flexran_get_srs_SubframeConfig(mod_id, cc_id);
|
||||
conf->has_srs_subframe_config = 1;
|
||||
|
||||
conf->srs_bw_config = flexran_get_srs_BandwidthConfig(mod_id, cc_id);
|
||||
conf->has_srs_bw_config = 1;
|
||||
|
||||
conf->srs_mac_up_pts = flexran_get_srs_MaxUpPts(mod_id, cc_id);
|
||||
conf->has_srs_mac_up_pts = 1;
|
||||
|
||||
conf->dl_freq = flexran_agent_get_operating_dl_freq (mod_id, cc_id);
|
||||
conf->has_dl_freq = 1;
|
||||
|
||||
conf->ul_freq = flexran_agent_get_operating_ul_freq (mod_id, cc_id);
|
||||
conf->has_ul_freq = 1;
|
||||
|
||||
conf->eutra_band = flexran_agent_get_operating_eutra_band (mod_id, cc_id);
|
||||
conf->has_eutra_band = 1;
|
||||
|
||||
conf->dl_pdsch_power = flexran_agent_get_operating_pdsch_refpower(mod_id, cc_id);
|
||||
conf->has_dl_pdsch_power = 1;
|
||||
|
||||
conf->enable_64qam = flexran_get_enable64QAM(mod_id, cc_id);
|
||||
conf->has_enable_64qam = 1;
|
||||
}
|
||||
|
||||
int flexran_agent_register_phy_xface(mid_t mod_id) {
|
||||
if (agent_phy_xface[mod_id]) {
|
||||
LOG_E(PHY, "PHY agent for eNB %d is already registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
AGENT_PHY_xface *xface = malloc(sizeof(AGENT_PHY_xface));
|
||||
|
||||
if (!xface) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not allocate memory for PHY agent xface %d\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
agent_phy_xface[mod_id] = xface;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_unregister_phy_xface(mid_t mod_id)
|
||||
{
|
||||
if (!agent_phy_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "PHY agent for eNB %d is not registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
free(agent_phy_xface[mod_id]);
|
||||
agent_phy_xface[mod_id] = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
AGENT_PHY_xface *flexran_agent_get_phy_xface(mid_t mod_id)
|
||||
{
|
||||
return agent_phy_xface[mod_id];
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_phy.h
|
||||
* \brief FlexRAN agent Control Module PHY header
|
||||
* \author Robert Schmidt
|
||||
* \date Oct 2018
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_PHY_H_
|
||||
#define FLEXRAN_AGENT_PHY_H_
|
||||
|
||||
#include "header.pb-c.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "stats_messages.pb-c.h"
|
||||
#include "stats_common.pb-c.h"
|
||||
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_phy_defs.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
// for flexran_agent_get_phy_xface()
|
||||
#include "flexran_agent_extern.h"
|
||||
|
||||
/**********************************
|
||||
* FlexRAN agent - technology PHY API
|
||||
**********************************/
|
||||
|
||||
/* Fill the PHY part of an cell_config message */
|
||||
void flexran_agent_fill_phy_cell_config(mid_t mod_id, uint8_t cc_id,
|
||||
Protocol__FlexCellConfig *conf);
|
||||
|
||||
/* Register technology specific interface callbacks */
|
||||
int flexran_agent_register_phy_xface(mid_t mod_id);
|
||||
|
||||
/* Unregister technology specific callbacks */
|
||||
int flexran_agent_unregister_phy_xface(mid_t mod_id);
|
||||
|
||||
#endif
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#ifndef __FLEXRAN_AGENT_PHY_PRIMITIVES_H__
|
||||
#define __FLEXRAN_AGENT_PHY_PRIMITIVES_H__
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "header.pb-c.h"
|
||||
|
||||
/* FLEXRAN AGENT-PHY Interface */
|
||||
typedef struct {
|
||||
|
||||
/* currently empty, will be used to control RU */
|
||||
|
||||
} AGENT_PHY_xface;
|
||||
|
||||
#endif /* __FLEXRAN_AGENT_PHY_PRIMITIVES_H__ */
|
||||
@@ -1,924 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_rrc.c
|
||||
* \brief FlexRAN agent Control Module RRC
|
||||
* \author shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_rrc.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
|
||||
#include "liblfds700.h"
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
/*Trigger boolean for RRC measurement*/
|
||||
bool triggered_rrc = false;
|
||||
|
||||
/*Array containing the Agent-RRC interfaces*/
|
||||
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
|
||||
|
||||
|
||||
void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change) {
|
||||
int size;
|
||||
Protocol__FlexranMessage *msg = NULL;
|
||||
Protocol__FlexHeader *header = NULL;
|
||||
Protocol__FlexUeStateChange *ue_state_change_msg = NULL;
|
||||
Protocol__FlexUeConfig *config = NULL;
|
||||
void *data;
|
||||
int priority = 0;
|
||||
err_code_t err_code=0;
|
||||
|
||||
int xid = 0;
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UE_STATE_CHANGE, &header) != 0)
|
||||
goto error;
|
||||
|
||||
ue_state_change_msg = malloc(sizeof(Protocol__FlexUeStateChange));
|
||||
if(ue_state_change_msg == NULL) {
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_ue_state_change__init(ue_state_change_msg);
|
||||
ue_state_change_msg->has_type = 1;
|
||||
ue_state_change_msg->type = state_change;
|
||||
|
||||
config = malloc(sizeof(Protocol__FlexUeConfig));
|
||||
if (config == NULL) {
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_ue_config__init(config);
|
||||
switch (state_change) {
|
||||
case PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED:
|
||||
config->has_rnti = 1;
|
||||
config->rnti = rnti;
|
||||
break;
|
||||
case PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_UPDATED:
|
||||
case PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_ACTIVATED:
|
||||
flexran_agent_fill_rrc_ue_config(mod_id, rnti, config);
|
||||
/* we don't call into the MAC CM here; it will be called later through an
|
||||
* ue_config_request */
|
||||
break;
|
||||
case PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_MOVED:
|
||||
default:
|
||||
LOG_E(FLEXRAN_AGENT, "state change FLUESC_MOVED or unknown state occured for RNTI %x\n",
|
||||
rnti);
|
||||
}
|
||||
|
||||
ue_state_change_msg->config = config;
|
||||
msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
if (msg == NULL) {
|
||||
goto error;
|
||||
}
|
||||
protocol__flexran_message__init(msg);
|
||||
msg->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG;
|
||||
msg->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
|
||||
msg->ue_state_change_msg = ue_state_change_msg;
|
||||
|
||||
data = flexran_agent_pack_message(msg, &size);
|
||||
/*Send sr info using the MAC channel of the eNB*/
|
||||
if (flexran_agent_msg_send(mod_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
|
||||
goto error;
|
||||
}
|
||||
|
||||
LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
|
||||
free(header);
|
||||
return;
|
||||
error:
|
||||
if (err_code != 0)
|
||||
LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d for RNTI %x\n",
|
||||
err_code, rnti);
|
||||
if (header){
|
||||
free(header);
|
||||
}
|
||||
if (ue_state_change_msg) {
|
||||
free(ue_state_change_msg);
|
||||
}
|
||||
if (config) {
|
||||
free(config);
|
||||
}
|
||||
if (msg) {
|
||||
free(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg) {
|
||||
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG)
|
||||
goto error;
|
||||
free(msg->ue_state_change_msg->header);
|
||||
if (msg->ue_state_change_msg->config->capabilities)
|
||||
free(msg->ue_state_change_msg->config->capabilities);
|
||||
if (msg->ue_state_change_msg->config->info) {
|
||||
if (msg->ue_state_change_msg->config->info->cell_individual_offset) {
|
||||
free(msg->ue_state_change_msg->config->info->cell_individual_offset);
|
||||
}
|
||||
if (msg->ue_state_change_msg->config->info->event) {
|
||||
if (msg->ue_state_change_msg->config->info->event->a3) {
|
||||
free(msg->ue_state_change_msg->config->info->event->a3);
|
||||
}
|
||||
free(msg->ue_state_change_msg->config->info->event);
|
||||
}
|
||||
free(msg->ue_state_change_msg->config->info);
|
||||
}
|
||||
free(msg->ue_state_change_msg->config);
|
||||
free(msg->ue_state_change_msg);
|
||||
free(msg);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
//LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* this is called by RRC as a part of rrc xface . The controller previously requested this*/
|
||||
void flexran_trigger_rrc_measurements (mid_t mod_id, LTE_MeasResults_t* measResults) {
|
||||
|
||||
// int priority = 0; // Warning Preventing
|
||||
// void *data;
|
||||
// int size;
|
||||
// err_code_t err_code = -100;
|
||||
triggered_rrc = true;
|
||||
|
||||
/* TODO do we need this at the current state? meas_stats is never put into a
|
||||
* protobuf message?!
|
||||
int num = flexran_get_rrc_num_ues (mod_id);
|
||||
rnti_t rntis[num];
|
||||
flexran_get_rrc_rnti_list(mod_id, rntis, num);
|
||||
|
||||
meas_stats = malloc(sizeof(rrc_meas_stats) * num);
|
||||
|
||||
for (int i = 0; i < num; i++){
|
||||
const rnti_t rnti = rntis[i];
|
||||
meas_stats[i].rnti = rnti;
|
||||
meas_stats[i].meas_id = flexran_get_rrc_pcell_measid(mod_id, rnti);
|
||||
meas_stats[i].rsrp = flexran_get_rrc_pcell_rsrp(mod_id, rnti) - 140;
|
||||
// measResults->measResultPCell.rsrpResult - 140;
|
||||
meas_stats[i].rsrq = flexran_get_rrc_pcell_rsrq(mod_id, rnti)/2 - 20;
|
||||
*/
|
||||
// repl->neigh_meas = NULL;
|
||||
|
||||
// if (meas->measResultNeighCells != NULL) {
|
||||
// /*
|
||||
// * Neighboring cells measurements performed by UE.
|
||||
// */
|
||||
// NeighCellsMeasurements *neigh_meas;
|
||||
// neigh_meas = malloc(sizeof(NeighCellsMeasurements));
|
||||
// if (neigh_meas == NULL)
|
||||
// goto error;
|
||||
// neigh_cells_measurements__init(neigh_meas);
|
||||
|
||||
// /* EUTRAN RRC Measurements. */
|
||||
// if (meas->measResultNeighCells->present ==
|
||||
// MeasResults__measResultNeighCells_PR_measResultListEUTRA) {
|
||||
|
||||
// MeasResultListEUTRA_t meas_list = meas->measResultNeighCells->
|
||||
// choice.measResultListEUTRA;
|
||||
// /* Set the number of EUTRAN measurements present in report. */
|
||||
// neigh_meas->n_eutra_meas = meas_list.list.count;
|
||||
// if (neigh_meas->n_eutra_meas > 0) {
|
||||
// /* Initialize EUTRAN measurements. */
|
||||
// EUTRAMeasurements **eutra_meas;
|
||||
// eutra_meas = malloc(sizeof(EUTRAMeasurements *) *
|
||||
// neigh_meas->n_eutra_meas);
|
||||
// for (i = 0; i < neigh_meas->n_eutra_meas; i++) {
|
||||
// eutra_meas[i] = malloc(sizeof(EUTRAMeasurements));
|
||||
// eutra_measurements__init(eutra_meas[i]);
|
||||
// /* Fill in the physical cell identifier. */
|
||||
// eutra_meas[i]->has_phys_cell_id = 1;
|
||||
// eutra_meas[i]->phys_cell_id = meas_list.list.array[i]->
|
||||
// physCellId;
|
||||
// // log_i(agent,"PCI of Target %d", eutra_meas[i]->phys_cell_id);
|
||||
// /* Check for Reference signal measurements. */
|
||||
// if (&(meas_list.list.array[i]->measResult)) {
|
||||
// /* Initialize Ref. signal measurements. */
|
||||
// EUTRARefSignalMeas *meas_result;
|
||||
// meas_result = malloc(sizeof(EUTRARefSignalMeas));
|
||||
// eutra_ref_signal_meas__init(meas_result);
|
||||
|
||||
// if (meas_list.list.array[i]->measResult.rsrpResult) {
|
||||
// meas_result->has_rsrp = 1;
|
||||
// meas_result->rsrp = RSRP_meas_mapping[*(meas_list.
|
||||
// list.array[i]->measResult.rsrpResult)];
|
||||
// // log_i(agent,"RSRP of Target %d", meas_result->rsrp);
|
||||
// }
|
||||
|
||||
// if (meas_list.list.array[i]->measResult.rsrqResult) {
|
||||
// meas_result->has_rsrq = 1;
|
||||
// meas_result->rsrq = RSRQ_meas_mapping[*(meas_list.
|
||||
// list.array[i]->measResult.rsrqResult)];
|
||||
// // log_i(agent,"RSRQ of Target %d", meas_result->rsrq);
|
||||
// }
|
||||
// eutra_meas[i]->meas_result = meas_result;
|
||||
// }
|
||||
// /* Check for CGI measurements. */
|
||||
// if (meas_list.list.array[i]->cgi_Info) {
|
||||
// /* Initialize CGI measurements. */
|
||||
// EUTRACgiMeasurements *cgi_meas;
|
||||
// cgi_meas = malloc(sizeof(EUTRACgiMeasurements));
|
||||
// eutra_cgi_measurements__init(cgi_meas);
|
||||
|
||||
// /* EUTRA Cell Global Identity (CGI). */
|
||||
// CellGlobalIdEUTRA *cgi;
|
||||
// cgi = malloc(sizeof(CellGlobalIdEUTRA));
|
||||
// cell_global_id__eutra__init(cgi);
|
||||
|
||||
// cgi->has_cell_id = 1;
|
||||
// CellIdentity_t cId = meas_list.list.array[i]->
|
||||
// cgi_Info->cellGlobalId.cellIdentity;
|
||||
// cgi->cell_id = (cId.buf[0] << 20) + (cId.buf[1] << 12) +
|
||||
// (cId.buf[2] << 4) + (cId.buf[3] >> 4);
|
||||
|
||||
// /* Public land mobile network identifier of neighbor
|
||||
// * cell.
|
||||
// */
|
||||
// PlmnIdentity *plmn_id;
|
||||
// plmn_id = malloc(sizeof(PlmnIdentity));
|
||||
// plmn_identity__init(plmn_id);
|
||||
|
||||
// MNC_t mnc = meas_list.list.array[i]->
|
||||
// cgi_Info->cellGlobalId.plmn_Identity.mnc;
|
||||
|
||||
// plmn_id->has_mnc = 1;
|
||||
// plmn_id->mnc = 0;
|
||||
// for (m = 0; m < mnc.list.count; m++) {
|
||||
// plmn_id->mnc += *mnc.list.array[m] *
|
||||
// ((uint32_t) pow(10, mnc.list.count - m - 1));
|
||||
// }
|
||||
|
||||
// MCC_t *mcc = meas_list.list.array[i]->
|
||||
// cgi_Info->cellGlobalId.plmn_Identity.mcc;
|
||||
|
||||
// plmn_id->has_mcc = 1;
|
||||
// plmn_id->mcc = 0;
|
||||
// for (m = 0; m < mcc->list.count; m++) {
|
||||
// plmn_id->mcc += *mcc->list.array[m] *
|
||||
// ((uint32_t) pow(10, mcc->list.count - m - 1));
|
||||
// }
|
||||
|
||||
// TrackingAreaCode_t tac = meas_list.list.array[i]->
|
||||
// cgi_Info->trackingAreaCode;
|
||||
|
||||
// cgi_meas->has_tracking_area_code = 1;
|
||||
// cgi_meas->tracking_area_code = (tac.buf[0] << 8) +
|
||||
// (tac.buf[1]);
|
||||
|
||||
// PLMN_IdentityList2_t *plmn_l = meas_list.list.array[i]->
|
||||
// cgi_Info->plmn_IdentityList;
|
||||
|
||||
// cgi_meas->n_plmn_id = plmn_l->list.count;
|
||||
// /* Set the PLMN ID list in CGI measurements. */
|
||||
// PlmnIdentity **plmn_id_l;
|
||||
// plmn_id_l = malloc(sizeof(PlmnIdentity *) *
|
||||
// cgi_meas->n_plmn_id);
|
||||
|
||||
// MNC_t mnc2;
|
||||
// MCC_t *mcc2;
|
||||
// for (m = 0; m < cgi_meas->n_plmn_id; m++) {
|
||||
// plmn_id_l[m] = malloc(sizeof(PlmnIdentity));
|
||||
// plmn_identity__init(plmn_id_l[m]);
|
||||
|
||||
// mnc2 = plmn_l->list.array[m]->mnc;
|
||||
// plmn_id_l[m]->has_mnc = 1;
|
||||
// plmn_id_l[m]->mnc = 0;
|
||||
// for (k = 0; k < mnc2.list.count; k++) {
|
||||
// plmn_id_l[m]->mnc += *mnc2.list.array[k] *
|
||||
// ((uint32_t) pow(10, mnc2.list.count - k - 1));
|
||||
// }
|
||||
|
||||
// mcc2 = plmn_l->list.array[m]->mcc;
|
||||
// plmn_id_l[m]->has_mcc = 1;
|
||||
// plmn_id_l[m]->mcc = 0;
|
||||
// for (k = 0; k < mcc2->list.count; k++) {
|
||||
// plmn_id_l[m]->mcc += *mcc2->list.array[k] *
|
||||
// ((uint32_t) pow(10, mcc2->list.count - k - 1));
|
||||
// }
|
||||
// }
|
||||
// cgi_meas->plmn_id = plmn_id_l;
|
||||
// eutra_meas[i]->cgi_meas = cgi_meas;
|
||||
// }
|
||||
// }
|
||||
// neigh_meas->eutra_meas = eutra_meas;
|
||||
// }
|
||||
// }
|
||||
// repl->neigh_meas = neigh_meas;
|
||||
// }
|
||||
/* Attach the RRC measurement reply message to RRC measurements message. */
|
||||
// mrrc_meas->repl = repl;
|
||||
/* Attach RRC measurement message to triggered event message. */
|
||||
// te->mrrc_meas = mrrc_meas;
|
||||
// te->has_action = 0;
|
||||
/* Attach the triggered event message to main message. */
|
||||
// reply->te = te;
|
||||
|
||||
/* Send the report to controller. */
|
||||
// if (flexran_agent_msg_send(b_id, reply) < 0) {
|
||||
// goto error;
|
||||
// }
|
||||
|
||||
/* Free the measurement report received from UE. */
|
||||
// ASN_STRUCT_FREE(asn_DEF_MeasResults, p->meas);
|
||||
/* Free the params. */
|
||||
// free(p);
|
||||
|
||||
|
||||
// stats_reply_msg->cell_report = cell_report;
|
||||
|
||||
// stats_reply_msg->ue_report = ue_report;
|
||||
|
||||
// msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
// if(msg == NULL)
|
||||
// goto error;
|
||||
// protocol__flexran_message__init(msg);
|
||||
// msg->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG;
|
||||
// msg->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
|
||||
// msg->stats_reply_msg = stats_reply_msg;
|
||||
|
||||
// data = flexran_agent_pack_message(msg, &size);
|
||||
|
||||
|
||||
// if (flexran_agent_msg_send(mod_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) {
|
||||
|
||||
// err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
|
||||
// goto error;
|
||||
// }
|
||||
|
||||
// LOG_I(FLEXRAN_AGENT,"RRC Trigger is done \n");
|
||||
|
||||
return;
|
||||
|
||||
// error:
|
||||
|
||||
// LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d \n",err_code);
|
||||
/* Free the measurement report received from UE. */
|
||||
// ASN_STRUCT_FREE(asn_DEF_MeasResults, p->meas);
|
||||
/* Free the params. */
|
||||
// free(p);
|
||||
// return -1;
|
||||
}
|
||||
|
||||
|
||||
int flexran_agent_rrc_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags) {
|
||||
if (n_ue > 0) {
|
||||
for (int i = 0; i < n_ue; i++) {
|
||||
const rnti_t rnti = ue_report[i]->rnti;
|
||||
|
||||
/* Check flag for creation of buffer status report */
|
||||
if (ue_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RRC_MEASUREMENTS) {
|
||||
|
||||
/*Source cell EUTRA Measurements*/
|
||||
Protocol__FlexRrcMeasurements *rrc_measurements;
|
||||
rrc_measurements = malloc(sizeof(Protocol__FlexRrcMeasurements));
|
||||
if (rrc_measurements == NULL)
|
||||
goto error;
|
||||
protocol__flex_rrc_measurements__init(rrc_measurements);
|
||||
|
||||
rrc_measurements->measid = flexran_get_rrc_pcell_measid(mod_id, rnti);
|
||||
rrc_measurements->has_measid = 1;
|
||||
|
||||
rrc_measurements->pcell_rsrp = flexran_get_rrc_pcell_rsrp(mod_id, rnti);
|
||||
rrc_measurements->has_pcell_rsrp = 1;
|
||||
|
||||
rrc_measurements->pcell_rsrq = flexran_get_rrc_pcell_rsrq(mod_id, rnti);
|
||||
rrc_measurements->has_pcell_rsrq = 1 ;
|
||||
|
||||
/* Neighbouring cells EUTRA Measurements*/
|
||||
Protocol__FlexNeighCellsMeasurements *neigh_meas;
|
||||
neigh_meas = malloc(sizeof(Protocol__FlexNeighCellsMeasurements));
|
||||
if (neigh_meas == NULL) {
|
||||
free(rrc_measurements);
|
||||
rrc_measurements = NULL;
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_neigh_cells_measurements__init(neigh_meas);
|
||||
|
||||
neigh_meas->n_eutra_meas = flexran_get_rrc_num_ncell(mod_id, rnti);
|
||||
|
||||
Protocol__FlexEutraMeasurements **eutra_meas = NULL;
|
||||
|
||||
if (neigh_meas->n_eutra_meas > 0) {
|
||||
eutra_meas = malloc(sizeof(Protocol__FlexEutraMeasurements) * neigh_meas->n_eutra_meas);
|
||||
if (eutra_meas == NULL) {
|
||||
free(neigh_meas);
|
||||
free(rrc_measurements);
|
||||
rrc_measurements = NULL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ) {
|
||||
eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements));
|
||||
if (eutra_meas[j] == NULL) {
|
||||
for (int k = 0 ; k < j ; k++)
|
||||
free(eutra_meas[k]);
|
||||
free(eutra_meas);
|
||||
free(neigh_meas);
|
||||
free(rrc_measurements);
|
||||
rrc_measurements = NULL;
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_eutra_measurements__init(eutra_meas[j]);
|
||||
|
||||
/* Fill in the physical cell identifier. */
|
||||
eutra_meas[j]->phys_cell_id = flexran_get_rrc_neigh_phy_cell_id(mod_id, rnti, j);
|
||||
eutra_meas[j]->has_phys_cell_id = 1;
|
||||
|
||||
/* The following is not correctly implemented */
|
||||
//if (flexran_get_rrc_neigh_cgi(mod_id, rnti, j)) {
|
||||
// /* Initialize CGI measurements. */
|
||||
// Protocol__FlexEutraCgiMeasurements *cgi_meas;
|
||||
// cgi_meas = malloc(sizeof(Protocol__FlexEutraCgiMeasurements));
|
||||
|
||||
// if (cgi_meas) {
|
||||
// protocol__flex_eutra_cgi_measurements__init(cgi_meas);
|
||||
|
||||
// cgi_meas->tracking_area_code = flexran_get_rrc_neigh_cgi_tac(mod_id, rnti, j);
|
||||
// cgi_meas->has_tracking_area_code = 1;
|
||||
|
||||
// /* EUTRA Cell Global Identity (CGI) */
|
||||
// Protocol__FlexCellGlobalEutraId *cgi;
|
||||
// cgi = malloc(sizeof(Protocol__FlexCellGlobalEutraId));
|
||||
|
||||
// if (cgi) {
|
||||
// protocol__flex_cell_global_eutra_id__init(cgi);
|
||||
|
||||
// cgi->cell_id = flexran_get_rrc_neigh_cgi_cell_id(mod_id, rnti, j);
|
||||
// cgi->has_cell_id = 1;
|
||||
|
||||
// /* PLMN for neighbouring cell */
|
||||
// Protocol__FlexPlmnIdentity *plmn_id;
|
||||
// plmn_id = malloc(sizeof(Protocol__FlexPlmnIdentity));
|
||||
|
||||
// if (plmn_id) {
|
||||
// protocol__flex_plmn_identity__init(plmn_id);
|
||||
|
||||
// plmn_id->mcc = 0;
|
||||
// plmn_id->n_mcc = flexran_get_rrc_neigh_cgi_num_mcc(mod_id, rnti, j);
|
||||
|
||||
// for (int m = 0; m < plmn_id->n_mcc; m++) {
|
||||
// plmn_id->mcc += flexran_get_rrc_neigh_cgi_mcc(mod_id, rnti, j, m);
|
||||
// }
|
||||
|
||||
// plmn_id->mnc = 0;
|
||||
// plmn_id->n_mnc = flexran_get_rrc_neigh_cgi_num_mnc(mod_id, rnti, j);
|
||||
|
||||
// for (int m = 0; m < plmn_id->n_mnc; m++) {
|
||||
// plmn_id->mnc += flexran_get_rrc_neigh_cgi_mnc(mod_id, rnti, j, m);
|
||||
// }
|
||||
|
||||
// cgi->plmn_id = plmn_id;
|
||||
// }
|
||||
// cgi_meas->cgi = cgi;
|
||||
// }
|
||||
// eutra_meas[j]->cgi_meas = cgi_meas;
|
||||
// }
|
||||
//}
|
||||
|
||||
/*RSRP/RSRQ of the neighbouring cell */
|
||||
Protocol__FlexEutraRefSignalMeas *meas_result;
|
||||
meas_result = malloc(sizeof(Protocol__FlexEutraRefSignalMeas));
|
||||
|
||||
if (meas_result) {
|
||||
protocol__flex_eutra_ref_signal_meas__init(meas_result);
|
||||
|
||||
meas_result->rsrp = flexran_get_rrc_neigh_rsrp(mod_id, rnti, j);
|
||||
meas_result->has_rsrp = 1;
|
||||
|
||||
meas_result->rsrq = flexran_get_rrc_neigh_rsrq(mod_id, rnti, j);
|
||||
meas_result->has_rsrq = 1;
|
||||
|
||||
eutra_meas[j]->meas_result = meas_result;
|
||||
}
|
||||
}
|
||||
|
||||
neigh_meas->eutra_meas = eutra_meas;
|
||||
|
||||
rrc_measurements->neigh_meas = neigh_meas;
|
||||
} else {
|
||||
free(neigh_meas);
|
||||
}
|
||||
|
||||
ue_report[i]->rrc_measurements = rrc_measurements;
|
||||
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RRC_MEASUREMENTS;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
error:
|
||||
for (int i = 0; i < n_ue; i++) {
|
||||
if (ue_report[i]->rrc_measurements && ue_report[i]->rrc_measurements->neigh_meas != NULL) {
|
||||
for (int j = 0; j < ue_report[i]->rrc_measurements->neigh_meas->n_eutra_meas; j++) {
|
||||
free(ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]);
|
||||
}
|
||||
free(ue_report[i]->rrc_measurements->neigh_meas);
|
||||
}
|
||||
}
|
||||
|
||||
if (ue_report != NULL)
|
||||
free(ue_report);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexStatsReply *reply)
|
||||
{
|
||||
for (int i = 0; i < reply->n_ue_report; i++){
|
||||
if (reply->ue_report[i]->rrc_measurements && reply->ue_report[i]->rrc_measurements->neigh_meas) {
|
||||
for (int j = 0; j < reply->ue_report[i]->rrc_measurements->neigh_meas->n_eutra_meas; j++) {
|
||||
//if (reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas) {
|
||||
// if (reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas->cgi) {
|
||||
// if (reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas->plmn_id) {
|
||||
// free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas->cgi->plmn_id);
|
||||
// }
|
||||
// free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas->cgi);
|
||||
// }
|
||||
// free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas);
|
||||
//}
|
||||
if (reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->meas_result) {
|
||||
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->meas_result);
|
||||
}
|
||||
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]);
|
||||
}
|
||||
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas);
|
||||
free(reply->ue_report[i]->rrc_measurements->neigh_meas);
|
||||
free(reply->ue_report[i]->rrc_measurements);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_rrc_gtp_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags) {
|
||||
/* This function fills the GTP part of the statistics. The necessary
|
||||
* information is, for our purposes, completely maintained in the RRC layer.
|
||||
* It would be possible to add a GTP module that handles this, though. */
|
||||
if (n_ue > 0) {
|
||||
for (int i = 0; i < n_ue; i++) {
|
||||
const rnti_t rnti = ue_report[i]->rnti;
|
||||
|
||||
/* Check flag for creation of buffer status report */
|
||||
if (ue_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_GTP_STATS) {
|
||||
|
||||
/* get number of rabs for this UE */
|
||||
const int num_e_rab = flexran_agent_rrc_gtp_num_e_rab(mod_id, rnti);
|
||||
Protocol__FlexGtpStats **gtp_stats = NULL;
|
||||
if (num_e_rab > 0) {
|
||||
gtp_stats = calloc(num_e_rab, sizeof(Protocol__FlexGtpStats *));
|
||||
if (!gtp_stats) goto error;
|
||||
for (int r = 0; r < num_e_rab; ++r) {
|
||||
gtp_stats[r] = malloc(sizeof(Protocol__FlexGtpStats));
|
||||
if (!gtp_stats[r]) goto error;
|
||||
protocol__flex_gtp_stats__init(gtp_stats[r]);
|
||||
gtp_stats[r]->e_rab_id = flexran_agent_rrc_gtp_get_e_rab_id(mod_id, rnti, r);
|
||||
gtp_stats[r]->has_e_rab_id = 1;
|
||||
gtp_stats[r]->teid_enb = flexran_agent_rrc_gtp_get_teid_enb(mod_id, rnti, r);
|
||||
gtp_stats[r]->has_teid_enb = 1;
|
||||
gtp_stats[r]->addr_enb = NULL;
|
||||
gtp_stats[r]->teid_sgw = flexran_agent_rrc_gtp_get_teid_sgw(mod_id, rnti, r);
|
||||
gtp_stats[r]->has_teid_sgw = 1;
|
||||
gtp_stats[r]->addr_sgw = NULL;
|
||||
}
|
||||
}
|
||||
ue_report[i]->n_gtp_stats = num_e_rab;
|
||||
ue_report[i]->gtp_stats = gtp_stats;
|
||||
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_GTP_STATS;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
error:
|
||||
for (int i = 0; i < n_ue; i++) {
|
||||
if (!ue_report[i]->gtp_stats) continue;
|
||||
for (int r = 0; r < ue_report[i]->n_gtp_stats; ++r) {
|
||||
if (ue_report[i]->gtp_stats[r]) {
|
||||
free(ue_report[i]->gtp_stats[r]);
|
||||
ue_report[i]->gtp_stats[r] = NULL;
|
||||
}
|
||||
}
|
||||
free(ue_report[i]->gtp_stats);
|
||||
ue_report[i]->gtp_stats = NULL;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int flexran_agent_rrc_gtp_destroy_stats_reply(Protocol__FlexStatsReply *reply) {
|
||||
for (int i = 0; i < reply->n_ue_report; ++i) {
|
||||
if (!reply->ue_report[i]->n_gtp_stats == 0) continue;
|
||||
|
||||
for (int r = 0; r < reply->ue_report[i]->n_gtp_stats; ++r) {
|
||||
//if (reply->ue_report[i]->gtp_stats[r]->addr_enb)
|
||||
// free(reply->ue_report[i]->gtp_stats[r]->addr_enb);
|
||||
//if (reply->ue_report[i]->gtp_stats[r]->addr_sgw)
|
||||
// free(reply->ue_report[i]->gtp_stats[r]->addr_sgw);
|
||||
free(reply->ue_report[i]->gtp_stats[r]);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flexran_agent_fill_rrc_ue_config(mid_t mod_id, rnti_t rnti,
|
||||
Protocol__FlexUeConfig *ue_conf)
|
||||
{
|
||||
if (ue_conf->has_rnti && ue_conf->rnti != rnti) {
|
||||
LOG_E(FLEXRAN_AGENT, "ue_config existing RNTI %x does not match RRC RNTI %x\n",
|
||||
ue_conf->rnti, rnti);
|
||||
return;
|
||||
}
|
||||
ue_conf->has_rnti = 1;
|
||||
ue_conf->rnti = rnti;
|
||||
ue_conf->imsi = flexran_get_ue_imsi(mod_id, rnti);
|
||||
ue_conf->has_imsi = 1;
|
||||
|
||||
//TODO: Set the DRX configuration (optional)
|
||||
//Not supported for now, so we do not set it
|
||||
|
||||
ue_conf->time_alignment_timer = flexran_get_time_alignment_timer(mod_id, rnti);
|
||||
ue_conf->has_time_alignment_timer = 1;
|
||||
|
||||
ue_conf->meas_gap_config_pattern = flexran_get_meas_gap_config(mod_id, rnti);
|
||||
ue_conf->has_meas_gap_config_pattern = 1;
|
||||
|
||||
if(ue_conf->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) {
|
||||
ue_conf->meas_gap_config_sf_offset = flexran_get_meas_gap_config_offset(mod_id, rnti);
|
||||
ue_conf->has_meas_gap_config_sf_offset = 1;
|
||||
}
|
||||
|
||||
//TODO: Set the SPS configuration (Optional)
|
||||
//Not supported for now, so we do not set it
|
||||
|
||||
//TODO: Set the SR configuration (Optional)
|
||||
//We do not set it for now
|
||||
|
||||
//TODO: Set the CQI configuration (Optional)
|
||||
//We do not set it for now
|
||||
|
||||
ue_conf->transmission_mode = flexran_get_ue_transmission_mode(mod_id, rnti);
|
||||
ue_conf->has_transmission_mode = 1;
|
||||
|
||||
Protocol__FlexUeCapabilities *c_capabilities;
|
||||
c_capabilities = malloc(sizeof(Protocol__FlexUeCapabilities));
|
||||
if (c_capabilities) {
|
||||
protocol__flex_ue_capabilities__init(c_capabilities);
|
||||
|
||||
c_capabilities->has_half_duplex = 1;
|
||||
c_capabilities->half_duplex = flexran_get_half_duplex(mod_id, rnti);
|
||||
|
||||
c_capabilities->has_intra_sf_hopping = 1;
|
||||
c_capabilities->intra_sf_hopping = flexran_get_intra_sf_hopping(mod_id, rnti);
|
||||
|
||||
c_capabilities->has_type2_sb_1 = 1;
|
||||
c_capabilities->type2_sb_1 = flexran_get_type2_sb_1(mod_id, rnti);
|
||||
|
||||
c_capabilities->has_ue_category = 1;
|
||||
c_capabilities->ue_category = flexran_get_ue_category(mod_id, rnti);
|
||||
|
||||
c_capabilities->has_res_alloc_type1 = 1;
|
||||
c_capabilities->res_alloc_type1 = flexran_get_res_alloc_type1(mod_id, rnti);
|
||||
|
||||
ue_conf->capabilities = c_capabilities;
|
||||
}
|
||||
|
||||
ue_conf->has_ue_transmission_antenna = 1;
|
||||
ue_conf->ue_transmission_antenna = flexran_get_ue_transmission_antenna(mod_id, rnti);
|
||||
|
||||
ue_conf->has_tti_bundling = 1;
|
||||
ue_conf->tti_bundling = flexran_get_tti_bundling(mod_id, rnti);
|
||||
|
||||
ue_conf->has_max_harq_tx = 1;
|
||||
ue_conf->max_harq_tx = flexran_get_maxHARQ_TX(mod_id, rnti);
|
||||
|
||||
ue_conf->has_beta_offset_ack_index = 1;
|
||||
ue_conf->beta_offset_ack_index = flexran_get_beta_offset_ack_index(mod_id, rnti);
|
||||
|
||||
ue_conf->has_beta_offset_ri_index = 1;
|
||||
ue_conf->beta_offset_ri_index = flexran_get_beta_offset_ri_index(mod_id, rnti);
|
||||
|
||||
ue_conf->has_beta_offset_cqi_index = 1;
|
||||
ue_conf->beta_offset_cqi_index = flexran_get_beta_offset_cqi_index(mod_id, rnti);
|
||||
|
||||
/* assume primary carrier */
|
||||
ue_conf->has_ack_nack_simultaneous_trans = 1;
|
||||
ue_conf->ack_nack_simultaneous_trans = flexran_get_ack_nack_simultaneous_trans(mod_id,0);
|
||||
|
||||
ue_conf->has_simultaneous_ack_nack_cqi = 1;
|
||||
ue_conf->simultaneous_ack_nack_cqi = flexran_get_simultaneous_ack_nack_cqi(mod_id, rnti);
|
||||
|
||||
ue_conf->has_aperiodic_cqi_rep_mode = 1;
|
||||
ue_conf->aperiodic_cqi_rep_mode = flexran_get_aperiodic_cqi_rep_mode(mod_id, rnti);
|
||||
|
||||
ue_conf->has_tdd_ack_nack_feedback = 1;
|
||||
ue_conf->tdd_ack_nack_feedback = flexran_get_tdd_ack_nack_feedback_mode(mod_id, rnti);
|
||||
|
||||
ue_conf->has_ack_nack_repetition_factor = 1;
|
||||
ue_conf->ack_nack_repetition_factor = flexran_get_ack_nack_repetition_factor(mod_id, rnti);
|
||||
|
||||
ue_conf->has_extended_bsr_size = 1;
|
||||
ue_conf->extended_bsr_size = flexran_get_extended_bsr_size(mod_id, rnti);
|
||||
|
||||
Protocol__FlexMeasurementInfo *meas_info;
|
||||
meas_info = malloc(sizeof(Protocol__FlexMeasurementInfo));
|
||||
|
||||
if (meas_info) {
|
||||
protocol__flex_measurement_info__init(meas_info);
|
||||
|
||||
meas_info->has_offset_freq_serving = 1;
|
||||
meas_info->offset_freq_serving = flexran_get_rrc_ofp(mod_id, rnti);
|
||||
|
||||
meas_info->has_offset_freq_neighbouring = 1;
|
||||
meas_info->offset_freq_neighbouring = flexran_get_rrc_ofn(mod_id, rnti);
|
||||
|
||||
int num_adj_cells = flexran_get_rrc_num_adj_cells(mod_id);
|
||||
meas_info->n_cell_individual_offset = num_adj_cells + 1;
|
||||
|
||||
int64_t *cell_individual_offset;
|
||||
if (num_adj_cells > 0) {
|
||||
cell_individual_offset = malloc(sizeof(int64_t)*(num_adj_cells+1));
|
||||
if (cell_individual_offset) {
|
||||
cell_individual_offset[0] = flexran_get_rrc_ocp(mod_id, rnti);
|
||||
for (int i=0; i < num_adj_cells; i++) {
|
||||
cell_individual_offset[i+1] = flexran_get_rrc_ocn(mod_id, rnti,i);
|
||||
}
|
||||
meas_info->cell_individual_offset = cell_individual_offset;
|
||||
}
|
||||
}
|
||||
else {
|
||||
cell_individual_offset = malloc(sizeof(int64_t));
|
||||
if (cell_individual_offset) {
|
||||
*cell_individual_offset = flexran_get_rrc_ocp(mod_id, rnti);
|
||||
meas_info->cell_individual_offset = cell_individual_offset;
|
||||
}
|
||||
}
|
||||
|
||||
meas_info->has_filter_coefficient_rsrp = 1;
|
||||
meas_info->filter_coefficient_rsrp = flexran_get_filter_coeff_rsrp(mod_id, rnti);
|
||||
|
||||
meas_info->has_filter_coefficient_rsrq = 1;
|
||||
meas_info->filter_coefficient_rsrq = flexran_get_filter_coeff_rsrq(mod_id, rnti);
|
||||
|
||||
Protocol__FlexMeasurementEvent *event;
|
||||
event = malloc(sizeof(Protocol__FlexMeasurementEvent));
|
||||
|
||||
if (event) {
|
||||
protocol__flex_measurement_event__init(event);
|
||||
Protocol__FlexA3Event *a3_event;
|
||||
a3_event = malloc(sizeof(Protocol__FlexA3Event));
|
||||
if (a3_event) {
|
||||
protocol__flex_a3_event__init(a3_event);
|
||||
a3_event->has_a3_offset = 1;
|
||||
a3_event->a3_offset = flexran_get_rrc_a3_event_a3_offset(mod_id, rnti);
|
||||
|
||||
a3_event->has_report_on_leave = 1;
|
||||
a3_event->report_on_leave = flexran_get_rrc_a3_event_reportOnLeave(mod_id, rnti);
|
||||
|
||||
a3_event->has_hysteresis = 1;
|
||||
a3_event->hysteresis = flexran_get_rrc_a3_event_hysteresis(mod_id, rnti);
|
||||
|
||||
a3_event->has_time_to_trigger = 1;
|
||||
a3_event->time_to_trigger = flexran_get_rrc_a3_event_timeToTrigger(mod_id, rnti);
|
||||
|
||||
a3_event->has_max_report_cells = 1;
|
||||
a3_event->max_report_cells = flexran_get_rrc_a3_event_maxReportCells(mod_id, rnti);
|
||||
event->a3 = a3_event;
|
||||
}
|
||||
meas_info->event = event;
|
||||
}
|
||||
ue_conf->info = meas_info;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_agent_register_rrc_xface(mid_t mod_id)
|
||||
{
|
||||
if (agent_rrc_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "RRC agent for eNB %d is already registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
AGENT_RRC_xface *xface = malloc(sizeof(AGENT_RRC_xface));
|
||||
if (!xface) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not allocate memory for RRC agent xface %d\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// xface->flexran_agent_send_update_rrc_stats = flexran_agent_send_update_rrc_stats;
|
||||
|
||||
xface->flexran_agent_notify_ue_state_change = flexran_agent_ue_state_change;
|
||||
xface->flexran_trigger_rrc_measurements = flexran_trigger_rrc_measurements;
|
||||
|
||||
agent_rrc_xface[mod_id] = xface;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flexran_agent_fill_rrc_cell_config(mid_t mod_id, uint8_t cc_id,
|
||||
Protocol__FlexCellConfig *conf) {
|
||||
|
||||
if (!conf->si_config) {
|
||||
conf->si_config = malloc(sizeof(Protocol__FlexSiConfig));
|
||||
if (conf->si_config)
|
||||
protocol__flex_si_config__init(conf->si_config);
|
||||
}
|
||||
|
||||
if (conf->si_config) {
|
||||
// TODO THIS IS DU RRC
|
||||
conf->si_config->sib1_length = flexran_get_sib1_length(mod_id, cc_id);
|
||||
conf->si_config->has_sib1_length = 1;
|
||||
|
||||
conf->si_config->si_window_length = (uint32_t) flexran_get_si_window_length(mod_id, cc_id);
|
||||
conf->si_config->has_si_window_length = 1;
|
||||
|
||||
conf->si_config->n_si_message = 0;
|
||||
|
||||
/* Protocol__FlexSiMessage **si_message; */
|
||||
/* si_message = malloc(sizeof(Protocol__FlexSiMessage *) * si_config->n_si_message); */
|
||||
/* if(si_message == NULL) */
|
||||
/* goto error; */
|
||||
/* for(j = 0; j < si_config->n_si_message; j++){ */
|
||||
/* si_message[j] = malloc(sizeof(Protocol__FlexSiMessage)); */
|
||||
/* if(si_message[j] == NULL) */
|
||||
/* goto error; */
|
||||
/* protocol__flex_si_message__init(si_message[j]); */
|
||||
/* //TODO: Fill in with actual value, Periodicity of SI msg in radio frames */
|
||||
/* si_message[j]->periodicity = 1; //SIPeriod */
|
||||
/* si_message[j]->has_periodicity = 1; */
|
||||
/* //TODO: Fill in with actual value, rhe length of the SI message in bytes */
|
||||
/* si_message[j]->length = 10; */
|
||||
/* si_message[j]->has_length = 1; */
|
||||
/* } */
|
||||
/* if(si_config->n_si_message > 0){ */
|
||||
/* si_config->si_message = si_message; */
|
||||
/* } */
|
||||
}
|
||||
|
||||
conf->ra_response_window_size = flexran_get_ra_ResponseWindowSize(mod_id, cc_id);
|
||||
conf->has_ra_response_window_size = 1;
|
||||
|
||||
// belongs to MAC but is read in RRC
|
||||
conf->mac_contention_resolution_timer = flexran_get_mac_ContentionResolutionTimer(mod_id, cc_id);
|
||||
conf->has_mac_contention_resolution_timer = 1;
|
||||
|
||||
conf->ul_pusch_power = flexran_agent_get_operating_pusch_p0 (mod_id, cc_id);
|
||||
conf->has_ul_pusch_power = 1;
|
||||
|
||||
conf->n_plmn_id = flexran_get_rrc_num_plmn_ids(mod_id);
|
||||
conf->plmn_id = calloc(conf->n_plmn_id, sizeof(Protocol__FlexPlmn *));
|
||||
if (conf->plmn_id) {
|
||||
for (int i = 0; i < conf->n_plmn_id; i++) {
|
||||
conf->plmn_id[i] = malloc(sizeof(Protocol__FlexPlmn));
|
||||
if (!conf->plmn_id[i]) continue;
|
||||
protocol__flex_plmn__init(conf->plmn_id[i]);
|
||||
conf->plmn_id[i]->mcc = flexran_get_rrc_mcc(mod_id, i);
|
||||
conf->plmn_id[i]->has_mcc = 1;
|
||||
conf->plmn_id[i]->mnc = flexran_get_rrc_mnc(mod_id, i);
|
||||
conf->plmn_id[i]->has_mnc = 1;
|
||||
conf->plmn_id[i]->mnc_length = flexran_get_rrc_mnc_digit_length(mod_id, i);
|
||||
conf->plmn_id[i]->has_mnc_length = 1;
|
||||
}
|
||||
} else {
|
||||
conf->n_plmn_id = 0;
|
||||
}
|
||||
|
||||
conf->x2_ho_net_control = flexran_get_x2_ho_net_control(mod_id);
|
||||
conf->has_x2_ho_net_control = 1;
|
||||
}
|
||||
|
||||
int flexran_agent_unregister_rrc_xface(mid_t mod_id)
|
||||
{
|
||||
if (!agent_rrc_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "RRC agent for eNB %d is not registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
//xface->agent_ctxt = NULL;
|
||||
// xface->flexran_agent_send_update_rrc_stats = NULL;
|
||||
|
||||
agent_rrc_xface[mod_id]->flexran_agent_notify_ue_state_change = NULL;
|
||||
agent_rrc_xface[mod_id]->flexran_trigger_rrc_measurements = NULL;
|
||||
free(agent_rrc_xface[mod_id]);
|
||||
agent_rrc_xface[mod_id] = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_rrc.h
|
||||
* \brief FlexRAN agent Control Module RRC header
|
||||
* \author shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_RRC_H_
|
||||
#define FLEXRAN_AGENT_RRC_H_
|
||||
|
||||
#include "header.pb-c.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "stats_messages.pb-c.h"
|
||||
#include "stats_common.pb-c.h"
|
||||
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_rrc_defs.h"
|
||||
// for flexran_agent_get_rrc_xface()
|
||||
#include "flexran_agent_extern.h"
|
||||
|
||||
|
||||
/* UE state change message constructor and destructor */
|
||||
void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change);
|
||||
int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg);
|
||||
|
||||
|
||||
/**********************************
|
||||
* FlexRAN agent - technology RRC API
|
||||
**********************************/
|
||||
|
||||
/* Send to the controller all the rrc stat updates that occured during this subframe*/
|
||||
// void flexran_agent_send_update_rrc_stats(mid_t mod_id);
|
||||
|
||||
/* this is called by RRC as a part of rrc xface . The controller previously requested this*/
|
||||
void flexran_trigger_rrc_measurements (mid_t mod_id, LTE_MeasResults_t *);
|
||||
|
||||
/* Statistics reply protocol message constructor and destructor */
|
||||
int flexran_agent_rrc_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags);
|
||||
int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexStatsReply *reply);
|
||||
|
||||
/* Statistic reply for GTP statistics which OAI stores also in the RRC layer.
|
||||
* This might be moved to a separate GTP module in the future */
|
||||
int flexran_agent_rrc_gtp_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags);
|
||||
int flexran_agent_rrc_gtp_destroy_stats_reply(Protocol__FlexStatsReply *reply);
|
||||
|
||||
/* Fill the RRC part of a ue_config message */
|
||||
void flexran_agent_fill_rrc_ue_config(mid_t mod_id, rnti_t rnti,
|
||||
Protocol__FlexUeConfig *ue_conf);
|
||||
|
||||
/* Fill the RRC part of an cell_config message */
|
||||
void flexran_agent_fill_rrc_cell_config(mid_t mod_id, uint8_t cc_id,
|
||||
Protocol__FlexCellConfig *conf);
|
||||
|
||||
/*Register technology specific interface callbacks*/
|
||||
int flexran_agent_register_rrc_xface(mid_t mod_id);
|
||||
|
||||
/*Unregister technology specific callbacks*/
|
||||
int flexran_agent_unregister_rrc_xface(mid_t mod_id);
|
||||
|
||||
#endif
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
|
||||
/*! \file flexran_agent_rrc_defs.h
|
||||
* \brief FlexRAN agent - RRC interface primitives
|
||||
* \author shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \mail
|
||||
*/
|
||||
|
||||
#ifndef __FLEXRAN_AGENT_RRC_PRIMITIVES_H__
|
||||
#define __FLEXRAN_AGENT_RRC_PRIMITIVES_H__
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "header.pb-c.h"
|
||||
#include "LTE_MeasResults.h"
|
||||
|
||||
#define RINGBUFFER_SIZE 100
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t rnti;
|
||||
int32_t meas_id;
|
||||
int32_t rsrp;
|
||||
int32_t rsrq;
|
||||
|
||||
/*To Be Extended*/
|
||||
}rrc_meas_stats;
|
||||
|
||||
|
||||
|
||||
/* FLEXRAN AGENT-RRC Interface */
|
||||
typedef struct {
|
||||
|
||||
|
||||
/// Notify the controller for a state change of a particular UE, by sending the proper
|
||||
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
|
||||
void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
|
||||
uint8_t state_change);
|
||||
|
||||
void (*flexran_trigger_rrc_measurements)(mid_t mod_id, LTE_MeasResults_t* measResults);
|
||||
|
||||
} AGENT_RRC_xface;
|
||||
|
||||
#endif
|
||||
@@ -1,147 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "flexran_agent_rrc_internal.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
|
||||
int update_rrc_reconfig(mid_t mod_id, rnti_t rnti, Protocol__FlexRrcTriggering *trigg) {
|
||||
|
||||
// Measurement info reconfiguration
|
||||
|
||||
if (trigg->meas_info) {
|
||||
|
||||
/* Set serving cell frequency offset */
|
||||
if (trigg->meas_info->has_offset_freq_serving) {
|
||||
if (flexran_set_rrc_ofp(mod_id, rnti, trigg->meas_info->offset_freq_serving) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set Serving cell frequency offset\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set neighbouring cell frequency offset */
|
||||
if (trigg->meas_info->has_offset_freq_neighbouring) {
|
||||
if (flexran_set_rrc_ofn(mod_id, rnti, trigg->meas_info->offset_freq_neighbouring) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell frequency offset\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (trigg->meas_info->n_cell_individual_offset > 0) {
|
||||
/* Set the serving cell offset */
|
||||
if (flexran_set_rrc_ocp(mod_id, rnti, trigg->meas_info->cell_individual_offset[0]) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set Serving cell offset\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Set the neighbouring cell offset */
|
||||
for (int i=0; i<(trigg->meas_info->n_cell_individual_offset-1); i++) {
|
||||
if (flexran_set_rrc_ocn(mod_id, rnti, i, trigg->meas_info->cell_individual_offset[i+1]) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell offset\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (trigg->meas_info->has_offset_freq_neighbouring) {
|
||||
if (flexran_set_rrc_ofn(mod_id, rnti, trigg->meas_info->offset_freq_neighbouring) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell frequency offset\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Set rsrp filter coefficient */
|
||||
if (trigg->meas_info->has_filter_coefficient_rsrp) {
|
||||
if (flexran_set_filter_coeff_rsrp(mod_id, rnti, trigg->meas_info->filter_coefficient_rsrp) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set RSRP filter coefficient\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set rsrq filter coefficient */
|
||||
if (trigg->meas_info->has_filter_coefficient_rsrq) {
|
||||
if (flexran_set_filter_coeff_rsrq(mod_id, rnti, trigg->meas_info->filter_coefficient_rsrq) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set RSRQ filter coefficient\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (trigg->meas_info->event) {
|
||||
|
||||
/* Set Periodic event parameters */
|
||||
if (trigg->meas_info->event->periodical) {
|
||||
|
||||
/* Set Periodic event maximum number of reported cells */
|
||||
if (trigg->meas_info->event->periodical->has_max_report_cells) {
|
||||
if (flexran_set_rrc_per_event_maxReportCells(mod_id, rnti, trigg->meas_info->event->periodical->max_report_cells) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set Periodic event max\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Set A3 event parameters */
|
||||
if (trigg->meas_info->event->a3) {
|
||||
|
||||
/* Set A3 event a3 offset */
|
||||
if (trigg->meas_info->event->a3->has_a3_offset) {
|
||||
if (flexran_set_rrc_a3_event_a3_offset(mod_id, rnti, trigg->meas_info->event->a3->a3_offset) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event offset\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set A3 event report on leave */
|
||||
if (trigg->meas_info->event->a3->has_report_on_leave) {
|
||||
if (flexran_set_rrc_a3_event_reportOnLeave(mod_id, rnti, trigg->meas_info->event->a3->report_on_leave) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event report on leave\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set A3 event hysteresis */
|
||||
if (trigg->meas_info->event->a3->has_hysteresis) {
|
||||
if (flexran_set_rrc_a3_event_hysteresis(mod_id, rnti, trigg->meas_info->event->a3->hysteresis) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event hysteresis\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set A3 event time to trigger */
|
||||
if (trigg->meas_info->event->a3->has_time_to_trigger) {
|
||||
if (flexran_set_rrc_a3_event_timeToTrigger(mod_id, rnti, trigg->meas_info->event->a3->time_to_trigger) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event time to trigger\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set A3 event maximum number of reported cells */
|
||||
if (trigg->meas_info->event->a3->has_max_report_cells) {
|
||||
if (flexran_set_rrc_a3_event_maxReportCells(mod_id, rnti, trigg->meas_info->event->a3->max_report_cells) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event max report cells\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_RRC_INTERNAL_H_
|
||||
#define FLEXRAN_AGENT_RRC_INTERNAL_H_
|
||||
|
||||
#include "flexran_agent_rrc_internal.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
|
||||
int update_rrc_reconfig(mid_t mod_id, rnti_t rnti, Protocol__FlexRrcTriggering *trigg);
|
||||
|
||||
#endif /*FLEXRAN_AGENT_RRC_INTERNAL_H_*/
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_s1ap.c
|
||||
* \brief FlexRAN agent Control Module S1AP
|
||||
* \author Navid Nikaein
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_s1ap.h"
|
||||
|
||||
|
||||
/*Array containing the Agent-S1AP interfaces*/
|
||||
AGENT_S1AP_xface *agent_s1ap_xface[NUM_MAX_ENB];
|
||||
|
||||
void flexran_agent_fill_s1ap_cell_config(mid_t mod_id,
|
||||
Protocol__FlexS1apConfig **s1ap_config) {
|
||||
*s1ap_config = malloc(sizeof(Protocol__FlexS1apConfig));
|
||||
if (!*s1ap_config) return;
|
||||
protocol__flex_s1ap_config__init(*s1ap_config);
|
||||
LOG_D(FLEXRAN_AGENT, "flexran_agent_fill_s1ap_cell_config %d\n", mod_id);
|
||||
|
||||
// S1AP status
|
||||
(*s1ap_config)->has_pending = 1;
|
||||
(*s1ap_config)->pending = flexran_get_s1ap_mme_pending(mod_id);
|
||||
|
||||
(*s1ap_config)->has_connected = 1;
|
||||
(*s1ap_config)->connected = flexran_get_s1ap_mme_connected(mod_id);
|
||||
|
||||
(*s1ap_config)->enb_s1_ip = flexran_get_s1ap_enb_s1_ip(mod_id);
|
||||
if (!(*s1ap_config)->enb_s1_ip)
|
||||
(*s1ap_config)->enb_s1_ip = "";
|
||||
|
||||
(*s1ap_config)->enb_name = flexran_get_s1ap_enb_name(mod_id);
|
||||
|
||||
(*s1ap_config)->mme = NULL;
|
||||
(*s1ap_config)->n_mme = flexran_get_s1ap_nb_mme(mod_id);
|
||||
if ((*s1ap_config)->n_mme > 0) {
|
||||
Protocol__FlexS1apMme **mme_conf = calloc((*s1ap_config)->n_mme,
|
||||
sizeof(Protocol__FlexS1apMme *));
|
||||
AssertFatal(mme_conf, "%s(): MME malloc failed\n", __func__);
|
||||
for(int i = 0; i < (*s1ap_config)->n_mme; i++){
|
||||
mme_conf[i] = malloc(sizeof(Protocol__FlexS1apMme));
|
||||
AssertFatal(mme_conf[i], "%s(): MME malloc failed\n", __func__);
|
||||
protocol__flex_s1ap_mme__init(mme_conf[i]);
|
||||
if (flexran_get_s1ap_mme_conf(mod_id, i, mme_conf[i]) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT,
|
||||
"error in flexran_get_s1ap_mme_conf(): cannot retrieve MME state\n");
|
||||
(*s1ap_config)->n_mme = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
(*s1ap_config)->mme = mme_conf;
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_agent_s1ap_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags) {
|
||||
if (n_ue <= 0)
|
||||
return 0;
|
||||
if (!(ue_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_S1AP_STATS))
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < n_ue; i++) {
|
||||
const rnti_t rnti = ue_report[i]->rnti;
|
||||
Protocol__FlexS1apUe *ue = malloc(sizeof(Protocol__FlexS1apUe));
|
||||
AssertFatal(ue, "%s(): MME malloc failed\n", __func__);
|
||||
protocol__flex_s1ap_ue__init(ue);
|
||||
if (flexran_get_s1ap_ue(mod_id, rnti, ue) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "error in %s(): cannot retrieve UE conf\n", __func__);
|
||||
break;
|
||||
}
|
||||
ue_report[i]->s1ap_stats = ue;
|
||||
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_S1AP_STATS;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flexran_agent_free_s1ap_cell_config(Protocol__FlexS1apConfig **s1ap) {
|
||||
for (int i = 0; i < (*s1ap)->n_mme; i++) {
|
||||
/* following structures allocated in the RAN API */
|
||||
for(int j = 0; j < (*s1ap)->mme[i]->n_served_gummeis; j++) {
|
||||
free((*s1ap)->mme[i]->served_gummeis[j]->plmn);
|
||||
free((*s1ap)->mme[i]->served_gummeis[j]);
|
||||
}
|
||||
free((*s1ap)->mme[i]->served_gummeis);
|
||||
for (int j = 0; j < (*s1ap)->mme[i]->n_requested_plmns; j++)
|
||||
free((*s1ap)->mme[i]->requested_plmns[j]);
|
||||
free((*s1ap)->mme[i]->requested_plmns);
|
||||
free((*s1ap)->mme[i]);
|
||||
}
|
||||
free((*s1ap)->mme);
|
||||
free(*s1ap);
|
||||
*s1ap = NULL;
|
||||
}
|
||||
|
||||
void flexran_agent_s1ap_destroy_stats_reply(Protocol__FlexStatsReply *reply) {
|
||||
for (int i = 0; i < reply->n_ue_report; ++i) {
|
||||
if (!reply->ue_report[i]->s1ap_stats)
|
||||
continue;
|
||||
free(reply->ue_report[i]->s1ap_stats->selected_plmn);
|
||||
free(reply->ue_report[i]->s1ap_stats);
|
||||
reply->ue_report[i]->s1ap_stats = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void flexran_agent_handle_mme_update(mid_t mod_id,
|
||||
size_t n_mme,
|
||||
Protocol__FlexS1apMme **mme) {
|
||||
if (n_mme == 0 || n_mme > 1) {
|
||||
LOG_E(FLEXRAN_AGENT, "cannot handle %lu MMEs yet\n", n_mme);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mme[0]->s1_ip) {
|
||||
LOG_E(FLEXRAN_AGENT, "no S1 IP present, cannot handle request\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mme[0]->has_state
|
||||
&& mme[0]->state == PROTOCOL__FLEX_MME_STATE__FLMMES_DISCONNECTED) {
|
||||
int rc = flexran_remove_s1ap_mme(mod_id, 1, &mme[0]->s1_ip);
|
||||
if (rc == 0)
|
||||
LOG_I(FLEXRAN_AGENT, "remove MME at IP %s\n", mme[0]->s1_ip);
|
||||
else
|
||||
LOG_W(FLEXRAN_AGENT,
|
||||
"could not remove MME: flexran_remove_s1ap_mme() returned %d\n",
|
||||
rc);
|
||||
} else {
|
||||
int rc = flexran_add_s1ap_mme(mod_id, 1, &mme[0]->s1_ip);
|
||||
if (rc == 0)
|
||||
LOG_I(FLEXRAN_AGENT, "add MME at IP %s\n", mme[0]->s1_ip);
|
||||
else
|
||||
LOG_W(FLEXRAN_AGENT,
|
||||
"could not add MME: flexran_add_s1ap_mme() returned %d\n",
|
||||
rc);
|
||||
}
|
||||
}
|
||||
|
||||
void flexran_agent_handle_plmn_update(mid_t mod_id,
|
||||
int CC_id,
|
||||
size_t n_plmn,
|
||||
Protocol__FlexPlmn **plmn_id) {
|
||||
if (n_plmn < 1 || n_plmn > 6) {
|
||||
LOG_E(FLEXRAN_AGENT, "cannot handle %lu PLMNs\n", n_plmn);
|
||||
return;
|
||||
}
|
||||
|
||||
/* We assume the controller has checked all the parameters within each
|
||||
* plmn_id */
|
||||
int rc = flexran_set_new_plmn_id(mod_id, CC_id, n_plmn, plmn_id);
|
||||
if (rc == 0) {
|
||||
LOG_I(FLEXRAN_AGENT, "set %lu new PLMNs:\n", n_plmn);
|
||||
for (int i = 0; i < (int)n_plmn; ++i)
|
||||
LOG_I(FLEXRAN_AGENT, " MCC %d MNC %d MNC length %d\n",
|
||||
plmn_id[i]->mcc, plmn_id[i]->mnc, plmn_id[0]->mnc_length);
|
||||
} else {
|
||||
LOG_W(FLEXRAN_AGENT,
|
||||
"could not set new PLMN configuration: flexran_set_new_plmn_id() returned %d\n",
|
||||
rc);
|
||||
}
|
||||
}
|
||||
|
||||
int flexran_agent_register_s1ap_xface(mid_t mod_id) {
|
||||
if (agent_s1ap_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "S1AP agent CM for eNB %d is already registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
AGENT_S1AP_xface *xface = malloc(sizeof(AGENT_S1AP_xface));
|
||||
if (!xface) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not allocate memory for S1AP agent xface %d\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// not implemented yet
|
||||
xface->flexran_s1ap_notify_release_request=NULL;
|
||||
|
||||
agent_s1ap_xface[mod_id] = xface;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_unregister_s1ap_xface(mid_t mod_id) {
|
||||
if (!agent_s1ap_xface[mod_id]) {
|
||||
LOG_E(FLEXRAN_AGENT, "S1AP agent for eNB %d is not registered\n", mod_id);
|
||||
return -1;
|
||||
}
|
||||
agent_s1ap_xface[mod_id]->flexran_s1ap_notify_release_request=NULL;
|
||||
free(agent_s1ap_xface[mod_id]);
|
||||
agent_s1ap_xface[mod_id] = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
AGENT_S1AP_xface *flexran_agent_get_s1ap_xface(mid_t mod_id) {
|
||||
return agent_s1ap_xface[mod_id];
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_s1ap.h
|
||||
* \brief FlexRAN agent S1AP Control Module
|
||||
* \author navid nikaein
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_S1AP_H_
|
||||
#define FLEXRAN_AGENT_S1AP_H_
|
||||
|
||||
#include "header.pb-c.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "stats_messages.pb-c.h"
|
||||
#include "stats_common.pb-c.h"
|
||||
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_s1ap_defs.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
|
||||
/***************************************
|
||||
* FlexRAN agent - technology S1AP API *
|
||||
***************************************/
|
||||
|
||||
/* Send to the controller all the S1AP configs */
|
||||
void flexran_agent_fill_s1ap_cell_config(mid_t mod_id,
|
||||
Protocol__FlexS1apConfig **s1ap_config);
|
||||
|
||||
/* Free allocated S1AP cell configs */
|
||||
void flexran_agent_free_s1ap_cell_config(Protocol__FlexS1apConfig **s1ap);
|
||||
|
||||
/* Fill the stats message for S1AP */
|
||||
int flexran_agent_s1ap_stats_reply(mid_t mod_id,
|
||||
Protocol__FlexUeStatsReport **ue_report,
|
||||
int n_ue,
|
||||
uint32_t ue_flags);
|
||||
|
||||
/* Free allocated S1AP stats message */
|
||||
void flexran_agent_s1ap_destroy_stats_reply(Protocol__FlexStatsReply *reply);
|
||||
|
||||
/* Add or remove MME updates */
|
||||
void flexran_agent_handle_mme_update(mid_t mod_id,
|
||||
size_t n_mme,
|
||||
Protocol__FlexS1apMme **mme);
|
||||
|
||||
/* Set a new PLMN configuration */
|
||||
void flexran_agent_handle_plmn_update(mid_t mod_id,
|
||||
int CC_id,
|
||||
size_t n_plmn,
|
||||
Protocol__FlexPlmn **plmn_id);
|
||||
|
||||
/* Register technology specific interface callbacks */
|
||||
int flexran_agent_register_s1ap_xface(mid_t mod_id);
|
||||
|
||||
/* Unregister technology specific callbacks */
|
||||
int flexran_agent_unregister_s1ap_xface(mid_t mod_id);
|
||||
|
||||
#endif
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#ifndef __FLEXRAN_AGENT_S1AP_PRIMITIVES_H__
|
||||
#define __FLEXRAN_AGENT_S1AP_PRIMITIVES_H__
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
|
||||
/* FLEXRAN AGENT-S1AP Interface */
|
||||
typedef struct {
|
||||
// S1AP statistics
|
||||
void (*flexran_s1ap_notify_release_request)(mid_t mod_id);
|
||||
} AGENT_S1AP_xface;
|
||||
|
||||
#endif
|
||||
@@ -1,311 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
//
|
||||
// Cell config related structures and enums
|
||||
//
|
||||
|
||||
message flex_si_config {
|
||||
optional uint32 sfn = 1;
|
||||
optional uint32 sib1_length = 2; // The length of SIB1 in bytes
|
||||
optional uint32 si_window_length = 3; // The scheduling window for all SIs in SF
|
||||
repeated flex_si_message si_message = 4; // List of SI messages to be sent.
|
||||
// The index identifies the type of an SI message
|
||||
// 0 - SIB1
|
||||
// 1..31 - SIx
|
||||
// 32..63 - PCCH
|
||||
}
|
||||
|
||||
message flex_si_message {
|
||||
optional uint32 periodicity = 1; // Periodicity of SI msg in radio frames
|
||||
optional uint32 length = 2; // The length of the SI message in bytes
|
||||
}
|
||||
|
||||
enum flex_hopping_mode {
|
||||
FLHM_INTER = 0;
|
||||
FLHM_INTERINTRA = 1;
|
||||
}
|
||||
|
||||
enum flex_phich_resource {
|
||||
FLPR_ONE_SIXTH = 0;
|
||||
FLPR_HALF = 1;
|
||||
FLPR_ONE = 2;
|
||||
FLPR_TWO = 3;
|
||||
}
|
||||
|
||||
enum flex_phich_duration {
|
||||
FLPD_NORMAL = 0;
|
||||
FLPD_EXTENDED = 1;
|
||||
}
|
||||
|
||||
enum flex_ul_cyclic_prefix_length {
|
||||
FLUCPL_NORMAL = 0;
|
||||
FLUCPL_EXTENDED = 1;
|
||||
}
|
||||
|
||||
enum flex_dl_cyclic_prefix_length {
|
||||
FLDCPL_NORMAL = 0;
|
||||
FLDCPL_EXTENDED = 1;
|
||||
}
|
||||
|
||||
enum flex_duplex_mode {
|
||||
FLDM_TDD = 0;
|
||||
FLDM_FDD = 1;
|
||||
}
|
||||
|
||||
enum flex_qam {
|
||||
FLEQ_MOD_16QAM = 0;
|
||||
FLEQ_MOD_64QAM = 1;
|
||||
}
|
||||
|
||||
//
|
||||
// Slice config related structures and enums
|
||||
//
|
||||
enum flex_slice_algorithm {
|
||||
None = 0;
|
||||
Static = 1;
|
||||
NVS = 2;
|
||||
}
|
||||
|
||||
message flex_slice_static {
|
||||
optional uint32 posLow = 1;
|
||||
optional uint32 posHigh = 2;
|
||||
}
|
||||
|
||||
message flex_slice {
|
||||
optional uint32 id = 1;
|
||||
optional string label = 2;
|
||||
optional string scheduler = 3;
|
||||
oneof params {
|
||||
flex_slice_static static = 10;
|
||||
}
|
||||
}
|
||||
|
||||
message flex_slice_dl_ul_config {
|
||||
optional flex_slice_algorithm algorithm = 1;
|
||||
repeated flex_slice slices = 2;
|
||||
optional string scheduler = 3; // if no slicing
|
||||
}
|
||||
|
||||
//
|
||||
// UE config related structures and enums
|
||||
//
|
||||
|
||||
message flex_drx_config {
|
||||
optional uint32 on_duration_timer = 1; // Timer in SF. See TS 36.321
|
||||
optional uint32 drx_inactivity_timer = 2; // Timer in SF. See TS 36.321
|
||||
optional uint32 drx_retransmission_timer = 3; // Timer in SF. See TS 36.321
|
||||
optional uint32 long_drx_cycle = 4; // In SF. See TS 36.321
|
||||
optional uint32 long_drx_cycle_start_offset = 5;// See TS 36.321
|
||||
optional uint32 short_drx_cycle = 6; // In SF
|
||||
optional uint32 drx_short_cycle_timer = 7; // Timer in subframes. See TS 36.321
|
||||
}
|
||||
|
||||
message flex_sps_config {
|
||||
optional uint32 semi_persistent_sched_interval_UL = 1; // SPS UL scheduling interval in SF
|
||||
optional uint32 semi_persistent_sched_interval_DL = 2; // SPS DL scheduling interval in SF
|
||||
optional uint32 num_of_conf_sps_proc = 3; // Number of SPS HARQ processes. See TS 36.321
|
||||
repeated uint32 n1_PUCCH_AN_persistent_element = 4;// See TS36.213. Ignored when config is used
|
||||
// as part of FLPT_SET_UE_CONFIG
|
||||
optional uint32 implicit_release_after = 5; // number of empty transmissions before release of SPS
|
||||
}
|
||||
|
||||
message flex_sr_config {
|
||||
optional uint32 sr_action = 1; // Indicates if SR config should be changed or released
|
||||
// One of the FLSRA_* enum values
|
||||
optional uint32 sched_interval = 2; // SR scheduling interval in SF
|
||||
optional uint32 dsr_trans_max = 3; // See TS 36.213
|
||||
}
|
||||
|
||||
message flex_cqi_config {
|
||||
optional uint32 cqi_action = 1; // Indicats if CQI changed or released.
|
||||
// One of the FLSRA_* enum values
|
||||
optional uint32 cqi_sched_interval = 2; // CQI scheduling interval in SF
|
||||
optional uint32 ri_sched_interval = 3; // RI scheduling interval in SF
|
||||
}
|
||||
|
||||
message flex_ue_capabilities {
|
||||
optional uint32 half_duplex = 1; // Boolean value. Only half duplex support. FDD operation
|
||||
optional uint32 intra_SF_hopping = 2; // Support for intra-subframe hopping. Boolean value
|
||||
optional uint32 type2_sb_1 = 3; // Support for type 2 hopping with n_sb > 1
|
||||
optional uint32 ue_category = 4;
|
||||
optional uint32 res_alloc_type1 = 5; // Boolean value. UE support for resource allocation type 1
|
||||
}
|
||||
|
||||
message flex_scell_config {
|
||||
optional uint32 carrier_index = 1; // Id of the carrier component
|
||||
optional uint32 scell_index = 2; // Index of this Scell (RRC SCellIndex)
|
||||
optional uint32 use_ccs = 3; // Boolean value. Indicates if cross-carrier scheduling
|
||||
// is used by this SCell
|
||||
optional uint32 sched_cell_index = 4; // Index of the cell responsible for scheduling
|
||||
// this SCell if cross-carrier scheduling is enabled
|
||||
optional uint32 pdsch_start = 5; // Starting OFDM symbol of PDSCH data region for this SCell
|
||||
}
|
||||
|
||||
enum flex_meas_gap_config_pattern {
|
||||
FLMGCP_GP1 = 0;
|
||||
FLMGCP_GP2 = 1;
|
||||
FLMGCP_OFF = 2;
|
||||
}
|
||||
|
||||
enum flex_setup_release_action {
|
||||
FLSRA_SETUP = 0;
|
||||
FLSRA_RELEASE = 1;
|
||||
}
|
||||
|
||||
enum flex_ue_transmission_antenna {
|
||||
FLUTA_NONE = 0;
|
||||
FLUTA_OPEN_LOOP = 1;
|
||||
FLUTA_CLOSED_LOOP = 2;
|
||||
}
|
||||
|
||||
enum flex_aperiodic_cqi_report_mode {
|
||||
FLACRM_RM12 = 0;
|
||||
FLACRM_RM20 = 1;
|
||||
FLACRM_RM22 = 2;
|
||||
FLACRM_RM30 = 3;
|
||||
FLACRM_RM31 = 4;
|
||||
FLACRM_NONE = 5;
|
||||
FLACRM_RM32_v1250 = 6;
|
||||
FLACRM_RM10_v1310 = 7;
|
||||
FLACRM_RM11_v1310 = 8;
|
||||
}
|
||||
|
||||
enum flex_tdd_ack_nack_feedback_mode {
|
||||
FLTANFM_BUNDLING = 0;
|
||||
FLTANFM_MULTIPLEXING = 1;
|
||||
}
|
||||
|
||||
//
|
||||
// Logical channel config related structures and enums
|
||||
//
|
||||
|
||||
message flex_lc_config {
|
||||
optional uint32 lcid = 1; // The logical channel id
|
||||
optional uint32 lcg = 2; // The logical channel group (0..3) the LC is mapped to
|
||||
optional uint32 direction = 3; // The LC direction. One of the FLLCD_* enum values
|
||||
optional uint32 qos_bearer_type = 4;// GBR or NGBR bearer. One of the FLQBT_* enum values
|
||||
optional uint32 qci = 5; // The QCI defined in TS 23.203, coded as defined in TS 36.413
|
||||
// One less than the actual QCI value
|
||||
optional uint64 e_RAB_max_bitrate_UL = 6; // In bps (GBR only)
|
||||
optional uint64 e_RAB_max_bitrate_DL = 7; // In bps (GBR only)
|
||||
optional uint64 e_RAB_guaranteed_bitrate_UL = 8; // In bps (GBR only)
|
||||
optional uint64 e_RAB_guaranteed_bitrate_DL = 9; // In bps (GBR only)
|
||||
}
|
||||
|
||||
enum flex_lc_direction {
|
||||
FLLCD_UL = 0;
|
||||
FLLCD_DL = 1;
|
||||
FLLCD_BOTH = 2;
|
||||
}
|
||||
|
||||
enum flex_qos_bearer_type {
|
||||
FLQBT_NON_GBR = 0;
|
||||
FLQBT_GBR = 1;
|
||||
}
|
||||
|
||||
enum flex_ue_state_change_type {
|
||||
FLUESC_UPDATED = 0;
|
||||
FLUESC_ACTIVATED = 1;
|
||||
FLUESC_DEACTIVATED = 2;
|
||||
FLUESC_MOVED = 3;
|
||||
}
|
||||
|
||||
message flex_plmn {
|
||||
optional uint32 mcc = 1;
|
||||
optional uint32 mnc = 2;
|
||||
optional uint32 mnc_length = 3;
|
||||
}
|
||||
|
||||
//
|
||||
// UE-related RRC configuration
|
||||
|
||||
message flex_measurement_info {
|
||||
// arbitrary offset OFS, from TS
|
||||
optional int64 offset_freq_serving = 1;
|
||||
// arbitrary offset OFN
|
||||
optional int64 offset_freq_neighbouring = 2;
|
||||
// arbitrary offset OCS + OCN
|
||||
repeated int64 cell_individual_offset = 3;
|
||||
// Parameter k for exponential moving average calculation coefficient
|
||||
// a = 1/2^(k/4) of all measured RSRPs
|
||||
optional int64 filter_coefficient_rsrp = 4;
|
||||
// Parameter k for RSRQ filtering
|
||||
optional int64 filter_coefficient_rsrq = 5;
|
||||
optional flex_measurement_event event = 6;
|
||||
}
|
||||
|
||||
message flex_measurement_event {
|
||||
optional flex_per_event periodical = 1;
|
||||
optional flex_a1_event a1 = 2;
|
||||
optional flex_a2_event a2 = 3;
|
||||
optional flex_a3_event a3 = 4;
|
||||
optional flex_a4_event a4 = 5;
|
||||
optional flex_a5_event a5 = 6;
|
||||
}
|
||||
|
||||
message flex_per_event {
|
||||
optional int64 max_report_cells = 1;
|
||||
}
|
||||
|
||||
message flex_a1_event {
|
||||
optional int64 threshold_rsrp = 1;
|
||||
optional int64 hysteresis = 2;
|
||||
optional int64 time_to_trigger = 3;
|
||||
optional int64 max_report_cells = 4;
|
||||
}
|
||||
|
||||
message flex_a2_event {
|
||||
optional int64 threshold_rsrp = 1;
|
||||
optional int64 hysteresis = 2;
|
||||
optional int64 time_to_trigger = 3;
|
||||
optional int64 max_report_cells = 4;
|
||||
}
|
||||
|
||||
message flex_a3_event {
|
||||
optional int64 a3_offset = 1;
|
||||
optional int32 report_on_leave = 2;
|
||||
optional int64 hysteresis = 3;
|
||||
optional int64 time_to_trigger = 4;
|
||||
optional int64 max_report_cells = 5;
|
||||
}
|
||||
|
||||
message flex_a4_event {
|
||||
optional int64 threshold_rsrp = 1;
|
||||
optional int64 hysteresis = 2;
|
||||
optional int64 time_to_trigger = 3;
|
||||
optional int64 max_report_cells = 4;
|
||||
}
|
||||
|
||||
message flex_a5_event {
|
||||
optional int64 threshold_rsrp_1 = 1;
|
||||
optional int64 threshold_rsrp_2 = 2;
|
||||
optional int64 hysteresis = 3;
|
||||
optional int64 time_to_trigger = 4;
|
||||
optional int64 max_report_cells = 5;
|
||||
}
|
||||
|
||||
//
|
||||
// S1AP cell configuration
|
||||
//
|
||||
message flex_gummei {
|
||||
optional flex_plmn plmn = 1;
|
||||
optional uint32 mme_group_id = 2;
|
||||
optional uint32 mme_code = 3;
|
||||
}
|
||||
|
||||
message flex_s1ap_mme {
|
||||
optional string s1_ip = 1; // S1-MME IP of MME
|
||||
optional string name = 2; // S1-MME name of MME
|
||||
optional flex_mme_state state = 3; // State of the MME
|
||||
repeated flex_gummei served_gummeis = 4; // GUMMEIs served by the MME
|
||||
repeated flex_plmn requested_plmns = 5; // PLMNs communicated to MME
|
||||
optional uint32 rel_capacity = 6; // Relative MME capacity, TS23.401
|
||||
}
|
||||
|
||||
enum flex_mme_state {
|
||||
FLMMES_DISCONNECTED = 0;
|
||||
FLMMES_WAITING = 1;
|
||||
FLMMES_CONNECTED = 2;
|
||||
FLMMES_OVERLOAD = 3;
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
import "config_common.proto";
|
||||
|
||||
message flex_cell_config {
|
||||
optional uint32 phy_cell_id = 1; // The PCI of this cell
|
||||
optional uint32 pusch_hopping_offset = 3; // PUSCH resources in RBs for hopping
|
||||
optional uint32 hopping_mode = 4; // One of the FLHM_* enum values
|
||||
optional uint32 n_sb = 5; // The number of subbands
|
||||
optional uint32 phich_resource = 6; // The number of REGs used for PHICH
|
||||
// One of the FLPR_* enum values
|
||||
optional uint32 phich_duration = 7; // One of the FLPD_* enum values
|
||||
optional uint32 init_nr_PDCCH_OFDM_sym = 8; // See TS 36.211, section 6.9
|
||||
optional flex_si_config si_config = 9; // The SI configuration
|
||||
optional uint32 dl_bandwidth = 10; // The DL transmission bandwidth in RBs
|
||||
optional uint32 ul_bandwidth = 11; // The UL transmission bandwidth in RBs
|
||||
optional uint32 ul_cyclic_prefix_length = 13; // One of the FLUCPL_* enum values
|
||||
optional uint32 dl_cyclic_prefix_length = 14; // One of the FLDCPL_* enum values
|
||||
optional uint32 antenna_ports_count = 15; // Number of cell specific antenna ports
|
||||
optional uint32 duplex_mode = 16; // One of the FLDM_* enum values
|
||||
optional uint32 subframe_assignment = 17; // DL/UL subframe assignment. TDD only
|
||||
optional uint32 special_subframe_patterns = 18; // TDD only. See TS 36.211, table 4.2.1
|
||||
repeated uint32 mbsfn_subframe_config_rfperiod = 19; // The MBSFN radio frame period (Optional)
|
||||
repeated uint32 mbsfn_subframe_config_rfoffset = 20; // The radio frame offset (Optional)
|
||||
repeated uint32 mbsfn_subframe_config_sfalloc = 21; // Bitmap indicating the MBSFN subframes (Optional)
|
||||
optional uint32 prach_config_index = 22; // See TS 36.211, section 5.7.1
|
||||
optional uint32 prach_freq_offset = 23; // See TS 36.211, section 5.7.1
|
||||
optional uint32 ra_response_window_size = 24; // The duration of the RA response window in SF
|
||||
optional uint32 mac_contention_resolution_timer = 25; // Timer for RA
|
||||
optional uint32 max_HARQ_Msg3Tx = 26; // See TS 36.321
|
||||
optional uint32 n1PUCCH_AN = 27; // See TS 36.213, section 10.1
|
||||
optional uint32 deltaPUCCH_shift = 28; // See TS 36.211, section 5.4
|
||||
optional uint32 nRB_cqi = 29; // See TS 36.211, section 5.4
|
||||
optional uint32 srs_subframe_config = 30; // See TS 36.211, table 5.5.3.3-1 and 2
|
||||
optional uint32 srs_bw_config = 31; // See TS 36.211, section 5.5.3.2
|
||||
optional uint32 srs_mac_up_pts = 32; // Boolean value. See TS 36.211, section 5.5.3.2. TDD only
|
||||
optional uint32 enable_64QAM = 33; // One of the FLEQ_* enum values
|
||||
optional uint32 carrier_index = 34; // Carrier component index
|
||||
optional uint32 dl_freq = 35; // operating downlink frequency
|
||||
optional uint32 ul_freq = 36; // operating uplink frequency
|
||||
optional uint32 eutra_band= 37; // operating band
|
||||
optional int32 dl_pdsch_power = 38; // operating downlink power
|
||||
optional int32 ul_pusch_power = 39; // operating uplink power
|
||||
repeated flex_plmn plmn_id = 40; // The PLMN cell id of this cell
|
||||
|
||||
optional flex_slice_config slice_config = 42;
|
||||
optional bool x2_ho_net_control = 43;
|
||||
}
|
||||
|
||||
message flex_slice_config {
|
||||
optional flex_slice_dl_ul_config dl = 6;
|
||||
optional flex_slice_dl_ul_config ul = 7;
|
||||
}
|
||||
|
||||
message flex_ue_config {
|
||||
optional uint32 rnti = 1;
|
||||
optional flex_drx_config drx_config = 2; // The DRX configuration (Optional)
|
||||
optional uint32 time_alignment_timer = 3; // Timer in SF. Control the synchronization
|
||||
// status of the UE, not the actual advance procedure
|
||||
// See TS 36.321
|
||||
optional uint32 meas_gap_config_pattern = 4; // Measurement gap configuration.
|
||||
// One of the FLMGCP_* enum values
|
||||
// See TS 36.133
|
||||
optional uint32 meas_gap_config_sf_offset = 5; // Measurement gap offset if applicable
|
||||
optional flex_sps_config sps_config = 6; // The SPS configuration (Optional)
|
||||
optional flex_sr_config sr_config = 7; // The SR configuration (Optional)
|
||||
optional flex_cqi_config cqi_config = 8; // The CQI configuration (Optional)
|
||||
optional uint32 transmission_mode = 9; // The UE transmission mode
|
||||
optional uint64 ue_aggregated_max_bitrate_UL = 10; // Aggregated bit-rate of non-gbr bearer
|
||||
// per UE. See TS 36.413
|
||||
optional uint64 ue_aggregated_max_bitrate_DL = 11; // Aggregated bit-rate of non-gbr bearer
|
||||
// per UE. See TS 36.413
|
||||
optional flex_ue_capabilities capabilities = 12;
|
||||
optional uint32 ue_transmission_antenna = 13; // One of the FLUTA_* enum values
|
||||
optional uint32 tti_bundling = 14; // Boolean value. See TS 36.321
|
||||
optional uint32 max_HARQ_tx = 15; // The max HARQ retransmission for UL
|
||||
optional uint32 beta_offset_ACK_index = 16; // See TS 36.213
|
||||
optional uint32 beta_offset_RI_index = 17; // See TS 36.213
|
||||
optional uint32 beta_offset_CQI_index = 18; // See TS 36.213
|
||||
optional uint32 ack_nack_simultaneous_trans = 19;// Boolean. See TS 36.213
|
||||
optional uint32 simultaneous_ack_nack_cqi = 20; // Boolean. See TS 36.213
|
||||
optional uint32 aperiodic_cqi_rep_mode = 21; // One of the FLACRM_* enum values
|
||||
optional uint32 tdd_ack_nack_feedback = 22; // One of the FLTANFM_* enum values
|
||||
optional uint32 ack_nack_repetition_factor = 23;// See TS 36.213, section 10.1
|
||||
optional uint32 extended_bsr_size = 24; // Boolean for extended BSR size
|
||||
optional uint32 ca_support = 25; // Boolean. Support for carrier aggregation
|
||||
optional uint32 cross_carrier_sched_support = 26; // Boolean value
|
||||
optional uint32 pcell_carrier_index = 27; // Index of primary cell
|
||||
repeated flex_scell_config scell_config = 28; // Secondary cells configuration
|
||||
optional uint32 scell_deactivation_timer = 29;// Deactivation timer for secondary cell
|
||||
optional uint64 imsi = 30;
|
||||
optional uint32 dl_slice_id = 31;
|
||||
optional uint32 ul_slice_id = 32;
|
||||
// Configuration about RRC measurements
|
||||
optional flex_measurement_info info = 33;
|
||||
}
|
||||
|
||||
message flex_lc_ue_config {
|
||||
optional uint32 rnti = 1;
|
||||
repeated flex_lc_config lc_config = 2; // A list of LC configurations for the given UE
|
||||
}
|
||||
|
||||
message flex_s1ap_config {
|
||||
optional uint32 pending = 1; // number of pending (to be connected) MMEs
|
||||
optional uint32 connected = 2; // number of connected MMEs
|
||||
optional string enb_s1_ip = 3; // S1-MME IP of eNodeB
|
||||
optional string enb_name = 4; // S1-MME name of eNodeB
|
||||
repeated flex_s1ap_mme mme = 5;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
enum flex_control_delegation_type {
|
||||
FLCDT_MAC_DL_UE_SCHEDULER = 1; // DL UE scheduler delegation
|
||||
FLCDT_AGENT_CONTROL_APP = 2; // Generic control application
|
||||
}
|
||||
|
||||
message flex_agent_reconfiguration_system {
|
||||
optional string system = 1;
|
||||
repeated flex_agent_reconfiguration_subsystem subsystems = 2;
|
||||
}
|
||||
|
||||
message flex_agent_reconfiguration_subsystem {
|
||||
optional string name = 1; // Name of the object (app name or user plane object)
|
||||
optional string behavior = 2; // For an app: a callback in a shared library. For any other subsystem: an object name (shared library) with defined syntax.
|
||||
map<string, flex_agent_reconfiguration_param> params = 3; // Param configurations depending on callback/shared library above.
|
||||
}
|
||||
|
||||
message flex_agent_reconfiguration_param {
|
||||
oneof param {
|
||||
int32 integer = 1;
|
||||
float floating = 2;
|
||||
bool boolean = 3;
|
||||
string str = 4;
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
import "mac_primitives.proto";
|
||||
|
||||
//
|
||||
// Body of UE DL MAC scheduling configuration info
|
||||
//
|
||||
|
||||
message flex_dl_data {
|
||||
optional uint32 rnti = 1;
|
||||
optional flex_dl_dci dl_dci = 2;
|
||||
repeated uint32 ce_bitmap = 3; // list of 2 MAC CEs, one for each TB
|
||||
repeated flex_rlc_pdu rlc_pdu = 4; // list of parameters for the creation of RLC PDUs. One for each lcid
|
||||
optional uint32 serv_cell_index = 5;
|
||||
optional uint32 act_deact_ce = 6; //Hex content of MAC CE for Activation/Deactivation in CA
|
||||
}
|
||||
|
||||
|
||||
message flex_ul_data {
|
||||
optional uint32 rnti = 1;
|
||||
optional flex_ul_dci ul_dci = 2;
|
||||
}
|
||||
|
||||
//
|
||||
// Body of the RAR scheduler configuration
|
||||
//
|
||||
message flex_dl_rar {
|
||||
optional uint32 rnti = 1;
|
||||
optional uint32 grant = 2; // The 20-bit UL grant. TS 36.213, sec 6.2
|
||||
optional flex_dl_dci rar_dci = 3;
|
||||
optional uint32 carrier_index = 4; // The carrier index for the RAR
|
||||
}
|
||||
|
||||
//
|
||||
// Body of the paging/broadcast configuration message
|
||||
//
|
||||
|
||||
message flex_dl_broadcast {
|
||||
optional uint32 type = 1; // The FLBT_* values
|
||||
optional uint32 index = 2; // Index of the broadcast message:
|
||||
// 0 - SIB1,
|
||||
// 1..31 - Six,
|
||||
// 32..63 - PCCH (PCCH index obtained from flex_paging_info)
|
||||
optional flex_dl_dci broad_dci = 3;
|
||||
optional uint32 carrier_index = 4; // Index of the carrier for broadcast
|
||||
}
|
||||
|
||||
//
|
||||
// Body of the OFDM symbol count message
|
||||
//
|
||||
|
||||
message flex_pdcch_ofdm_sym_count {
|
||||
optional uint32 carrier_index = 1;
|
||||
optional uint32 num_pdcch_ofdm_symbols = 2;
|
||||
}
|
||||
|
||||
//
|
||||
// Types of commands related enums
|
||||
//
|
||||
|
||||
enum flex_broadcast_type {
|
||||
FLBT_BCCH = 0;
|
||||
FLBT_PCCH = 1;
|
||||
}
|
||||
@@ -1,269 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
import "stats_messages.proto";
|
||||
import "header.proto";
|
||||
import "time_common.proto";
|
||||
import "config_messages.proto";
|
||||
import "controller_commands.proto";
|
||||
import "config_common.proto";
|
||||
import "control_delegation.proto";
|
||||
|
||||
message flexran_message {
|
||||
optional flexran_direction msg_dir = 100;
|
||||
oneof msg {
|
||||
flex_hello hello_msg = 1;
|
||||
flex_echo_request echo_request_msg = 2;
|
||||
flex_echo_reply echo_reply_msg = 3;
|
||||
flex_stats_request stats_request_msg = 4;
|
||||
flex_stats_reply stats_reply_msg = 5;
|
||||
flex_sf_trigger sf_trigger_msg = 6;
|
||||
flex_ul_sr_info ul_sr_info_msg = 7;
|
||||
flex_enb_config_request enb_config_request_msg = 8;
|
||||
flex_enb_config_reply enb_config_reply_msg = 9;
|
||||
flex_ue_config_request ue_config_request_msg = 10;
|
||||
flex_ue_config_reply ue_config_reply_msg = 11;
|
||||
flex_lc_config_request lc_config_request_msg = 12;
|
||||
flex_lc_config_reply lc_config_reply_msg = 13;
|
||||
flex_dl_mac_config dl_mac_config_msg = 14;
|
||||
flex_ue_state_change ue_state_change_msg = 15;
|
||||
flex_control_delegation control_delegation_msg = 16;
|
||||
flex_agent_reconfiguration agent_reconfiguration_msg = 17;
|
||||
flex_rrc_triggering rrc_triggering = 18;
|
||||
flex_ul_mac_config ul_mac_config_msg = 19;
|
||||
flex_disconnect disconnect_msg = 20;
|
||||
flex_ho_command ho_command_msg = 21;
|
||||
flex_control_delegation_request control_del_req_msg = 22;
|
||||
}
|
||||
}
|
||||
|
||||
enum flexran_direction {
|
||||
//option allow_alias = true;
|
||||
NOT_SET = 0;
|
||||
INITIATING_MESSAGE = 1;
|
||||
SUCCESSFUL_OUTCOME=2;
|
||||
UNSUCCESSFUL_OUTCOME=3;
|
||||
}
|
||||
|
||||
enum flexran_err {
|
||||
//option allow_alias = true;
|
||||
// message errors
|
||||
NO_ERR = 0;
|
||||
MSG_DEQUEUING = -1;
|
||||
MSG_ENQUEUING = -2;
|
||||
MSG_DECODING = -3;
|
||||
MSG_ENCODING = -4;
|
||||
MSG_BUILD = -5;
|
||||
MSG_NOT_SUPPORTED = -6;
|
||||
MSG_NOT_HANDLED = -7;
|
||||
MSG_NOT_VALIDATED = -8;
|
||||
MSG_OUT_DATED = -9;
|
||||
|
||||
|
||||
// other erros
|
||||
UNEXPECTED = -100;
|
||||
}
|
||||
|
||||
//
|
||||
// Maintenance and discovery messages
|
||||
//
|
||||
enum flex_bs_capability {
|
||||
LOPHY = 0;
|
||||
HIPHY = 1;
|
||||
LOMAC = 2;
|
||||
HIMAC = 3;
|
||||
RLC = 4;
|
||||
PDCP = 5;
|
||||
SDAP = 6;
|
||||
RRC = 7;
|
||||
S1AP = 8;
|
||||
}
|
||||
|
||||
enum flex_bs_split {
|
||||
F1 = 0;
|
||||
nFAPI = 1;
|
||||
IF4 = 2;
|
||||
IF4p5 = 3;
|
||||
IF5 = 4;
|
||||
}
|
||||
|
||||
message flex_hello {
|
||||
optional flex_header header = 1;
|
||||
optional uint64 bs_id = 2; // Unique id to distinguish the eNB
|
||||
repeated flex_bs_capability capabilities = 3;
|
||||
repeated flex_bs_split splits = 4;
|
||||
}
|
||||
|
||||
message flex_echo_request {
|
||||
optional flex_header header = 1;
|
||||
extensions 100 to 199;
|
||||
}
|
||||
|
||||
|
||||
message flex_echo_reply {
|
||||
optional flex_header header = 1;
|
||||
extensions 100 to 199;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Statistics request and reply message
|
||||
//
|
||||
|
||||
message flex_stats_request {
|
||||
optional flex_header header = 1;
|
||||
optional flex_stats_type type = 2;
|
||||
oneof body {
|
||||
flex_complete_stats_request complete_stats_request = 3;
|
||||
flex_cell_stats_request cell_stats_request = 4;
|
||||
flex_ue_stats_request ue_stats_request = 5;
|
||||
}
|
||||
}
|
||||
|
||||
message flex_stats_reply {
|
||||
optional flex_header header = 1;
|
||||
repeated flex_ue_stats_report ue_report = 2;
|
||||
repeated flex_cell_stats_report cell_report = 3;
|
||||
}
|
||||
|
||||
//
|
||||
// Time indication messages
|
||||
//
|
||||
|
||||
message flex_sf_trigger {
|
||||
optional flex_header header = 1;
|
||||
optional uint32 sfn_sf = 2;
|
||||
repeated flex_dl_info dl_info = 3;
|
||||
repeated flex_ul_info ul_info = 4;
|
||||
}
|
||||
|
||||
//
|
||||
// Asynchronous messages
|
||||
//
|
||||
|
||||
message flex_ul_sr_info {
|
||||
optional flex_header header = 1;
|
||||
optional uint32 sfn_sf = 2;
|
||||
repeated uint32 rnti = 3;
|
||||
}
|
||||
|
||||
//
|
||||
// eNB configuration messages
|
||||
//
|
||||
message flex_enb_config_request {
|
||||
optional flex_header header = 1;
|
||||
}
|
||||
|
||||
message flex_enb_config_reply {
|
||||
optional flex_header header = 1;
|
||||
repeated flex_cell_config cell_config = 3;
|
||||
optional uint32 device_spec = 4;
|
||||
optional flex_s1ap_config s1ap = 5;
|
||||
repeated string loadedApps = 6;
|
||||
repeated string loadedMacObjects = 7;
|
||||
}
|
||||
|
||||
message flex_ue_config_request {
|
||||
optional flex_header header = 1;
|
||||
}
|
||||
|
||||
message flex_ue_config_reply {
|
||||
optional flex_header header = 1;
|
||||
repeated flex_ue_config ue_config = 2;
|
||||
}
|
||||
|
||||
message flex_lc_config_request {
|
||||
optional flex_header header = 1;
|
||||
}
|
||||
|
||||
message flex_lc_config_reply {
|
||||
optional flex_header header = 1;
|
||||
repeated flex_lc_ue_config lc_ue_config = 2;
|
||||
}
|
||||
|
||||
//
|
||||
// Controller command messages
|
||||
//
|
||||
|
||||
message flex_dl_mac_config {
|
||||
optional flex_header header = 1;
|
||||
optional uint32 sfn_sf = 2;
|
||||
repeated flex_dl_data dl_ue_data = 3;
|
||||
repeated flex_dl_rar dl_rar = 4;
|
||||
repeated flex_dl_broadcast dl_broadcast = 5;
|
||||
repeated flex_pdcch_ofdm_sym_count ofdm_sym = 6; // OFDM symbol count for each CC
|
||||
}
|
||||
|
||||
message flex_ul_mac_config {
|
||||
optional flex_header header = 1;
|
||||
optional uint32 sfn_sf = 2;
|
||||
repeated flex_ul_data ul_ue_data = 3;
|
||||
}
|
||||
|
||||
message flex_rrc_triggering {
|
||||
|
||||
optional flex_header header = 1;
|
||||
optional string rrc_trigger = 2;
|
||||
optional flex_measurement_info meas_info = 3;
|
||||
}
|
||||
|
||||
message flex_ho_command {
|
||||
optional flex_header header = 1;
|
||||
optional uint32 rnti = 2;
|
||||
optional uint32 target_phy_cell_id = 3;
|
||||
}
|
||||
|
||||
//
|
||||
// UE state change message
|
||||
//
|
||||
|
||||
message flex_ue_state_change {
|
||||
optional flex_header header = 1;
|
||||
optional uint32 type = 2; // One of the FLUESC_* values
|
||||
optional flex_ue_config config = 3; // Body of the message (based on type)
|
||||
}
|
||||
|
||||
//
|
||||
// Control delegation message
|
||||
//
|
||||
|
||||
message flex_control_delegation {
|
||||
optional flex_header header = 1;
|
||||
optional flex_control_delegation_type delegation_type = 2; // The delegated object type, decides about further processing
|
||||
optional bytes payload = 3; // Byte array of shared lib containing the delegated functions
|
||||
optional string name = 4; // The delegated functions names ordered based on bitmap flags
|
||||
}
|
||||
|
||||
message flex_control_delegation_request {
|
||||
optional flex_header header = 1;
|
||||
optional flex_control_delegation_type delegation_type = 2;
|
||||
optional string name = 4;
|
||||
}
|
||||
|
||||
//
|
||||
// Agent reconfiguration message
|
||||
//
|
||||
|
||||
message flex_agent_reconfiguration {
|
||||
optional flex_header header = 1;
|
||||
optional string policy = 2; // The policy changes using YAML syntax in string format
|
||||
repeated flex_agent_reconfiguration_system systems = 3; // The policy changes.
|
||||
}
|
||||
|
||||
// Extensions of the echo request and reply
|
||||
// messages for carrying a latency value in ms
|
||||
message flex_echo_request_latency {
|
||||
extend flex_echo_request {
|
||||
optional uint32 latency = 100;
|
||||
}
|
||||
}
|
||||
|
||||
message flex_echo_reply_latency {
|
||||
extend flex_echo_reply {
|
||||
optional uint32 latency = 100;
|
||||
}
|
||||
}
|
||||
|
||||
message flex_disconnect {
|
||||
optional flex_header header = 1;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
message flex_header {
|
||||
optional uint32 version = 1;
|
||||
optional uint32 type = 2;
|
||||
optional uint32 xid = 4;
|
||||
}
|
||||
|
||||
enum flex_type {
|
||||
// Discovery and maintenance messages
|
||||
FLPT_HELLO = 0;
|
||||
FLPT_ECHO_REQUEST = 1;
|
||||
FLPT_ECHO_REPLY = 2;
|
||||
FLPT_DISCONNECT = 20;
|
||||
|
||||
// Statistics and measurement messages
|
||||
FLPT_STATS_REQUEST = 3;
|
||||
FLPT_STATS_REPLY = 4;
|
||||
|
||||
// Time indication messages
|
||||
FLPT_SF_TRIGGER = 5;
|
||||
|
||||
// Asynchronous messages
|
||||
FLPT_UL_SR_INFO = 6;
|
||||
|
||||
// eNB configuration messages
|
||||
FLPT_GET_ENB_CONFIG_REQUEST = 7;
|
||||
FLPT_GET_ENB_CONFIG_REPLY = 8;
|
||||
FLPT_GET_UE_CONFIG_REQUEST = 9;
|
||||
FLPT_GET_UE_CONFIG_REPLY = 10;
|
||||
FLPT_GET_LC_CONFIG_REQUEST = 11;
|
||||
FLPT_GET_LC_CONFIG_REPLY = 12;
|
||||
|
||||
//Controller command messages
|
||||
FLPT_DL_MAC_CONFIG = 13;
|
||||
FLPT_HO_COMMAND = 21;
|
||||
|
||||
// UE state change messages
|
||||
FLPT_UE_STATE_CHANGE = 14;
|
||||
|
||||
// Control delegation messages
|
||||
FLPT_DELEGATE_CONTROL = 15;
|
||||
FLPT_RECONFIGURE_AGENT = 16;
|
||||
FLPT_RRC_TRIGGERING = 17;
|
||||
FLPT_UL_MAC_CONFIG = 18;
|
||||
FLPT_DELEGATE_REQUEST = 22;
|
||||
}
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
//
|
||||
// Message containing the DL DCI info
|
||||
//
|
||||
|
||||
message flex_dl_dci {
|
||||
optional uint32 rnti = 1;
|
||||
optional uint32 res_alloc = 2; // Type of resource allocation
|
||||
optional uint32 rb_bitmap = 3; // Bitmap for RB allocation
|
||||
optional uint32 rb_shift = 4; // See TS 36.214, section 7.1.6.2
|
||||
repeated uint32 tbs_size = 5; // The size of each TBS
|
||||
repeated uint32 mcs = 6; // The MCS of each TB
|
||||
repeated uint32 ndi = 7; // New data indicator of each TB
|
||||
repeated uint32 rv = 8; // Redundancy version of each TB
|
||||
optional uint32 cce_index = 9; // CCE index used to send the DCI
|
||||
optional uint32 aggr_level = 10;
|
||||
optional uint32 precoding_info = 11; // 2 antenna ports:0..6,
|
||||
// 4 antenna ports:0..50
|
||||
optional uint32 format = 12; // DCI format. A FLDCIF_* value
|
||||
optional uint32 tpc = 13; // TS 36.213, sec 5.1.1.1
|
||||
optional uint32 harq_process = 14; // HARQ process ID
|
||||
optional uint32 dai = 15; // TDD only
|
||||
optional uint32 vrb_format = 16; // One of the FLVRBF_* values
|
||||
optional uint32 tb_swap = 17; // Boolean. TB to codeword swap flag
|
||||
optional uint32 sps_release = 18; // Flag value
|
||||
optional uint32 pdcch_order = 19;
|
||||
optional uint32 preamble_index = 20; // Only valid if pdcch_order = 1
|
||||
optional uint32 prach_mask_index = 21; // Only valid if pdcch_order = 1
|
||||
optional uint32 n_gap = 22; // One of the FLNGV_* values
|
||||
optional uint32 tbs_idx = 23; // The TBS index for Format 1A
|
||||
optional uint32 dl_power_offset = 24; // For format 1D
|
||||
optional uint32 pdcch_power_offset = 25; // DL PDCCH power boosting in dB
|
||||
optional uint32 cif_present = 26; // Boolean. Indication of CIF field
|
||||
optional uint32 cif = 27; // CIF for cross-carrier scheduling
|
||||
}
|
||||
|
||||
message flex_ul_dci {
|
||||
optional uint32 rnti = 1;
|
||||
optional uint32 rb_start = 2; // The start RB allocated to the UE
|
||||
optional uint32 rb_len = 3; // The number of RBs allocated to the UE
|
||||
optional uint32 mcs = 4; // Modulation and coding scheme
|
||||
optional uint32 cyclic_shift2 = 5; // match DCI format 0/4 PDU
|
||||
optional uint32 freq_hop_flag = 6; // 0 no hopping, 1 hoppping
|
||||
optional uint32 freq_hop_map = 7; // Frequency hopping bits (0..4)
|
||||
optional uint32 ndi = 8; // New data indicator
|
||||
optional uint32 rv = 9; // Redundancy version
|
||||
optional uint32 harq_pid = 10; // The harq process id
|
||||
optional uint32 ultx_mode = 11; // A FLULM_* value
|
||||
optional uint32 tbs_size = 12; // The size of each TBS
|
||||
optional uint32 n_srs = 13; // Overlap indication with srs
|
||||
optional uint32 res_alloc = 14; // Type of resource allocation
|
||||
optional uint32 size = 15; // Size of the ULSCH PDU in bytes for UL Grant.
|
||||
|
||||
optional uint32 dai = 16; // TDD only
|
||||
|
||||
// optional uint32 tb_swap = 17; // Boolean. TB to codeword swap flag
|
||||
|
||||
// optional uint32 pdcch_order = 19;
|
||||
// optional uint32 preamble_index = 20; // Only valid if pdcch_order = 1
|
||||
// optional uint32 prach_mask_index = 21; // Only valid if pdcch_order = 1
|
||||
|
||||
// optional uint32 tbs_idx = 23; // The TBS index for Format 1A
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Messages related to the creation of RLC PDUs
|
||||
//
|
||||
|
||||
message flex_rlc_pdu {
|
||||
repeated flex_rlc_pdu_tb rlc_pdu_tb = 1; // list of parameters for the creation of RLC PDUs. One for each TB
|
||||
}
|
||||
|
||||
message flex_rlc_pdu_tb {
|
||||
optional uint32 logical_channel_id = 1;
|
||||
optional uint32 size = 2; // Maximum RLC PDU to be created in bytes
|
||||
}
|
||||
|
||||
//
|
||||
// MAC content types related enums
|
||||
//
|
||||
|
||||
enum flex_dci_format {
|
||||
FLDCIF_1 = 0;
|
||||
FLDCIF_1A = 1;
|
||||
FLDCIF_1B = 2;
|
||||
FLDCIF_1C = 3;
|
||||
FLDCIF_1D = 4;
|
||||
FLDCIF_2 = 5;
|
||||
FLDCIF_2A = 6;
|
||||
FLDCIF_2B = 7;
|
||||
FLDCIF_3 = 8;
|
||||
FLDCIF_3A = 9;
|
||||
}
|
||||
|
||||
enum flex_vrb_format {
|
||||
FLVRBF_LOCALIZED = 0;
|
||||
FLVRBF_DISTRIBUTED = 1;
|
||||
}
|
||||
|
||||
enum flex_ngap_val {
|
||||
FLNGV_1 = 0;
|
||||
FLNGV_2 = 1;
|
||||
}
|
||||
@@ -1,324 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
import "config_common.proto"; // for flex_plmn
|
||||
|
||||
//
|
||||
// UE related statistics
|
||||
//
|
||||
|
||||
// RLC buffer status for a specific logical channel of a UE
|
||||
message flex_rlc_bsr {
|
||||
optional uint32 lc_id = 1;
|
||||
optional uint32 tx_queue_size = 2;
|
||||
optional uint32 tx_queue_hol_delay = 3;
|
||||
optional uint32 retransmission_queue_size = 4;
|
||||
optional uint32 retransmission_queue_hol_delay = 5;
|
||||
optional uint32 status_pdu_size = 6;
|
||||
}
|
||||
|
||||
// Flags for MAC Control Elements
|
||||
enum flex_ce_type {
|
||||
FLPCET_TA = 1;
|
||||
FLPCET_DRX = 2;
|
||||
FLPCET_CR = 4;
|
||||
FLPCET_CA = 8;
|
||||
}
|
||||
|
||||
// Types of DL CSI reports
|
||||
enum flex_csi_type {
|
||||
FLCSIT_P10 = 0;
|
||||
FLCSIT_P11 = 1;
|
||||
FLCSIT_P20 = 2;
|
||||
FLCSIT_P21 = 3;
|
||||
FLCSIT_A12 = 4;
|
||||
FLCSIT_A22 = 5;
|
||||
FLCSIT_A20 = 6;
|
||||
FLCSIT_A30 = 7;
|
||||
FLCSIT_A31 = 8;
|
||||
}
|
||||
|
||||
// CSI type P10
|
||||
message flex_csi_p10 {
|
||||
optional uint32 wb_cqi = 1;
|
||||
}
|
||||
|
||||
// CSI type P11
|
||||
message flex_csi_p11 {
|
||||
repeated uint32 wb_cqi = 1;
|
||||
optional uint32 wb_pmi = 2;
|
||||
}
|
||||
|
||||
// CSI type P20
|
||||
message flex_csi_p20 {
|
||||
optional uint32 wb_cqi = 1;
|
||||
optional uint32 sb_cqi = 2;
|
||||
optional uint32 bandwidth_part_index = 3;
|
||||
optional uint32 sb_index = 4;
|
||||
}
|
||||
|
||||
// CSI type P21
|
||||
message flex_csi_p21 {
|
||||
repeated uint32 wb_cqi = 1;
|
||||
optional uint32 wb_pmi = 2;
|
||||
repeated uint32 sb_cqi = 3;
|
||||
optional uint32 badwidth_part_index = 4;
|
||||
optional uint32 sb_index = 5;
|
||||
}
|
||||
|
||||
// CSI type A12
|
||||
message flex_csi_a12 {
|
||||
repeated uint32 wb_cqi = 1;
|
||||
repeated uint32 sb_pmi = 2;
|
||||
}
|
||||
|
||||
// CSI type A22
|
||||
message flex_csi_a22 {
|
||||
repeated uint32 wb_cqi = 1;
|
||||
repeated uint32 sb_cqi = 2;
|
||||
optional uint32 wb_pmi = 3;
|
||||
optional uint32 sb_pmi = 4;
|
||||
repeated uint32 sb_list = 5;
|
||||
}
|
||||
|
||||
// CSI type A20
|
||||
message flex_csi_a20 {
|
||||
optional uint32 wb_cqi = 1;
|
||||
optional uint32 sb_cqi = 2;
|
||||
repeated uint32 sb_list = 3;
|
||||
}
|
||||
|
||||
// CSI type A30
|
||||
message flex_csi_a30 {
|
||||
optional uint32 wb_cqi = 1;
|
||||
repeated uint32 sb_cqi = 2;
|
||||
}
|
||||
|
||||
// CSI type A31
|
||||
message flex_csi_a31 {
|
||||
repeated uint32 wb_cqi = 1;
|
||||
repeated flex_msb_cqi sb_cqi = 2;
|
||||
optional uint32 wb_pmi = 3;
|
||||
}
|
||||
|
||||
// The CQI for the M-preffered subband
|
||||
message flex_msb_cqi {
|
||||
repeated uint32 sb_cqi = 1;
|
||||
}
|
||||
|
||||
// The CSI report of the UE for a specific servCellIndex
|
||||
message flex_dl_csi {
|
||||
optional uint32 serv_cell_index = 1;
|
||||
optional uint32 ri = 2;
|
||||
optional flex_csi_type type = 3;
|
||||
oneof report {
|
||||
flex_csi_p10 p10csi = 4;
|
||||
flex_csi_p11 p11csi = 5;
|
||||
flex_csi_p20 p20csi = 6;
|
||||
flex_csi_p21 p21csi = 7;
|
||||
flex_csi_a12 a12csi = 8;
|
||||
flex_csi_a22 a22csi = 9;
|
||||
flex_csi_a20 a20csi = 10;
|
||||
flex_csi_a30 a30csi = 11;
|
||||
flex_csi_a31 a31csi = 12;
|
||||
}
|
||||
}
|
||||
|
||||
// The full DL CQI report for all CC of a UE
|
||||
message flex_dl_cqi_report {
|
||||
optional uint32 sfn_sn = 1;
|
||||
repeated flex_dl_csi csi_report = 2;
|
||||
}
|
||||
|
||||
// Paging message info
|
||||
message flex_paging_info {
|
||||
optional uint32 paging_index = 1;
|
||||
optional uint32 paging_message_size = 2;
|
||||
optional uint32 paging_subframe = 3;
|
||||
optional uint32 carrier_index = 4;
|
||||
}
|
||||
|
||||
// Report for the paging buffer status
|
||||
message flex_paging_buffer_report {
|
||||
repeated flex_paging_info paging_info = 1;
|
||||
}
|
||||
|
||||
// The type of UL CQI
|
||||
enum flex_ul_cqi_type {
|
||||
FLUCT_SRS = 0;
|
||||
FLUCT_PUSCH = 1;
|
||||
FLUCT_PUCCH_1 = 2;
|
||||
FLUCT_PUCCH_2 = 3;
|
||||
FLUCT_PRACH = 4;
|
||||
}
|
||||
|
||||
// UL CQI report for a specific UE for a given report type
|
||||
message flex_ul_cqi {
|
||||
optional flex_ul_cqi_type type = 1;
|
||||
repeated uint32 sinr = 2;
|
||||
optional uint32 serv_cell_index = 3;
|
||||
}
|
||||
|
||||
// Full UL CQI report for a specific UE
|
||||
message flex_ul_cqi_report {
|
||||
optional uint32 sfn_sn = 1;
|
||||
repeated flex_ul_cqi cqi_meas = 2;
|
||||
repeated flex_pucch_dbm pucch_dbm = 3;
|
||||
}
|
||||
|
||||
message flex_pucch_dbm {
|
||||
optional int32 p0_pucch_dbm = 1;
|
||||
optional uint32 serv_cell_index = 2;
|
||||
optional uint32 p0_pucch_updated = 3;
|
||||
}
|
||||
|
||||
//
|
||||
// Cell related statistics
|
||||
//
|
||||
|
||||
// The UL noise and interference report for a UE
|
||||
message flex_noise_interference_report {
|
||||
optional uint32 sfn_sf = 1;
|
||||
optional uint32 rip = 2;
|
||||
optional uint32 tnp = 3;
|
||||
optional int32 p0_nominal_pucch = 4;
|
||||
}
|
||||
|
||||
//
|
||||
// RRC Measurements Primitives
|
||||
//
|
||||
|
||||
|
||||
message flex_rrc_measurements {
|
||||
// Measurement identifier.
|
||||
optional int32 measid = 1;
|
||||
// Primary Cell Reference Signal Received Power (RSRP).
|
||||
optional int32 pcell_rsrp = 2;
|
||||
// Primary Cell Reference Signal Received Quality (RSRQ).
|
||||
optional int32 pcell_rsrq = 3;
|
||||
// Neighboring cells measurements performed by UE.
|
||||
optional flex_neigh_cells_measurements neigh_meas = 4;
|
||||
}
|
||||
|
||||
message flex_neigh_cells_measurements {
|
||||
// Neighboring EUTRA cells measurements.
|
||||
repeated flex_eutra_measurements eutra_meas = 1;
|
||||
}
|
||||
|
||||
message flex_eutra_measurements {
|
||||
// Physical Cell identifier.
|
||||
optional int32 phys_cell_id = 1;
|
||||
// EUTRA Cell Global Identity (CGI) measurement.
|
||||
optional flex_eutra_cgi_measurements cgi_meas = 2;
|
||||
// EUTRA nearby cell reference signal measurement.
|
||||
optional flex_eutra_ref_signal_meas meas_result = 3;
|
||||
}
|
||||
|
||||
message flex_eutra_cgi_measurements {
|
||||
// EUTRA Cell Global Identity (CGI).
|
||||
optional flex_cell_global_eutra_id cgi = 1;
|
||||
// Tracking area code of the neighbor cell.
|
||||
optional uint32 tracking_area_code = 2;
|
||||
// Public land mobile network identifiers of neighbor cell.
|
||||
repeated flex_plmn plmn = 3;
|
||||
}
|
||||
|
||||
message flex_cell_global_eutra_id {
|
||||
// Public land mobile network identifier of neighbor cell.
|
||||
optional flex_plmn plmn = 1;
|
||||
// Cell identifier of neighbor cell.
|
||||
optional uint32 cell_id = 2;
|
||||
}
|
||||
|
||||
message flex_eutra_ref_signal_meas {
|
||||
// Neighboring Cell RSRP
|
||||
optional int32 rsrp = 1;
|
||||
// Neighboring Cell RSRQ
|
||||
optional int32 rsrq = 2;
|
||||
}
|
||||
|
||||
//
|
||||
// PDCP Statistics
|
||||
//
|
||||
|
||||
message flex_pdcp_stats {
|
||||
|
||||
optional uint32 pkt_tx = 1;
|
||||
optional uint32 pkt_tx_bytes = 2;
|
||||
optional uint32 pkt_tx_sn = 3;
|
||||
optional uint32 pkt_tx_w = 4;
|
||||
optional uint32 pkt_tx_bytes_w = 5;
|
||||
optional uint32 pkt_tx_aiat = 7;
|
||||
optional uint32 pkt_tx_aiat_w = 8;
|
||||
|
||||
optional uint32 pkt_rx = 9;
|
||||
optional uint32 pkt_rx_bytes = 10;
|
||||
optional uint32 pkt_rx_sn = 11;
|
||||
optional uint32 pkt_rx_w = 12;
|
||||
optional uint32 pkt_rx_bytes_w = 13;
|
||||
optional uint32 pkt_rx_aiat = 14;
|
||||
optional uint32 pkt_rx_aiat_w = 15;
|
||||
optional uint32 pkt_rx_oo = 16;
|
||||
|
||||
optional uint64 sfn=17;
|
||||
}
|
||||
|
||||
//
|
||||
// MAC Stats
|
||||
//
|
||||
|
||||
message flex_mac_stats {
|
||||
|
||||
optional uint32 tbs_dl = 1;
|
||||
optional uint32 tbs_ul = 2;
|
||||
optional uint32 prb_retx_dl = 3;
|
||||
optional uint32 prb_retx_ul = 4;
|
||||
optional uint32 prb_dl = 5;
|
||||
optional uint32 prb_ul = 6;
|
||||
optional uint32 mcs1_dl = 7;
|
||||
optional uint32 mcs2_dl = 8;
|
||||
optional uint32 mcs1_ul = 9;
|
||||
optional uint32 mcs2_ul = 10;
|
||||
optional uint32 total_bytes_sdus_ul = 11;
|
||||
optional uint32 total_bytes_sdus_dl = 12;
|
||||
optional uint32 total_prb_retx_dl = 13;
|
||||
optional uint32 total_prb_retx_ul = 14;
|
||||
optional uint32 total_prb_dl = 15;
|
||||
optional uint32 total_prb_ul = 16;
|
||||
optional uint32 total_pdu_dl = 17;
|
||||
optional uint32 total_pdu_ul = 18;
|
||||
optional uint32 total_tbs_dl = 19;
|
||||
optional uint32 total_tbs_ul = 20;
|
||||
repeated flex_mac_sdus_dl mac_sdus_dl = 21;
|
||||
optional uint32 harq_round = 22;
|
||||
}
|
||||
|
||||
message flex_mac_sdus_dl {
|
||||
|
||||
optional uint32 sdu_length = 1;
|
||||
optional uint32 lcid = 2;
|
||||
}
|
||||
|
||||
//
|
||||
// GTP stats
|
||||
//
|
||||
|
||||
message flex_gtp_stats {
|
||||
optional uint32 e_rab_id = 1;
|
||||
optional uint32 teid_enb = 2;
|
||||
optional string addr_enb = 3;
|
||||
optional uint32 teid_sgw = 4;
|
||||
optional string addr_sgw = 5;
|
||||
}
|
||||
|
||||
//
|
||||
// S1AP stats
|
||||
//
|
||||
|
||||
message flex_s1ap_ue {
|
||||
optional string mme_s1_ip = 1; // IP of MME to which UE is connected
|
||||
optional uint32 enb_ue_s1ap_id = 2; // S1AP ID on eNodeB side for UE
|
||||
optional uint32 mme_ue_s1ap_id = 3; // S1AP ID on MME side for UE
|
||||
optional flex_plmn selected_plmn = 4; // UE-selected PLMN in RRC Conn Setup Cplt
|
||||
}
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
//import "header.proto";
|
||||
import "stats_common.proto";
|
||||
|
||||
//
|
||||
// Bodies of statistics report requests
|
||||
//
|
||||
|
||||
message flex_complete_stats_request {
|
||||
optional flex_stats_report_freq report_frequency = 1;
|
||||
optional uint32 sf = 2;
|
||||
optional uint32 cell_report_flags = 3;
|
||||
optional uint32 ue_report_flags = 4;
|
||||
}
|
||||
|
||||
message flex_cell_stats_request {
|
||||
repeated uint32 cell = 1;
|
||||
optional uint32 flags = 2;
|
||||
}
|
||||
|
||||
message flex_ue_stats_request {
|
||||
repeated uint32 rnti = 1;
|
||||
optional uint32 flags = 2;
|
||||
}
|
||||
|
||||
//
|
||||
// Bodies of statistics reports
|
||||
//
|
||||
|
||||
// The full statistics report for a specific cell
|
||||
message flex_cell_stats_report {
|
||||
optional uint32 carrier_index = 1;
|
||||
optional uint32 flags = 2;
|
||||
optional flex_noise_interference_report noise_inter_report = 3;
|
||||
}
|
||||
|
||||
// Statistics report for a specific UE
|
||||
message flex_ue_stats_report {
|
||||
optional uint32 rnti = 1;
|
||||
optional uint32 flags = 2;
|
||||
repeated uint32 bsr = 3;
|
||||
optional uint32 phr = 4;
|
||||
repeated flex_rlc_bsr rlc_report = 5;
|
||||
optional uint32 pending_mac_ces = 6;
|
||||
optional flex_dl_cqi_report dl_cqi_report = 7;
|
||||
optional flex_paging_buffer_report pbr = 8;
|
||||
optional flex_ul_cqi_report ul_cqi_report = 9;
|
||||
optional flex_rrc_measurements rrc_measurements = 10;
|
||||
optional flex_pdcp_stats pdcp_stats = 11;
|
||||
optional flex_mac_stats mac_stats = 12;
|
||||
repeated flex_gtp_stats gtp_stats = 13;
|
||||
optional flex_s1ap_ue s1ap_stats = 14;
|
||||
}
|
||||
|
||||
//
|
||||
// Types of statistics related enums
|
||||
//
|
||||
|
||||
|
||||
//Types of statistics requested by the controller
|
||||
enum flex_stats_type {
|
||||
FLST_COMPLETE_STATS = 0;
|
||||
FLST_CELL_STATS = 1;
|
||||
FLST_UE_STATS = 2;
|
||||
}
|
||||
|
||||
// Report frequency for the requested statistics
|
||||
enum flex_stats_report_freq {
|
||||
FLSRF_ONCE = 0;
|
||||
FLSRF_PERIODICAL = 1;
|
||||
FLSRF_CONTINUOUS = 2;
|
||||
FLSRF_OFF = 3;
|
||||
}
|
||||
|
||||
// Flags for cell statistics
|
||||
enum flex_cell_stats_type {
|
||||
FLCST_NOISE_INTERFERENCE = 1;
|
||||
}
|
||||
|
||||
// Flags for UE-related statistics
|
||||
enum flex_ue_stats_type {
|
||||
FLUST_BSR = 1;
|
||||
FLUST_PHR = 2;
|
||||
FLUST_RLC_BS = 4;
|
||||
FLUST_MAC_CE_BS = 8;
|
||||
FLUST_DL_CQI = 16;
|
||||
FLUST_PBS = 32;
|
||||
FLUST_UL_CQI = 64;
|
||||
FLUST_MAC_STATS = 128;
|
||||
|
||||
FLUST_PDCP_STATS = 1024;
|
||||
FLUST_GTP_STATS = 2048;
|
||||
FLUST_S1AP_STATS = 4096;
|
||||
FLUST_RRC_MEASUREMENTS = 65536;
|
||||
// To be extended with more types of stats
|
||||
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
syntax = "proto2";
|
||||
package protocol;
|
||||
|
||||
enum flex_harq_status {
|
||||
FLHS_ACK = 0;
|
||||
FLHS_NACK = 1;
|
||||
FLHS_DTX = 2;
|
||||
}
|
||||
|
||||
enum flex_reception_status {
|
||||
FLRS_OK = 0;
|
||||
FLRS_NOT_OK = 1;
|
||||
FLRS_NOT_VALID = 2;
|
||||
}
|
||||
|
||||
message flex_dl_info {
|
||||
optional uint32 rnti = 1;
|
||||
optional uint32 harq_process_id = 2;
|
||||
repeated uint32 harq_status = 3;
|
||||
optional uint32 serv_cell_index = 4;
|
||||
}
|
||||
|
||||
message flex_ul_info {
|
||||
optional uint32 rnti = 1;
|
||||
repeated uint32 ul_reception = 2;
|
||||
optional uint32 reception_status = 3;
|
||||
optional uint32 tpc = 4;
|
||||
optional uint32 serv_cell_index = 5;
|
||||
optional uint32 rssi = 6;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
# include "s1ap_eNB.h"
|
||||
# include "sctp_eNB_task.h"
|
||||
# include "gtpv1u_eNB_task.h"
|
||||
# include "flexran_agent.h"
|
||||
|
||||
# include "x2ap_eNB.h"
|
||||
# include "x2ap_messages_types.h"
|
||||
@@ -260,10 +259,6 @@ void *eNB_app_task(void *args_p) {
|
||||
LOG_I(ENB_APP, "Received %s\n", ITTI_MSG_NAME(msg_p));
|
||||
break;
|
||||
|
||||
case SOFT_RESTART_MESSAGE:
|
||||
handle_reconfiguration(instance);
|
||||
break;
|
||||
|
||||
case S1AP_REGISTER_ENB_CNF:
|
||||
AssertFatal(!NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received S1AP_REGISTER_ENB_CNF\n");
|
||||
if (EPC_MODE_ENABLED) {
|
||||
@@ -550,55 +545,3 @@ void *eNB_app_task(void *args_p) {
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void handle_reconfiguration(module_id_t mod_id) {
|
||||
struct timespec start, end;
|
||||
clock_gettime(CLOCK_MONOTONIC, &start);
|
||||
flexran_agent_info_t *flexran = RC.flexran[mod_id];
|
||||
LOG_I(ENB_APP, "lte-softmodem soft-restart requested\n");
|
||||
|
||||
if (ENB_WAIT == flexran->node_ctrl_state) {
|
||||
/* this is already waiting, just release */
|
||||
pthread_mutex_lock(&flexran->mutex_node_ctrl);
|
||||
flexran->node_ctrl_state = ENB_NORMAL_OPERATION;
|
||||
pthread_mutex_unlock(&flexran->mutex_node_ctrl);
|
||||
pthread_cond_signal(&flexran->cond_node_ctrl);
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop_L1L2(mod_id) < 0) {
|
||||
LOG_E(ENB_APP, "can not stop lte-softmodem, aborting restart\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* node_ctrl_state should have value ENB_MAKE_WAIT only if this method is not
|
||||
* executed by the FlexRAN thread */
|
||||
if (ENB_MAKE_WAIT == flexran->node_ctrl_state) {
|
||||
LOG_I(ENB_APP, " * eNB %d: Waiting for FlexRAN RTController command *\n", mod_id);
|
||||
pthread_mutex_lock(&flexran->mutex_node_ctrl);
|
||||
flexran->node_ctrl_state = ENB_WAIT;
|
||||
|
||||
while (ENB_NORMAL_OPERATION != flexran->node_ctrl_state)
|
||||
pthread_cond_wait(&flexran->cond_node_ctrl, &flexran->mutex_node_ctrl);
|
||||
|
||||
pthread_mutex_unlock(&flexran->mutex_node_ctrl);
|
||||
}
|
||||
|
||||
if (restart_L1L2(mod_id) < 0) {
|
||||
LOG_E(ENB_APP, "can not restart, killing lte-softmodem\n");
|
||||
exit_fun("can not restart L1L2, killing lte-softmodem");
|
||||
return;
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &end);
|
||||
end.tv_sec -= start.tv_sec;
|
||||
|
||||
if (end.tv_nsec >= start.tv_nsec) {
|
||||
end.tv_nsec -= start.tv_nsec;
|
||||
} else {
|
||||
end.tv_sec -= 1;
|
||||
end.tv_nsec = end.tv_nsec - start.tv_nsec + 1000000000;
|
||||
}
|
||||
|
||||
LOG_I(ENB_APP, "lte-softmodem restart succeeded in %ld.%ld s\n", end.tv_sec, end.tv_nsec / 1000000);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,4 @@
|
||||
|
||||
void *eNB_app_task(void *args_p);
|
||||
|
||||
void handle_reconfiguration(module_id_t mod_id);
|
||||
|
||||
#endif /* ENB_APP_H_ */
|
||||
|
||||
@@ -65,45 +65,6 @@ extern char *worker_config;
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
|
||||
void RCconfig_flexran() {
|
||||
/* get number of eNBs */
|
||||
paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
|
||||
config_get(ENBSParams, sizeof(ENBSParams)/sizeof(paramdef_t), NULL);
|
||||
uint16_t num_enbs = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt;
|
||||
paramdef_t flexranParams[] = FLEXRANPARAMS_DESC;
|
||||
config_get(flexranParams, sizeof(flexranParams)/sizeof(paramdef_t), CONFIG_STRING_NETWORK_CONTROLLER_CONFIG);
|
||||
|
||||
if (!RC.flexran) {
|
||||
RC.flexran = calloc(num_enbs, sizeof(flexran_agent_info_t *));
|
||||
AssertFatal(RC.flexran,
|
||||
"can't ALLOCATE %zu Bytes for %d flexran agent info with size %zu\n",
|
||||
num_enbs * sizeof(flexran_agent_info_t *),
|
||||
num_enbs, sizeof(flexran_agent_info_t *));
|
||||
}
|
||||
|
||||
for (uint16_t i = 0; i < num_enbs; i++) {
|
||||
RC.flexran[i] = calloc(1, sizeof(flexran_agent_info_t));
|
||||
AssertFatal(RC.flexran[i],
|
||||
"can't ALLOCATE %zu Bytes for flexran agent info (iteration %d/%d)\n",
|
||||
sizeof(flexran_agent_info_t), i + 1, num_enbs);
|
||||
/* if config says "yes", enable Agent, in all other cases it's like "no" */
|
||||
RC.flexran[i]->enabled = strcasecmp(*(flexranParams[FLEXRAN_ENABLED].strptr), "yes") == 0;
|
||||
|
||||
/* if not enabled, simply skip the rest, it is not needed anyway */
|
||||
if (!RC.flexran[i]->enabled)
|
||||
continue;
|
||||
|
||||
RC.flexran[i]->interface_name = strdup(*(flexranParams[FLEXRAN_INTERFACE_NAME_IDX].strptr));
|
||||
//inet_ntop(AF_INET, &(enb_properties->properties[mod_id]->flexran_agent_ipv4_address), in_ip, INET_ADDRSTRLEN);
|
||||
RC.flexran[i]->remote_ipv4_addr = strdup(*(flexranParams[FLEXRAN_IPV4_ADDRESS_IDX].strptr));
|
||||
RC.flexran[i]->remote_port = *(flexranParams[FLEXRAN_PORT_IDX].uptr);
|
||||
RC.flexran[i]->cache_name = strdup(*(flexranParams[FLEXRAN_CACHE_IDX].strptr));
|
||||
RC.flexran[i]->node_ctrl_state = strcasecmp(*(flexranParams[FLEXRAN_AWAIT_RECONF_IDX].strptr), "yes") == 0 ? ENB_WAIT : ENB_NORMAL_OPERATION;
|
||||
RC.flexran[i]->mod_id = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RCconfig_L1(void) {
|
||||
int i,j;
|
||||
paramdef_t L1_Params[] = L1PARAMS_DESC;
|
||||
@@ -3220,6 +3181,4 @@ void read_config_and_init(void) {
|
||||
memset((void *)RC.rrc[enb_id], 0, sizeof(eNB_RRC_INST));
|
||||
RCconfig_RRC(enb_id, RC.rrc[enb_id],macrlc_has_f1[enb_id]);
|
||||
}
|
||||
|
||||
RCconfig_flexran();
|
||||
}
|
||||
|
||||
@@ -100,7 +100,6 @@ typedef struct ru_config_s {
|
||||
uint8_t if_compress;
|
||||
} ru_config_t;
|
||||
|
||||
extern void RCconfig_flexran(void);
|
||||
extern void RCconfig_L1(void);
|
||||
extern void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]);
|
||||
extern void UE_config_stub_pnf(void);
|
||||
|
||||
@@ -1153,34 +1153,6 @@ typedef struct srb1_params_s {
|
||||
#define CONFIG_STRING_L1_LIST "L1s"
|
||||
#define CONFIG_STRING_L1_CONFIG "l1_config"
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER"
|
||||
|
||||
#define CONFIG_STRING_FLEXRAN_ENABLED "FLEXRAN_ENABLED"
|
||||
#define CONFIG_STRING_FLEXRAN_INTERFACE_NAME "FLEXRAN_INTERFACE_NAME"
|
||||
#define CONFIG_STRING_FLEXRAN_IPV4_ADDRESS "FLEXRAN_IPV4_ADDRESS"
|
||||
#define CONFIG_STRING_FLEXRAN_PORT "FLEXRAN_PORT"
|
||||
#define CONFIG_STRING_FLEXRAN_CACHE "FLEXRAN_CACHE"
|
||||
#define CONFIG_STRING_FLEXRAN_AWAIT_RECONF "FLEXRAN_AWAIT_RECONF"
|
||||
|
||||
#define FLEXRAN_ENABLED 0
|
||||
#define FLEXRAN_INTERFACE_NAME_IDX 1
|
||||
#define FLEXRAN_IPV4_ADDRESS_IDX 2
|
||||
#define FLEXRAN_PORT_IDX 3
|
||||
#define FLEXRAN_CACHE_IDX 4
|
||||
#define FLEXRAN_AWAIT_RECONF_IDX 5
|
||||
|
||||
#define FLEXRANPARAMS_DESC { \
|
||||
{CONFIG_STRING_FLEXRAN_ENABLED, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_FLEXRAN_INTERFACE_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_FLEXRAN_IPV4_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_FLEXRAN_PORT, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_FLEXRAN_CACHE, NULL, 0, strptr:NULL, defstrval:"/mnt/oai_agent_cache", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_FLEXRAN_AWAIT_RECONF, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0} \
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* CU/DU configuration section names*/
|
||||
|
||||
@@ -1,268 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent.h
|
||||
* \brief top level flexran agent receive thread and itti task
|
||||
* \author Xenofon Foukas and Navid Nikaein and shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include "flexran_agent.h"
|
||||
#include <common/utils/system.h>
|
||||
|
||||
#include <pthread.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
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 *flexran_agent_task(void *args){
|
||||
MessageDef *msg_p = NULL;
|
||||
int result;
|
||||
|
||||
itti_mark_task_ready(TASK_FLEXRAN_AGENT);
|
||||
|
||||
do {
|
||||
// Wait for a message
|
||||
itti_receive_msg (TASK_FLEXRAN_AGENT, &msg_p);
|
||||
DevAssert(msg_p != NULL);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
LOG_W(FLEXRAN_AGENT, " *** Exiting FLEXRAN thread\n");
|
||||
itti_exit_task ();
|
||||
break;
|
||||
|
||||
case MESSAGE_TEST:
|
||||
LOG_I(FLEXRAN_AGENT, "Received %s\n", ITTI_MSG_NAME(msg_p));
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(FLEXRAN_AGENT, "Received unexpected message %s\n", ITTI_MSG_NAME (msg_p));
|
||||
break;
|
||||
}
|
||||
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
} while (1);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *receive_thread(void *args) {
|
||||
|
||||
flexran_agent_info_t *d = args;
|
||||
void *data;
|
||||
int size;
|
||||
int priority;
|
||||
err_code_t err_code=0;
|
||||
|
||||
Protocol__FlexranMessage *msg;
|
||||
pthread_setname_np(pthread_self(), "flexran_rx_thr");
|
||||
|
||||
while (1) {
|
||||
|
||||
while ((size = flexran_agent_msg_recv(d->mod_id, FLEXRAN_AGENT_DEFAULT, &data, &priority)) > 0) {
|
||||
|
||||
LOG_D(FLEXRAN_AGENT,"received message with size %d\n", size);
|
||||
|
||||
// Invoke the message handler
|
||||
msg=flexran_agent_handle_message(d->mod_id, data, size);
|
||||
|
||||
free(data);
|
||||
|
||||
// check if there is something to send back to the controller
|
||||
if (msg != NULL){
|
||||
data=flexran_agent_pack_message(msg,&size);
|
||||
|
||||
if (flexran_agent_msg_send(d->mod_id, FLEXRAN_AGENT_DEFAULT, data, size, priority)) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_ENQUEUING;
|
||||
goto error;
|
||||
}
|
||||
|
||||
LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
error:
|
||||
if (err_code != 0)
|
||||
LOG_E(FLEXRAN_AGENT,"receive_thread: error %d occured\n",err_code);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int channel_container_init = 0;
|
||||
int flexran_agent_start(mid_t mod_id)
|
||||
{
|
||||
flexran_agent_info_t *flexran = RC.flexran[mod_id];
|
||||
int channel_id;
|
||||
char *in_ip = flexran->remote_ipv4_addr;
|
||||
uint16_t in_port = flexran->remote_port;
|
||||
|
||||
/* if this agent is disabled, return and don't do anything */
|
||||
if (!flexran->enabled) {
|
||||
LOG_I(FLEXRAN_AGENT, "FlexRAN Agent for eNB %d is DISABLED\n", mod_id);
|
||||
return 100;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the channel container
|
||||
*/
|
||||
if (!channel_container_init) {
|
||||
flexran_agent_init_channel_container();
|
||||
channel_container_init = 1;
|
||||
}
|
||||
/*Create the async channel info*/
|
||||
flexran_agent_async_channel_t *channel_info = flexran_agent_async_channel_info(mod_id, in_ip, in_port);
|
||||
|
||||
if (!channel_info) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not create channel_info\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*Create a channel using the async channel info*/
|
||||
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) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not create channel\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
flexran_agent_channel_t *channel = get_channel(channel_id);
|
||||
|
||||
if (channel == NULL) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not get channel for channel_id %d\n", channel_id);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/*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):
|
||||
*flexran_agent_register_channel(mod_id, channel, FLEXRAN_AGENT_MAC);
|
||||
*/
|
||||
|
||||
pthread_t t;
|
||||
threadCreate(&t, receive_thread, flexran, "flexran", -1, OAI_PRIORITY_RT);
|
||||
|
||||
/* Register and initialize the control modules depending on capabilities.
|
||||
* After registering, calling flexran_agent_get_*_xface() tells whether a
|
||||
* control module is operational */
|
||||
uint32_t caps = flexran_get_capabilities_mask(mod_id);
|
||||
LOG_I(FLEXRAN_AGENT, "Agent handles BS ID %ld, capabilities=0x%x => handling%s%s%s%s%s%s%s%s%s\n",
|
||||
flexran_get_bs_id(mod_id), caps,
|
||||
FLEXRAN_CAP_LOPHY(caps) ? " LOPHY" : "",
|
||||
FLEXRAN_CAP_HIPHY(caps) ? " HIPHY" : "",
|
||||
FLEXRAN_CAP_LOMAC(caps) ? " LOMAC" : "",
|
||||
FLEXRAN_CAP_HIMAC(caps) ? " HIMAC" : "",
|
||||
FLEXRAN_CAP_RLC(caps) ? " RLC" : "",
|
||||
FLEXRAN_CAP_PDCP(caps) ? " PDCP" : "",
|
||||
FLEXRAN_CAP_SDAP(caps) ? " SDAP" : "",
|
||||
FLEXRAN_CAP_RRC(caps) ? " RRC" : "",
|
||||
FLEXRAN_CAP_S1AP(caps) ? " S1AP" : "");
|
||||
|
||||
if (FLEXRAN_CAP_LOPHY(caps) || FLEXRAN_CAP_HIPHY(caps)) {
|
||||
flexran_agent_register_phy_xface(mod_id);
|
||||
LOG_I(FLEXRAN_AGENT, "registered PHY interface/CM for eNB %d\n", mod_id);
|
||||
}
|
||||
|
||||
if (FLEXRAN_CAP_LOMAC(caps) || FLEXRAN_CAP_HIMAC(caps)) {
|
||||
flexran_agent_register_mac_xface(mod_id);
|
||||
flexran_agent_init_mac_agent(mod_id);
|
||||
LOG_I(FLEXRAN_AGENT, "registered MAC interface/CM for eNB %d\n", mod_id);
|
||||
}
|
||||
|
||||
if (FLEXRAN_CAP_RRC(caps)) {
|
||||
flexran_agent_register_rrc_xface(mod_id);
|
||||
LOG_I(FLEXRAN_AGENT, "registered RRC interface/CM for eNB %d\n", mod_id);
|
||||
}
|
||||
|
||||
if (FLEXRAN_CAP_PDCP(caps)) {
|
||||
flexran_agent_register_pdcp_xface(mod_id);
|
||||
LOG_I(FLEXRAN_AGENT, "registered PDCP interface/CM for eNB %d\n", mod_id);
|
||||
}
|
||||
|
||||
if (FLEXRAN_CAP_S1AP(caps)) {
|
||||
flexran_agent_register_s1ap_xface(mod_id);
|
||||
LOG_I(FLEXRAN_AGENT, "registered S1AP interface/CM for eNB %d\n", mod_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* initilize a timer
|
||||
*/
|
||||
|
||||
flexran_agent_timer_init(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_FLEXRAN_AGENT, flexran_agent_task, flexran) < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "Create task for FlexRAN Agent failed\n");
|
||||
return -1;
|
||||
}
|
||||
agent_task_created = 1;
|
||||
}
|
||||
|
||||
/* Init the app sublayer */
|
||||
flexran_agent_app_init(mod_id);
|
||||
|
||||
pthread_mutex_init(&flexran->mutex_node_ctrl, NULL);
|
||||
pthread_cond_init(&flexran->cond_node_ctrl, NULL);
|
||||
|
||||
if (flexran->node_ctrl_state == ENB_WAIT) {
|
||||
/* wait three seconds before showing message and waiting "for real".
|
||||
* This way, the message is (hopefully...) the last one and the user knows
|
||||
* what is happening. If the controller sends a reconfiguration message in
|
||||
* the meantime, the softmodem will never wait */
|
||||
sleep(3);
|
||||
LOG_I(ENB_APP, " * eNB %d: Waiting for FlexRAN RTController command *\n", mod_id);
|
||||
pthread_mutex_lock(&flexran->mutex_node_ctrl);
|
||||
while (ENB_NORMAL_OPERATION != flexran->node_ctrl_state)
|
||||
pthread_cond_wait(&flexran->cond_node_ctrl, &flexran->mutex_node_ctrl);
|
||||
pthread_mutex_unlock(&flexran->mutex_node_ctrl);
|
||||
|
||||
/* reconfigure RRC again, the agent might have changed the configuration */
|
||||
MessageDef *msg_p = itti_alloc_new_message(TASK_ENB_APP, 0, RRC_CONFIGURATION_REQ);
|
||||
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[mod_id]->configuration;
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(mod_id), msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
LOG_E(FLEXRAN_AGENT, "%s(): there was an error\n", __func__);
|
||||
return 1;
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent.h
|
||||
* \brief top level flexran agent
|
||||
* \author Navid Nikaein and Xenofon Foukas
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_H_
|
||||
#define FLEXRAN_AGENT_H_
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_async.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
#include "flexran_agent_timer.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
#include "flexran_agent_phy.h"
|
||||
#include "flexran_agent_mac.h"
|
||||
#include "flexran_agent_rrc.h"
|
||||
#include "flexran_agent_pdcp.h"
|
||||
#include "flexran_agent_s1ap.h"
|
||||
#include "flexran_agent_app.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
|
||||
/* Initiation of the eNodeB agent */
|
||||
int flexran_agent_start(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 *flexran_agent_task(void *args);
|
||||
|
||||
#endif
|
||||
@@ -1,207 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_app.c
|
||||
* \brief CM for handling of applications
|
||||
* \author Robert Schmidt
|
||||
* \date 2020
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_app.h"
|
||||
#include "queue.h"
|
||||
#include <dlfcn.h>
|
||||
|
||||
/* app definition */
|
||||
typedef struct flexran_agent_app_internal_s {
|
||||
char *name;
|
||||
void *dl_handle;
|
||||
flexran_agent_app_t *app;
|
||||
|
||||
SLIST_ENTRY (flexran_agent_app_internal_s) entries;
|
||||
} flexran_agent_app_internal_t;
|
||||
|
||||
/* a list of all apps */
|
||||
SLIST_HEAD(flexran_apps_s, flexran_agent_app_internal_s) flexran_apps[NUM_MAX_ENB];
|
||||
|
||||
void flexran_agent_app_init(mid_t mod_id) {
|
||||
//flexran_apps[mod_id] = SLIST_HEAD_INITIALIZER(flexran_apps[mod_id]);
|
||||
SLIST_INIT(&flexran_apps[mod_id]);
|
||||
}
|
||||
|
||||
int flexran_agent_start_app_direct(mid_t mod_id, flexran_agent_app_t *app, char *name) {
|
||||
app->start(mod_id, NULL, 0);
|
||||
|
||||
flexran_agent_app_internal_t *so = malloc(sizeof(flexran_agent_app_internal_t));
|
||||
DevAssert(so);
|
||||
so->name = strdup(name);
|
||||
DevAssert(so->name);
|
||||
so->dl_handle = NULL;
|
||||
so->app = app;
|
||||
SLIST_INSERT_HEAD(&flexran_apps[mod_id], so, entries);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_start_app(mid_t mod_id, Protocol__FlexAgentReconfigurationSubsystem *sub) {
|
||||
char s[512];
|
||||
int rc = flexran_agent_map_name_to_delegated_object(mod_id, sub->name, s, 512);
|
||||
if (rc < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "cannot map name %s\n", sub->name);
|
||||
return -1;
|
||||
}
|
||||
void *h = dlopen(s, RTLD_NOW);
|
||||
if (!h) {
|
||||
LOG_E(FLEXRAN_AGENT, "cannot open shared object %s\n", s);
|
||||
return -1;
|
||||
}
|
||||
flexran_agent_app_t *app = dlsym(h, "app");
|
||||
if (!app) {
|
||||
LOG_E(FLEXRAN_AGENT, "cannot locate app inside of shared object %s\n", s);
|
||||
return -1;
|
||||
}
|
||||
app->start(mod_id, sub->params, sub->n_params);
|
||||
|
||||
flexran_agent_app_internal_t *so = malloc(sizeof(flexran_agent_app_internal_t));
|
||||
DevAssert(so);
|
||||
so->name = strdup(sub->name);
|
||||
DevAssert(so->name);
|
||||
so->dl_handle = h;
|
||||
so->app = app;
|
||||
SLIST_INSERT_HEAD(&flexran_apps[mod_id], so, entries);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_stop_app(mid_t mod_id, char *name) {
|
||||
flexran_agent_app_internal_t *so = NULL;
|
||||
SLIST_FOREACH(so, &flexran_apps[mod_id], entries) {
|
||||
if (strcmp(so->name, name) == 0) {
|
||||
LOG_I(FLEXRAN_AGENT, "application %s seems to be running\n", name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!so) {
|
||||
LOG_E(FLEXRAN_AGENT, "no such application %s found\n", name);
|
||||
return -1;
|
||||
}
|
||||
flexran_agent_app_t *app = so->app;
|
||||
app->stop(mod_id);
|
||||
|
||||
SLIST_REMOVE(&flexran_apps[mod_id], so, flexran_agent_app_internal_s, entries);
|
||||
free(so->name);
|
||||
if (so->dl_handle)
|
||||
dlclose(so->dl_handle);
|
||||
free(so);
|
||||
so = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_reconfig_app(
|
||||
mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem *sub)
|
||||
{
|
||||
flexran_agent_app_internal_t *so = NULL;
|
||||
SLIST_FOREACH(so, &flexran_apps[mod_id], entries) {
|
||||
if (strcmp(so->name, sub->name) == 0) {
|
||||
LOG_I(FLEXRAN_AGENT, "application %s is running\n", sub->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!so) {
|
||||
LOG_E(FLEXRAN_AGENT, "no such application %s found\n", sub->name);
|
||||
return -1;
|
||||
}
|
||||
flexran_agent_app_t *app = so->app;
|
||||
LOG_I(FLEXRAN_AGENT, "reconfiguring app %s\n", so->name);
|
||||
app->reconfig(mod_id, sub->params, sub->n_params);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flexran_agent_custom_command_app(
|
||||
mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem *sub)
|
||||
{
|
||||
flexran_agent_app_internal_t *so = NULL;
|
||||
SLIST_FOREACH(so, &flexran_apps[mod_id], entries) {
|
||||
if (strcmp(so->name, sub->name) == 0) {
|
||||
LOG_I(FLEXRAN_AGENT, "application %s is running\n", sub->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!so) {
|
||||
LOG_E(FLEXRAN_AGENT, "no such application %s found\n", sub->name);
|
||||
return -1;
|
||||
}
|
||||
void (*cmd)(mid_t, Protocol__FlexAgentReconfigurationSubsystem *) = dlsym(so->dl_handle, sub->behavior);
|
||||
if (!cmd) {
|
||||
LOG_E(FLEXRAN_AGENT,
|
||||
"cannot locate command %s inside of app %s\n",
|
||||
sub->behavior,
|
||||
so->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG_I(FLEXRAN_AGENT,
|
||||
"calling command %s inside of app %s\n",
|
||||
sub->behavior,
|
||||
so->name);
|
||||
(*cmd)(mod_id, sub);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flexran_agent_handle_apps(
|
||||
mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem **subs,
|
||||
int n_subs) {
|
||||
for (int i = 0; i < n_subs; ++i) {
|
||||
Protocol__FlexAgentReconfigurationSubsystem *s = subs[i];
|
||||
if (strcmp(s->behavior, "start") == 0) {
|
||||
int rc = flexran_agent_start_app(mod_id, s);
|
||||
if (rc == 0)
|
||||
LOG_I(FLEXRAN_AGENT, "application \"%s\" started\n", s->name);
|
||||
} else if (strcmp(s->behavior, "stop") == 0) {
|
||||
int rc = flexran_agent_stop_app(mod_id, s->name);
|
||||
if (rc == 0)
|
||||
LOG_I(FLEXRAN_AGENT, "application \"%s\" stopped\n", s->name);
|
||||
} else if (strcmp(s->behavior, "reconfig") == 0) {
|
||||
flexran_agent_reconfig_app(mod_id, s);
|
||||
} else {
|
||||
flexran_agent_custom_command_app(mod_id, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void flexran_agent_fill_loaded_apps(mid_t mod_id,
|
||||
Protocol__FlexEnbConfigReply *reply) {
|
||||
int n = 0;
|
||||
flexran_agent_app_internal_t *so = NULL;
|
||||
SLIST_FOREACH(so, &flexran_apps[mod_id], entries)
|
||||
++n;
|
||||
reply->n_loadedapps = n;
|
||||
reply->loadedapps = calloc(n, sizeof(char *));
|
||||
if (!reply->loadedapps) {
|
||||
reply->n_loadedapps = 0;
|
||||
return;
|
||||
}
|
||||
n = 0;
|
||||
SLIST_FOREACH(so, &flexran_apps[mod_id], entries)
|
||||
reply->loadedapps[n++] = so->name;
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_app.h
|
||||
* \brief Common app definitions
|
||||
* \author Robert Schmidt
|
||||
* \date 2020
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef BURST_ANALYSIS_LL_H_
|
||||
#define BURST_ANALYSIS_LL_H_
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_async.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
#include "flexran_agent_timer.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
#include "flexran_agent_phy.h"
|
||||
#include "flexran_agent_mac.h"
|
||||
#include "flexran_agent_rrc.h"
|
||||
#include "flexran_agent_pdcp.h"
|
||||
#include "flexran_agent_s1ap.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
|
||||
/* App type: to be implemented by shared libraries */
|
||||
typedef struct {
|
||||
int (*start)(mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem__ParamsEntry **p,
|
||||
int n_p);
|
||||
int (*reconfig)(mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem__ParamsEntry **p,
|
||||
int n_p);
|
||||
int (* stop)(mid_t mod_id);
|
||||
} flexran_agent_app_t;
|
||||
|
||||
/* FlexRAN agent app handling init */
|
||||
void flexran_agent_app_init(mid_t mod_id);
|
||||
|
||||
/* Start an app from within the agent */
|
||||
int flexran_agent_start_app_direct(mid_t mod_id, flexran_agent_app_t *app, char *name);
|
||||
|
||||
/* FlexRAN agent handler to setup/teardown apps */
|
||||
void flexran_agent_handle_apps(
|
||||
mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem **subs,
|
||||
int n_subs);
|
||||
|
||||
/* Fills the enb_config_reply with the currently loaded (started) apps */
|
||||
void flexran_agent_fill_loaded_apps(mid_t mod_id,
|
||||
Protocol__FlexEnbConfigReply *reply);
|
||||
|
||||
#endif
|
||||
@@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_async.c
|
||||
* \brief channel implementation for async interface
|
||||
* \author Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_async.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
flexran_agent_async_channel_t * flexran_agent_async_channel_info(mid_t mod_id, char *dst_ip, uint16_t dst_port) {
|
||||
|
||||
flexran_agent_async_channel_t *channel;
|
||||
channel = (flexran_agent_async_channel_t *) malloc(sizeof(flexran_agent_channel_t));
|
||||
|
||||
if (channel == NULL) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not allocate memory for flexran_agent_async_channel_t\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
channel->enb_id = mod_id;
|
||||
/*Create a socket*/
|
||||
channel->link = new_link_client(dst_ip, dst_port);
|
||||
if (channel->link == NULL) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not create new link client\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
/*
|
||||
* create a message queue
|
||||
*/
|
||||
// Set size of queues statically for now
|
||||
// channel->send_queue = new_message_queue(500);
|
||||
// not using the circular buffer: affects the PDCP split
|
||||
channel->send_queue = new_message_queue();
|
||||
if (channel->send_queue == NULL) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not create send_queue\n");
|
||||
goto error;
|
||||
}
|
||||
// not using the circular buffer: affects the PDCP split
|
||||
//channel->receive_queue = new_message_queue(500);
|
||||
channel->receive_queue = new_message_queue();
|
||||
if (channel->receive_queue == NULL) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not create send_queue\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* create a link manager */
|
||||
channel->manager = create_link_manager(channel->send_queue, channel->receive_queue, channel->link);
|
||||
if (channel->manager == NULL) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not create link_manager\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
return channel;
|
||||
|
||||
error:
|
||||
LOG_I(FLEXRAN_AGENT, "%s(): there was an error\n", __func__);
|
||||
if (channel){
|
||||
free(channel);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int flexran_agent_async_msg_send(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_put(channel->send_queue, data, size, priority);
|
||||
}
|
||||
|
||||
int flexran_agent_async_msg_recv(void **data, 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, priority);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
destroy_message_queue(channel_info->send_queue);
|
||||
destroy_message_queue(channel_info->receive_queue);
|
||||
|
||||
close_link(channel_info->link);
|
||||
free(channel_info);
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_async.h
|
||||
* \brief channel implementation for async interface
|
||||
* \author Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_ASYNC_H_
|
||||
#define FLEXRAN_AGENT_ASYNC_H_
|
||||
|
||||
#include "flexran_agent_net_comm.h"
|
||||
|
||||
typedef struct {
|
||||
mid_t enb_id;
|
||||
socket_link_t *link;
|
||||
message_queue_t *send_queue;
|
||||
message_queue_t *receive_queue;
|
||||
link_manager_t *manager;
|
||||
} flexran_agent_async_channel_t;
|
||||
|
||||
/* Create a new channel for a given destination ip and destination 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 flexran_agent_async_msg_send(void *data, int size, int priority, void *channel_info);
|
||||
|
||||
/* Receive a message from a given channel */
|
||||
int flexran_agent_async_msg_recv(void **data, int *priority, void *channel_info);
|
||||
|
||||
/* Release a channel */
|
||||
void flexran_agent_async_release(flexran_agent_channel_t *channel);
|
||||
|
||||
|
||||
#endif /*FLEXRAN_AGENT_ASYNC_H_*/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,199 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_common.h
|
||||
* \brief common message primitves and utilities
|
||||
* \author Xenofon Foukas, Mohamed Kassem and Navid Nikaein and shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef FLEXRAN_AGENT_COMMON_H_
|
||||
#define FLEXRAN_AGENT_COMMON_H_
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "header.pb-c.h"
|
||||
#include "flexran.pb-c.h"
|
||||
#include "stats_messages.pb-c.h"
|
||||
#include "stats_common.pb-c.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "enb_config.h"
|
||||
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
|
||||
# include "tree.h"
|
||||
# include "intertask_interface.h"
|
||||
|
||||
#define FLEXRAN_VERSION 0
|
||||
|
||||
typedef int (*flexran_agent_message_decoded_callback)(
|
||||
mid_t mod_id,
|
||||
const void *params,
|
||||
Protocol__FlexranMessage **msg
|
||||
);
|
||||
|
||||
typedef int (*flexran_agent_message_destruction_callback)(
|
||||
Protocol__FlexranMessage *msg
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
|
||||
uint8_t is_initialized;
|
||||
volatile uint8_t cont_update;
|
||||
xid_t xid;
|
||||
Protocol__FlexranMessage *stats_req;
|
||||
Protocol__FlexranMessage *prev_stats_reply;
|
||||
|
||||
pthread_mutex_t *mutex;
|
||||
} stats_updates_context_t;
|
||||
|
||||
|
||||
/**********************************
|
||||
* FlexRAN protocol messages helper
|
||||
* functions and generic handlers
|
||||
**********************************/
|
||||
|
||||
/* Helper functions for message (de)serialization */
|
||||
int flexran_agent_serialize_message(Protocol__FlexranMessage *msg, void **buf, int *size);
|
||||
int flexran_agent_deserialize_message(void *data, int size, Protocol__FlexranMessage **msg);
|
||||
|
||||
/* Serialize message and then destroy the input flexran msg. Should be called when protocol
|
||||
message is created dynamically */
|
||||
void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
|
||||
int * size);
|
||||
|
||||
/* Calls destructor of the given message */
|
||||
err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Function to create the header for any FlexRAN protocol message */
|
||||
int flexran_create_header(xid_t xid, Protocol__FlexType type, Protocol__FlexHeader **header);
|
||||
|
||||
/* Hello protocol message constructor and destructor */
|
||||
int flexran_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_hello(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Echo request protocol message constructor and destructor */
|
||||
int flexran_agent_echo_request(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_echo_request(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Echo reply protocol message constructor and destructor */
|
||||
int flexran_agent_echo_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_echo_reply(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* eNodeB configuration reply message constructor and destructor */
|
||||
int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* UE configuration reply message constructor and destructor */
|
||||
int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_ue_config_reply(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Logical channel reply configuration message constructor and destructor */
|
||||
int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_lc_config_reply(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* eNodeB configuration request message constructor and destructor */
|
||||
int flexran_agent_enb_config_request(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_enb_config_request(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* UE configuration request message constructor */
|
||||
/* TODO: Need to define and implement destructor */
|
||||
int flexran_agent_destroy_ue_config_request(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Logical channel configuration request message constructor */
|
||||
/* TODO: Need to define and implement destructor */
|
||||
int flexran_agent_destroy_lc_config_request(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Control delegation message constructor and destructor */
|
||||
int flexran_agent_control_delegation(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_control_delegation(Protocol__FlexranMessage *msg);
|
||||
/* Map a name from a control_delegation message to a file name. The function
|
||||
* stat()s the file to check existence and returns the complete path name in
|
||||
* path. The length in path needs to be maxlen, the maximum length the path may
|
||||
* have. */
|
||||
int flexran_agent_map_name_to_delegated_object(mid_t mod_id, const char *name,
|
||||
char *path, int maxlen);
|
||||
|
||||
/* Policy reconfiguration message constructor and destructor */
|
||||
int flexran_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_agent_reconfiguration(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Policy reconfiguration request message destructor */
|
||||
int flexran_agent_destroy_control_delegation_request(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* rrc triggering measurement message constructor and destructor */
|
||||
int flexran_agent_rrc_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_rrc_reconfiguration(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* rrc triggering handover command message constructor and destructor */
|
||||
int flexran_agent_rrc_trigger_handover(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_rrc_trigger_handover(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* FlexRAN protocol message dispatcher function */
|
||||
Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id,
|
||||
uint8_t *data,
|
||||
uint32_t size);
|
||||
|
||||
/* Function to be used to send a message to a dispatcher once the appropriate event is triggered. */
|
||||
Protocol__FlexranMessage *flexran_agent_handle_timed_task(
|
||||
mid_t mod_id,
|
||||
Protocol__FlexranMessage *msg);
|
||||
|
||||
/*Top level Statistics hanlder*/
|
||||
Protocol__FlexranMessage *flexran_agent_send_stats_reply(
|
||||
mid_t mod_id,
|
||||
const Protocol__FlexranMessage *msg);
|
||||
|
||||
int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
|
||||
|
||||
/* Function to be used to handle reply message . */
|
||||
int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const Protocol__FlexStatsRequest *stats_req, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_stats_reply(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Top level Statistics request protocol message constructor and destructor */
|
||||
//int flexran_agent_stats_request(mid_t mod_id, xid_t xid, const stats_request_config_t *report_config, Protocol__FlexranMessage **msg);
|
||||
int flexran_agent_destroy_stats_request(Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Handle a received eNB config reply message as an "order" to reconfigure. It
|
||||
* does not come as a reconfiguration message as this is a "structured"
|
||||
* ProtoBuf message (as opposed to "unstructured" YAML). There is no destructor
|
||||
* since we do not reply to this message (yet). Instead, the controller has to
|
||||
* issue another eNB config request message. */
|
||||
int flexran_agent_handle_enb_config_reply(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg);
|
||||
|
||||
/* Handle a received UE config reply message as an "order" to reconfigure the
|
||||
* association of a UE to a slice. It does not come as a reconfiguration
|
||||
* message as this is a "structured" ProtoBuf message (as opposed to
|
||||
* "unstructured" YAML). There is no destructor since we do not reply to this
|
||||
* message (yet). Instead, the controller has to issue another eNB config
|
||||
* request message. */
|
||||
int flexran_agent_handle_ue_config_reply(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg);
|
||||
|
||||
/* Return the number of UEs in the BS of this agent across RRC/MAC. If they
|
||||
* disagree, prints an error and returns the minimum of both. */
|
||||
int flexran_agent_get_num_ues(mid_t mod_id);
|
||||
|
||||
#endif
|
||||
@@ -1,570 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_common_internal.c
|
||||
* \brief internal functions for common message primitves and utilities
|
||||
* \author Xenofon Foukas and N. Nikaein
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "flexran_agent_common_internal.h"
|
||||
#include "flexran_agent_mac_internal.h"
|
||||
#include "enb_app.h"
|
||||
|
||||
int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length) {
|
||||
|
||||
yaml_parser_t parser;
|
||||
yaml_event_t event;
|
||||
|
||||
int done = 0;
|
||||
|
||||
LOG_I(ENB_APP, "Time to apply a new policy \n");
|
||||
|
||||
yaml_parser_initialize(&parser);
|
||||
|
||||
yaml_parser_set_input_string(&parser, (unsigned char *) policy, strlen(policy));
|
||||
|
||||
while (!done) {
|
||||
if (!yaml_parser_parse(&parser, &event))
|
||||
goto error;
|
||||
|
||||
switch (event.type) {
|
||||
case YAML_STREAM_START_EVENT:
|
||||
break;
|
||||
case YAML_STREAM_END_EVENT:
|
||||
break;
|
||||
case YAML_DOCUMENT_START_EVENT:
|
||||
break;
|
||||
case YAML_DOCUMENT_END_EVENT:
|
||||
break;
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
break;
|
||||
case YAML_MAPPING_END_EVENT:
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
// Check the system name and call the proper handler
|
||||
// Check the system name and call the proper handler
|
||||
if (strcmp((char *) event.data.scalar.value, "enb") == 0) {
|
||||
LOG_I(ENB_APP, "This is intended for the enb system\n");
|
||||
// Call the enb handler
|
||||
if (parse_enb_id(mod_id, &parser) == -1) {
|
||||
LOG_E(ENB_APP, "cannot parse data for eNB\n");
|
||||
goto error;
|
||||
} else { // succeful parse and setting
|
||||
handle_reconfiguration(mod_id);
|
||||
}
|
||||
} else if (strcmp((char *) event.data.scalar.value, "mac") == 0) {
|
||||
LOG_D(ENB_APP, "This is intended for the mac system\n");
|
||||
// Call the mac handler
|
||||
if (parse_mac_config(mod_id, &parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp((char *) event.data.scalar.value, "rlc") == 0) {
|
||||
// Call the RLC handler
|
||||
LOG_D(ENB_APP, "This is intended for the rlc system\n");
|
||||
// TODO : Just skip it for now
|
||||
if (skip_system_section(&parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp((char *) event.data.scalar.value, "pdcp") == 0) {
|
||||
// Call the PDCP handler
|
||||
LOG_D(ENB_APP, "This is intended for the pdcp system\n");
|
||||
// TODO : Just skip it for now
|
||||
if (skip_system_section(&parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp((char *) event.data.scalar.value, "rrc") == 0) {
|
||||
// Call the RRC handler
|
||||
LOG_D(ENB_APP, "This is intended for the rrc system\n");
|
||||
// TODO : Just skip it for now
|
||||
if (skip_system_section(&parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// We are not expecting to find any other type of event at this level
|
||||
// of the hierarchy
|
||||
yaml_event_delete(&event);
|
||||
goto error;
|
||||
}
|
||||
|
||||
done = (event.type == YAML_STREAM_END_EVENT);
|
||||
|
||||
yaml_event_delete(&event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
yaml_parser_delete(&parser);
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
int parse_enb_id(mid_t mod_id, yaml_parser_t *parser) {
|
||||
yaml_event_t event;
|
||||
|
||||
char *endptr;
|
||||
// int is_array;
|
||||
|
||||
int done = 0;
|
||||
int mapping_started = 0;
|
||||
|
||||
while (!done) {
|
||||
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
|
||||
switch (event.type) {
|
||||
// We are expecting a mapping of parameters
|
||||
case YAML_SEQUENCE_START_EVENT:
|
||||
// is_array = 1;
|
||||
break;
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
LOG_D(ENB_APP, "The mapping of the parameters started\n");
|
||||
mapping_started = 1;
|
||||
break;
|
||||
case YAML_MAPPING_END_EVENT:
|
||||
LOG_D(ENB_APP, "The mapping of the parameters ended\n");
|
||||
mapping_started = 0;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if (!mapping_started) {
|
||||
goto error;
|
||||
}
|
||||
// Check what key needs to be set
|
||||
// use eNB egistered
|
||||
if (flexran_agent_get_mac_xface(mod_id)) {
|
||||
LOG_I(ENB_APP, "Setting parameter for eNB %s\n", event.data.scalar.value);
|
||||
if (strcmp((char *) event.data.scalar.tag, YAML_INT_TAG) == 0) { // if int
|
||||
if ((strtol((char *) event.data.scalar.value, &endptr, 10))== mod_id ) { // enb_id == mod_id: right enb instance to be configured
|
||||
if (parse_enb_config_parameters(mod_id, parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
else{
|
||||
goto error; // not the expected type
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
done = (event.type == YAML_MAPPING_END_EVENT);
|
||||
yaml_event_delete(&event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
yaml_event_delete(&event);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int parse_enb_config_parameters(mid_t mod_id, yaml_parser_t *parser) {
|
||||
yaml_event_t event;
|
||||
|
||||
char *endptr;
|
||||
|
||||
int done = 0;
|
||||
int mapping_started = 0;
|
||||
|
||||
while (!done) {
|
||||
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
|
||||
switch (event.type) {
|
||||
// We are expecting a mapping of parameters
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
LOG_D(ENB_APP, "The mapping of the parameters started\n");
|
||||
mapping_started = 1;
|
||||
break;
|
||||
case YAML_MAPPING_END_EVENT:
|
||||
LOG_D(ENB_APP, "The mapping of the parameters ended\n");
|
||||
mapping_started = 0;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if (!mapping_started) {
|
||||
goto error;
|
||||
}
|
||||
// Check what key needs to be set
|
||||
if (strcmp((char *) event.data.scalar.value, "dl_freq") == 0) {
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
flexran_agent_set_operating_dl_freq(mod_id,
|
||||
0,
|
||||
strtol((char *) event.data.scalar.value, &endptr, 10));
|
||||
LOG_I(ENB_APP, "Setting dl_freq to %s\n", event.data.scalar.value);
|
||||
} else if (strcmp((char *) event.data.scalar.value, "ul_freq_offset") == 0) {
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
flexran_agent_set_operating_ul_freq(mod_id,
|
||||
0,
|
||||
strtol((char *) event.data.scalar.value, &endptr, 10));
|
||||
LOG_I(ENB_APP, "Setting ul_freq_offset to %s\n", event.data.scalar.value);
|
||||
} else if (strcmp((char *) event.data.scalar.value, "bandwidth") == 0) {
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
flexran_agent_set_operating_bandwidth(mod_id,
|
||||
0,
|
||||
strtol((char *) event.data.scalar.value, &endptr, 10));
|
||||
LOG_I(ENB_APP, "Setting bandwidth to %s\n", event.data.scalar.value);
|
||||
} else if (strcmp((char *) event.data.scalar.value, "frame_type") == 0) {
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
flexran_agent_set_operating_frame_type (mod_id,
|
||||
0,
|
||||
strtol((char *) event.data.scalar.value, &endptr, 10));
|
||||
LOG_I(ENB_APP, "Setting frame_type to %s\n", event.data.scalar.value);
|
||||
}else { // not supported tag
|
||||
LOG_E(FLEXRAN_AGENT, "Unsupported tag %s\n", event.data.scalar.value);
|
||||
goto error;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
done = (event.type == YAML_MAPPING_END_EVENT);
|
||||
yaml_event_delete(&event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
yaml_event_delete(&event);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int skip_system_section(yaml_parser_t *parser) {
|
||||
yaml_event_t event;
|
||||
|
||||
int done = 0;
|
||||
|
||||
int sequence_started = 0;
|
||||
int mapping_started = 0;
|
||||
|
||||
while (!done) {
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
|
||||
switch (event.type) {
|
||||
|
||||
case YAML_SEQUENCE_START_EVENT:
|
||||
LOG_D(ENB_APP, "A sequence just started as expected\n");
|
||||
sequence_started = 1;
|
||||
break;
|
||||
case YAML_SEQUENCE_END_EVENT:
|
||||
LOG_D(ENB_APP, "A sequence ended\n");
|
||||
sequence_started = 0;
|
||||
break;
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
if (!sequence_started) {
|
||||
goto error;
|
||||
}
|
||||
LOG_D(ENB_APP, "A mapping started\n");
|
||||
mapping_started = 1;
|
||||
break;
|
||||
case YAML_MAPPING_END_EVENT:
|
||||
if (!mapping_started) {
|
||||
goto error;
|
||||
}
|
||||
LOG_D(ENB_APP, "A mapping ended\n");
|
||||
mapping_started = 0;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if (!mapping_started) {
|
||||
goto error;
|
||||
}
|
||||
// Entered a subsystem section. Let's skip it
|
||||
if (skip_subsystem_section(parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
done = (event.type == YAML_SEQUENCE_END_EVENT);
|
||||
|
||||
yaml_event_delete(&event);
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
yaml_event_delete(&event);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int skip_subsystem_section(yaml_parser_t *parser) {
|
||||
|
||||
yaml_event_t event;
|
||||
|
||||
int done = 0;
|
||||
int mapping_started = 0;
|
||||
|
||||
while (!done) {
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
|
||||
switch (event.type) {
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
LOG_D(ENB_APP, "The mapping of the subsystem started\n");
|
||||
mapping_started = 1;
|
||||
break;
|
||||
case YAML_MAPPING_END_EVENT:
|
||||
LOG_D(ENB_APP, "The mapping of the subsystem ended\n");
|
||||
mapping_started = 0;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if (!mapping_started) {
|
||||
goto error;
|
||||
}
|
||||
// Check what key needs to be set
|
||||
if (strcmp((char *) event.data.scalar.value, "behavior") == 0) {
|
||||
LOG_D(ENB_APP, "Skipping the behavior attribute\n");
|
||||
yaml_event_delete(&event);
|
||||
if (!yaml_parser_parse(parser, &event)) {
|
||||
goto error;
|
||||
}
|
||||
if (event.type == YAML_SCALAR_EVENT) {
|
||||
break;
|
||||
} else {
|
||||
goto error;
|
||||
}
|
||||
} else if (strcmp((char *) event.data.scalar.value, "parameters") == 0) {
|
||||
LOG_D(ENB_APP, "Skipping the parameters for this subsystem\n");
|
||||
if (skip_subsystem_parameters_config(parser) == -1) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
done = (event.type == YAML_MAPPING_END_EVENT);
|
||||
yaml_event_delete(&event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
yaml_event_delete(&event);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int skip_subsystem_parameters_config(yaml_parser_t *parser) {
|
||||
yaml_event_t event;
|
||||
|
||||
int done = 0;
|
||||
int mapping_started = 0;
|
||||
|
||||
while (!done) {
|
||||
|
||||
if (!yaml_parser_parse(parser, &event))
|
||||
goto error;
|
||||
|
||||
switch (event.type) {
|
||||
// We are expecting a mapping of parameters
|
||||
case YAML_MAPPING_START_EVENT:
|
||||
LOG_D(ENB_APP, "The mapping of the parameters started\n");
|
||||
mapping_started = 1;
|
||||
break;
|
||||
case YAML_MAPPING_END_EVENT:
|
||||
LOG_D(ENB_APP, "The mapping of the parameters ended\n");
|
||||
mapping_started = 0;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if (!mapping_started) {
|
||||
goto error;
|
||||
}
|
||||
// Check what key needs to be set
|
||||
LOG_D(ENB_APP, "Skipping parameter %s\n", event.data.scalar.value);
|
||||
if (skip_parameter_modification(parser) == -1 ) {
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
done = (event.type == YAML_MAPPING_END_EVENT);
|
||||
yaml_event_delete(&event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
yaml_event_delete(&event);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int skip_parameter_modification(yaml_parser_t *parser) {
|
||||
yaml_event_t event;
|
||||
|
||||
int done = 0;
|
||||
int is_array = 0;
|
||||
int i = 0;
|
||||
|
||||
while (!done) {
|
||||
if (!yaml_parser_parse(parser, &event)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
// Expecting either a scalar or a sequence
|
||||
switch (event.type) {
|
||||
case YAML_SEQUENCE_START_EVENT:
|
||||
is_array = 1;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if ((strcmp((char *) event.data.scalar.tag, YAML_INT_TAG) == 0) ||
|
||||
(strcmp((char *) event.data.scalar.tag, YAML_FLOAT_TAG) == 0) ||
|
||||
(strcmp((char *) event.data.scalar.tag, YAML_STR_TAG) == 0) ||
|
||||
(strcmp((char *) event.data.scalar.tag, YAML_BOOL_TAG) == 0)) {
|
||||
// Do nothing
|
||||
} else {
|
||||
// No other type is supported at the moment, so it should be considered an error
|
||||
// if we reach here
|
||||
goto error;
|
||||
}
|
||||
if (is_array) {
|
||||
i++;
|
||||
} else {
|
||||
done = 1;
|
||||
}
|
||||
break;
|
||||
case YAML_SEQUENCE_END_EVENT:
|
||||
done = 1;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
yaml_event_delete(&event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
yaml_event_delete(&event);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int apply_parameter_modification(void *parameter, yaml_parser_t *parser) {
|
||||
yaml_event_t event;
|
||||
|
||||
int done = 0;
|
||||
int is_array = 0;
|
||||
int i = 0;
|
||||
|
||||
char *endptr;
|
||||
|
||||
while (!done) {
|
||||
if (!yaml_parser_parse(parser, &event)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
// Expecting either a scalar or a sequence
|
||||
switch (event.type) {
|
||||
case YAML_SEQUENCE_START_EVENT:
|
||||
is_array = 1;
|
||||
break;
|
||||
case YAML_SCALAR_EVENT:
|
||||
if (strcmp((char *) event.data.scalar.tag, YAML_INT_TAG) == 0) {
|
||||
((int *) parameter)[i] = strtol((char *) event.data.scalar.value, &endptr, 10);
|
||||
} else if (strcmp((char *) event.data.scalar.tag, YAML_FLOAT_TAG) == 0) {
|
||||
((float *) parameter)[i] = strtof((char *) event.data.scalar.value, &endptr);
|
||||
} else if (strcmp((char *) event.data.scalar.tag, YAML_STR_TAG) == 0) {
|
||||
strncpy(&((char *) parameter)[i], (char *) event.data.scalar.value, event.data.scalar.length);
|
||||
} else if (strcmp((char *) event.data.scalar.tag, YAML_BOOL_TAG) == 0) {
|
||||
if (strcmp((char *) event.data.scalar.value, "true") == 0) {
|
||||
((int *) parameter)[i] = 1;
|
||||
} else {
|
||||
((int *) parameter)[i] = 0;
|
||||
}
|
||||
} else {
|
||||
// No other type is supported at the moment, so it should be considered an error
|
||||
// if we reach here
|
||||
goto error;
|
||||
}
|
||||
if (is_array) {
|
||||
i++;
|
||||
} else {
|
||||
done = 1;
|
||||
}
|
||||
break;
|
||||
case YAML_SEQUENCE_END_EVENT:
|
||||
done = 1;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
yaml_event_delete(&event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
yaml_event_delete(&event);
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
void initiate_soft_restart(module_id_t mod_id, Protocol__FlexCellConfig *c)
|
||||
{
|
||||
const uint8_t cc_id = 0;
|
||||
if (c->has_eutra_band) {
|
||||
flexran_agent_set_operating_eutra_band(mod_id, cc_id, c->eutra_band);
|
||||
LOG_I(ENB_APP, "Setting eutra_band to %d\n", c->eutra_band);
|
||||
}
|
||||
if (c->has_dl_freq && c->has_ul_freq) {
|
||||
flexran_agent_set_operating_dl_freq(mod_id, cc_id, c->dl_freq);
|
||||
LOG_I(ENB_APP, "Setting dl_freq to %d\n", c->dl_freq);
|
||||
int32_t ul_freq_offset = c->ul_freq - c->dl_freq;
|
||||
flexran_agent_set_operating_ul_freq(mod_id, cc_id, ul_freq_offset);
|
||||
LOG_I(ENB_APP, "Setting ul_freq to %d\n", c->ul_freq);
|
||||
}
|
||||
if (c->has_dl_bandwidth) {
|
||||
flexran_agent_set_operating_bandwidth(mod_id, cc_id, c->dl_bandwidth);
|
||||
LOG_I(ENB_APP, "Setting bandwidth to %d\n", c->dl_bandwidth);
|
||||
if (c->has_ul_bandwidth && c->ul_bandwidth != c->dl_bandwidth)
|
||||
LOG_W(ENB_APP, "UL/DL bandwidth mismatch, applied DL bandwidth\n");
|
||||
} else if (c->has_ul_bandwidth) {
|
||||
flexran_agent_set_operating_bandwidth(mod_id, cc_id, c->ul_bandwidth);
|
||||
LOG_I(ENB_APP, "Setting bandwidth to %d\n", c->ul_bandwidth);
|
||||
}
|
||||
|
||||
MessageDef *msg;
|
||||
msg = itti_alloc_new_message(TASK_FLEXRAN_AGENT, 0, SOFT_RESTART_MESSAGE);
|
||||
itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(mod_id), msg);
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_common_internal.h
|
||||
* \brief internal agent functions for common message primitves and utilities
|
||||
* \author Xenofon Foukas and N. Nikaein
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_COMMON_INTERNAL_H_
|
||||
#define FLEXRAN_AGENT_COMMON_INTERNAL_H_
|
||||
|
||||
#include <yaml.h>
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran.pb-c.h"
|
||||
|
||||
int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length);
|
||||
|
||||
int apply_parameter_modification(void *parameter, yaml_parser_t *parser);
|
||||
|
||||
int parse_enb_id(mid_t mod_id, yaml_parser_t *parser);
|
||||
int parse_enb_config_parameters(mid_t mod_id, yaml_parser_t *parser) ;
|
||||
|
||||
|
||||
// This can be used when parsing for a specific system that is not yet implmeneted
|
||||
// in order to skip its configuration, without affecting the rest
|
||||
int skip_system_section(yaml_parser_t *parser);
|
||||
|
||||
// This can be used when parsing for a specific subsystem that is not yet implmeneted
|
||||
// in order to skip its configuration, without affecting the rest
|
||||
int skip_subsystem_section(yaml_parser_t *parser);
|
||||
|
||||
// This can be used when parsing for the parameters of a specific subsystem
|
||||
//that is not yet implmeneted in order to skip its configuration, without affecting the rest
|
||||
int skip_subsystem_parameters_config(yaml_parser_t *parser);
|
||||
|
||||
// This can be used when configuring the parameters of a specific subsystem
|
||||
//that is not yet implmeneted in order to skip its configuration, without affecting the rest
|
||||
int skip_parameter_modification(yaml_parser_t *parser);
|
||||
|
||||
// applies reconfiguration parameters and notifies ENB APP
|
||||
void initiate_soft_restart(mid_t mod_id, Protocol__FlexCellConfig *c);
|
||||
|
||||
#endif
|
||||
@@ -1,167 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_defs.h
|
||||
* \brief FlexRAN agent common definitions
|
||||
* \author Navid Nikaein and Xenofon Foukas and shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
#ifndef FLEXRAN_AGENT_DEFS_H_
|
||||
#define FLEXRAN_AGENT_DEFS_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "link_manager.h"
|
||||
|
||||
#define NUM_MAX_ENB 2
|
||||
#define NUM_MAX_DRB 8
|
||||
#define NUM_MAX_SRB 3
|
||||
#define NUM_MAX_UE 2048
|
||||
#define DEFAULT_DRB 3
|
||||
#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 {
|
||||
|
||||
FLEXRAN_AGENT_DEFAULT=0,
|
||||
|
||||
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 */
|
||||
FLEXRAN_AGENT_ACTION_NONE = 0x0,
|
||||
|
||||
/* send action */
|
||||
FLEXRAN_AGENT_ACTION_SEND = 0x1,
|
||||
|
||||
/* apply action */
|
||||
FLEXRAN_AGENT_ACTION_APPLY = 0x2,
|
||||
|
||||
/* clear action */
|
||||
FLEXRAN_AGENT_ACTION_CLEAR = 0x4,
|
||||
|
||||
/* write action */
|
||||
FLEXRAN_AGENT_ACTION_WRITE = 0x8,
|
||||
|
||||
/* filter action */
|
||||
FLEXRAN_AGENT_ACTION_FILTER = 0x10,
|
||||
|
||||
/* preprocess action */
|
||||
FLEXRAN_AGENT_ACTION_PREPROCESS = 0x20,
|
||||
|
||||
/* meter action */
|
||||
FLEXRAN_AGENT_ACTION_METER = 0x40,
|
||||
|
||||
/* Max number of states available */
|
||||
FLEXRAN_AGENT_ACTION_MAX = 0x7f,
|
||||
} agent_action_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
|
||||
RAN_LTE_OAI= 0,
|
||||
|
||||
/* Max number of states available */
|
||||
RAN_NAME_MAX = 0x7f,
|
||||
} ran_name_t;
|
||||
|
||||
typedef uint8_t xid_t;
|
||||
typedef uint16_t mid_t; // module or enb id
|
||||
typedef uint8_t lcid_t;
|
||||
typedef int32_t err_code_t;
|
||||
|
||||
|
||||
|
||||
#define FLEXRAN_CAP_LOPHY(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__LOPHY)) > 0)
|
||||
#define FLEXRAN_CAP_HIPHY(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__HIPHY)) > 0)
|
||||
#define FLEXRAN_CAP_LOMAC(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__LOMAC)) > 0)
|
||||
#define FLEXRAN_CAP_HIMAC(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__HIMAC)) > 0)
|
||||
#define FLEXRAN_CAP_RLC(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__RLC)) > 0)
|
||||
#define FLEXRAN_CAP_PDCP(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__PDCP)) > 0)
|
||||
#define FLEXRAN_CAP_SDAP(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__SDAP)) > 0)
|
||||
#define FLEXRAN_CAP_RRC(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__RRC)) > 0)
|
||||
#define FLEXRAN_CAP_S1AP(cApS) (((cApS) & (1 << PROTOCOL__FLEX_BS_CAPABILITY__S1AP)) > 0)
|
||||
|
||||
typedef enum {
|
||||
ENB_NORMAL_OPERATION = 0x0,
|
||||
ENB_WAIT = 0x1,
|
||||
ENB_MAKE_WAIT = 0x2,
|
||||
} flexran_enb_state_t;
|
||||
|
||||
typedef struct {
|
||||
/* general info */
|
||||
int enabled;
|
||||
char *interface_name;
|
||||
char *remote_ipv4_addr;
|
||||
uint16_t remote_port;
|
||||
char *cache_name;
|
||||
|
||||
mid_t mod_id;
|
||||
uint64_t agent_id;
|
||||
uint16_t capability_mask;
|
||||
|
||||
/* lock for waiting before starting or soft-restart */
|
||||
pthread_cond_t cond_node_ctrl;
|
||||
pthread_mutex_t mutex_node_ctrl;
|
||||
flexran_enb_state_t node_ctrl_state;
|
||||
|
||||
/* stats */
|
||||
|
||||
uint32_t total_rx_msg;
|
||||
uint32_t total_tx_msg;
|
||||
|
||||
uint32_t rx_msg[NUM_MAX_ENB];
|
||||
uint32_t tx_msg[NUM_MAX_ENB];
|
||||
|
||||
} flexran_agent_info_t;
|
||||
|
||||
|
||||
/*
|
||||
rrc triggering
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
char * trigger_policy;
|
||||
uint32_t report_interval;
|
||||
uint32_t report_amount;
|
||||
|
||||
} agent_reconf_rrc;
|
||||
|
||||
#endif
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file ENB_APP/extern.h
|
||||
* \brief FlexRAN agent - Extern VSF xfaces
|
||||
* \author Xenofon Foukas and shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \mail x.foukas@sms.ed.ac.uk
|
||||
*/
|
||||
|
||||
#ifndef __FLEXRAN_AGENT_EXTERN_H__
|
||||
#define __FLEXRAN_AGENT_EXTERN_H__
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_phy_defs.h"
|
||||
#include "flexran_agent_mac_defs.h"
|
||||
#include "flexran_agent_rrc_defs.h"
|
||||
#include "flexran_agent_pdcp_defs.h"
|
||||
#include "flexran_agent_s1ap_defs.h"
|
||||
|
||||
/* Control module interface for the communication of the PHY control module with the agent */
|
||||
AGENT_PHY_xface *flexran_agent_get_phy_xface(mid_t mod_id);
|
||||
|
||||
/* Control module interface for the communication of the MAC Control Module with the agent */
|
||||
|
||||
extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
|
||||
#define flexran_agent_get_mac_xface(mod_id) (agent_mac_xface[mod_id])
|
||||
/* Control module interface for the communication of the RRC Control Module with the agent */
|
||||
// AGENT_RRC_xface *flexran_agent_get_rrc_xface(mid_t mod_id);
|
||||
extern AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
|
||||
#define flexran_agent_get_rrc_xface(mod_id) (agent_rrc_xface[mod_id])
|
||||
|
||||
/* Control module interface for the communication of the RRC Control Module with the agent */
|
||||
AGENT_PDCP_xface *flexran_agent_get_pdcp_xface(mid_t mod_id);
|
||||
|
||||
/* Control module interface for the communication of the S1AP Control Module with the agent */
|
||||
AGENT_S1AP_xface *flexran_agent_get_s1ap_xface(mid_t mod_id);
|
||||
|
||||
/* Requried to know which UEs had a harq updated over some subframe */
|
||||
extern int harq_pid_updated[NUM_MAX_UE][8];
|
||||
extern int harq_pid_round[NUM_MAX_UE][8];
|
||||
|
||||
#endif
|
||||
@@ -1,553 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_handler.c
|
||||
* \brief FlexRAN agent tx and rx message handler
|
||||
* \author Xenofon Foukas and Navid Nikaein and shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_mac.h"
|
||||
#include "flexran_agent_rrc.h"
|
||||
#include "flexran_agent_pdcp.h"
|
||||
#include "flexran_agent_s1ap.h"
|
||||
#include "flexran_agent_app.h"
|
||||
#include "flexran_agent_timer.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
#include "assertions.h"
|
||||
|
||||
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
|
||||
{flexran_agent_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*/
|
||||
{flexran_agent_enb_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG*/
|
||||
{flexran_agent_handle_enb_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG*/
|
||||
{flexran_agent_ue_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REQUEST_MSG*/
|
||||
{flexran_agent_handle_ue_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_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*/
|
||||
{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*/
|
||||
{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*/
|
||||
{flexran_agent_rrc_reconfiguration, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_RRC_TRIGGERING_MSG*/
|
||||
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_MAC_CONFIG_MSG*/
|
||||
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_DISCONNECT_MSG*/
|
||||
{flexran_agent_rrc_trigger_handover, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_HO_COMMAND_MSG*/
|
||||
};
|
||||
|
||||
flexran_agent_message_destruction_callback message_destruction_callback[] = {
|
||||
flexran_agent_destroy_hello,
|
||||
flexran_agent_destroy_echo_request,
|
||||
flexran_agent_destroy_echo_reply,
|
||||
flexran_agent_destroy_stats_request,
|
||||
flexran_agent_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,
|
||||
NULL, /* flex_rrc_triggering */
|
||||
NULL, /* flex_ul_mac_config */
|
||||
NULL, /* flex_disconnect */
|
||||
NULL, /* flex_ho_command */
|
||||
flexran_agent_destroy_control_delegation_request,
|
||||
};
|
||||
|
||||
/* static const char *flexran_agent_direction2String[] = { */
|
||||
/* "", /\* not_set *\/ */
|
||||
/* "originating message", /\* originating message *\/ */
|
||||
/* "successfull outcome", /\* successfull outcome *\/ */
|
||||
/* "unsuccessfull outcome", /\* unsuccessfull outcome *\/ */
|
||||
/* }; */
|
||||
|
||||
|
||||
Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id,
|
||||
uint8_t *data,
|
||||
uint32_t size){
|
||||
|
||||
Protocol__FlexranMessage *decoded_message = NULL;
|
||||
Protocol__FlexranMessage *reply_message = NULL;
|
||||
err_code_t err_code;
|
||||
DevAssert(data != NULL);
|
||||
|
||||
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(flexran_agent_message_decoded_callback))) ||
|
||||
(decoded_message->msg_dir > PROTOCOL__FLEXRAN_DIRECTION__UNSUCCESSFUL_OUTCOME)){
|
||||
err_code= PROTOCOL__FLEXRAN_ERR__MSG_NOT_HANDLED;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1] == NULL) {
|
||||
err_code= PROTOCOL__FLEXRAN_ERR__MSG_NOT_SUPPORTED;
|
||||
goto error;
|
||||
|
||||
}
|
||||
|
||||
err_code = ((*agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1])(mod_id, (void *) decoded_message, &reply_message));
|
||||
if ( err_code < 0 ){
|
||||
goto error;
|
||||
} else if (err_code == 0) { //If err_code > 1, we do not want to dispose the message yet
|
||||
protocol__flexran_message__free_unpacked(decoded_message, NULL);
|
||||
}
|
||||
return reply_message;
|
||||
|
||||
error:
|
||||
LOG_E(FLEXRAN_AGENT,"errno %d occured\n",err_code);
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void * flexran_agent_pack_message(Protocol__FlexranMessage *msg,
|
||||
int * size){
|
||||
|
||||
void * buffer;
|
||||
|
||||
if (flexran_agent_serialize_message(msg, &buffer, size) < 0 ) {
|
||||
LOG_E(FLEXRAN_AGENT,"errno %d occured\n",PROTOCOL__FLEXRAN_ERR__MSG_ENCODING);
|
||||
goto error;
|
||||
}
|
||||
|
||||
// free the msg --> later keep this in the data struct and just update the values
|
||||
//TODO call proper destroy function
|
||||
((*message_destruction_callback[msg->msg_case-1])(msg));
|
||||
|
||||
DevAssert(buffer !=NULL);
|
||||
|
||||
LOG_D(FLEXRAN_AGENT,"Serilized the eNB-UE stats reply (size %d)\n", *size);
|
||||
|
||||
return buffer;
|
||||
|
||||
error :
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Protocol__FlexranMessage *flexran_agent_handle_timed_task(
|
||||
mid_t mod_id,
|
||||
Protocol__FlexranMessage *msg) {
|
||||
err_code_t err_code;
|
||||
|
||||
Protocol__FlexranMessage *reply_message;
|
||||
err_code = ((*agent_messages_callback[msg->msg_case-1][msg->msg_dir-1])(
|
||||
mod_id, msg, &reply_message));
|
||||
if (err_code < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "could not handle message: errno %d occured\n", err_code);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return reply_message;
|
||||
}
|
||||
|
||||
err_code_t flexran_agent_destroy_flexran_message(Protocol__FlexranMessage *msg) {
|
||||
return ((*message_destruction_callback[msg->msg_case-1])(msg));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Top Level Statistics Report
|
||||
*/
|
||||
|
||||
int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
|
||||
*msg = NULL;
|
||||
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
|
||||
Protocol__FlexStatsRequest *stats_req = input->stats_request_msg;
|
||||
const xid_t xid = stats_req->header->xid;
|
||||
|
||||
if (stats_req->body_case != PROTOCOL__FLEX_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST) {
|
||||
LOG_E(FLEXRAN_AGENT, "only complete stats are supported at the moment\n");
|
||||
return -1;
|
||||
}
|
||||
Protocol__FlexCompleteStatsRequest *comp_req = stats_req->complete_stats_request;
|
||||
|
||||
switch (comp_req->report_frequency) {
|
||||
case PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_OFF:
|
||||
flexran_agent_destroy_timer(mod_id, xid);
|
||||
return 0;
|
||||
case PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE:
|
||||
LOG_E(FLEXRAN_AGENT, "one-shot timer not implemented yet\n");
|
||||
return -1;
|
||||
case PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_PERIODICAL:
|
||||
/* Create a one off flexran message as an argument for the periodical task */
|
||||
LOG_I(FLEXRAN_AGENT, "periodical timer xid %d cell_flags %d ue_flags %d\n",
|
||||
xid, comp_req->cell_report_flags, comp_req->ue_report_flags);
|
||||
flexran_agent_create_timer(mod_id, comp_req->sf,
|
||||
FLEXRAN_AGENT_TIMER_TYPE_PERIODIC, xid,
|
||||
flexran_agent_send_stats_reply, input);
|
||||
/* return 1: do not dispose comp_req message we received, we still need it */
|
||||
return 1;
|
||||
case PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_CONTINUOUS:
|
||||
LOG_E(FLEXRAN_AGENT, "unsupported report frequency continuous\n");
|
||||
return -1;
|
||||
default:
|
||||
LOG_E(FLEXRAN_AGENT, "unknown report frequency\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Top level reply
|
||||
*/
|
||||
Protocol__FlexranMessage *flexran_agent_send_stats_reply(
|
||||
mid_t mod_id,
|
||||
const Protocol__FlexranMessage *msg) {
|
||||
const Protocol__FlexStatsRequest *stats_req = msg->stats_request_msg;
|
||||
const xid_t xid = stats_req->header->xid;
|
||||
|
||||
Protocol__FlexranMessage *reply = NULL;
|
||||
err_code_t rc = flexran_agent_stats_reply(mod_id, xid, stats_req, &reply);
|
||||
if (rc < 0) {
|
||||
LOG_E(FLEXRAN_AGENT, "%s(): errno %d occured, cannot send stats_reply\n",
|
||||
__func__, rc);
|
||||
return NULL;
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
int flexran_agent_stats_reply(mid_t enb_id,
|
||||
xid_t xid,
|
||||
const Protocol__FlexStatsRequest *stats_req,
|
||||
Protocol__FlexranMessage **msg) {
|
||||
|
||||
Protocol__FlexHeader *header = NULL;
|
||||
Protocol__FlexUeStatsReport **ue_report = NULL;
|
||||
Protocol__FlexCellStatsReport **cell_report = NULL;
|
||||
Protocol__FlexStatsReply *stats_reply_msg = NULL;
|
||||
err_code_t err_code = PROTOCOL__FLEXRAN_ERR__UNEXPECTED;
|
||||
AssertFatal(stats_req->body_case == PROTOCOL__FLEX_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST,
|
||||
"%s() handles only complete stats requests\n",
|
||||
__func__);
|
||||
const uint32_t cell_flags = stats_req->complete_stats_request->cell_report_flags;
|
||||
const uint32_t ue_flags = stats_req->complete_stats_request->ue_report_flags;
|
||||
|
||||
int n_ue = flexran_agent_get_num_ues(enb_id);
|
||||
|
||||
rnti_t rntis[n_ue];
|
||||
if (flexran_agent_get_rrc_xface(enb_id))
|
||||
flexran_get_rrc_rnti_list(enb_id, rntis, n_ue);
|
||||
if (flexran_agent_get_mac_xface(enb_id) && !flexran_agent_get_rrc_xface(enb_id)) {
|
||||
for (int i = 0; i < n_ue; i++) {
|
||||
const int UE_id = flexran_get_mac_ue_id(enb_id, i);
|
||||
rntis[i] = flexran_get_mac_ue_crnti(enb_id, UE_id);
|
||||
}
|
||||
}
|
||||
|
||||
int n_cc = MAX_NUM_CCs;
|
||||
|
||||
ue_report = calloc(n_ue, sizeof(Protocol__FlexUeStatsReport *));
|
||||
if (ue_report == NULL) {
|
||||
goto error;
|
||||
}
|
||||
for (int i = 0; i < n_ue; i++) {
|
||||
ue_report[i] = malloc(sizeof(Protocol__FlexUeStatsReport));
|
||||
if (ue_report[i] == NULL) {
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_ue_stats_report__init(ue_report[i]);
|
||||
ue_report[i]->rnti = rntis[i];
|
||||
ue_report[i]->has_rnti = 1;
|
||||
ue_report[i]->has_flags = 1; /* actual flags are filled in the CMs below */
|
||||
}
|
||||
|
||||
cell_report = calloc(n_cc, sizeof(Protocol__FlexCellStatsReport *));
|
||||
if (cell_report == NULL) {
|
||||
goto error;
|
||||
}
|
||||
for (int i = 0; i < n_cc; i++) {
|
||||
cell_report[i] = malloc(sizeof(Protocol__FlexCellStatsReport));
|
||||
if(cell_report[i] == NULL) {
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_cell_stats_report__init(cell_report[i]);
|
||||
cell_report[i]->carrier_index = i;
|
||||
cell_report[i]->has_carrier_index = 1;
|
||||
cell_report[i]->has_flags = 1; /* actual flags are filled in the CMs below */
|
||||
}
|
||||
|
||||
/* MAC reply split */
|
||||
if (flexran_agent_get_mac_xface(enb_id)
|
||||
&& (flexran_agent_mac_stats_reply_ue(enb_id, ue_report, n_ue, ue_flags) < 0
|
||||
|| flexran_agent_mac_stats_reply_cell(enb_id, cell_report, n_cc, cell_flags) < 0)) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_BUILD;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* RRC reply split */
|
||||
if (flexran_agent_get_rrc_xface(enb_id)
|
||||
&& flexran_agent_rrc_stats_reply(enb_id, ue_report, n_ue, ue_flags) < 0) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_BUILD;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* PDCP reply split */
|
||||
if (flexran_agent_get_pdcp_xface(enb_id)
|
||||
&& flexran_agent_pdcp_stats_reply(enb_id, ue_report, n_ue, ue_flags) < 0) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_BUILD;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* GTP reply split, currently performed through RRC module */
|
||||
if (flexran_agent_get_rrc_xface(enb_id)
|
||||
&& flexran_agent_rrc_gtp_stats_reply(enb_id, ue_report, n_ue, ue_flags) < 0) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_BUILD;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* S1AP statistics, depends on RRC to find S1AP ID */
|
||||
if (flexran_agent_get_rrc_xface(enb_id)
|
||||
&& flexran_agent_get_s1ap_xface(enb_id)
|
||||
&& flexran_agent_s1ap_stats_reply(enb_id, ue_report, n_ue, ue_flags) < 0) {
|
||||
err_code = PROTOCOL__FLEXRAN_ERR__MSG_BUILD;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) {
|
||||
goto error;
|
||||
}
|
||||
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
|
||||
AssertFatal(stats_reply_msg, "no memory for stats_reply_msg\n");
|
||||
protocol__flex_stats_reply__init(stats_reply_msg);
|
||||
stats_reply_msg->header = header;
|
||||
stats_reply_msg->n_ue_report = n_ue;
|
||||
stats_reply_msg->ue_report = ue_report;
|
||||
stats_reply_msg->n_cell_report = n_cc;
|
||||
stats_reply_msg->cell_report = cell_report;
|
||||
|
||||
*msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
AssertFatal(*msg, "no memory for stats_reply container msg\n");
|
||||
protocol__flexran_message__init(*msg);
|
||||
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG;
|
||||
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
|
||||
(*msg)->stats_reply_msg = stats_reply_msg;
|
||||
|
||||
return 0;
|
||||
|
||||
error :
|
||||
LOG_E(FLEXRAN_AGENT, "errno %d occured\n", err_code);
|
||||
|
||||
if (header != NULL) {
|
||||
free(header);
|
||||
header = NULL;
|
||||
}
|
||||
|
||||
if (stats_reply_msg != NULL) {
|
||||
free(stats_reply_msg);
|
||||
stats_reply_msg = NULL;
|
||||
}
|
||||
|
||||
if (ue_report != NULL) {
|
||||
for (int j = 0; j < n_ue; j++) {
|
||||
if (ue_report[j] != NULL) {
|
||||
free(ue_report[j]);
|
||||
}
|
||||
}
|
||||
free(ue_report);
|
||||
ue_report = NULL;
|
||||
}
|
||||
|
||||
if (cell_report != NULL) {
|
||||
for (int j = 0; j < n_cc; j++) {
|
||||
if (cell_report[j] != NULL) {
|
||||
free(cell_report[j]);
|
||||
}
|
||||
}
|
||||
free(cell_report);
|
||||
cell_report = NULL;
|
||||
}
|
||||
|
||||
return err_code;
|
||||
}
|
||||
|
||||
/*
|
||||
Top Level Request
|
||||
*/
|
||||
|
||||
/*
|
||||
int flexran_agent_stats_request(mid_t mod_id,
|
||||
xid_t xid,
|
||||
const stats_request_config_t *report_config,
|
||||
Protocol__FlexranMessage **msg) {
|
||||
Protocol__FlexHeader *header = NULL;
|
||||
int i;
|
||||
|
||||
Protocol__FlexStatsRequest *stats_request_msg;
|
||||
stats_request_msg = malloc(sizeof(Protocol__FlexStatsRequest));
|
||||
if(stats_request_msg == NULL)
|
||||
goto error;
|
||||
protocol__flex_stats_request__init(stats_request_msg);
|
||||
|
||||
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0)
|
||||
goto error;
|
||||
|
||||
stats_request_msg->header = header;
|
||||
|
||||
stats_request_msg->type = report_config->report_type;
|
||||
stats_request_msg->has_type = 1;
|
||||
|
||||
switch (report_config->report_type) {
|
||||
case PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS:
|
||||
stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_COMPLETE_STATS_REQUEST;
|
||||
Protocol__FlexCompleteStatsRequest *complete_stats;
|
||||
complete_stats = malloc(sizeof(Protocol__FlexCompleteStatsRequest));
|
||||
if(complete_stats == NULL)
|
||||
goto error;
|
||||
protocol__flex_complete_stats_request__init(complete_stats);
|
||||
complete_stats->report_frequency = report_config->report_frequency;
|
||||
complete_stats->has_report_frequency = 1;
|
||||
complete_stats->sf = report_config->period;
|
||||
complete_stats->has_sf = 1;
|
||||
complete_stats->has_cell_report_flags = 1;
|
||||
complete_stats->has_ue_report_flags = 1;
|
||||
if (report_config->config->nr_cc > 0) {
|
||||
complete_stats->cell_report_flags = report_config->config->cc_report_type[0].cc_report_flags;
|
||||
}
|
||||
if (report_config->config->nr_ue > 0) {
|
||||
complete_stats->ue_report_flags = report_config->config->ue_report_type[0].ue_report_flags;
|
||||
}
|
||||
stats_request_msg->complete_stats_request = complete_stats;
|
||||
break;
|
||||
case PROTOCOL__FLEX_STATS_TYPE__FLST_CELL_STATS:
|
||||
stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_CELL_STATS_REQUEST;
|
||||
Protocol__FlexCellStatsRequest *cell_stats;
|
||||
cell_stats = malloc(sizeof(Protocol__FlexCellStatsRequest));
|
||||
if(cell_stats == NULL)
|
||||
goto error;
|
||||
protocol__flex_cell_stats_request__init(cell_stats);
|
||||
cell_stats->n_cell = report_config->config->nr_cc;
|
||||
cell_stats->has_flags = 1;
|
||||
if (cell_stats->n_cell > 0) {
|
||||
uint32_t *cells;
|
||||
cells = (uint32_t *) malloc(sizeof(uint32_t)*cell_stats->n_cell);
|
||||
for (i = 0; i < cell_stats->n_cell; i++) {
|
||||
cells[i] = report_config->config->cc_report_type[i].cc_id;
|
||||
}
|
||||
cell_stats->cell = cells;
|
||||
cell_stats->flags = report_config->config->cc_report_type[i].cc_report_flags;
|
||||
}
|
||||
stats_request_msg->cell_stats_request = cell_stats;
|
||||
break;
|
||||
case PROTOCOL__FLEX_STATS_TYPE__FLST_UE_STATS:
|
||||
stats_request_msg->body_case = PROTOCOL__FLEX_STATS_REQUEST__BODY_UE_STATS_REQUEST;
|
||||
Protocol__FlexUeStatsRequest *ue_stats;
|
||||
ue_stats = malloc(sizeof(Protocol__FlexUeStatsRequest));
|
||||
if(ue_stats == NULL)
|
||||
goto error;
|
||||
protocol__flex_ue_stats_request__init(ue_stats);
|
||||
ue_stats->n_rnti = report_config->config->nr_ue;
|
||||
ue_stats->has_flags = 1;
|
||||
if (ue_stats->n_rnti > 0) {
|
||||
uint32_t *ues;
|
||||
ues = (uint32_t *) malloc(sizeof(uint32_t)*ue_stats->n_rnti);
|
||||
for (i = 0; i < ue_stats->n_rnti; i++) {
|
||||
ues[i] = report_config->config->ue_report_type[i].ue_rnti;
|
||||
}
|
||||
ue_stats->rnti = ues;
|
||||
ue_stats->flags = report_config->config->ue_report_type[i].ue_report_flags;
|
||||
}
|
||||
stats_request_msg->ue_stats_request = ue_stats;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
*msg = malloc(sizeof(Protocol__FlexranMessage));
|
||||
if(*msg == NULL)
|
||||
goto error;
|
||||
protocol__flexran_message__init(*msg);
|
||||
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG;
|
||||
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
|
||||
(*msg)->stats_request_msg = stats_request_msg;
|
||||
return 0;
|
||||
|
||||
error:
|
||||
// TODO: Need to make proper error handling
|
||||
if (header != NULL)
|
||||
free(header);
|
||||
if (stats_request_msg != NULL)
|
||||
free(stats_request_msg);
|
||||
if(*msg != NULL)
|
||||
free(*msg);
|
||||
//LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
int flexran_agent_destroy_stats_request(Protocol__FlexranMessage *msg) {
|
||||
if(msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REQUEST_MSG)
|
||||
goto error;
|
||||
free(msg->stats_request_msg->header);
|
||||
if (msg->stats_request_msg->body_case == PROTOCOL__FLEX_STATS_REQUEST__BODY_CELL_STATS_REQUEST) {
|
||||
free(msg->stats_request_msg->cell_stats_request->cell);
|
||||
}
|
||||
if (msg->stats_request_msg->body_case == PROTOCOL__FLEX_STATS_REQUEST__BODY_UE_STATS_REQUEST) {
|
||||
free(msg->stats_request_msg->ue_stats_request->rnti);
|
||||
}
|
||||
free(msg->stats_request_msg);
|
||||
free(msg);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
//LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int flexran_agent_destroy_stats_reply(Protocol__FlexranMessage *msg)
|
||||
{
|
||||
if (msg->msg_case != PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG) {
|
||||
LOG_E(FLEXRAN_AGENT, "%s(): message is not a msg_stats_reply\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
flexran_agent_mac_destroy_stats_reply(msg->stats_reply_msg);
|
||||
flexran_agent_rrc_destroy_stats_reply(msg->stats_reply_msg);
|
||||
flexran_agent_pdcp_destroy_stats_reply(msg->stats_reply_msg);
|
||||
flexran_agent_rrc_gtp_destroy_stats_reply(msg->stats_reply_msg);
|
||||
flexran_agent_s1ap_destroy_stats_reply(msg->stats_reply_msg);
|
||||
for (int i = 0; i < msg->stats_reply_msg->n_cell_report; ++i)
|
||||
free(msg->stats_reply_msg->cell_report[i]);
|
||||
for (int i = 0; i < msg->stats_reply_msg->n_ue_report; ++i)
|
||||
free(msg->stats_reply_msg->ue_report[i]);
|
||||
free(msg->stats_reply_msg->cell_report);
|
||||
free(msg->stats_reply_msg->ue_report);
|
||||
free(msg->stats_reply_msg->header);
|
||||
free(msg->stats_reply_msg);
|
||||
free(msg);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_net_comm.c
|
||||
* \brief FlexRAN agent network interface abstraction
|
||||
* \author Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
flexran_agent_channel_t *agent_channel[NUM_MAX_ENB][FLEXRAN_AGENT_MAX];
|
||||
static flexran_agent_channel_instance_t channel_instance;
|
||||
int flexran_agent_channel_id = 0;
|
||||
|
||||
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 >= FLEXRAN_AGENT_MAX || agent_id < 0) {
|
||||
goto error;
|
||||
}
|
||||
flexran_agent_channel_t *channel;
|
||||
channel = agent_channel[mod_id][agent_id];
|
||||
|
||||
/*Check if agent has a channel registered*/
|
||||
if (channel == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
return channel->msg_send(data, size, priority, channel->channel_info);
|
||||
|
||||
error:
|
||||
LOG_E(FLEXRAN_AGENT, "No channel registered for agent with id %d\n", agent_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int flexran_agent_msg_recv(mid_t mod_id, agent_id_t agent_id, void **data, int *priority) {
|
||||
/*Check if agent id is valid*/
|
||||
if (agent_id >= FLEXRAN_AGENT_MAX || agent_id < 0) {
|
||||
goto error;
|
||||
}
|
||||
flexran_agent_channel_t *channel;
|
||||
channel = agent_channel[mod_id][agent_id];
|
||||
|
||||
/*Check if agent has a channel registered*/
|
||||
if (channel == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
return channel->msg_recv(data, priority, channel->channel_info);
|
||||
|
||||
error:
|
||||
LOG_E(FLEXRAN_AGENT, "No channel registered for agent with id %d\n", agent_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
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 == FLEXRAN_AGENT_MAX) {
|
||||
for (i = 0; i < FLEXRAN_AGENT_MAX; i++) {
|
||||
agent_channel[mod_id][i] = channel;
|
||||
}
|
||||
} else {
|
||||
agent_channel[mod_id][agent_id] = channel;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flexran_agent_unregister_channel(mid_t mod_id, agent_id_t agent_id) {
|
||||
int i;
|
||||
|
||||
if (agent_id == FLEXRAN_AGENT_MAX) {
|
||||
for (i = 0; i < FLEXRAN_AGENT_MAX; i++) {
|
||||
agent_channel[mod_id][i] = NULL;
|
||||
}
|
||||
} else {
|
||||
agent_channel[mod_id][agent_id] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
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 *priority, void *channel_info),
|
||||
void (*release)(flexran_agent_channel_t *channel)) {
|
||||
|
||||
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;
|
||||
channel->msg_recv = msg_recv;
|
||||
channel->release = release;
|
||||
|
||||
/*element should be a real pointer*/
|
||||
RB_INSERT(flexran_agent_channel_map, &channel_instance.flexran_agent_head, channel);
|
||||
|
||||
LOG_I(FLEXRAN_AGENT,"Created a new channel with id %d \n", channel->channel_id);
|
||||
|
||||
return channel_id;
|
||||
}
|
||||
|
||||
int flexran_agent_destroy_channel(int channel_id) {
|
||||
int i, j;
|
||||
|
||||
/*Check to see if channel exists*/
|
||||
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(flexran_agent_channel_map, &channel_instance.flexran_agent_head, &search);
|
||||
|
||||
if (e == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*Unregister the channel from all agents*/
|
||||
for (i = 0; i < NUM_MAX_ENB; i++) {
|
||||
for (j = 0; j < FLEXRAN_AGENT_MAX; j++) {
|
||||
if (agent_channel[i][j] != NULL) {
|
||||
if (agent_channel[i][j]->channel_id == e->channel_id) {
|
||||
free(agent_channel[i][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Remove the channel from the tree and free memory*/
|
||||
RB_REMOVE(flexran_agent_channel_map, &channel_instance.flexran_agent_head, e);
|
||||
e->release(e);
|
||||
free(e);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
err_code_t flexran_agent_init_channel_container(void) {
|
||||
int i, j;
|
||||
LOG_I(FLEXRAN_AGENT, "init RB tree for channel container\n");
|
||||
|
||||
RB_INIT(&channel_instance.flexran_agent_head);
|
||||
|
||||
for (i = 0; i < NUM_MAX_ENB; i++) {
|
||||
for (j = 0; j < FLEXRAN_AGENT_MAX; j++) {
|
||||
agent_channel[i][j] = malloc(sizeof(flexran_agent_channel_t));
|
||||
if (!agent_channel[i][j])
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
RB_GENERATE(flexran_agent_channel_map, flexran_agent_channel_s, entry, flexran_agent_compare_channel);
|
||||
|
||||
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;
|
||||
|
||||
// equal timers
|
||||
return 0;
|
||||
}
|
||||
|
||||
flexran_agent_channel_t * get_channel(int channel_id) {
|
||||
|
||||
struct flexran_agent_channel_s search;
|
||||
memset(&search, 0, sizeof(struct flexran_agent_channel_s));
|
||||
search.channel_id = channel_id;
|
||||
|
||||
return RB_FIND(flexran_agent_channel_map, &channel_instance.flexran_agent_head, &search);
|
||||
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_net_comm.h
|
||||
* \brief FlexRAN agent network interface abstraction
|
||||
* \autho Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
#ifndef FLEXRAN_AGENT_NET_COMM_H_
|
||||
#define FLEXRAN_AGENT_NET_COMM_H_
|
||||
|
||||
#include "flexran_agent_defs.h"
|
||||
|
||||
#include "tree.h"
|
||||
|
||||
/*Channel related information used for Tx/Rx of protocol messages*/
|
||||
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 *priority, void *channel_info);
|
||||
void (*release)(struct flexran_agent_channel_s *channel);
|
||||
} flexran_agent_channel_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 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 *priority);
|
||||
|
||||
/*Register a channel to an agent. Use FLEXRAN_AGENT_MAX to register the
|
||||
*same channel to all agents*/
|
||||
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 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 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 *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 flexran_agent_destroy_channel(int channel_id);
|
||||
|
||||
/*Return an agent communication channel based on its id*/
|
||||
flexran_agent_channel_t * get_channel(int channel_id);
|
||||
|
||||
/*Should be called before performing any channel operations*/
|
||||
err_code_t flexran_agent_init_channel_container(void);
|
||||
|
||||
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(flexran_agent_channel_map, flexran_agent_channel_s, entry, flexran_agent_compare_channel);
|
||||
|
||||
#endif /*FLEXRAN_AGENT_COMM_H_*/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,772 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_ran_api.h
|
||||
* \brief FlexRAN RAN API abstraction header
|
||||
* \author N. Nikaein, X. Foukas and S. SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_common_internal.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
|
||||
|
||||
#include "enb_config.h"
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "pdcp.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
#include "RRC/LTE/rrc_eNB_UE_context.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
/****************************
|
||||
* get generic info from RAN
|
||||
****************************/
|
||||
|
||||
uint32_t flexran_get_current_time_ms(mid_t mod_id, int subframe_flag);
|
||||
|
||||
/*Return the current frame number
|
||||
*Could be using implementation specific numbering of frames
|
||||
*/
|
||||
frame_t flexran_get_current_frame(mid_t mod_id);
|
||||
|
||||
/*Return the current SFN (0-1023)*/
|
||||
frame_t flexran_get_current_system_frame_num(mid_t mod_id);
|
||||
|
||||
sub_frame_t flexran_get_current_subframe(mid_t mod_id);
|
||||
|
||||
/*Return the frame and subframe number in compact 16-bit format.
|
||||
Bits 0-3 subframe, rest for frame. Required by FlexRAN protocol*/
|
||||
uint32_t flexran_get_sfn_sf(mid_t mod_id);
|
||||
|
||||
/* Return a future frame and subframe number that is ahead_of_time
|
||||
subframes later in compact 16-bit format. Bits 0-3 subframe,
|
||||
rest for frame */
|
||||
uint16_t flexran_get_future_sfn_sf(mid_t mod_id, int ahead_of_time);
|
||||
|
||||
/* Return the number of attached UEs for the MAC */
|
||||
int flexran_get_mac_num_ues(mid_t mod_id);
|
||||
|
||||
/* Get the number of logical channels per UE. This function does not consider
|
||||
* dedicated bearers yet */
|
||||
int flexran_get_num_ue_lcs(mid_t mod_id, mid_t ue_id);
|
||||
|
||||
/* Get the rnti of a UE with id ue_id from MAC */
|
||||
rnti_t flexran_get_mac_ue_crnti(mid_t mod_id, mid_t ue_id);
|
||||
|
||||
int flexran_get_mac_ue_id_rnti(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Return the UE id of attached UE as opposed to the index [0,NUM UEs] (i.e.,
|
||||
* the i'th active UE). Returns 0 if the i'th active UE could not be found. */
|
||||
int flexran_get_mac_ue_id(mid_t mod_id, int i);
|
||||
|
||||
/* Get the RLC buffer status report in bytes of a ue for a designated
|
||||
* logical channel id */
|
||||
int flexran_get_ue_bsr_ul_buffer_info(mid_t mod_id, mid_t ue_id, lcid_t lcid);
|
||||
|
||||
/* Get power headroom of UE with id ue_id */
|
||||
int8_t flexran_get_ue_phr(mid_t mod_id, mid_t ue_id);
|
||||
|
||||
/* Get the UE wideband CQI */
|
||||
uint8_t flexran_get_ue_wcqi(mid_t mod_id, mid_t ue_id);
|
||||
|
||||
/* Get the transmission queue size for a UE with a channel_id logical channel id */
|
||||
rlc_buffer_occupancy_t flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
|
||||
|
||||
/*Get number of pdus in RLC buffer*/
|
||||
rlc_buffer_occupancy_t flexran_get_num_pdus_buffer(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
|
||||
|
||||
/* Get the head of line delay for a UE with a channel_id logical channel id */
|
||||
frame_t flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
|
||||
|
||||
/* Check the status of the timing advance for a UE */
|
||||
int32_t flexran_get_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
/* Update the timing advance status(find out whether a timing advance command is required) */
|
||||
/* currently broken
|
||||
void flexran_update_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id); */
|
||||
|
||||
/* Return timing advance MAC control element for a designated cell and UE */
|
||||
/* this function is broken */
|
||||
int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
/*Get number of mac SDU DL*/
|
||||
uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Return the MAC sdu size got from logical channel lcid */
|
||||
uint32_t flexran_get_mac_sdu_size(mid_t mod_id, mid_t ue_id, int cc_id, int lcid);
|
||||
|
||||
/*Return number of MAC SDUs obtained in MAC layer*/
|
||||
uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get mac sdu lcid index*/
|
||||
unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_id, int index);
|
||||
|
||||
/*Get MAC size sdus length dl*/
|
||||
uint32_t flexran_get_size_dl_mac_sdus(mid_t mod_id, int cc_id);
|
||||
|
||||
/*Get MAC size sdus length ul */
|
||||
uint32_t flexran_get_size_ul_mac_sdus(mid_t mod_id, int cc_id);
|
||||
|
||||
/*Get total size DL MAC SDUS*/
|
||||
uint32_t flexran_get_total_size_dl_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total size of UL mac SDUS*/
|
||||
uint32_t flexran_get_total_size_ul_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total number of PDU DL*/
|
||||
uint32_t flexran_get_total_num_pdu_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total number of PDU UL*/
|
||||
uint32_t flexran_get_total_num_pdu_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total PRB dl TODO Should be changed*/
|
||||
uint32_t flexran_get_total_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total PRB ul TODO Should be changed*/
|
||||
uint32_t flexran_get_total_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get number of prb for tx per UE DL*/
|
||||
uint16_t flexran_get_num_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get number of prb for rx per UE UL*/
|
||||
uint16_t flexran_get_num_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get number of prb for retx per UE UL*/
|
||||
uint32_t flexran_get_num_prb_retx_ul_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get number of prb for retx per UE*/
|
||||
uint16_t flexran_get_num_prb_retx_dl_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*MCS before rate adaptation DL*/
|
||||
uint8_t flexran_get_mcs1_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*MCS after rate adaptation DL*/
|
||||
uint8_t flexran_get_mcs2_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*MCS before rate adaptation UL*/
|
||||
uint8_t flexran_get_mcs1_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*MCS after rate adaptation UL*/
|
||||
uint8_t flexran_get_mcs2_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get downlink TBS*/
|
||||
uint32_t flexran_get_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get uplink TBS */
|
||||
uint32_t flexran_get_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total TBS DL*/
|
||||
uint64_t flexran_get_total_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/*Get total TBS DL*/
|
||||
uint64_t flexran_get_total_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id);
|
||||
|
||||
/* Get the current HARQ round for UE ue_id */
|
||||
int flexran_get_harq_round(mid_t mod_id, uint8_t cc_id, mid_t ue_id);
|
||||
|
||||
/* Get the number of active component carriers for a specific UE */
|
||||
int flexran_get_active_CC(mid_t mod_id, mid_t ue_id);
|
||||
|
||||
/* Get the rank indicator for a designated cell and UE */
|
||||
uint8_t flexran_get_current_RI(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.213, section 10.1 */
|
||||
uint16_t flexran_get_n1pucch_an(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.211, section 5.4 */
|
||||
uint8_t flexran_get_nRB_CQI(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.211, section 5.4 */
|
||||
uint8_t flexran_get_deltaPUCCH_Shift(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.211, section 5.7.1 */
|
||||
uint8_t flexran_get_prach_ConfigIndex(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.211, section 5.7.1 */
|
||||
uint8_t flexran_get_prach_FreqOffset(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.321 */
|
||||
uint8_t flexran_get_maxHARQ_Msg3Tx(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get the length of the UL cyclic prefix */
|
||||
Protocol__FlexUlCyclicPrefixLength flexran_get_ul_cyclic_prefix_length(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get the length of the DL cyclic prefix */
|
||||
Protocol__FlexDlCyclicPrefixLength flexran_get_dl_cyclic_prefix_length(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get the physical cell id of a cell */
|
||||
uint16_t flexran_get_cell_id(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.211, section 5.5.3.2 */
|
||||
uint8_t flexran_get_srs_BandwidthConfig(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.211, table 5.5.3.3-1 and 2 */
|
||||
uint8_t flexran_get_srs_SubframeConfig(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Boolean value. See TS 36.211,
|
||||
section 5.5.3.2. TDD only */
|
||||
uint8_t flexran_get_srs_MaxUpPts(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get number of DL resource blocks */
|
||||
uint8_t flexran_get_N_RB_DL(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get number of UL resource blocks */
|
||||
uint8_t flexran_get_N_RB_UL(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get number of resource block groups */
|
||||
uint8_t flexran_get_N_RBG(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get DL/UL subframe assignment. TDD only */
|
||||
uint8_t flexran_get_subframe_assignment(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* TDD only. See TS 36.211, table 4.2.1 */
|
||||
uint8_t flexran_get_special_subframe_assignment(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get the duration of the random access response window in subframes */
|
||||
long flexran_get_ra_ResponseWindowSize(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get timer used for random access */
|
||||
long flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get type of duplex mode(FDD/TDD) */
|
||||
Protocol__FlexDuplexMode flexran_get_duplex_mode(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get the SI window length */
|
||||
long flexran_get_si_window_length(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get length of SystemInformationBlock1 */
|
||||
uint8_t flexran_get_sib1_length(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get the number of PDCCH symbols configured for the cell */
|
||||
uint8_t flexran_get_num_pdcch_symb(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
uint8_t flexran_get_antenna_ports(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* See TS 36.213, sec 5.1.1.1 */
|
||||
int flexran_get_tpc(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
uint8_t flexran_get_ue_wpmi(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
/* Get the first available HARQ process for a specific cell and UE during
|
||||
a designated frame and subframe. Returns 0 for success. The id and the
|
||||
status of the HARQ process are stored in id and status respectively */
|
||||
/* currently broken
|
||||
int flexran_get_harq(mid_t mod_id, uint8_t cc_id, mid_t ue_id, frame_t frame,
|
||||
sub_frame_t subframe, unsigned char *id, unsigned char *round,
|
||||
uint8_t harq_flag); */
|
||||
|
||||
/* Uplink power control management*/
|
||||
int32_t flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
int8_t flexran_get_p0_nominal_pucch(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
int32_t flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
|
||||
|
||||
uint8_t flexran_get_threequarter_fs(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
Protocol__FlexHoppingMode flexran_get_hopping_mode(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
uint8_t flexran_get_hopping_offset(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
uint8_t flexran_get_n_SB(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
Protocol__FlexPhichResource flexran_get_phich_resource(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
Protocol__FlexQam flexran_get_enable64QAM(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
Protocol__FlexPhichDuration flexran_get_phich_duration(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/*
|
||||
* ************************************
|
||||
* Get Messages for UE Configuration Reply
|
||||
* ************************************
|
||||
*/
|
||||
/* Get the number of attached UEs for the RRC */
|
||||
int flexran_get_rrc_num_ues(mid_t mod_id);
|
||||
|
||||
/* Get the RNTI of UE at index 'index' in RRC list */
|
||||
rnti_t flexran_get_rrc_rnti_nth_ue(mid_t mod_id, int index);
|
||||
|
||||
/* Get the list of RNTIs of up to max_list entries. When max_list >=
|
||||
* flexran_get_rrc_num_ues(), gets a list of all UEs registered in the RRC. UE
|
||||
* RNTIs are saved in list, returns number of saved RNTIs */
|
||||
int flexran_get_rrc_rnti_list(mid_t mod_id, rnti_t *list, int max_list);
|
||||
|
||||
/* Get timer in subframes. Controls the synchronization
|
||||
status of the UE, not the actual timing
|
||||
advance procedure. See TS 36.321 */
|
||||
LTE_TimeAlignmentTimer_t flexran_get_time_alignment_timer(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get measurement gap configuration. See TS 36.133 */
|
||||
Protocol__FlexMeasGapConfigPattern flexran_get_meas_gap_config(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get measurement gap configuration offset if applicable */
|
||||
long flexran_get_meas_gap_config_offset(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* DL aggregated bit-rate of non-gbr bearer
|
||||
per UE. See TS 36.413 */
|
||||
uint64_t flexran_get_ue_aggregated_max_bitrate_dl(mid_t mod_id, mid_t ue_id);
|
||||
|
||||
/* UL aggregated bit-rate of non-gbr bearer
|
||||
per UE. See TS 36.413 */
|
||||
uint64_t flexran_get_ue_aggregated_max_bitrate_ul(mid_t mod_id, mid_t ue_id);
|
||||
|
||||
/* Only half-duplex support. FDD operation. Boolean value */
|
||||
int flexran_get_half_duplex(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Support of intra-subframe hopping. Boolean value */
|
||||
int flexran_get_intra_sf_hopping(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* UE support for type 2 hopping with n_sb>1 */
|
||||
int flexran_get_type2_sb_1(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get the UE category */
|
||||
long flexran_get_ue_category(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* UE support for resource allocation type 1 */
|
||||
int flexran_get_res_alloc_type1(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get UE transmission mode */
|
||||
long flexran_get_ue_transmission_mode(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Boolean value. See TS 36.321 */
|
||||
BOOLEAN_t flexran_get_tti_bundling(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* The max HARQ retransmission for UL.
|
||||
See TS 36.321 */
|
||||
long flexran_get_maxHARQ_TX(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* See TS 36.213 */
|
||||
long flexran_get_beta_offset_ack_index(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* See TS 36.213 */
|
||||
long flexran_get_beta_offset_ri_index(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* See TS 36.213 */
|
||||
long flexran_get_beta_offset_cqi_index(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Boolean. See TS36.213, Section 10.1 */
|
||||
BOOLEAN_t flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Boolean. See TS 36.213, Section 8.2 */
|
||||
BOOLEAN_t flexran_get_ack_nack_simultaneous_trans(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/* Get aperiodic CQI report mode */
|
||||
Protocol__FlexAperiodicCqiReportMode flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get ACK/NACK feedback mode. TDD only */
|
||||
long flexran_get_tdd_ack_nack_feedback_mode(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* See TS36.213, section 10.1 */
|
||||
long flexran_get_ack_nack_repetition_factor(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Boolean. Extended buffer status report size */
|
||||
long flexran_get_extended_bsr_size(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get number of UE transmission antennas */
|
||||
int flexran_get_ue_transmission_antenna(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get the IMSI of UE */
|
||||
uint64_t flexran_get_ue_imsi(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get logical channel group of a channel with id lc_id */
|
||||
long flexran_get_lcg(mid_t mod_id, mid_t ue_id, mid_t lc_id);
|
||||
|
||||
/* Get direction of logical channel with id lc_id */
|
||||
int flexran_get_direction(mid_t ue_id, mid_t lc_id);
|
||||
|
||||
/*Get downlink frequency*/
|
||||
uint32_t flexran_agent_get_operating_dl_freq(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/*Get uplink frequency*/
|
||||
uint32_t flexran_agent_get_operating_ul_freq(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/*Get eutra band*/
|
||||
uint8_t flexran_agent_get_operating_eutra_band(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/*Get downlink ref signal power*/
|
||||
int8_t flexran_agent_get_operating_pdsch_refpower(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/*Get uplink power*/
|
||||
long flexran_agent_get_operating_pusch_p0(mid_t mod_id, uint8_t cc_id);
|
||||
|
||||
/*set the dl freq */
|
||||
void flexran_agent_set_operating_dl_freq(mid_t mod_id, uint8_t cc_id, uint32_t dl_freq_mhz);
|
||||
|
||||
/* set the ul freq */
|
||||
void flexran_agent_set_operating_ul_freq(mid_t mod_id, uint8_t cc_id, int32_t ul_freq_mhz_offset);
|
||||
|
||||
/*set the the band */
|
||||
void flexran_agent_set_operating_eutra_band(mid_t mod_id, uint8_t cc_id, uint8_t eutra_band);
|
||||
|
||||
/* set the bandwidth (in RB) */
|
||||
void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t N_RB);
|
||||
|
||||
/*set frame type*/
|
||||
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, frame_type_t frame_type);
|
||||
|
||||
/*RRC status flexRAN*/
|
||||
uint8_t flexran_get_rrc_status(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
|
||||
/***************************** PDCP ***********************/
|
||||
/* PDCP uid obtained through the RNTI */
|
||||
uint16_t flexran_get_pdcp_uid_from_rnti(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/*PDCP superframe numberflexRAN*/
|
||||
uint32_t flexran_get_pdcp_sfn(mid_t mod_id);
|
||||
|
||||
/*PDCP pdcp tx stats window*/
|
||||
void flexran_set_pdcp_tx_stat_window(mid_t mod_id, uint16_t uid, uint16_t obs_window);
|
||||
|
||||
/*PDCP pdcp rx stats window*/
|
||||
void flexran_set_pdcp_rx_stat_window(mid_t mod_id, uint16_t uid, uint16_t obs_window);
|
||||
|
||||
/*PDCP num tx pdu status flexRAN*/
|
||||
uint32_t flexran_get_pdcp_tx(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP num tx bytes status flexRAN*/
|
||||
uint32_t flexran_get_pdcp_tx_bytes(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP number of transmit packet / second status flexRAN*/
|
||||
uint32_t flexran_get_pdcp_tx_w(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP pdcp tx bytes in a given window flexRAN*/
|
||||
uint32_t flexran_get_pdcp_tx_bytes_w(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP tx sequence number flexRAN*/
|
||||
uint32_t flexran_get_pdcp_tx_sn(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP tx aggregated packet arrival flexRAN*/
|
||||
uint32_t flexran_get_pdcp_tx_aiat(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP tx aggregated packet arrival per second flexRAN*/
|
||||
uint32_t flexran_get_pdcp_tx_aiat_w(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
|
||||
/*PDCP num rx pdu status flexRAN*/
|
||||
uint32_t flexran_get_pdcp_rx(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP num rx bytes status flexRAN*/
|
||||
uint32_t flexran_get_pdcp_rx_bytes(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP number of received packet / second flexRAN*/
|
||||
uint32_t flexran_get_pdcp_rx_w(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP gootput (bit/s) status flexRAN*/
|
||||
uint32_t flexran_get_pdcp_rx_bytes_w(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP rx sequence number flexRAN*/
|
||||
uint32_t flexran_get_pdcp_rx_sn(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP rx aggregated packet arrival flexRAN*/
|
||||
uint32_t flexran_get_pdcp_rx_aiat(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP rx aggregated packet arrival per second flexRAN*/
|
||||
uint32_t flexran_get_pdcp_rx_aiat_w(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*PDCP num of received outoforder pdu status flexRAN*/
|
||||
uint32_t flexran_get_pdcp_rx_oo(mid_t mod_id, uint16_t uid, lcid_t lcid);
|
||||
|
||||
/*********************RRC**********************/
|
||||
/* Call RRC Reconfiguration wrapper function */
|
||||
int flexran_call_rrc_reconfiguration (mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Call RRC to trigger handover wrapper function */
|
||||
int flexran_call_rrc_trigger_handover (mid_t mod_id, rnti_t rnti, int target_cell_id);
|
||||
|
||||
/*Get primary cell measuremeant id flexRAN*/
|
||||
LTE_MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/*Get primary cell RSRP measurement flexRAN*/
|
||||
float flexran_get_rrc_pcell_rsrp(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/*Get primary cell RSRQ measurement flexRAN*/
|
||||
float flexran_get_rrc_pcell_rsrq(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get RRC neighbouring measurement */
|
||||
int flexran_get_rrc_num_ncell(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get neighbouring physical cell id */
|
||||
long flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get neighbouring cgi */
|
||||
int flexran_get_rrc_neigh_cgi(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get neighbouring cgi info cell id */
|
||||
uint32_t flexran_get_rrc_neigh_cgi_cell_id(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get neighbouring cgi info tac */
|
||||
uint32_t flexran_get_rrc_neigh_cgi_tac(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get the number of neighbouring cgi mnc */
|
||||
int flexran_get_rrc_neigh_cgi_num_mnc(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get the number of neighbouring cgi mcc */
|
||||
int flexran_get_rrc_neigh_cgi_num_mcc(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get neighbouring cgi mnc */
|
||||
uint32_t flexran_get_rrc_neigh_cgi_mnc(mid_t mod_id, rnti_t rnti, long cell_id, int mnc_id);
|
||||
|
||||
/* Get neighbouring cgi mcc */
|
||||
uint32_t flexran_get_rrc_neigh_cgi_mcc(mid_t mod_id, rnti_t rnti, long cell_id, int mcc_id);
|
||||
|
||||
/* Get RSRP of neighbouring Cell */
|
||||
float flexran_get_rrc_neigh_rsrp(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get RSRQ of neighbouring Cell */
|
||||
float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get ofp offset */
|
||||
long flexran_get_rrc_ofp(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get ofn offset */
|
||||
long flexran_get_rrc_ofn(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get ocp offset */
|
||||
long flexran_get_rrc_ocp(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get ocn offset */
|
||||
long flexran_get_rrc_ocn(mid_t mod_id, rnti_t rnti, long cell_id);
|
||||
|
||||
/* Get Periodic Event max reported cells */
|
||||
long flexran_get_rrc_per_event_maxReportCells(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get A3 Event hysteresis */
|
||||
long flexran_get_rrc_a3_event_hysteresis(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get A3 Event time to trigger */
|
||||
long flexran_get_rrc_a3_event_timeToTrigger(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get A3 Event max reported cells */
|
||||
long flexran_get_rrc_a3_event_maxReportCells(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get A3 Event a3 offset */
|
||||
long flexran_get_rrc_a3_event_a3_offset(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get A3 Event report on leave */
|
||||
int flexran_get_rrc_a3_event_reportOnLeave(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get filter coefficient for rsrp */
|
||||
long flexran_get_filter_coeff_rsrp(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get filter coefficient for rsrq */
|
||||
long flexran_get_filter_coeff_rsrq(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Set ofp offset */
|
||||
int flexran_set_rrc_ofp(mid_t mod_id, rnti_t rnti, long offsetFreq);
|
||||
|
||||
/* Set ofn offset */
|
||||
int flexran_set_rrc_ofn(mid_t mod_id, rnti_t rnti, long offsetFreq);
|
||||
|
||||
/* Set ocp offset */
|
||||
int flexran_set_rrc_ocp(mid_t mod_id, rnti_t rnti, long cellIndividualOffset);
|
||||
|
||||
/* Set ocn offset */
|
||||
int flexran_set_rrc_ocn(mid_t mod_id, rnti_t rnti, long cell_id, long cellIndividualOffset);
|
||||
|
||||
/* Set Periodic Event max reported cells */
|
||||
int flexran_set_rrc_per_event_maxReportCells(mid_t mod_id, rnti_t rnti, long maxReportCells);
|
||||
|
||||
/* Set A3 Event hysteresis */
|
||||
int flexran_set_rrc_a3_event_hysteresis(mid_t mod_id, rnti_t rnti, long hysteresis);
|
||||
|
||||
/* Set A3 Event time to trigger */
|
||||
int flexran_set_rrc_a3_event_timeToTrigger(mid_t mod_id, rnti_t rnti, long timeToTrigger);
|
||||
|
||||
/* Set A3 Event max reported cells */
|
||||
int flexran_set_rrc_a3_event_maxReportCells(mid_t mod_id, rnti_t rnti, long maxReportCells);
|
||||
|
||||
/* Set A3 Event a3 offset */
|
||||
int flexran_set_rrc_a3_event_a3_offset(mid_t mod_id, rnti_t rnti, long a3_offset);
|
||||
|
||||
/* Set A3 Event report on leave */
|
||||
int flexran_set_rrc_a3_event_reportOnLeave(mid_t mod_id, rnti_t rnti, int reportOnLeave);
|
||||
|
||||
/* Set filter coefficient for rsrp */
|
||||
int flexran_set_filter_coeff_rsrp(mid_t mod_id, rnti_t rnti, long filterCoefficientRSRP);
|
||||
|
||||
/* Set filter coefficient for rsrq */
|
||||
int flexran_set_filter_coeff_rsrq(mid_t mod_id, rnti_t rnti, long filterCoefficientRSRQ);
|
||||
|
||||
/* Get number of PLMNs that is broadcasted in SIB1 */
|
||||
uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id);
|
||||
|
||||
/* Get index'th MCC broadcasted in SIB1 */
|
||||
uint16_t flexran_get_rrc_mcc(mid_t mod_id, uint8_t index);
|
||||
|
||||
/* Get index'th MNC broadcasted in SIB1 */
|
||||
uint16_t flexran_get_rrc_mnc(mid_t mod_id, uint8_t index);
|
||||
|
||||
/* Get index'th MNC's digit length broadcasted in SIB1 */
|
||||
uint8_t flexran_get_rrc_mnc_digit_length(mid_t mod_id, uint8_t index);
|
||||
|
||||
/* Get X2 handover controlled by network */
|
||||
int flexran_get_x2_ho_net_control(mid_t mod_id);
|
||||
|
||||
/* Set X2 handover controlled by network */
|
||||
int flexran_set_x2_ho_net_control(mid_t mod_id, int x2_ho_net_control);
|
||||
|
||||
/* Get number of adjacent cells via X2 interface */
|
||||
int flexran_get_rrc_num_adj_cells(mid_t mod_id);
|
||||
|
||||
/* Get the number of E-RABs for UE */
|
||||
int flexran_agent_rrc_gtp_num_e_rab(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/* Get the e-RAB ID for UE */
|
||||
int flexran_agent_rrc_gtp_get_e_rab_id(mid_t mod_id, rnti_t rnti, int index);
|
||||
|
||||
/* Get the TEID at the eNB for UE */
|
||||
int flexran_agent_rrc_gtp_get_teid_enb(mid_t mod_id, rnti_t rnti, int index);
|
||||
|
||||
/* Get the TEID at the SGW for UE */
|
||||
int flexran_agent_rrc_gtp_get_teid_sgw(mid_t mod_id, rnti_t rnti, int index);
|
||||
|
||||
/* gets the UEs S1AP ID at eNodeB, stored in RRC */
|
||||
uint32_t flexran_get_rrc_enb_ue_s1ap_id(mid_t mod_id, rnti_t rnti);
|
||||
|
||||
/************************** Slice configuration **************************/
|
||||
/* Get the currently active DL slicing algorithm */
|
||||
Protocol__FlexSliceAlgorithm flexran_get_dl_slice_algo(mid_t mod_id);
|
||||
/* Set the active DL slicing algorithm */
|
||||
int flexran_set_dl_slice_algo(mid_t mod_id, Protocol__FlexSliceAlgorithm algo);
|
||||
|
||||
/* Get the currently active UL slicing algorithm */
|
||||
Protocol__FlexSliceAlgorithm flexran_get_ul_slice_algo(mid_t mod_id);
|
||||
/* Set the active UL slicing algorithm */
|
||||
int flexran_set_ul_slice_algo(mid_t mod_id, Protocol__FlexSliceAlgorithm algo);
|
||||
|
||||
/* Get the DL slice ID for a UE */
|
||||
int flexran_get_ue_dl_slice_id(mid_t mod_id, mid_t ue_id);
|
||||
/* Set the DL slice for a UE */
|
||||
int flexran_set_ue_dl_slice_id(mid_t mod_id, mid_t ue_id, slice_id_t slice_id);
|
||||
|
||||
/* Get the UL slice ID for a UE */
|
||||
int flexran_get_ue_ul_slice_id(mid_t mod_id, mid_t ue_id);
|
||||
/* Set the UL slice for a UE */
|
||||
int flexran_set_ue_ul_slice_id(mid_t mod_id, mid_t ue_id, slice_id_t slice_id);
|
||||
|
||||
/* Create slice in DL, returns the new slice index, object can be shared
|
||||
* library for the scheduler or NULL */
|
||||
int flexran_create_dl_slice(mid_t mod_id, const Protocol__FlexSlice *s, void *object);
|
||||
/* Remove slice in DL, returns new number of slices or -1 on error */
|
||||
int flexran_remove_dl_slice(mid_t mod_id, const Protocol__FlexSlice *s);
|
||||
|
||||
/* Finds slice in DL with given slice_id and returns slice index */
|
||||
int flexran_find_dl_slice(mid_t mod_id, slice_id_t slice_id);
|
||||
/* Return the parameters of slice at index slice_idx */
|
||||
void flexran_get_dl_slice(mid_t mod_id,
|
||||
int slice_idx,
|
||||
Protocol__FlexSlice *slice,
|
||||
Protocol__FlexSliceAlgorithm algo);
|
||||
/* Get the number of slices in DL */
|
||||
int flexran_get_num_dl_slices(mid_t mod_id);
|
||||
|
||||
/* Create slice in UL, returns the new slice index, object can be shared library
|
||||
* for the scheduler or NULL */
|
||||
int flexran_create_ul_slice(mid_t mod_id, const Protocol__FlexSlice *s, void *object);
|
||||
/* Remove slice in UL */
|
||||
int flexran_remove_ul_slice(mid_t mod_id, const Protocol__FlexSlice *s);
|
||||
|
||||
/* Finds slice in DL with given slice_id and returns slice index */
|
||||
int flexran_find_ul_slice(mid_t mod_id, slice_id_t slice_id);
|
||||
/* Return the parameters of slice at index slice_idx */
|
||||
void flexran_get_ul_slice(mid_t mod_id,
|
||||
int slice_idx,
|
||||
Protocol__FlexSlice *slice,
|
||||
Protocol__FlexSliceAlgorithm algo);
|
||||
/* Get the number of slices in UL */
|
||||
int flexran_get_num_ul_slices(mid_t mod_id);
|
||||
|
||||
/* Get the name of/Set the DL scheduling algorithm. If slicing is active, this
|
||||
* corresponds to the default algorithm for slices, otherwise the currently
|
||||
* used one. object is a shared object in which to find the scheduler */
|
||||
char *flexran_get_dl_scheduler_name(mid_t mod_id);
|
||||
int flexran_set_dl_scheduler(mid_t mod_id, char *sched, void *object);
|
||||
|
||||
/* Get the name of/Set the UL scheduler algorithm. Same applies as for the DL
|
||||
* case. object is a shared object in which to find the scheduler */
|
||||
char *flexran_get_ul_scheduler_name(mid_t mod_id);
|
||||
int flexran_set_ul_scheduler(mid_t mod_id, char *sched, void *object);
|
||||
|
||||
/************************** S1AP **************************/
|
||||
/* Get the number of MMEs to be connected */
|
||||
int flexran_get_s1ap_mme_pending(mid_t mod_id);
|
||||
|
||||
/* Get the number of connected MMEs */
|
||||
int flexran_get_s1ap_mme_connected(mid_t mod_id);
|
||||
|
||||
/* Get the eNB S1AP IP address */
|
||||
char* flexran_get_s1ap_enb_s1_ip(mid_t mod_id);
|
||||
|
||||
/* Get the name of the eNB */
|
||||
char* flexran_get_s1ap_enb_name(mid_t mod_id);
|
||||
|
||||
/* Get the number of connected MMEs to this eNB */
|
||||
int flexran_get_s1ap_nb_mme(mid_t mod_id);
|
||||
|
||||
/* Get the number of connected UEs to this eNB */
|
||||
int flexran_get_s1ap_nb_ue(mid_t mod_id);
|
||||
|
||||
/* Get the S1AP MME conf */
|
||||
int flexran_get_s1ap_mme_conf(mid_t mod_id, mid_t mme_index, Protocol__FlexS1apMme * mme_conf);
|
||||
|
||||
/* Get the S1AP UE conf */
|
||||
int flexran_get_s1ap_ue(mid_t mod_id, rnti_t rnti, Protocol__FlexS1apUe * ue_conf);
|
||||
|
||||
/* Add MMEs and re-issue S1AP Registration Request */
|
||||
int flexran_add_s1ap_mme(mid_t mod_id, size_t n_mme, char **mme_ipv4);
|
||||
|
||||
/* Remove MMEs and and cut SCTP to MME */
|
||||
int flexran_remove_s1ap_mme(mid_t mod_id, size_t n_mme, char **mme_ipv4);
|
||||
|
||||
/* Set a new PLMN configuration */
|
||||
int flexran_set_new_plmn_id(mid_t mod_id, int CC_id, size_t n_plmn, Protocol__FlexPlmn **plmn_id);
|
||||
|
||||
/********************* general information *****************/
|
||||
/* get an ID for this BS (or part of a BS) */
|
||||
uint64_t flexran_get_bs_id(mid_t mod_id);
|
||||
|
||||
/* get the capabilities supported by the underlying network function,
|
||||
* returns the number and stores list of this length in caps. If there are zero
|
||||
* capabilities, *caps will be NULL */
|
||||
size_t flexran_get_capabilities(mid_t mod_id, Protocol__FlexBsCapability **caps);
|
||||
|
||||
/* get the capabilities supported by the underlying network function as a bit
|
||||
* mask. */
|
||||
uint32_t flexran_get_capabilities_mask(mid_t mod_id);
|
||||
|
||||
/* get the splits used by the underlying network function,
|
||||
* return the number and stores list of this length in splits. If there are
|
||||
* zero capabilities, splits will be NULL */
|
||||
size_t flexran_get_splits(mid_t mod_id, Protocol__FlexBsSplit **splits);
|
||||
@@ -1,33 +0,0 @@
|
||||
#include <stdint.h>
|
||||
#include <openair2/COMMON/platform_constants.h>
|
||||
#include <openair2/LAYER2/PDCP_v10.1.0/pdcp.h>
|
||||
pdcp_enb_t pdcp_enb[MAX_NUM_CCs];
|
||||
uint32_t Pdcp_stats_tx_window_ms[MAX_eNB][MAX_MOBILES_PER_ENB];
|
||||
uint32_t Pdcp_stats_tx_bytes[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_bytes_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_bytes_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_sn[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_throughput_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_aiat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_aiat_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_aiat_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_tx_iat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
|
||||
uint32_t Pdcp_stats_rx_window_ms[MAX_eNB][MAX_MOBILES_PER_ENB];
|
||||
uint32_t Pdcp_stats_rx[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_bytes[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_bytes_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_bytes_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_sn[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_goodput_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_aiat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_aiat_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_iat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_outoforder[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
|
||||
@@ -1,305 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_task_manager.h
|
||||
* \brief Implementation of scheduled tasks manager for the FlexRAN agent
|
||||
* \author Xenofon Foukas
|
||||
* \date January 2016
|
||||
* \version 0.1
|
||||
* \email: x.foukas@sms.ed.ac.uk
|
||||
* @ingroup _mac
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "flexran_agent_task_manager.h"
|
||||
#include "flexran_agent_common.h"
|
||||
|
||||
|
||||
/* Util macros */
|
||||
#define LEFT(x) (2 * (x) + 1)
|
||||
#define RIGHT(x) (2 * (x) + 2)
|
||||
#define PARENT(x) ((x - 1) / 2)
|
||||
|
||||
flexran_agent_task_t *flexran_agent_task_create(Protocol__FlexranMessage *msg,
|
||||
uint16_t frame_num, uint8_t subframe_num) {
|
||||
flexran_agent_task_t *task = NULL;
|
||||
task = malloc(sizeof(flexran_agent_task_t));
|
||||
|
||||
if (task == NULL)
|
||||
goto error;
|
||||
|
||||
task->frame_num = frame_num;
|
||||
task->subframe_num = subframe_num;
|
||||
task->task = msg;
|
||||
|
||||
return task;
|
||||
|
||||
error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void flexran_agent_task_destroy(flexran_agent_task_t *task) {
|
||||
if (task == NULL)
|
||||
return;
|
||||
|
||||
/* TODO: must free the task properly */
|
||||
free(task->task);
|
||||
free(task);
|
||||
}
|
||||
|
||||
flexran_agent_task_queue_t *flexran_agent_task_queue_init(mid_t mod_id, size_t capacity,
|
||||
int (*cmp)(mid_t mod_id, const flexran_agent_task_t *t1,
|
||||
const flexran_agent_task_t *t2)) {
|
||||
flexran_agent_task_queue_t *queue = NULL;
|
||||
|
||||
queue = malloc(sizeof(flexran_agent_task_queue_t));
|
||||
if (queue == NULL)
|
||||
goto error;
|
||||
|
||||
queue->mutex = NULL;
|
||||
/* If no comparator was given, use the default one */
|
||||
if (cmp == NULL)
|
||||
queue->cmp = _flexran_agent_task_queue_cmp;
|
||||
else
|
||||
queue->cmp = cmp;
|
||||
|
||||
queue->mod_id = mod_id;
|
||||
|
||||
queue->first_frame = 0;
|
||||
queue->first_subframe = 0;
|
||||
|
||||
queue->task = malloc(capacity * sizeof(flexran_agent_task_t *));
|
||||
if (queue->task == NULL)
|
||||
goto error;
|
||||
|
||||
queue->count = 0;
|
||||
queue->capacity = capacity;
|
||||
|
||||
queue->mutex = malloc(sizeof(pthread_mutex_t));
|
||||
if (queue->mutex == NULL)
|
||||
goto error;
|
||||
if (pthread_mutex_init(queue->mutex, NULL))
|
||||
goto error;
|
||||
|
||||
return queue;
|
||||
|
||||
error:
|
||||
if (queue != NULL) {
|
||||
free(queue->mutex);
|
||||
free(queue->task);
|
||||
free(queue);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
flexran_agent_task_queue_t *flexran_agent_task_queue_default_init(mid_t mod_id) {
|
||||
return flexran_agent_task_queue_init(mod_id, DEFAULT_CAPACITY, NULL);
|
||||
}
|
||||
|
||||
void flexran_agent_task_queue_destroy(flexran_agent_task_queue_t *queue) {
|
||||
int i;
|
||||
|
||||
if (queue == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < queue->count; i++) {
|
||||
flexran_agent_task_destroy(queue->task[i]);
|
||||
}
|
||||
free(queue->task);
|
||||
free(queue->mutex);
|
||||
free(queue);
|
||||
}
|
||||
|
||||
int flexran_agent_task_queue_put(flexran_agent_task_queue_t *queue, flexran_agent_task_t *task) {
|
||||
size_t i;
|
||||
flexran_agent_task_t *tmp = NULL;
|
||||
int realloc_status, err_code;
|
||||
|
||||
if (pthread_mutex_lock(queue->mutex)) {
|
||||
/*TODO*/
|
||||
err_code = -1;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (queue->count >= queue->capacity) {
|
||||
/*TODO: need to call realloc heap*/
|
||||
realloc_status = _flexran_agent_task_queue_realloc_heap(queue);
|
||||
if (realloc_status != HEAP_OK) {
|
||||
err_code = realloc_status;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
queue->task[queue->count] = task;
|
||||
i = queue->count;
|
||||
queue->count++;
|
||||
/*Swap elements to maintain heap properties*/
|
||||
while(i > 0 && queue->cmp(queue->mod_id, queue->task[i], queue->task[PARENT(i)]) > 0) {
|
||||
tmp = queue->task[i];
|
||||
queue->task[i] = queue->task[PARENT(i)];
|
||||
queue->task[PARENT(i)] = tmp;
|
||||
i = PARENT(i);
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(queue->mutex)) {
|
||||
// LOG_E(MAC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
return 0;
|
||||
|
||||
error:
|
||||
/*TODO*/
|
||||
return err_code;
|
||||
}
|
||||
|
||||
|
||||
int flexran_agent_task_queue_get_current_task(flexran_agent_task_queue_t *queue, flexran_agent_task_t **task) {
|
||||
int err_code;
|
||||
|
||||
if (pthread_mutex_lock(queue->mutex)) {
|
||||
/*TODO*/
|
||||
err_code = -1;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (queue->count < 1) {
|
||||
/* Priority Queue is empty */
|
||||
err_code = HEAP_EMPTY;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Find current frame and subframe number */
|
||||
uint16_t curr_frame = flexran_get_current_frame(queue->mod_id);
|
||||
uint8_t curr_subframe = flexran_get_current_subframe(queue->mod_id);
|
||||
|
||||
/* If no task is scheduled for the current subframe, return without any task */
|
||||
if(queue->task[0]->frame_num != curr_frame || queue->task[0]->subframe_num != curr_subframe) {
|
||||
*task = NULL;
|
||||
return 0;
|
||||
}
|
||||
/* Otherwise, the first task should be returned */
|
||||
*task = queue->task[0];
|
||||
queue->task[0] = queue->task[queue->count-1];
|
||||
queue->count--;
|
||||
/* Restore heap property */
|
||||
_flexran_agent_task_queue_heapify(queue, 0);
|
||||
|
||||
/*If queue has no element*/
|
||||
if (queue->count < 1) {
|
||||
queue->first_frame = 0;
|
||||
queue->first_subframe = 0;
|
||||
} else {
|
||||
queue->first_frame = queue->task[0]->frame_num;
|
||||
queue->first_subframe = queue->task[0]->subframe_num;
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(queue->mutex)) {
|
||||
// LOG_E(MAC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
return HEAP_OK;
|
||||
|
||||
error:
|
||||
/*TODO*/
|
||||
return err_code;
|
||||
}
|
||||
|
||||
/*Warning: Internal function. Should not be called as API function. Not thread safe*/
|
||||
void _flexran_agent_task_queue_heapify(flexran_agent_task_queue_t *queue, size_t idx) {
|
||||
/* left index, right index, largest */
|
||||
flexran_agent_task_t *tmp = NULL;
|
||||
size_t l_idx, r_idx, lrg_idx;
|
||||
|
||||
l_idx = LEFT(idx);
|
||||
r_idx = RIGHT(idx);
|
||||
|
||||
/* Left child exists, compare left child with its parent */
|
||||
if (l_idx < queue->count && queue->cmp(queue->mod_id, queue->task[l_idx], queue->task[idx]) > 0) {
|
||||
lrg_idx = l_idx;
|
||||
} else {
|
||||
lrg_idx = idx;
|
||||
}
|
||||
|
||||
/* Right child exists, compare right child with the largest element */
|
||||
if (r_idx < queue->count && queue->cmp(queue->mod_id, queue->task[r_idx], queue->task[lrg_idx]) > 0) {
|
||||
lrg_idx = r_idx;
|
||||
}
|
||||
|
||||
/* At this point largest element was determined */
|
||||
if (lrg_idx != idx) {
|
||||
/* Swap between the index at the largest element */
|
||||
tmp = queue->task[lrg_idx];
|
||||
queue->task[lrg_idx] = queue->task[idx];
|
||||
queue->task[idx] = tmp;
|
||||
/* Heapify again */
|
||||
_flexran_agent_task_queue_heapify(queue, lrg_idx);
|
||||
}
|
||||
}
|
||||
|
||||
/*Warning: Internal function. Should not be called as API function. Not thread safe*/
|
||||
int _flexran_agent_task_queue_realloc_heap(flexran_agent_task_queue_t *queue) {
|
||||
flexran_agent_task_t **resized_task_heap;
|
||||
if (queue->count >= queue->capacity) {
|
||||
size_t task_size = sizeof(flexran_agent_task_t);
|
||||
|
||||
resized_task_heap = realloc(queue->task, (2*queue->capacity) * task_size);
|
||||
if (resized_task_heap != NULL) {
|
||||
queue->capacity *= 2;
|
||||
queue->task = (flexran_agent_task_t **) resized_task_heap;
|
||||
return HEAP_OK;
|
||||
} else return HEAP_REALLOCERROR;
|
||||
}
|
||||
return HEAP_NOREALLOC;
|
||||
}
|
||||
|
||||
int _flexran_agent_task_queue_cmp(mid_t mod_id, const flexran_agent_task_t *t1, const flexran_agent_task_t *t2) {
|
||||
if ((t1->frame_num == t2->frame_num) && (t1->subframe_num == t2->subframe_num))
|
||||
return 0;
|
||||
|
||||
uint16_t curr_frame = flexran_get_current_frame(mod_id);
|
||||
uint8_t curr_subframe = flexran_get_current_subframe(mod_id);
|
||||
|
||||
int f_offset, sf_offset, tmp1, tmp2;
|
||||
|
||||
/*Check if the offsets have the same sign and compare the tasks position frame-wise*/
|
||||
tmp1 = t1->frame_num - curr_frame;
|
||||
tmp2 = t2->frame_num - curr_frame;
|
||||
if ((tmp1 >= 0) ^ (tmp2 < 0)) {
|
||||
f_offset = tmp2 - tmp1;
|
||||
}
|
||||
else {
|
||||
f_offset = tmp1 - tmp2;
|
||||
}
|
||||
/*Do the same for the subframe*/
|
||||
tmp1 = t1->subframe_num - curr_subframe;
|
||||
tmp2 = t2->subframe_num - curr_subframe;
|
||||
if ((tmp1 >= 0) ^ (tmp2 < 0))
|
||||
sf_offset = tmp2 - tmp1;
|
||||
else
|
||||
sf_offset = tmp1 - tmp2;
|
||||
|
||||
/*Subframe position matters only if f_offset is 0. Multiply f_offset by 100
|
||||
to be the only comparisson parameter in all other cases */
|
||||
return f_offset*100 + sf_offset;
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_task_manager.h
|
||||
* \brief Implementation of scheduled tasks manager for the FlexRAN agent
|
||||
* \author Xenofon Foukas
|
||||
* \date January 2016
|
||||
* \version 0.1
|
||||
* \email: x.foukas@sms.ed.ac.uk
|
||||
* @ingroup _mac
|
||||
*/
|
||||
|
||||
#ifndef FLEXRAN_AGENT_TASK_MANAGER_
|
||||
#define FLEXRAN_AGENT_TASK_MANAGER_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "flexran.pb-c.h"
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DEFAULT_CAPACITY 512
|
||||
|
||||
/**
|
||||
* The structure containing the enb agent task to be executed
|
||||
*/
|
||||
typedef struct flexran_agent_task_s {
|
||||
/* The frame in which the task needs to be executed */
|
||||
uint16_t frame_num;
|
||||
/* The subframe in which the task needs to be executed */
|
||||
uint8_t subframe_num;
|
||||
/* The task to be executed in the form of a Protocol__FlexranMessage */
|
||||
Protocol__FlexranMessage *task;
|
||||
} flexran_agent_task_t;
|
||||
|
||||
/**
|
||||
* Priority Queue Structure for tasks
|
||||
*/
|
||||
typedef struct flexran_agent_task_queue_s {
|
||||
mid_t mod_id;
|
||||
/* The amount of allocated memory for agent tasks in the heap*/
|
||||
volatile size_t capacity;
|
||||
/* The actual size of the tasks heap at a certain time */
|
||||
volatile size_t count;
|
||||
/* The earliest frame that has a pending task */
|
||||
volatile uint16_t first_frame;
|
||||
/* The earliest subframe within the frame that has a pending task */
|
||||
volatile uint8_t first_subframe;
|
||||
/* An array of prioritized tasks stored in a heap */
|
||||
flexran_agent_task_t **task;
|
||||
/* A pointer to a comparator function, used to prioritize elements */
|
||||
int (*cmp)(mid_t mod_id, const flexran_agent_task_t *t1, const flexran_agent_task_t *t2);
|
||||
pthread_mutex_t *mutex;
|
||||
} flexran_agent_task_queue_t;
|
||||
|
||||
typedef enum {
|
||||
HEAP_OK = 0,
|
||||
HEAP_EMPTY,
|
||||
HEAP_FAILED,
|
||||
HEAP_REALLOCERROR,
|
||||
HEAP_NOREALLOC,
|
||||
HEAP_FATAL,
|
||||
} heapstatus_e;
|
||||
|
||||
/**
|
||||
* Allocate memory for a task in the queue
|
||||
*/
|
||||
flexran_agent_task_t *flexran_agent_task_create(Protocol__FlexranMessage *msg,
|
||||
uint16_t frame_num, uint8_t subframe_num);
|
||||
|
||||
/**
|
||||
* Free memory for a task of the queue
|
||||
*/
|
||||
void flexran_agent_task_destroy(flexran_agent_task_t *task);
|
||||
|
||||
/**
|
||||
* Allocate initial memory for storing the tasks
|
||||
*/
|
||||
flexran_agent_task_queue_t *flexran_agent_task_queue_init(mid_t mod_id, size_t capacity,
|
||||
int (*cmp)(mid_t mod_id, const flexran_agent_task_t *t1,
|
||||
const flexran_agent_task_t *t2));
|
||||
|
||||
/**
|
||||
* Allocate initial memory for storing the tasks using default parameters
|
||||
*/
|
||||
flexran_agent_task_queue_t *flexran_agent_task_queue_default_init(mid_t mod_id);
|
||||
|
||||
/**
|
||||
* De-allocate memory for the tasks queue
|
||||
*/
|
||||
void flexran_agent_task_queue_destroy(flexran_agent_task_queue_t *queue);
|
||||
|
||||
/**
|
||||
* Insert task into the queue
|
||||
*/
|
||||
int flexran_agent_task_queue_put(flexran_agent_task_queue_t *queue, flexran_agent_task_t *task);
|
||||
|
||||
/**
|
||||
* Remove the task with the highest priority from the queue
|
||||
* task becomes NULL if there is no task for the current frame and subframe
|
||||
*/
|
||||
int flexran_agent_task_queue_get_current_task(flexran_agent_task_queue_t *queue, flexran_agent_task_t **task);
|
||||
|
||||
/**
|
||||
* Check if the top priority task is for a specific frame and subframe
|
||||
*/
|
||||
int flexran_agent_task_queue_has_upcoming_task (flexran_agent_task_queue_t *queue,
|
||||
const uint16_t frame, const uint8_t subframe);
|
||||
|
||||
/**
|
||||
* Restructure heap after modifications
|
||||
*/
|
||||
void _flexran_agent_task_queue_heapify(flexran_agent_task_queue_t *queue, size_t idx);
|
||||
|
||||
/**
|
||||
* Reallocate memory once the heap reaches max size
|
||||
*/
|
||||
int _flexran_agent_task_queue_realloc_heap(flexran_agent_task_queue_t *queue);
|
||||
|
||||
/**
|
||||
* Compare two agent tasks based on frame and subframe
|
||||
* returns 0 if tasks t1, t2 have the same priority
|
||||
* return negative value if t1 needs to be executed after t2
|
||||
* return positive value if t1 preceeds t2
|
||||
* Need to give eNB id for the comparisson based on the current frame-subframe
|
||||
*/
|
||||
int _flexran_agent_task_queue_cmp(mid_t mod_id, const flexran_agent_task_t *t1, const flexran_agent_task_t *t2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*FLEXRAN_AGENT_TASK_MANAGER_*/
|
||||
@@ -1,292 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_timer.c
|
||||
* \brief FlexRAN Timer
|
||||
* \author Robert Schmidt
|
||||
* \date 2019
|
||||
* \version 0.2
|
||||
*/
|
||||
|
||||
#include "flexran_agent_timer.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
#include <pthread.h>
|
||||
#include <sys/timerfd.h>
|
||||
|
||||
#define MAX_NUM_TIMERS 10
|
||||
|
||||
typedef struct flexran_agent_timer_element_s {
|
||||
mid_t mod_id;
|
||||
xid_t xid; /* The id of the task as received by the controller message*/
|
||||
uint32_t sf;
|
||||
uint64_t next;
|
||||
flexran_agent_timer_callback_t cb;
|
||||
Protocol__FlexranMessage *msg;
|
||||
} flexran_agent_timer_element_t;
|
||||
|
||||
typedef struct flexran_agent_timer_extern_source_s {
|
||||
pthread_mutex_t mutex_sync;
|
||||
pthread_cond_t cond;
|
||||
int wait;
|
||||
} flexran_agent_timer_extern_source_t;
|
||||
|
||||
struct timesync {
|
||||
void *param_sync;
|
||||
void (*fsync)(void *);
|
||||
pthread_t thread;
|
||||
|
||||
uint64_t current;
|
||||
uint64_t next;
|
||||
|
||||
int timer_num;
|
||||
flexran_agent_timer_element_t *timer[MAX_NUM_TIMERS];
|
||||
|
||||
int add_num;
|
||||
flexran_agent_timer_element_t *add_list[MAX_NUM_TIMERS];
|
||||
int remove_num;
|
||||
int remove_list[MAX_NUM_TIMERS];
|
||||
pthread_mutex_t mutex_timer;
|
||||
|
||||
int exit;
|
||||
};
|
||||
struct timesync timesync[NUM_MAX_ENB];
|
||||
|
||||
int flexran_agent_timer_signal_init(struct timesync *sync);
|
||||
int flexran_agent_timer_source_setup(struct timesync *sync);
|
||||
void *flexran_agent_timer_thread(void *args);
|
||||
void flexran_agent_timer_remove_internal(struct timesync *sync, int index);
|
||||
void flexran_agent_timer_process(flexran_agent_timer_element_t *t);
|
||||
|
||||
|
||||
err_code_t flexran_agent_timer_init(mid_t mod_id) {
|
||||
struct timesync *sync = ×ync[mod_id];
|
||||
sync->current = 0;
|
||||
sync->next = 0;
|
||||
sync->timer_num = 0;
|
||||
sync->add_num = 0;
|
||||
sync->remove_num = 0;
|
||||
for (int i = 0; i < MAX_NUM_TIMERS; ++i) {
|
||||
sync->timer[i] = NULL;
|
||||
sync->add_list[i] = NULL;
|
||||
}
|
||||
pthread_mutex_init(&sync->mutex_timer, NULL);
|
||||
sync->exit = 0;
|
||||
|
||||
/* if there is a MAC, we assume we can have a tick from the MAC interface
|
||||
* (external tick source). Otherwise, generate a tick internally via the
|
||||
* timerfd linux library. The init functions set everything up and the thread
|
||||
* will use whatever is available. */
|
||||
int (*init)(struct timesync *) = flexran_agent_get_mac_xface(mod_id) ?
|
||||
flexran_agent_timer_signal_init : flexran_agent_timer_source_setup;
|
||||
if (init(timesync) < 0
|
||||
|| pthread_create(&sync->thread, NULL, flexran_agent_timer_thread, sync) != 0) {
|
||||
sync->thread = 0;
|
||||
if (sync->param_sync)
|
||||
free(sync->param_sync);
|
||||
LOG_E(FLEXRAN_AGENT, "could not start timer thread\n");
|
||||
return TIMER_SETUP_FAILED;
|
||||
}
|
||||
return PROTOCOL__FLEXRAN_ERR__NO_ERR;
|
||||
}
|
||||
|
||||
void flexran_agent_timer_exit(mid_t mod_id) {
|
||||
timesync[mod_id].exit = 1;
|
||||
}
|
||||
|
||||
void flexran_agent_timer_source_sync(void *sync) {
|
||||
int fd = *(int *)sync;
|
||||
uint64_t occ;
|
||||
int rc __attribute__((unused)) = read(fd, &occ, sizeof(occ));
|
||||
}
|
||||
|
||||
int flexran_agent_timer_source_setup(struct timesync *sync) {
|
||||
sync->param_sync = malloc(sizeof(int));
|
||||
if (!sync->param_sync)
|
||||
return -1;
|
||||
int fd = timerfd_create(CLOCK_MONOTONIC, 0);
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
|
||||
const uint64_t period_ns = 1000000; // 1ms
|
||||
struct itimerspec t;
|
||||
t.it_interval.tv_sec = period_ns / 1000000000;
|
||||
t.it_interval.tv_nsec = period_ns % 1000000000;
|
||||
t.it_value.tv_sec = period_ns / 1000000000;
|
||||
t.it_value.tv_nsec = period_ns % 1000000000;
|
||||
int rc = timerfd_settime(fd, 0, &t, NULL);
|
||||
if (rc != 0)
|
||||
return -1;
|
||||
*(int *)sync->param_sync = fd;
|
||||
sync->fsync = flexran_agent_timer_source_sync;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flexran_agent_timer_signal_sync(void *param_sync) {
|
||||
flexran_agent_timer_extern_source_t *sync = param_sync;
|
||||
pthread_mutex_lock(&sync->mutex_sync);
|
||||
while (sync->wait) {
|
||||
pthread_cond_wait(&sync->cond, &sync->mutex_sync);
|
||||
}
|
||||
sync->wait = 1;
|
||||
pthread_mutex_unlock(&sync->mutex_sync);
|
||||
}
|
||||
|
||||
int flexran_agent_timer_signal_init(struct timesync *sync) {
|
||||
flexran_agent_timer_extern_source_t *s = malloc(sizeof(flexran_agent_timer_extern_source_t));
|
||||
if (!s)
|
||||
return TIMER_SETUP_FAILED;
|
||||
if (pthread_mutex_init(&s->mutex_sync, NULL) < 0)
|
||||
return TIMER_SETUP_FAILED;
|
||||
if (pthread_cond_init(&s->cond, NULL) < 0)
|
||||
return TIMER_SETUP_FAILED;
|
||||
s->wait = 1;
|
||||
sync->param_sync = s;
|
||||
sync->fsync = flexran_agent_timer_signal_sync;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flexran_agent_timer_signal(mid_t mod_id) {
|
||||
flexran_agent_timer_extern_source_t *sync = timesync[mod_id].param_sync;
|
||||
pthread_mutex_lock(&sync->mutex_sync);
|
||||
sync->wait = 0;
|
||||
pthread_mutex_unlock(&sync->mutex_sync);
|
||||
pthread_cond_signal(&sync->cond);
|
||||
}
|
||||
|
||||
void *flexran_agent_timer_thread(void *args) {
|
||||
struct timesync *sync = args;
|
||||
while (1) {
|
||||
sync->fsync(sync->param_sync);
|
||||
if (sync->exit)
|
||||
break;
|
||||
|
||||
pthread_mutex_lock(&sync->mutex_timer);
|
||||
for (int i = 0; i < sync->add_num; ++i) {
|
||||
sync->timer[sync->timer_num] = sync->add_list[i];
|
||||
sync->timer_num++;
|
||||
}
|
||||
sync->add_num = 0;
|
||||
for (int i = 0; i < sync->remove_num; ++i)
|
||||
flexran_agent_timer_remove_internal(sync, sync->remove_list[i]);
|
||||
sync->remove_num = 0;
|
||||
pthread_mutex_unlock(&sync->mutex_timer);
|
||||
|
||||
sync->current++;
|
||||
if (sync->current < sync->next)
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < sync->timer_num; ++i) {
|
||||
flexran_agent_timer_element_t *t = sync->timer[i];
|
||||
if (sync->current == t->next) {
|
||||
flexran_agent_timer_process(t);
|
||||
t->next += t->sf;
|
||||
}
|
||||
if (sync->next == sync->current || t->next < sync->next)
|
||||
sync->next = t->next;
|
||||
}
|
||||
}
|
||||
LOG_W(FLEXRAN_AGENT, "terminated timer thread\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void flexran_agent_timer_process(flexran_agent_timer_element_t *t) {
|
||||
Protocol__FlexranMessage *msg = t->cb(t->mod_id, t->msg);
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
int size = 0;
|
||||
void *data = flexran_agent_pack_message(msg, &size);
|
||||
if (flexran_agent_msg_send(t->mod_id, FLEXRAN_AGENT_DEFAULT, data, size, 0) < 0)
|
||||
LOG_E(FLEXRAN_AGENT, "error while sending message for timer xid %d\n", t->xid);
|
||||
}
|
||||
|
||||
|
||||
err_code_t flexran_agent_create_timer(mid_t mod_id,
|
||||
uint32_t sf,
|
||||
flexran_agent_timer_type_t timer_type,
|
||||
xid_t xid,
|
||||
flexran_agent_timer_callback_t cb,
|
||||
Protocol__FlexranMessage *msg) {
|
||||
if (sf == 0)
|
||||
return TIMER_NULL;
|
||||
if (cb == NULL)
|
||||
return TIMER_SETUP_FAILED;
|
||||
AssertFatal(timer_type != FLEXRAN_AGENT_TIMER_TYPE_ONESHOT,
|
||||
"one shot timer not yet implemented\n");
|
||||
|
||||
flexran_agent_timer_element_t *t = malloc(sizeof(flexran_agent_timer_element_t));
|
||||
if (!t) {
|
||||
LOG_E(FLEXRAN_AGENT, "no memory for new timer %d\n", xid);
|
||||
return TIMER_SETUP_FAILED;
|
||||
}
|
||||
t->mod_id = mod_id;
|
||||
t->xid = xid;
|
||||
t->sf = sf;
|
||||
t->cb = cb;
|
||||
t->msg = msg;
|
||||
|
||||
struct timesync *sync = ×ync[mod_id];
|
||||
pthread_mutex_lock(&sync->mutex_timer);
|
||||
if (sync->timer_num + sync->add_num >= MAX_NUM_TIMERS) {
|
||||
pthread_mutex_unlock(&sync->mutex_timer);
|
||||
LOG_E(FLEXRAN_AGENT, "maximum number of timers (%d) reached while adding timer %d\n",
|
||||
sync->timer_num + sync->add_num, xid);
|
||||
free(t);
|
||||
return TIMER_SETUP_FAILED;
|
||||
}
|
||||
/* TODO check that xid does not exist? */
|
||||
t->next = sync->current + sf;
|
||||
if (sync->next <= sync->current || t->next < sync->next)
|
||||
sync->next = t->next;
|
||||
sync->add_list[sync->add_num] = t;
|
||||
sync->add_num++;
|
||||
pthread_mutex_unlock(&sync->mutex_timer);
|
||||
LOG_I(FLEXRAN_AGENT, "added new timer xid %d for agent %d\n", xid, mod_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
err_code_t flexran_agent_destroy_timer(mid_t mod_id, xid_t xid) {
|
||||
struct timesync *sync = ×ync[mod_id];
|
||||
for (int i = 0; i < sync->timer_num; ++i) {
|
||||
if (sync->timer[i]->xid == xid) {
|
||||
pthread_mutex_lock(&sync->mutex_timer);
|
||||
sync->remove_list[sync->remove_num] = i;
|
||||
sync->remove_num++;
|
||||
pthread_mutex_unlock(&sync->mutex_timer);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
LOG_E(FLEXRAN_AGENT, "could not find timer %d\n", xid);
|
||||
return TIMER_ELEMENT_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* this function assumes that the timer lock is held */
|
||||
void flexran_agent_timer_remove_internal(struct timesync *sync, int index) {
|
||||
LOG_I(FLEXRAN_AGENT, "remove timer xid %d (index %d) for agent %d\n",
|
||||
sync->timer[index]->xid, index, sync->timer[index]->mod_id);
|
||||
if (sync->timer[index]->msg)
|
||||
flexran_agent_destroy_flexran_message(sync->timer[index]->msg);
|
||||
free(sync->timer[index]);
|
||||
for (int i = index + 1; i < sync->timer_num; ++i)
|
||||
sync->timer[i - 1] = sync->timer[i];
|
||||
sync->timer_num--;
|
||||
sync->timer[sync->timer_num] = NULL;
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file flexran_agent_timer.h
|
||||
* \brief FlexRAN Timer header
|
||||
* \author shahab SHARIAT BAGHERI
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef _FLEXRAN_AGENT_TIMER_
|
||||
#define _FLEXRAN_AGENT_TIMER_
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
|
||||
#define TIMER_NULL -1
|
||||
#define TIMER_TYPE_INVALIDE -2
|
||||
#define TIMER_SETUP_FAILED -3
|
||||
#define TIMER_REMOVED_FAILED -4
|
||||
#define TIMER_ELEMENT_NOT_FOUND -5
|
||||
|
||||
typedef enum {
|
||||
FLEXRAN_AGENT_TIMER_TYPE_ONESHOT,
|
||||
FLEXRAN_AGENT_TIMER_TYPE_PERIODIC,
|
||||
} flexran_agent_timer_type_t;
|
||||
|
||||
/* Type of the callback executed when the timer expired */
|
||||
typedef Protocol__FlexranMessage *(*flexran_agent_timer_callback_t)(
|
||||
mid_t mod_id, const Protocol__FlexranMessage *msg);
|
||||
|
||||
err_code_t flexran_agent_timer_init(mid_t mod_id);
|
||||
void flexran_agent_timer_exit(mid_t mod_id);
|
||||
|
||||
/* Signals next subframe for FlexRAN timers */
|
||||
void flexran_agent_timer_signal(mid_t mod_id);
|
||||
|
||||
/* Create a timer for some agent related event with id xid. */
|
||||
err_code_t flexran_agent_create_timer(mid_t mod_id,
|
||||
uint32_t sf,
|
||||
flexran_agent_timer_type_t timer_type,
|
||||
xid_t xid,
|
||||
flexran_agent_timer_callback_t cb,
|
||||
Protocol__FlexranMessage *msg);
|
||||
|
||||
/* Destroy the timer for task with id xid */
|
||||
err_code_t flexran_agent_destroy_timer(mid_t mod_id, xid_t xid);
|
||||
|
||||
#endif /* _FLEXRAN_AGENT_TIMER_ */
|
||||
@@ -1,245 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file imsi.c
|
||||
* \brief flexran IMSI UE-slice association app
|
||||
* \author Robert Schmidt, Firas Abdeljelil
|
||||
* \date 2020
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <regex.h>
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_async.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
#include "flexran_agent_timer.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
#include "flexran_agent_phy.h"
|
||||
#include "flexran_agent_mac.h"
|
||||
#include "flexran_agent_rrc.h"
|
||||
#include "flexran_agent_pdcp.h"
|
||||
#include "flexran_agent_s1ap.h"
|
||||
#include "flexran_agent_app.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
#include "queue.h"
|
||||
typedef struct Map_regex_slice slist_data_t;
|
||||
struct Map_regex_slice {
|
||||
char regex_[30] ;
|
||||
int slice_dl;
|
||||
int slice_ul;
|
||||
regex_t regex;
|
||||
SLIST_ENTRY (Map_regex_slice) entries;
|
||||
};
|
||||
bool reconfig = false;
|
||||
int ue[MAX_MOBILES_PER_ENB]={ [0 ... MAX_MOBILES_PER_ENB - 1] = -1 };
|
||||
|
||||
SLIST_HEAD(slisthead, Map_regex_slice) head;
|
||||
|
||||
int dump_list(void) {
|
||||
int len = 1;
|
||||
slist_data_t *datap = NULL;
|
||||
SLIST_FOREACH(datap, &head, entries) {
|
||||
LOG_W(FLEXRAN_AGENT, "%d: regex %s DL %d UL %d\n", len++, datap->regex_,
|
||||
datap->slice_dl, datap->slice_ul);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
void add(char *regex, int dl, int ul) {
|
||||
slist_data_t *datap = malloc(sizeof(slist_data_t));
|
||||
if (!datap) {
|
||||
LOG_E(FLEXRAN_AGENT, "cannot allocate memory for slist_data_t\n");
|
||||
return;
|
||||
}
|
||||
strcpy(datap->regex_, regex);
|
||||
datap->slice_dl = dl;
|
||||
datap->slice_ul = ul;
|
||||
regcomp(&datap->regex, datap->regex_, 0);
|
||||
SLIST_INSERT_HEAD(&head, datap, entries);
|
||||
if (ul==-1)
|
||||
LOG_I(FLEXRAN_AGENT, "added new element to list: regex %s slice DL %d\n" ,regex, dl);
|
||||
else if (dl==-1)
|
||||
LOG_I(FLEXRAN_AGENT, "added new element to list: regex %s slice UL %d\n" ,regex, ul);
|
||||
else
|
||||
LOG_I(FLEXRAN_AGENT, "added new element to list: regex %s slice DL %d UL %d\n",
|
||||
regex, dl, ul);
|
||||
}
|
||||
void remove_(char *regex) {
|
||||
slist_data_t *datap = NULL;
|
||||
SLIST_FOREACH(datap, &head, entries) {
|
||||
if (strcmp(datap->regex_, regex) == 0) {
|
||||
SLIST_REMOVE(&head, datap, Map_regex_slice, entries);
|
||||
if (datap->slice_dl==-1)
|
||||
LOG_I(FLEXRAN_AGENT, "removed element from list: regex %s slice UL %d\n",datap->regex_, datap->slice_ul);
|
||||
else if (datap->slice_ul==-1)
|
||||
LOG_I(FLEXRAN_AGENT, "removed element from list: regex %s slice DL %d\n",datap->regex_, datap->slice_dl);
|
||||
else
|
||||
LOG_I(FLEXRAN_AGENT, "removed element from list: regex %s slice DL %d UL %d\n",
|
||||
datap->regex_, datap->slice_dl, datap->slice_ul);
|
||||
regfree(&datap->regex);
|
||||
free(datap);
|
||||
return;
|
||||
}
|
||||
}
|
||||
LOG_E(FLEXRAN_AGENT, "no regex %s found in list\n", regex);
|
||||
}
|
||||
|
||||
Protocol__FlexranMessage *matching_tick(
|
||||
mid_t mod_id,
|
||||
const Protocol__FlexranMessage *msg) {
|
||||
const int num = flexran_get_mac_num_ues(mod_id);
|
||||
for (int i = 0; i < num; i++) {
|
||||
int ue_id = flexran_get_mac_ue_id(mod_id, i);
|
||||
if (ue[ue_id] >= 0 && !reconfig)
|
||||
continue;
|
||||
rnti_t rnti = flexran_get_mac_ue_crnti(mod_id, ue_id);
|
||||
uint64_t imsi = flexran_get_ue_imsi(mod_id, rnti);
|
||||
char snum[20];
|
||||
sprintf(snum, "%" PRIu64, imsi);
|
||||
slist_data_t *datap = NULL;
|
||||
SLIST_FOREACH(datap, &head, entries) {
|
||||
if (regexec(&datap->regex, snum, 0, NULL, 0) == 0) {
|
||||
|
||||
int dl = datap->slice_dl;
|
||||
if (dl >= 0 && dl != flexran_get_ue_dl_slice_id(mod_id, ue_id)) {
|
||||
int ra = flexran_set_ue_dl_slice_id(mod_id, ue_id, dl);
|
||||
if (ra)
|
||||
LOG_I(FLEXRAN_AGENT,
|
||||
"RNTI %04x/IMSI %s in the slice_dl %d\n",
|
||||
rnti,
|
||||
snum,
|
||||
dl);
|
||||
else
|
||||
LOG_W(FLEXRAN_AGENT, "No such DL slice %d\n", dl);
|
||||
}
|
||||
|
||||
int ul = datap->slice_ul;
|
||||
if (ul >= 0 && ul != flexran_get_ue_ul_slice_id(mod_id, ue_id)) {
|
||||
int rb = flexran_set_ue_ul_slice_id(mod_id, ue_id, ul);
|
||||
if (rb)
|
||||
LOG_I(FLEXRAN_AGENT,
|
||||
"RNTI %04x/IMSI %s in the slice_ul %d\n",
|
||||
rnti,
|
||||
snum,
|
||||
ul);
|
||||
else
|
||||
LOG_W(FLEXRAN_AGENT, "No such DL slice %d\n", dl);
|
||||
}
|
||||
}
|
||||
}
|
||||
ue[ue_id] = ue_id;
|
||||
}
|
||||
reconfig = false;
|
||||
return NULL;
|
||||
}
|
||||
void add_param(Protocol__FlexAgentReconfigurationSubsystem__ParamsEntry **p, int n_p) {
|
||||
char s[30];
|
||||
reconfig = true;
|
||||
bool supp=false;
|
||||
bool sl_E=false;
|
||||
int dl=-1;
|
||||
int ul=-1;
|
||||
slist_data_t *datap = NULL;
|
||||
for (int i = 0; i < n_p; ++i) {
|
||||
switch (p[i]->value->param_case) {
|
||||
case PROTOCOL__FLEX_AGENT_RECONFIGURATION_PARAM__PARAM__NOT_SET:
|
||||
LOG_I(FLEXRAN_AGENT, " param %s is not set\n", p[i]->key);
|
||||
break;
|
||||
case PROTOCOL__FLEX_AGENT_RECONFIGURATION_PARAM__PARAM_INTEGER:
|
||||
if( strcmp(p[i]->key, "slice_dl")==0)
|
||||
dl= p[i]->value->integer;
|
||||
else
|
||||
ul= p[i]->value->integer;
|
||||
sl_E=true;
|
||||
break;
|
||||
case PROTOCOL__FLEX_AGENT_RECONFIGURATION_PARAM__PARAM_STR:
|
||||
strcpy(s,p[i]->value->str);
|
||||
break;
|
||||
default:
|
||||
LOG_W(FLEXRAN_AGENT, " type of param %s is unknown\n", p[i]->key);
|
||||
break;
|
||||
};
|
||||
}
|
||||
if (!SLIST_EMPTY(&head)){
|
||||
SLIST_FOREACH(datap, &head, entries) {
|
||||
if (strcmp(datap->regex_, s) == 0) {
|
||||
if (datap->slice_dl!=dl || datap->slice_ul!=ul)
|
||||
supp=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sl_E==false)
|
||||
remove_(s);
|
||||
else {
|
||||
if (supp==true)
|
||||
remove_(s);
|
||||
add(s,dl,ul);
|
||||
}
|
||||
/* re-verify all UEs again */
|
||||
for (int i = 0; i < MAX_MOBILES_PER_ENB; ++i)
|
||||
ue[i] = -1;
|
||||
}
|
||||
/* imsi_start: entry point for imsi app. Installs a callback using the timer
|
||||
* API to have function imsi_tick() called every 5s */
|
||||
#define TIMER 32
|
||||
int imsi_start(mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem__ParamsEntry **p,
|
||||
int n_p)
|
||||
{
|
||||
LOG_W(FLEXRAN_AGENT, "%s(): enable IMSI app timer\n", __func__);
|
||||
flexran_agent_create_timer(mod_id,
|
||||
500,
|
||||
FLEXRAN_AGENT_TIMER_TYPE_PERIODIC,
|
||||
TIMER,
|
||||
matching_tick,
|
||||
NULL);
|
||||
SLIST_INIT(&head);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int imsi_reconfig(mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem__ParamsEntry **p,
|
||||
int n_p)
|
||||
{
|
||||
add_param(p, n_p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* stop function: cleans up before app can be unloaded. Here: stop the timer */
|
||||
int imsi_stop(mid_t mod_id) {
|
||||
LOG_W(FLEXRAN_AGENT, "%s(): disable IMSI app timer\n", __func__);
|
||||
flexran_agent_destroy_timer(mod_id, TIMER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* app definition. visibility should be set to default so this symbol is
|
||||
* reachable from outside */
|
||||
flexran_agent_app_t __attribute__ ((visibility ("default"))) app = {
|
||||
.start = imsi_start,
|
||||
.reconfig = imsi_reconfig,
|
||||
.stop = imsi_stop
|
||||
};
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file sample.c
|
||||
* \brief flexran sample app
|
||||
* \author Robert Schmidt
|
||||
* \date 2020
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "flexran_agent_common.h"
|
||||
#include "flexran_agent_async.h"
|
||||
#include "flexran_agent_extern.h"
|
||||
#include "flexran_agent_timer.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
#include "flexran_agent_net_comm.h"
|
||||
#include "flexran_agent_ran_api.h"
|
||||
#include "flexran_agent_phy.h"
|
||||
#include "flexran_agent_mac.h"
|
||||
#include "flexran_agent_rrc.h"
|
||||
#include "flexran_agent_pdcp.h"
|
||||
#include "flexran_agent_s1ap.h"
|
||||
#include "flexran_agent_app.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
|
||||
/* callback to be called for event: shows exemplary variable use and use of RAN
|
||||
* API */
|
||||
int tick;
|
||||
Protocol__FlexranMessage *sample_tick(
|
||||
mid_t mod_id,
|
||||
const Protocol__FlexranMessage *msg) {
|
||||
tick++;
|
||||
const int num = flexran_get_mac_num_ues(mod_id);
|
||||
LOG_I(FLEXRAN_AGENT, "%s(): tick %d number UEs %d\n", __func__, tick, num);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void print_param(Protocol__FlexAgentReconfigurationSubsystem__ParamsEntry **p, int n_p) {
|
||||
LOG_I(FLEXRAN_AGENT, "%s(): received %d parameters\n", __func__, n_p);
|
||||
for (int i = 0; i < n_p; ++i) {
|
||||
switch (p[i]->value->param_case) {
|
||||
case PROTOCOL__FLEX_AGENT_RECONFIGURATION_PARAM__PARAM__NOT_SET:
|
||||
LOG_I(FLEXRAN_AGENT, " param %s is not set\n", p[i]->key);
|
||||
break;
|
||||
case PROTOCOL__FLEX_AGENT_RECONFIGURATION_PARAM__PARAM_INTEGER:
|
||||
LOG_I(FLEXRAN_AGENT, " param %s is %d\n", p[i]->key, p[i]->value->integer);
|
||||
break;
|
||||
case PROTOCOL__FLEX_AGENT_RECONFIGURATION_PARAM__PARAM_FLOATING:
|
||||
LOG_I(FLEXRAN_AGENT, " param %s is %f\n", p[i]->key, p[i]->value->floating);
|
||||
break;
|
||||
case PROTOCOL__FLEX_AGENT_RECONFIGURATION_PARAM__PARAM_BOOLEAN:
|
||||
LOG_I(FLEXRAN_AGENT, " param %s is %s\n", p[i]->key, p[i]->value->boolean ? "true" : "false");
|
||||
break;
|
||||
case PROTOCOL__FLEX_AGENT_RECONFIGURATION_PARAM__PARAM_STR:
|
||||
LOG_I(FLEXRAN_AGENT, " param %s is %s\n", p[i]->key, p[i]->value->str);
|
||||
break;
|
||||
default:
|
||||
LOG_W(FLEXRAN_AGENT, " type of param %s is unknown\n", p[i]->key);
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/* sa_start: entry point for sample app. Installs a callback using the timer
|
||||
* API to have function sample_tick() called every 5s */
|
||||
#define TIMER 22
|
||||
int sa_start(mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem__ParamsEntry **p,
|
||||
int n_p) {
|
||||
LOG_W(FLEXRAN_AGENT, "%s(): enable sample app timer\n", __func__);
|
||||
flexran_agent_create_timer(mod_id,
|
||||
5000,
|
||||
FLEXRAN_AGENT_TIMER_TYPE_PERIODIC,
|
||||
TIMER,
|
||||
sample_tick,
|
||||
NULL);
|
||||
print_param(p, n_p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sa_reconfig(mid_t mod_id,
|
||||
Protocol__FlexAgentReconfigurationSubsystem__ParamsEntry **p,
|
||||
int n_p)
|
||||
{
|
||||
print_param(p, n_p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* stop function: cleans up before app can be unloaded. Here: stop the timer */
|
||||
int sa_stop(mid_t mod_id) {
|
||||
LOG_W(FLEXRAN_AGENT, "%s(): disable sample app timer\n", __func__);
|
||||
flexran_agent_destroy_timer(mod_id, TIMER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* app definition. visibility should be set to default so this symbol is
|
||||
* reachable from outside */
|
||||
flexran_agent_app_t __attribute__ ((visibility ("default"))) app = {
|
||||
.start = sa_start,
|
||||
.reconfig = sa_reconfig,
|
||||
.stop = sa_stop
|
||||
};
|
||||
Reference in New Issue
Block a user