flexran_agent_ran_api.h 25.9 KB
Newer Older
1 2 3 4 5
/*
 * 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
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 * 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 
24
 * \author N. Nikaein, X. Foukas and S. SHARIAT BAGHERI
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
 * \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"
40
#include "SCHED/sched_eNB.h"
41
#include "pdcp.h"
42
#include "RRC/LTE/rrc_extern.h"
43
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
44 45
#include "RRC/LTE/rrc_eNB_UE_context.h"
#include "PHY/phy_extern.h"
46
#include "common/utils/LOG/log.h"
47 48 49 50 51

/****************************
 * get generic info from RAN
 ****************************/

Robert Schmidt's avatar
Robert Schmidt committed
52
uint32_t flexran_get_current_time_ms(mid_t mod_id, int subframe_flag);
53 54 55 56

/*Return the current frame number
 *Could be using implementation specific numbering of frames
 */
Robert Schmidt's avatar
Robert Schmidt committed
57
frame_t flexran_get_current_frame(mid_t mod_id);
58 59

/*Return the current SFN (0-1023)*/ 
Robert Schmidt's avatar
Robert Schmidt committed
60
frame_t flexran_get_current_system_frame_num(mid_t mod_id);
61

Robert Schmidt's avatar
Robert Schmidt committed
62
sub_frame_t flexran_get_current_subframe(mid_t mod_id);
63 64 65

/*Return the frame and subframe number in compact 16-bit format.
  Bits 0-3 subframe, rest for frame. Required by FlexRAN protocol*/
Robert Schmidt's avatar
Robert Schmidt committed
66
uint16_t flexran_get_sfn_sf(mid_t mod_id);
67 68 69 70 71 72 73 74 75

/* 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 */
int flexran_get_num_ues(mid_t mod_id);

76 77 78 79
/* 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_ue_id(mid_t mod_id, int i);

80
/* Get the rnti of a UE with id ue_id */
Robert Schmidt's avatar
Robert Schmidt committed
81
rnti_t flexran_get_ue_crnti(mid_t mod_id, mid_t ue_id);
82

83 84 85
/* 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);
86 87

/* Get power headroom of UE with id ue_id */
Robert Schmidt's avatar
Robert Schmidt committed
88
int8_t flexran_get_ue_phr(mid_t mod_id, mid_t ue_id);
89 90

/* Get the UE wideband CQI */
Robert Schmidt's avatar
Robert Schmidt committed
91
uint8_t flexran_get_ue_wcqi(mid_t mod_id, mid_t ue_id);
92 93

/* Get the transmission queue size for a UE with a channel_id logical channel id */
Robert Schmidt's avatar
Robert Schmidt committed
94
rlc_buffer_occupancy_t flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
95

96
/*Get number of pdus in RLC buffer*/
Robert Schmidt's avatar
Robert Schmidt committed
97
rlc_buffer_occupancy_t flexran_get_num_pdus_buffer(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
98

99
/* Get the head of line delay for a UE with a channel_id logical channel id */
Robert Schmidt's avatar
Robert Schmidt committed
100
frame_t flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id);
101 102

/* Check the status of the timing advance for a UE */
Robert Schmidt's avatar
Robert Schmidt committed
103
int32_t flexran_get_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
104

Robert Schmidt's avatar
Robert Schmidt committed
105 106 107
/* 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); */
108 109

/* Return timing advance MAC control element for a designated cell and UE */
Robert Schmidt's avatar
Robert Schmidt committed
110 111
/* this function is broken */
int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
112

113 114 115 116 117 118 119 120 121 122 123 124 125
/*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*/
126
uint32_t flexran_get_size_dl_mac_sdus(mid_t mod_id, int cc_id);
127 128

/*Get MAC size sdus length ul */
129
uint32_t flexran_get_size_ul_mac_sdus(mid_t mod_id, int cc_id);
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149

/*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*/
150
uint16_t flexran_get_num_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
151 152

/*Get number of prb for rx per UE UL*/
153
uint16_t flexran_get_num_prb_ul_rx_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
154 155

/*Get number of prb for retx per UE UL*/
156
uint32_t flexran_get_num_prb_retx_ul_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
157 158

/*Get number of prb for retx per UE*/
159
uint16_t flexran_get_num_prb_retx_dl_per_ue(mid_t mod_id, mid_t ue_id, int cc_id);
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184

/*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);

185 186 187
/* 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);

188 189 190 191
/* 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 */
Robert Schmidt's avatar
Robert Schmidt committed
192
uint8_t flexran_get_current_RI(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
193 194

/* See TS 36.213, section 10.1 */
Robert Schmidt's avatar
Robert Schmidt committed
195
uint16_t flexran_get_n1pucch_an(mid_t mod_id, uint8_t cc_id);
196 197

/* See TS 36.211, section 5.4 */
Robert Schmidt's avatar
Robert Schmidt committed
198
uint8_t flexran_get_nRB_CQI(mid_t mod_id, uint8_t cc_id);
199 200

/* See TS 36.211, section 5.4 */
Robert Schmidt's avatar
Robert Schmidt committed
201
uint8_t flexran_get_deltaPUCCH_Shift(mid_t mod_id, uint8_t cc_id);
202 203

/* See TS 36.211, section 5.7.1 */
Robert Schmidt's avatar
Robert Schmidt committed
204
uint8_t flexran_get_prach_ConfigIndex(mid_t mod_id, uint8_t cc_id);
205 206

/* See TS 36.211, section 5.7.1 */
Robert Schmidt's avatar
Robert Schmidt committed
207
uint8_t flexran_get_prach_FreqOffset(mid_t mod_id, uint8_t cc_id);
208 209

/* See TS 36.321 */
Robert Schmidt's avatar
Robert Schmidt committed
210
uint8_t flexran_get_maxHARQ_Msg3Tx(mid_t mod_id, uint8_t cc_id);
211 212

/* Get the length of the UL cyclic prefix */
Robert Schmidt's avatar
Robert Schmidt committed
213
lte_prefix_type_t flexran_get_ul_cyclic_prefix_length(mid_t mod_id, uint8_t cc_id);
214 215

/* Get the length of the DL cyclic prefix */
Robert Schmidt's avatar
Robert Schmidt committed
216
lte_prefix_type_t flexran_get_dl_cyclic_prefix_length(mid_t mod_id, uint8_t cc_id);
217 218

/* Get the physical cell id of a cell */
Robert Schmidt's avatar
Robert Schmidt committed
219
uint16_t flexran_get_cell_id(mid_t mod_id, uint8_t cc_id);
220 221

/* See TS 36.211, section 5.5.3.2 */
Robert Schmidt's avatar
Robert Schmidt committed
222
uint8_t flexran_get_srs_BandwidthConfig(mid_t mod_id, uint8_t cc_id);
223 224

/* See TS 36.211, table 5.5.3.3-1 and 2 */
Robert Schmidt's avatar
Robert Schmidt committed
225
uint8_t flexran_get_srs_SubframeConfig(mid_t mod_id, uint8_t cc_id);
226 227 228

/* Boolean value. See TS 36.211,
   section 5.5.3.2. TDD only */
Robert Schmidt's avatar
Robert Schmidt committed
229
uint8_t flexran_get_srs_MaxUpPts(mid_t mod_id, uint8_t cc_id);
230 231

/* Get number of DL resource blocks */
Robert Schmidt's avatar
Robert Schmidt committed
232
uint8_t flexran_get_N_RB_DL(mid_t mod_id, uint8_t cc_id);
233 234

/* Get number of UL resource blocks */
Robert Schmidt's avatar
Robert Schmidt committed
235
uint8_t flexran_get_N_RB_UL(mid_t mod_id, uint8_t cc_id);
236 237

/* Get number of resource block groups */
Robert Schmidt's avatar
Robert Schmidt committed
238
uint8_t flexran_get_N_RBG(mid_t mod_id, uint8_t cc_id);
239 240

/* Get DL/UL subframe assignment. TDD only */
Robert Schmidt's avatar
Robert Schmidt committed
241
uint8_t flexran_get_subframe_assignment(mid_t mod_id, uint8_t cc_id);
242 243

/* TDD only. See TS 36.211, table 4.2.1 */
Robert Schmidt's avatar
Robert Schmidt committed
244
uint8_t flexran_get_special_subframe_assignment(mid_t mod_id, uint8_t cc_id);
245 246

/* Get the duration of the random access response window in subframes */
Robert Schmidt's avatar
Robert Schmidt committed
247
long flexran_get_ra_ResponseWindowSize(mid_t mod_id, uint8_t cc_id);
248 249

/* Get timer used for random access */
Robert Schmidt's avatar
Robert Schmidt committed
250
long flexran_get_mac_ContentionResolutionTimer(mid_t mod_id, uint8_t cc_id);
251

Robert Schmidt's avatar
Robert Schmidt committed
252 253
/* Get type of duplex mode(FDD/TDD) */
Protocol__FlexDuplexMode flexran_get_duplex_mode(mid_t mod_id, uint8_t cc_id);
254 255

/* Get the SI window length */
Robert Schmidt's avatar
Robert Schmidt committed
256 257 258 259
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);
260 261

/* Get the number of PDCCH symbols configured for the cell */
Robert Schmidt's avatar
Robert Schmidt committed
262
uint8_t flexran_get_num_pdcch_symb(mid_t mod_id, uint8_t cc_id);
263

Robert Schmidt's avatar
Robert Schmidt committed
264
uint8_t flexran_get_antenna_ports(mid_t mod_id, uint8_t cc_id);
265 266

/* See TS 36.213, sec 5.1.1.1 */
Robert Schmidt's avatar
Robert Schmidt committed
267
int flexran_get_tpc(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
268

Robert Schmidt's avatar
Robert Schmidt committed
269
uint8_t flexran_get_ue_wpmi(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
270 271 272 273

/* 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 */
Robert Schmidt's avatar
Robert Schmidt committed
274 275 276 277
/* 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); */
278 279

/* Uplink power control management*/
Robert Schmidt's avatar
Robert Schmidt committed
280
int32_t flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
281

Robert Schmidt's avatar
Robert Schmidt committed
282
int8_t flexran_get_p0_nominal_pucch(mid_t mod_id, uint8_t cc_id);
283

Robert Schmidt's avatar
Robert Schmidt committed
284
int32_t flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
285

Robert Schmidt's avatar
Robert Schmidt committed
286
int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
287

Robert Schmidt's avatar
Robert Schmidt committed
288
uint8_t flexran_get_threequarter_fs(mid_t mod_id, uint8_t cc_id);
289

Robert Schmidt's avatar
Robert Schmidt committed
290
PUSCH_HOPPING_t flexran_get_hopping_mode(mid_t mod_id, uint8_t cc_id);
shahab SHARIATBAGHERI's avatar
shahab SHARIATBAGHERI committed
291

Robert Schmidt's avatar
Robert Schmidt committed
292
uint8_t flexran_get_hopping_offset(mid_t mod_id, uint8_t cc_id);
shahab SHARIATBAGHERI's avatar
shahab SHARIATBAGHERI committed
293

Robert Schmidt's avatar
Robert Schmidt committed
294
uint8_t flexran_get_n_SB(mid_t mod_id, uint8_t cc_id);
shahab SHARIATBAGHERI's avatar
shahab SHARIATBAGHERI committed
295

Robert Schmidt's avatar
Robert Schmidt committed
296
int flexran_get_phich_resource(mid_t mod_id, uint8_t cc_id);
shahab SHARIATBAGHERI's avatar
shahab SHARIATBAGHERI committed
297

Robert Schmidt's avatar
Robert Schmidt committed
298
uint8_t flexran_get_enable64QAM(mid_t mod_id, uint8_t cc_id);
shahab SHARIATBAGHERI's avatar
shahab SHARIATBAGHERI committed
299

Robert Schmidt's avatar
Robert Schmidt committed
300
PHICH_DURATION_t flexran_get_phich_duration(mid_t mod_id, uint8_t cc_id);
301 302 303 304 305 306 307 308 309 310

/*
 * ************************************
 * Get Messages for UE Configuration Reply
 * ************************************
 */

/* Get timer in subframes. Controls the synchronization
   status of the UE, not the actual timing 
   advance procedure. See TS 36.321 */
Robert Schmidt's avatar
Robert Schmidt committed
311
TimeAlignmentTimer_t flexran_get_time_alignment_timer(mid_t mod_id, mid_t ue_id);
312 313

/* Get measurement gap configuration. See TS 36.133 */
Robert Schmidt's avatar
Robert Schmidt committed
314
Protocol__FlexMeasGapConfigPattern flexran_get_meas_gap_config(mid_t mod_id, mid_t ue_id);
315 316

/* Get measurement gap configuration offset if applicable */
Robert Schmidt's avatar
Robert Schmidt committed
317
long flexran_get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id);
318 319 320

/* DL aggregated bit-rate of non-gbr bearer
   per UE. See TS 36.413 */
Robert Schmidt's avatar
Robert Schmidt committed
321
uint64_t flexran_get_ue_aggregated_max_bitrate_dl(mid_t mod_id, mid_t ue_id);
322 323 324

/* UL aggregated bit-rate of non-gbr bearer
   per UE. See TS 36.413 */
Robert Schmidt's avatar
Robert Schmidt committed
325
uint64_t flexran_get_ue_aggregated_max_bitrate_ul(mid_t mod_id, mid_t ue_id);
326

327 328
/* Only half-duplex support. FDD operation. Boolean value */
int flexran_get_half_duplex(mid_t mod_id, mid_t ue_id);
329

330 331
/* Support of intra-subframe hopping.  Boolean value */
int flexran_get_intra_sf_hopping(mid_t mod_id, mid_t ue_id);
332

333 334
/* UE support for type 2 hopping with n_sb>1 */
int flexran_get_type2_sb_1(mid_t mod_id, mid_t ue_id);
335 336

/* Get the UE category */
337
long flexran_get_ue_category(mid_t mod_id, mid_t ue_id);
338

339 340
/* UE support for resource allocation type 1 */
int flexran_get_res_alloc_type1(mid_t mod_id, mid_t ue_id);
341 342

/* Get UE transmission mode */
Robert Schmidt's avatar
Robert Schmidt committed
343
long flexran_get_ue_transmission_mode(mid_t mod_id, mid_t ue_id);
344 345

/* Boolean value. See TS 36.321 */
Robert Schmidt's avatar
Robert Schmidt committed
346
BOOLEAN_t flexran_get_tti_bundling(mid_t mod_id, mid_t ue_id);
347 348 349

/* The max HARQ retransmission for UL.
   See TS 36.321 */
Robert Schmidt's avatar
Robert Schmidt committed
350
long flexran_get_maxHARQ_TX(mid_t mod_id, mid_t ue_id);
351 352

/* See TS 36.213 */
Robert Schmidt's avatar
Robert Schmidt committed
353
long flexran_get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id);
354 355

/* See TS 36.213 */
Robert Schmidt's avatar
Robert Schmidt committed
356
long flexran_get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id);
357 358

/* See TS 36.213 */
Robert Schmidt's avatar
Robert Schmidt committed
359
long flexran_get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id);
360 361

/* Boolean. See TS36.213, Section 10.1 */
Robert Schmidt's avatar
Robert Schmidt committed
362
BOOLEAN_t flexran_get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id);
363 364

/* Boolean. See TS 36.213, Section 8.2 */
Robert Schmidt's avatar
Robert Schmidt committed
365
BOOLEAN_t flexran_get_ack_nack_simultaneous_trans(mid_t mod_id, mid_t ue_id, uint8_t cc_id);
366 367

/* Get aperiodic CQI report mode */
Robert Schmidt's avatar
Robert Schmidt committed
368
CQI_ReportModeAperiodic_t flexran_get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id);
369 370

/* Get ACK/NACK feedback mode. TDD only */
Robert Schmidt's avatar
Robert Schmidt committed
371
long flexran_get_tdd_ack_nack_feedback_mode(mid_t mod_id, mid_t ue_id);
372 373

/* See TS36.213, section 10.1 */
Robert Schmidt's avatar
Robert Schmidt committed
374
long flexran_get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id);
375 376

/* Boolean. Extended buffer status report size */
Robert Schmidt's avatar
Robert Schmidt committed
377
long flexran_get_extended_bsr_size(mid_t mod_id, mid_t ue_id);
378 379 380 381

/* Get number of UE transmission antennas */
int flexran_get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id);

382 383 384
/* Get the IMSI of UE */
uint64_t flexran_get_ue_imsi(mid_t mod_id, mid_t ue_id);

385
/* Get logical channel group of a channel with id lc_id */
386
long flexran_get_lcg(mid_t mod_id, mid_t ue_id, mid_t lc_id);
387 388

/* Get direction of logical channel with id lc_id */
389 390
int flexran_get_direction(mid_t ue_id, mid_t lc_id);

391
/*Get downlink frequency*/
Robert Schmidt's avatar
Robert Schmidt committed
392
uint32_t flexran_agent_get_operating_dl_freq(mid_t mod_id, uint8_t cc_id);
393 394

/*Get uplink frequency*/
Robert Schmidt's avatar
Robert Schmidt committed
395
uint32_t flexran_agent_get_operating_ul_freq(mid_t mod_id, uint8_t cc_id);
396 397

/*Get eutra band*/
Robert Schmidt's avatar
Robert Schmidt committed
398
uint8_t flexran_agent_get_operating_eutra_band(mid_t mod_id, uint8_t cc_id);
399 400

/*Get downlink ref signal power*/
Robert Schmidt's avatar
Robert Schmidt committed
401
int8_t flexran_agent_get_operating_pdsch_refpower(mid_t mod_id, uint8_t cc_id);
402 403

/*Get uplink power*/
Robert Schmidt's avatar
Robert Schmidt committed
404
long flexran_agent_get_operating_pusch_p0(mid_t mod_id, uint8_t cc_id);
shahab SHARIAT BAGHERI's avatar
shahab SHARIAT BAGHERI committed
405

406
/*set the dl freq */
Robert Schmidt's avatar
Robert Schmidt committed
407
void flexran_agent_set_operating_dl_freq(mid_t mod_id, uint8_t cc_id, uint32_t dl_freq_mhz);
408 409

/* set the ul freq */
Robert Schmidt's avatar
Robert Schmidt committed
410
void flexran_agent_set_operating_ul_freq(mid_t mod_id, uint8_t cc_id, int32_t ul_freq_mhz_offset);
411 412

/*set the the band */
Robert Schmidt's avatar
Robert Schmidt committed
413
void flexran_agent_set_operating_eutra_band(mid_t mod_id, uint8_t cc_id, uint8_t eutra_band);
414

Robert Schmidt's avatar
Robert Schmidt committed
415 416
/* set the bandwidth (in RB) */
void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t N_RB);
417 418

/*set frame type*/
Robert Schmidt's avatar
Robert Schmidt committed
419
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, lte_frame_type_t frame_type);
420

shahab SHARIAT BAGHERI's avatar
shahab SHARIAT BAGHERI committed
421
/*RRC status flexRAN*/
422
uint8_t flexran_get_rrc_status(mid_t mod_id, mid_t ue_id);
423 424 425 426


/***************************** PDCP ***********************/

427
/*PDCP superframe numberflexRAN*/
428
uint32_t flexran_get_pdcp_sfn(mid_t mod_id);
429

430
/*PDCP pdcp tx stats window*/
431
void flexran_set_pdcp_tx_stat_window(mid_t mod_id, mid_t ue_id, uint16_t obs_window);
432 433

/*PDCP pdcp rx stats window*/
434
void flexran_set_pdcp_rx_stat_window(mid_t mod_id, mid_t ue_id, uint16_t obs_window);
435

436
/*PDCP num tx pdu status flexRAN*/
437
uint32_t flexran_get_pdcp_tx(mid_t mod_id, mid_t ue_id, lcid_t lcid);
438 439

/*PDCP num tx bytes status flexRAN*/
440
uint32_t flexran_get_pdcp_tx_bytes(mid_t mod_id, mid_t ue_id, lcid_t lcid);
441 442

/*PDCP number of transmit packet / second status flexRAN*/
443
uint32_t flexran_get_pdcp_tx_w(mid_t mod_id, mid_t ue_id, lcid_t lcid);
444

445
/*PDCP pdcp tx bytes in a given window flexRAN*/
446
uint32_t flexran_get_pdcp_tx_bytes_w(mid_t mod_id, mid_t ue_id, lcid_t lcid);
447 448

/*PDCP tx sequence number flexRAN*/
449
uint32_t flexran_get_pdcp_tx_sn(mid_t mod_id, mid_t ue_id, lcid_t lcid);
450 451

/*PDCP tx aggregated packet arrival  flexRAN*/
452
uint32_t flexran_get_pdcp_tx_aiat(mid_t mod_id, mid_t ue_id, lcid_t lcid);
453 454

/*PDCP tx aggregated packet arrival per second flexRAN*/
455
uint32_t flexran_get_pdcp_tx_aiat_w(mid_t mod_id, mid_t ue_id, lcid_t lcid);
456 457 458


/*PDCP num rx pdu status flexRAN*/
459
uint32_t flexran_get_pdcp_rx(mid_t mod_id, mid_t ue_id, lcid_t lcid);
460 461

/*PDCP num rx bytes status flexRAN*/
462
uint32_t flexran_get_pdcp_rx_bytes(mid_t mod_id, mid_t ue_id, lcid_t lcid);
463 464

/*PDCP number of received packet / second  flexRAN*/
465
uint32_t flexran_get_pdcp_rx_w(mid_t mod_id, mid_t ue_id, lcid_t lcid);
466 467

/*PDCP gootput (bit/s) status flexRAN*/
468
uint32_t flexran_get_pdcp_rx_bytes_w(mid_t mod_id, mid_t ue_id, lcid_t lcid);
469 470

/*PDCP rx sequence number flexRAN*/
471
uint32_t flexran_get_pdcp_rx_sn(mid_t mod_id, mid_t ue_id, lcid_t lcid);
472 473

/*PDCP rx aggregated packet arrival  flexRAN*/
474
uint32_t flexran_get_pdcp_rx_aiat(mid_t mod_id, mid_t ue_id, lcid_t lcid);
475 476

/*PDCP rx aggregated packet arrival per second flexRAN*/
477
uint32_t flexran_get_pdcp_rx_aiat_w(mid_t mod_id, mid_t ue_id, lcid_t lcid);
478 479

/*PDCP num of received outoforder pdu status flexRAN*/
480
uint32_t flexran_get_pdcp_rx_oo(mid_t mod_id, mid_t ue_id, lcid_t lcid);
481

482 483
/*********************RRC**********************/
/*Get primary cell measuremeant id flexRAN*/
Robert Schmidt's avatar
Robert Schmidt committed
484
MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, mid_t ue_id);
485

486
/*Get primary cell RSRP measurement flexRAN*/  
Robert Schmidt's avatar
Robert Schmidt committed
487
float flexran_get_rrc_pcell_rsrp(mid_t mod_id, mid_t ue_id);
488 489

/*Get primary cell RSRQ measurement flexRAN*/
Robert Schmidt's avatar
Robert Schmidt committed
490
float flexran_get_rrc_pcell_rsrq(mid_t mod_id, mid_t ue_id);
491 492 493 494 495

/* Get RRC neighbouring measurement */
int flexran_get_rrc_num_ncell(mid_t mod_id, mid_t ue_id);

/*Get physical cell id*/
Robert Schmidt's avatar
Robert Schmidt committed
496
PhysCellId_t flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, mid_t ue_id, int cell_id);
497 498

/*Get RSRP of neighbouring Cell*/
Robert Schmidt's avatar
Robert Schmidt committed
499
float flexran_get_rrc_neigh_rsrp(mid_t mod_id, mid_t ue_id, int cell_id);
500 501

/*Get RSRQ of neighbouring Cell*/
Robert Schmidt's avatar
Robert Schmidt committed
502
float flexran_get_rrc_neigh_rsrq(mid_t mod_id, mid_t ue_id, int cell_id);
503 504

/*Get MCC PLMN identity neighbouring Cell*/
Robert Schmidt's avatar
Robert Schmidt committed
505 506
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mcc(mid_t mod_id, mid_t ue_id, int cell_id); */
507 508

/*Get MNC PLMN identity neighbouring Cell*/
Robert Schmidt's avatar
Robert Schmidt committed
509 510
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mnc(mid_t mod_id, mid_t ue_id, int cell_id); */
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541

/************************** Slice configuration **************************/

/* 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 index(!) for a UE */
void flexran_set_ue_dl_slice_idx(mid_t mod_id, mid_t ue_id, int slice_idx);

/* 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 index(!) for a UE */
void flexran_set_ue_ul_slice_idx(mid_t mod_id, mid_t ue_id, int slice_idx);

/* Whether intraslice sharing is active, return boolean */
int flexran_get_intraslice_sharing_active(mid_t mod_id);
/* Set whether intraslice sharing is active */
void flexran_set_intraslice_sharing_active(mid_t mod_id, int intraslice_active);

/* Whether intraslice sharing is active, return boolean */
int flexran_get_interslice_sharing_active(mid_t mod_id);
/* Set whether intraslice sharing is active */
void flexran_set_interslice_sharing_active(mid_t mod_id, int interslice_active);

/* Get the number of slices in DL */
int flexran_get_num_dl_slices(mid_t mod_id);

/* Query slice existence in DL. Return is boolean value */
int flexran_dl_slice_exists(mid_t mod_id, int slice_idx);

542 543
/* Create slice in DL, returns the new slice index */
int flexran_create_dl_slice(mid_t mod_id, slice_id_t slice_id);
544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595
/* 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);
/* Remove slice in DL, returns new number of slices or -1 on error */
int flexran_remove_dl_slice(mid_t mod_id, int slice_idx);

/* Get the ID of a slice in DL */
slice_id_t flexran_get_dl_slice_id(mid_t mod_id, int slice_idx);
/* Set the ID of a slice in DL */
void flexran_set_dl_slice_id(mid_t mod_id, int slice_idx, slice_id_t slice_id);

/* Get the RB share a slice in DL, value 0-100 */
int flexran_get_dl_slice_percentage(mid_t mod_id, int slice_idx);
/* Set the RB share a slice in DL, value 0-100 */
void flexran_set_dl_slice_percentage(mid_t mod_id, int slice_idx, int percentage);

/* Whether a slice in DL is isolated */
int flexran_get_dl_slice_isolation(mid_t mod_id, int slice_idx);
/* Set whether a slice in DL is isolated */
void flexran_set_dl_slice_isolation(mid_t mod_id, int slice_idx, int is_isolated);

/* Get the priority of a slice in DL */
int flexran_get_dl_slice_priority(mid_t mod_id, int slice_idx);
/* Get the priority of a slice in DL */
void flexran_set_dl_slice_priority(mid_t mod_id, int slice_idx, int priority);

/* Get the lower end of the frequency range for the slice positioning in DL */
int flexran_get_dl_slice_position_low(mid_t mod_id, int slice_idx);
/* Set the lower end of the frequency range for the slice positioning in DL */
void flexran_set_dl_slice_position_low(mid_t mod_id, int slice_idx, int poslow);

/* Get the higher end of the frequency range for the slice positioning in DL */
int flexran_get_dl_slice_position_high(mid_t mod_id, int slice_idx);
/* Set the higher end of the frequency range for the slice positioning in DL */
void flexran_set_dl_slice_position_high(mid_t mod_id, int slice_idx, int poshigh);

/* Get the maximum MCS for slice in DL */
int flexran_get_dl_slice_maxmcs(mid_t mod_id, int slice_idx);
/* Set the maximum MCS for slice in DL */
void flexran_set_dl_slice_maxmcs(mid_t mod_id, int slice_idx, int maxmcs);

/* Get the sorting order of a slice in DL, return value is number of elements
 * in sorting_list */
int flexran_get_dl_slice_sorting(mid_t mod_id, int slice_idx, Protocol__FlexDlSorting **sorting_list);
/* Set the sorting order of a slice in DL */
void flexran_set_dl_slice_sorting(mid_t mod_id, int slice_idx, Protocol__FlexDlSorting *sorting_list, int n);

/* Get the accounting policy for a slice in DL */
Protocol__FlexDlAccountingPolicy flexran_get_dl_slice_accounting_policy(mid_t mod_id, int slice_idx);
/* Set the accounting policy for a slice in DL */
void flexran_set_dl_slice_accounting_policy(mid_t mod_id, int slice_idx, Protocol__FlexDlAccountingPolicy accounting);

/* Get the scheduler name for a slice in DL */
596
char *flexran_get_dl_slice_scheduler(mid_t mod_id, int slice_idx);
597
/* Set the scheduler name for a slice in DL */
598
int flexran_set_dl_slice_scheduler(mid_t mod_id, int slice_idx, char *name);
599 600 601 602 603 604 605

/* Get the number of slices in UL */
int flexran_get_num_ul_slices(mid_t mod_id);

/* Query slice existence in UL. Return is boolean value */
int flexran_ul_slice_exists(mid_t mod_id, int slice_idx);

606 607
/* Create slice in UL, returns the new slice index */
int flexran_create_ul_slice(mid_t mod_id, slice_id_t slice_id);
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659
/* Finds slice in UL with given slice_id and returns slice index */
int flexran_find_ul_slice(mid_t mod_id, slice_id_t slice_id);
/* Remove slice in UL */
int flexran_remove_ul_slice(mid_t mod_id, int slice_idx);

/* Get the ID of a slice in UL */
slice_id_t flexran_get_ul_slice_id(mid_t mod_id, int slice_idx);
/* Set the ID of a slice in UL */
void flexran_set_ul_slice_id(mid_t mod_id, int slice_idx, slice_id_t slice_id);

/* Get the RB share a slice in UL, value 0-100 */
int flexran_get_ul_slice_percentage(mid_t mod_id, int slice_idx);
/* Set the RB share a slice in UL, value 0-100 */
void flexran_set_ul_slice_percentage(mid_t mod_id, int slice_idx, int percentage);

/* TODO Whether a slice in UL is isolated */
/*int flexran_get_ul_slice_isolation(mid_t mod_id, int slice_idx);*/
/* TODO Set whether a slice in UL is isolated */
/*void flexran_set_ul_slice_isolation(mid_t mod_id, int slice_idx, int is_isolated);*/

/* TODO Get the priority of a slice in UL */
/*int flexran_get_ul_slice_priority(mid_t mod_id, int slice_idx);*/
/* TODO Set the priority of a slice in UL */
/*void flexran_set_ul_slice_priority(mid_t mod_id, int slice_idx, int priority);*/

/* Get the first RB for allocation in a slice in UL */
int flexran_get_ul_slice_first_rb(mid_t mod_id, int slice_idx);
/* Set the first RB for allocation in a slice in UL */
void flexran_set_ul_slice_first_rb(mid_t mod_id, int slice_idx, int first_rb);

/* TODO Get the number of RB for the allocation in a slice in UL */
/*int flexran_get_ul_slice_length_rb(mid_t mod_id, int slice_idx);*/
/* TODO Set the of number of RB for the allocation in a slice in UL */
/*void flexran_set_ul_slice_length_rb(mid_t mod_id, int slice_idx, int poshigh);*/

/* Get the maximum MCS for slice in UL */
int flexran_get_ul_slice_maxmcs(mid_t mod_id, int slice_idx);
/* Set the maximum MCS for slice in UL */
void flexran_set_ul_slice_maxmcs(mid_t mod_id, int slice_idx, int maxmcs);

/* TODO Get the sorting order of a slice in UL, return value is number of elements
 * in sorting_list */
/*int flexran_get_ul_slice_sorting(mid_t mod_id, int slice_idx, Protocol__FlexUlSorting **sorting_list);*/
/* TODO Set the sorting order of a slice in UL */
/*void flexran_set_ul_slice_sorting(mid_t mod_id, int slice_idx, Protocol__FlexUlSorting *sorting_list, int n);*/

/* TODO Get the accounting policy for a slice in UL */
/*Protocol__UlAccountingPolicy flexran_get_ul_slice_accounting_policy(mid_t mod_id, int slice_idx);*/
/* TODO Set the accounting policy for a slice in UL */
/*void flexran_get_ul_slice_accounting_policy(mid_t mod_id, int slice_idx, Protocol__UlAccountingPolicy accountin);*/

/* Get the scheduler name for a slice in UL */
660
char *flexran_get_ul_slice_scheduler(mid_t mod_id, int slice_idx);
661
/* Set the scheduler name for a slice in UL */
662
int flexran_set_ul_slice_scheduler(mid_t mod_id, int slice_idx, char *name);