rrc_defs.h 32.5 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
 * 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:
19
 *      conmnc_digit_lengtht@openairinterface.org
20
 */
21

22
/*! \file RRC/LTE/defs.h
23 24 25
* \brief RRC struct definitions and function prototypes
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
26 27
* \version 1.0
* \company Eurecom
28
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
29 30 31 32 33 34 35 36 37
*/

#ifndef __OPENAIR_RRC_DEFS_H__
#define __OPENAIR_RRC_DEFS_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

38
#include "collection/tree.h"
39
#include "common/ngran_types.h"
winckel's avatar
winckel committed
40
#include "rrc_types.h"
41
//#include "PHY/phy_defs.h"
42 43
#include "LAYER2/RLC/rlc.h"

44
#include "COMMON/platform_constants.h"
45
#include "COMMON/platform_types.h"
46

47
#include "LAYER2/MAC/mac.h"
48

49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
//for D2D
#define DEBUG_CTRL_SOCKET
#define BUFSIZE                1024
#define CONTROL_SOCKET_PORT_NO 8888
#define MAX_NUM_DEST           10
//netlink
//#define DEBUG_PDCP
#define UE_IP_PDCP_NETLINK_ID  31
#define PDCP_PID               1
#define NETLINK_HEADER_SIZE    16
#define SL_DEFAULT_RAB_ID      3
#define SLRB_ID                3

#define MAX_PAYLOAD 1024 /* maximum payload size*/

#define UE_STATE_NOTIFICATION_INTERVAL      50

#define IPV4_ADDR    "%u.%u.%u.%u"
#define IPV4_ADDR_FORMAT(aDDRESS)                 \
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
68 69 70 71
  (uint8_t)((aDDRESS)  & 0x000000ff),         \
  (uint8_t)(((aDDRESS) & 0x0000ff00) >> 8 ),  \
  (uint8_t)(((aDDRESS) & 0x00ff0000) >> 16),  \
  (uint8_t)(((aDDRESS) & 0xff000000) >> 24)
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87


//-----------------------------------------------------
// header for Control socket

//Primitives
#define SESSION_INIT_REQ                    1
#define UE_STATUS_INFO                      2
#define GROUP_COMMUNICATION_ESTABLISH_REQ   3
#define GROUP_COMMUNICATION_ESTABLISH_RSP   4
#define DIRECT_COMMUNICATION_ESTABLISH_REQ  5
#define DIRECT_COMMUNICATION_ESTABLISH_RSP  6
#define GROUP_COMMUNICATION_RELEASE_REQ     7
#define GROUP_COMMUNICATION_RELEASE_RSP     8
#define PC5S_ESTABLISH_REQ                  9
#define PC5S_ESTABLISH_RSP                  10
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
88
#define PC5_DISCOVERY_MESSAGE             11
89 90


Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
91
#define PC5_DISCOVERY_PAYLOAD_SIZE      29
92 93 94


typedef enum {
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
95 96
  UE_STATE_OFF_NETWORK,
  UE_STATE_ON_NETWORK
97 98 99
} SL_UE_STATE_t;

typedef enum {
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
100 101
  GROUP_COMMUNICATION_RELEASE_OK = 0,
  GROUP_COMMUNICATION_RELEASE_FAILURE
102 103 104
} Group_Communication_Status_t;

struct GroupCommunicationEstablishReq {
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
105 106 107 108
  uint32_t sourceL2Id;
  uint32_t groupL2Id;
  uint32_t groupIpAddress;
  uint8_t pppp;
109 110 111
};

struct GroupCommunicationReleaseReq {
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
112 113 114
  uint32_t sourceL2Id;
  uint32_t groupL2Id;
  int slrb_id;
115 116 117
};

struct DirectCommunicationEstablishReq {
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
118 119 120
  uint32_t sourceL2Id;
  uint32_t destinationL2Id;
  uint32_t pppp;
121 122
};

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
123 124 125 126
struct PC5SEstablishReq {
  uint8_t type;
  uint32_t sourceL2Id;
  uint32_t destinationL2Id;
127 128
};

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
129 130 131 132
struct PC5SEstablishRsp {
  uint32_t slrbid_lcid28;
  uint32_t slrbid_lcid29;
  uint32_t slrbid_lcid30;
133 134 135 136 137
};


//PC5_DISCOVERY MESSAGE
typedef struct  {
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
138 139
  unsigned char payload[PC5_DISCOVERY_PAYLOAD_SIZE];
  uint32_t measuredPower;
140 141 142 143
}  __attribute__((__packed__)) PC5DiscoveryMessage ;


struct sidelink_ctrl_element {
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
144 145 146 147 148 149 150 151 152 153 154 155
  unsigned short type;
  union {
    struct GroupCommunicationEstablishReq group_comm_establish_req;
    struct DirectCommunicationEstablishReq direct_comm_establish_req;
    Group_Communication_Status_t group_comm_release_rsp;
    //struct DirectCommunicationReleaseReq  direct_comm_release_req;
    SL_UE_STATE_t ue_state;
    int slrb_id;
    struct PC5SEstablishReq pc5s_establish_req;
    struct PC5SEstablishRsp pc5s_establish_rsp;
    PC5DiscoveryMessage pc5_discovery_message;
  } sidelinkPrimitive;
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
};


//global variables
extern struct sockaddr_in clientaddr;
extern int slrb_id;
extern pthread_mutex_t slrb_mutex;

//the thread function
void *send_UE_status_notification(void *);



//#include "COMMON/openair_defs.h"
#ifndef USER_MODE
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
171
  //#include <rtai.h>
172
#endif
173

174 175 176 177 178 179 180 181 182 183 184 185
#include "LTE_SystemInformationBlockType1.h"
#include "LTE_SystemInformation.h"
#include "LTE_RRCConnectionReconfiguration.h"
#include "LTE_RRCConnectionReconfigurationComplete.h"
#include "LTE_RRCConnectionSetup.h"
#include "LTE_RRCConnectionSetupComplete.h"
#include "LTE_RRCConnectionRequest.h"
#include "LTE_RRCConnectionReestablishmentRequest.h"
#include "LTE_BCCH-DL-SCH-Message.h"
#include "LTE_SBCCH-SL-BCH-MessageType.h"
#include "LTE_BCCH-BCH-Message.h"
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
186 187
  #include "LTE_MCCH-Message.h"
  #include "LTE_MBSFNAreaConfiguration-r9.h"
188
#endif
189
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
190
  #include "LTE_SCellToAddMod-r10.h"
191
#endif
192 193 194 195 196
#include "LTE_AS-Config.h"
#include "LTE_AS-Context.h"
#include "LTE_UE-EUTRA-Capability.h"
#include "LTE_MeasResults.h"
#if (LTE_RRC_VERSION >= MAKE_VERSION(12, 0, 0))
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
197
  #include "LTE_SidelinkUEInformation-r12.h"
198
#endif
199

200 201
/* for ImsiMobileIdentity_t */
#include "MobileIdentity.h"
202

Cedric Roux's avatar
Cedric Roux committed
203 204 205
/* correct Rel(8|10)/Rel14 differences
 * the code is in favor of Rel14, those defines do the translation
 */
206
#if (LTE_RRC_VERSION < MAKE_VERSION(14, 0, 0))
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
  #define CipheringAlgorithm_r12_t e_SecurityAlgorithmConfig__cipheringAlgorithm
  #define CipheringAlgorithm_r12_eea0 SecurityAlgorithmConfig__cipheringAlgorithm_eea0
  #define CipheringAlgorithm_r12_eea1 SecurityAlgorithmConfig__cipheringAlgorithm_eea1
  #define CipheringAlgorithm_r12_eea2 SecurityAlgorithmConfig__cipheringAlgorithm_eea2
  #define CipheringAlgorithm_r12_spare1 SecurityAlgorithmConfig__cipheringAlgorithm_spare1
  #define Alpha_r12_al0 UplinkPowerControlCommon__alpha_al0
  #define Alpha_r12_al04 UplinkPowerControlCommon__alpha_al04
  #define Alpha_r12_al05 UplinkPowerControlCommon__alpha_al05
  #define Alpha_r12_al06 UplinkPowerControlCommon__alpha_al06
  #define Alpha_r12_al07 UplinkPowerControlCommon__alpha_al07
  #define Alpha_r12_al08 UplinkPowerControlCommon__alpha_al08
  #define Alpha_r12_al09 UplinkPowerControlCommon__alpha_al09
  #define Alpha_r12_al1 UplinkPowerControlCommon__alpha_al1
  #define PreambleTransMax_n3 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3
  #define PreambleTransMax_n4 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n4
  #define PreambleTransMax_n5 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n5
  #define PreambleTransMax_n6 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n6
  #define PreambleTransMax_n7 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n7
  #define PreambleTransMax_n8 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n8
  #define PreambleTransMax_n10 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n10
  #define PreambleTransMax_n20 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n20
  #define PreambleTransMax_n50 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n50
  #define PreambleTransMax_n100 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n100
  #define PreambleTransMax_n200 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n200
  #define PeriodicBSR_Timer_r12_sf5 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf5
  #define PeriodicBSR_Timer_r12_sf10 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf10
  #define PeriodicBSR_Timer_r12_sf16 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf16
  #define PeriodicBSR_Timer_r12_sf20 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf20
  #define PeriodicBSR_Timer_r12_sf32 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf32
  #define PeriodicBSR_Timer_r12_sf40 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf40
  #define PeriodicBSR_Timer_r12_sf64 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf64
  #define PeriodicBSR_Timer_r12_sf80 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf80
  #define PeriodicBSR_Timer_r12_sf128 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf128
  #define PeriodicBSR_Timer_r12_sf160 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf160
  #define PeriodicBSR_Timer_r12_sf320 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf320
  #define PeriodicBSR_Timer_r12_sf640 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf640
  #define PeriodicBSR_Timer_r12_sf1280 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf1280
  #define PeriodicBSR_Timer_r12_sf2560 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf2560
  #define PeriodicBSR_Timer_r12_infinity MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity
  #define RetxBSR_Timer_r12_sf320 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf320
  #define RetxBSR_Timer_r12_sf640 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf640
  #define RetxBSR_Timer_r12_sf1280 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf1280
  #define RetxBSR_Timer_r12_sf2560 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560
  #define RetxBSR_Timer_r12_sf5120 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf5120
  #define RetxBSR_Timer_r12_sf10240 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf10240
Cedric Roux's avatar
Cedric Roux committed
252 253
#endif

254
// This corrects something generated by asn1c which is different between Rel8 and Rel10
255
#if (LTE_RRC_VERSION <= MAKE_VERSION(10, 0, 0))
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
256 257 258 259 260 261 262 263 264 265 266
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member SystemInformation_r8_IEs_sib_TypeAndInfo_Member
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib2
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib3
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib4
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib5
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib6
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib7
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib8
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib9
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib10
  #define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib11
267
#endif
268 269 270 271 272 273 274


#define NB_SIG_CNX_CH 1
#define NB_CNX_CH MAX_MOBILES_PER_ENB
#define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE
#define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE

275
/*
276
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
277 278
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib12_v920
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib13_v920
279
#endif
280
*/
281 282
//#include "L3_rrc_defs.h"
#ifndef NO_RRM
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
283 284 285
  #include "L3_rrc_interface.h"
  #include "rrc_rrm_msg.h"
  #include "rrc_rrm_interface.h"
286 287
#endif

288

289 290 291 292 293 294
#include "intertask_interface.h"




#include "commonDef.h"
Cedric Roux's avatar
Cedric Roux committed
295

296

297 298
//--------
typedef unsigned int uid_t;
299
#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((MAX_MOBILES_PER_ENB/8)/sizeof(unsigned int)) + 1)
300 301 302 303 304 305 306 307 308 309 310 311 312
typedef struct uid_linear_allocator_s {
  unsigned int   bitmap[UID_LINEAR_ALLOCATOR_BITMAP_SIZE];
} uid_allocator_t;

//--------



#define PROTOCOL_RRC_CTXT_UE_FMT           PROTOCOL_CTXT_FMT
#define PROTOCOL_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)

#define PROTOCOL_RRC_CTXT_FMT           PROTOCOL_CTXT_FMT
#define PROTOCOL_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
313
/** @defgroup _rrc RRC
314
 * @ingroup _oai2
315 316 317 318
 * @{
 */


319 320
#define UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!!
#define UE_INDEX_INVALID  ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1
winckel's avatar
winckel committed
321

322 323 324 325 326 327 328 329
typedef enum {
  RRC_OK=0,
  RRC_ConnSetup_failed,
  RRC_PHY_RESYNCH,
  RRC_Handover_failed,
  RRC_HO_STARTED
} RRC_status_t;

winckel's avatar
winckel committed
330
typedef enum UE_STATE_e {
winckel's avatar
winckel committed
331 332
  RRC_INACTIVE=0,
  RRC_IDLE,
333 334
  RRC_SI_RECEIVED,
  RRC_CONNECTED,
335 336
  RRC_RECONFIGURED,
  RRC_HO_EXECUTION
337 338
} UE_STATE_t;

winckel's avatar
winckel committed
339
typedef enum HO_STATE_e {
340
  HO_IDLE=0,
341
  HO_MEASUREMENT,
342 343
  HO_PREPARE,
  HO_CMD, // initiated by the src eNB
344 345 346 347
  HO_COMPLETE, // initiated by the target eNB
  HO_REQUEST,
  HO_ACK,
  HO_CONFIGURED
348 349
} HO_STATE_t;

350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
typedef enum SL_TRIGGER_e {
  SL_RECEIVE_COMMUNICATION=0,
  SL_TRANSMIT_RELAY_ONE_TO_ONE,
  SL_TRANSMIT_RELAY_ONE_TO_MANY,
  SL_TRANSMIT_NON_RELAY_ONE_TO_ONE,
  SL_TRANSMIT_NON_RELAY_ONE_TO_MANY,
  SL_RECEIVE_DISCOVERY,
  SL_TRANSMIT_NON_PS_DISCOVERY,
  SL_TRANSMIT_PS_DISCOVERY,
  SL_RECEIVE_V2X,
  SL_TRANSMIT_V2X,
  SL_REQUEST_DISCOVERY_TRANSMISSION_GAPS,
  SL_REQUEST_DISCOVERY_RECEPTION_GAPS
} SL_TRIGGER_t;

365
//#define MAX_MOBILES_PER_ENB MAX_MOBILES_PER_RG
366
#define RRM_FREE(p)       if ( (p) != NULL) { free(p) ; p=NULL ; }
367 368 369
#define RRM_MALLOC(t,n)   (t *) malloc16( sizeof(t) * n )
#define RRM_CALLOC(t,n)   (t *) malloc16( sizeof(t) * n)
#define RRM_CALLOC2(t,s)  (t *) malloc16( s )
370

371 372 373
#define MAX_MEAS_OBJ 6
#define MAX_MEAS_CONFIG 6
#define MAX_MEAS_ID 6
374 375

#define PAYLOAD_SIZE_MAX 1024
376
#define RRC_BUF_SIZE 255
377
#define UNDEF_SECURITY_MODE 0xff
378
#define NO_SECURITY_MODE 0x20
379 380 381 382

#define CBA_OFFSET        0xfff4
// #define NUM_MAX_CBA_GROUP 4 // in the platform_constants

383 384 385
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
#define RRC_TRANSACTION_IDENTIFIER_NUMBER  3

386
typedef struct {
387 388 389 390
  unsigned short transport_block_size;   /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
  unsigned short max_transport_blocks;   /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
  unsigned long  Guaranteed_bit_rate;    /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/
  unsigned long  Max_bit_rate;           /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/
391 392 393 394 395 396 397
  uint8_t  Delay_class;                  /*!< \brief Delay class offered by MAC layer scheduling*/
  uint8_t  Target_bler;                  /*!< \brief Target Average Transport Block Error rate*/
  uint8_t  Lchan_t;                      /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
} __attribute__ ((__packed__))  LCHAN_DESC;

#define LCHAN_DESC_SIZE sizeof(LCHAN_DESC)

winckel's avatar
winckel committed
398
typedef struct UE_RRC_INFO_s {
399
  UE_STATE_t State;
400
  uint8_t SIB1systemInfoValueTag;
401 402
  uint32_t SIStatus;
  uint32_t SIcnt;
403
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
404
  uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA
405
#endif
406
  uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40
407
  uint8_t handoverTarget;
408
  HO_STATE_t ho_state;
409
  uint16_t SIperiod; //!< Corresponds to the SIB1 si-Periodicity parameter (multiplied by 10). Possible values are (final): 80,160,320,640,1280,2560,5120
410
  unsigned short UE_index;
411 412 413 414 415 416 417 418
  uint32_t T300_active;
  uint32_t T300_cnt;
  uint32_t T304_active;
  uint32_t T304_cnt;
  uint32_t T310_active;
  uint32_t T310_cnt;
  uint32_t N310_cnt;
  uint32_t N311_cnt;
419
  rnti_t   rnti;
winckel's avatar
winckel committed
420
} __attribute__ ((__packed__)) UE_RRC_INFO;
421

422
typedef struct UE_S_TMSI_s {
gauthier's avatar
gauthier committed
423 424 425
  boolean_t  presence;
  mme_code_t mme_code;
  m_tmsi_t   m_tmsi;
winckel's avatar
winckel committed
426
} __attribute__ ((__packed__)) UE_S_TMSI;
427

428

winckel's avatar
winckel committed
429
typedef enum e_rab_satus_e {
430
  E_RAB_STATUS_NEW,
431 432
  E_RAB_STATUS_DONE, // from the eNB perspective
  E_RAB_STATUS_ESTABLISHED, // get the reconfigurationcomplete form UE
433
  E_RAB_STATUS_REESTABLISHED, // after HO
434
  E_RAB_STATUS_FAILED,
435
  E_RAB_STATUS_TORELEASE  // to release DRB between eNB and UE
winckel's avatar
winckel committed
436 437
} e_rab_status_t;

438
typedef struct e_rab_param_s {
439 440
  e_rab_t param;
  uint8_t status;
441
  uint8_t xid; // transaction_id
442 443
  s1ap_Cause_t cause;
  uint8_t cause_value;
winckel's avatar
winckel committed
444
} __attribute__ ((__packed__)) e_rab_param_t;
445

446

447
/* Intermediate structure for Handover management. Associated per-UE in eNB_RRC_INST */
winckel's avatar
winckel committed
448
typedef struct HANDOVER_INFO_s {
449 450
  uint8_t ho_prepare;
  uint8_t ho_complete;
451 452 453
  HO_STATE_t state; //current state of handover
  uint32_t modid_s; //module_idP of serving cell
  uint32_t modid_t; //module_idP of target cell
454 455
  uint8_t ueid_s; //UE index in serving cell
  uint8_t ueid_t; //UE index in target cell
456 457
  LTE_AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */
  LTE_AS_Context_t as_context; /* They are mandatory for HO */
458 459
  uint8_t buf[RRC_BUF_SIZE];  /* ASN.1 encoded handoverCommandMessage */
  int size;   /* size of above message in bytes */
winckel's avatar
winckel committed
460
} HANDOVER_INFO;
461 462 463

#define RRC_HEADER_SIZE_MAX 64
#define RRC_BUFFER_SIZE_MAX 1024
464
typedef struct {
465
  char Payload[RRC_BUFFER_SIZE_MAX];
466
  char Header[RRC_HEADER_SIZE_MAX];
467
  char payload_size;
468
} RRC_BUFFER;
469 470
#define RRC_BUFFER_SIZE sizeof(RRC_BUFFER)

winckel's avatar
winckel committed
471
typedef struct RB_INFO_s {
472
  uint16_t Rb_id;  //=Lchan_id
473
  LCHAN_DESC Lchan_desc[2];
474
  //  MAC_MEAS_REQ_ENTRY *Meas_entry;
winckel's avatar
winckel committed
475
} RB_INFO;
476

winckel's avatar
winckel committed
477
typedef struct SRB_INFO_s {
478
  uint16_t Srb_id;  //=Lchan_id
479 480
  RRC_BUFFER Rx_buffer;
  RRC_BUFFER Tx_buffer;
481 482
  LCHAN_DESC Lchan_desc[2];
  unsigned int Trans_id;
483
  uint8_t Active;
winckel's avatar
winckel committed
484
} SRB_INFO;
485

winckel's avatar
winckel committed
486
typedef struct RB_INFO_TABLE_ENTRY_s {
487
  RB_INFO Rb_info;
488 489 490
  uint8_t Active;
  uint32_t Next_check_frame;
  uint8_t Status;
winckel's avatar
winckel committed
491
} RB_INFO_TABLE_ENTRY;
492

winckel's avatar
winckel committed
493
typedef struct SRB_INFO_TABLE_ENTRY_s {
494
  SRB_INFO Srb_info;
495 496
  uint8_t Active;
  uint8_t Status;
497
  uint32_t Next_check_frame;
498
} SRB_INFO_TABLE_ENTRY;
499

winckel's avatar
winckel committed
500
typedef struct MEAS_REPORT_LIST_s {
501
  LTE_MeasId_t measId;
502
  //CellsTriggeredList  cellsTriggeredList;//OPTIONAL
503
  uint32_t numberOfReportsSent;
504
} MEAS_REPORT_LIST;
505

winckel's avatar
winckel committed
506
typedef struct HANDOVER_INFO_UE_s {
507
  LTE_PhysCellId_t targetCellId;
508
  uint8_t measFlag;
winckel's avatar
winckel committed
509
} HANDOVER_INFO_UE;
510

511 512 513 514 515 516 517
typedef struct rrc_gummei_s {
  uint16_t mcc;
  uint16_t mnc;
  uint8_t  mnc_len;
  uint8_t  mme_code;
  uint16_t mme_group_id;
} rrc_gummei_t;
518

519
typedef struct eNB_RRC_UE_s {
520
  uint8_t                            primaryCC_id;
521 522
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
  LTE_SCellToAddMod_r10_t            sCell_config[2];
523
#endif
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
524 525 526 527 528
  LTE_SRB_ToAddModList_t            *SRB_configList;
  LTE_SRB_ToAddModList_t            *SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
  LTE_DRB_ToAddModList_t            *DRB_configList;
  LTE_DRB_ToAddModList_t            *DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
  LTE_DRB_ToReleaseList_t           *DRB_Release_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
529
  uint8_t                            DRB_active[8];
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
530 531 532 533 534 535 536 537
  struct LTE_PhysicalConfigDedicated    *physicalConfigDedicated;
  struct LTE_SPS_Config             *sps_Config;
  LTE_MeasObjectToAddMod_t          *MeasObj[MAX_MEAS_OBJ];
  struct LTE_ReportConfigToAddMod   *ReportConfig[MAX_MEAS_CONFIG];
  struct LTE_QuantityConfig         *QuantityConfig;
  struct LTE_MeasIdToAddMod         *MeasId[MAX_MEAS_ID];
  LTE_MAC_MainConfig_t              *mac_MainConfig;
  LTE_MeasGapConfig_t               *measGapConfig;
538 539 540 541
  SRB_INFO                           SI;
  SRB_INFO                           Srb0;
  SRB_INFO_TABLE_ENTRY               Srb1;
  SRB_INFO_TABLE_ENTRY               Srb2;
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
542 543 544
  LTE_MeasConfig_t                  *measConfig;
  HANDOVER_INFO                     *handover_info;
  LTE_MeasResults_t                 *measResults;
545
  LTE_MobilityControlInfo_t         *mobilityInfo;
546

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
547
  LTE_UE_EUTRA_Capability_t         *UE_Capability;
548
  int                                UE_Capability_size;
549
  ImsiMobileIdentity_t               imsi;
550 551 552

  /* KeNB as derived from KASME received from EPC */
  uint8_t kenb[32];
553 554 555
  int8_t  kenb_ncc;
  uint8_t nh[32];
  int8_t  nh_ncc;
556
  /* Used integrity/ciphering algorithms */
557 558
  LTE_CipheringAlgorithm_r12_t                          ciphering_algorithm;
  e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
559

560
  uint8_t                            Status; // RRC status, type enum UE_STATE_t
561 562 563
  rnti_t                             rnti;
  uint64_t                           random_ue_identity;

564

565 566
  /* Information from UE RRC ConnectionRequest */
  UE_S_TMSI                          Initialue_identity_s_TMSI;
567
  LTE_EstablishmentCause_t           establishment_cause;
568 569

  /* Information from UE RRC ConnectionReestablishmentRequest */
570
  LTE_ReestablishmentCause_t         reestablishment_cause;
571 572 573 574 575 576 577

  /* UE id for initial connection to S1AP */
  uint16_t                           ue_initial_id;

  /* Information from S1AP initial_context_setup_req */
  uint32_t                           eNB_ue_s1ap_id :24;

578 579 580
  uint32_t                           mme_ue_s1ap_id;
  rrc_gummei_t                       ue_gummei;

581 582
  security_capabilities_t            security_capabilities;

583 584 585 586
  int                                next_hop_chain_count;

  uint8_t                            next_security_key[SECURITY_KEY_LENGTH];

587
  /* Total number of e_rab already setup in the list */
588
  uint8_t                            setup_e_rabs;
589 590
  /* Number of e_rab to be setup in the list */
  uint8_t                            nb_of_e_rabs;
591 592 593 594
  /* Number of e_rab to be modified in the list */
  uint8_t                            nb_of_modify_e_rabs;
  uint8_t                            nb_of_failed_e_rabs;
  e_rab_param_t                      modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
595
  /* list of e_rab to be setup by RRC layers */
596
  e_rab_param_t                      e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
597 598
  /* UE aggregate maximum bitrate */
  ambr_t ue_ambr;
599 600
  //release e_rabs
  uint8_t                            nb_release_of_e_rabs;
601 602
  /* list of e_rab to be released by RRC layers */
  uint8_t                            e_rabs_tobereleased[NB_RB_MAX];
603
  e_rab_failed_t                     e_rabs_release_failed[S1AP_MAX_E_RAB];
604 605 606 607
  // LG: For GTPV1 TUNNELS
  uint32_t                           enb_gtp_teid[S1AP_MAX_E_RAB];
  transport_layer_addr_t             enb_gtp_addrs[S1AP_MAX_E_RAB];
  rb_id_t                            enb_gtp_ebi[S1AP_MAX_E_RAB];
608
  uint32_t                           ul_failure_timer;
609
  uint32_t                           ue_release_timer;
610
  uint32_t                           ue_release_timer_thres;
611 612 613 614 615 616
  uint32_t                           ue_release_timer_s1;
  uint32_t                           ue_release_timer_thres_s1;
  uint32_t                           ue_release_timer_rrc;
  uint32_t                           ue_release_timer_thres_rrc;
  uint32_t                           ue_reestablishment_timer;
  uint32_t                           ue_reestablishment_timer_thres;
617 618
  /* RRC inactivity timer: on timeout, should release RRC connection for inactivity on all E-RABs */
  uint32_t                           ue_rrc_inactivity_timer;
619
  uint8_t                            e_rab_release_command_flag;
620
  int8_t                             reestablishment_xid;
621 622 623
} eNB_RRC_UE_t;

typedef uid_t ue_uid_t;
624

625 626 627 628 629 630 631 632 633
typedef struct rrc_eNB_ue_context_s {
  /* Tree related data */
  RB_ENTRY(rrc_eNB_ue_context_s) entries;

  /* Uniquely identifies the UE between MME and eNB within the eNB.
   * This id is encoded on 24bits.
   */
  rnti_t         ue_id_rnti;

634
  // another key for protocol layers but should not be used as a key for RB tree
635 636 637 638 639
  ue_uid_t       local_uid;

  /* UE id for initial connection to S1AP */
  struct eNB_RRC_UE_s   ue_context;
} rrc_eNB_ue_context_t;
640

641
typedef struct {
642 643
  uint8_t                           *MIB;
  uint8_t                           sizeof_MIB;
644 645 646 647
  uint8_t                           *SIB1;
  uint8_t                           sizeof_SIB1;
  uint8_t                           *SIB23;
  uint8_t                           sizeof_SIB23;
648
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
649 650
  uint8_t                           *SIB1_BR;
  uint8_t                           sizeof_SIB1_BR;
651 652 653
  uint8_t                           *SIB23_BR;
  uint8_t                           sizeof_SIB23_BR;
#endif
654 655 656 657 658
  int                                   physCellId;
  int                                   Ncp;
  int                                   p_eNB;
  uint32_t                              dl_CarrierFreq;
  uint32_t                              ul_CarrierFreq;
659 660
  uint32_t                              eutra_band;
  uint32_t                              N_RB_DL;
661 662
  uint32_t                              pbch_repetition;
  LTE_BCCH_BCH_Message_t                mib;
663
  LTE_BCCH_BCH_Message_t                *mib_DU;
664 665
  LTE_BCCH_DL_SCH_Message_t             siblock1;
  LTE_BCCH_DL_SCH_Message_t             siblock1_BR;
666
  LTE_BCCH_DL_SCH_Message_t             *siblock1_DU;
667 668
  LTE_BCCH_DL_SCH_Message_t             systemInformation;
  LTE_BCCH_DL_SCH_Message_t             systemInformation_BR;
669
  //  SystemInformation_t               systemInformation;
670 671 672
  LTE_SystemInformationBlockType1_t     *sib1;
  LTE_SystemInformationBlockType2_t     *sib2;
  LTE_SystemInformationBlockType3_t     *sib3;
673
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
674 675
  LTE_SystemInformationBlockType1_t     *sib1_BR;
  LTE_SystemInformationBlockType2_t     *sib2_BR;
676
#endif
677 678
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
  LTE_SystemInformationBlockType13_r9_t *sib13;
679
  uint8_t                           MBMS_flag;
680 681 682
  uint8_t                           num_mbsfn_sync_area;
  uint8_t                           **MCCH_MESSAGE; //  MAX_MBSFN_AREA
  uint8_t                           sizeof_MCCH_MESSAGE[8];// MAX_MBSFN_AREA
683 684
  LTE_MCCH_Message_t                mcch;
  LTE_MBSFNAreaConfiguration_r9_t  *mcch_message;
685
  SRB_INFO                          MCCH_MESS[8];// MAX_MBSFN_AREA
686
#endif
687
  //TTN - SIB 18,19,21 for D2D
688 689 690
  LTE_SystemInformationBlockType18_r12_t *sib18;
  LTE_SystemInformationBlockType19_r12_t *sib19;
  LTE_SystemInformationBlockType21_r14_t *sib21;
691
  // End - TTN
692
  SRB_INFO                          SI;
693 694
  uint8_t                           *paging[MAX_MOBILES_PER_ENB];
  uint32_t                           sizeof_paging[MAX_MOBILES_PER_ENB];
695
} rrc_eNB_carrier_data_t;
696

697
  
698
typedef struct eNB_RRC_INST_s {
699
  /// southbound midhaul configuration
700
  ngran_node_t                    node_type;
701
  eth_params_t                    eth_params_s;
702 703
  char                            *node_name;
  uint32_t                        node_id;
704
  rrc_eNB_carrier_data_t          carrier[MAX_NUM_CCs];
705 706
  uid_allocator_t                    uid_allocator; // for rrc_ue_head
  RB_HEAD(rrc_ue_tree_s, rrc_eNB_ue_context_s)     rrc_ue_head; // ue_context tree key search by rnti
707
  uint8_t                           HO_flag;
708
  uint8_t                            Nb_ue;
709 710 711
  hash_table_t                      *initial_id2_s1ap_ids; // key is    content is rrc_ue_s1ap_ids_t
  hash_table_t                      *s1ap_id2_s1ap_ids   ; // key is    content is rrc_ue_s1ap_ids_t

712 713 714 715 716 717
#ifdef LOCALIZATION
  /// localization type, 0: power based, 1: time based
  uint8_t loc_type;
  /// epoch timestamp in millisecond, RRC
  int32_t reference_timestamp_ms;
  /// aggregate physical states every n millisecond
718
  int32_t aggregation_period_ms;
719 720
  /// localization list for aggregated measurements from PHY
  struct list loc_list;
721
#endif
722

723 724
  //RRC configuration
  RrcConfigurationReq configuration;
725

726 727
  /// NR cell id
  uint64_t nr_cellid;
728

729 730 731 732 733 734 735 736
  // other RAN parameters
  int srb1_timer_poll_retransmit;
  int srb1_poll_pdu;
  int srb1_poll_byte;
  int srb1_max_retx_threshold;
  int srb1_timer_reordering;
  int srb1_timer_status_prohibit;
  int srs_enable[MAX_NUM_CCs];
737 738
  int cell_info_configured;
  pthread_mutex_t cell_info_mutex;
739 740 741
  uint16_t sctp_in_streams;
  uint16_t sctp_out_streams;

742 743 744
} eNB_RRC_INST;

#define MAX_UE_CAPABILITY_SIZE 255
winckel's avatar
winckel committed
745
typedef struct OAI_UECapability_s {
746 747
  uint8_t sdu[MAX_UE_CAPABILITY_SIZE];
  uint8_t sdu_size;
748
  LTE_UE_EUTRA_Capability_t *UE_EUTRA_Capability;
749 750
} OAI_UECapability_t;

winckel's avatar
winckel committed
751
typedef struct UE_RRC_INST_s {
winckel's avatar
winckel committed
752 753 754 755 756
  Rrc_State_t     RrcState;
  Rrc_Sub_State_t RrcSubState;
  plmn_t          plmnID;
  Byte_t          rat;
  as_nas_info_t   initialNasMsg;
Raymond Knopp's avatar
 
Raymond Knopp committed
757
  OAI_UECapability_t *UECap;
758 759 760 761 762 763
  uint8_t *UECapability;
  uint8_t UECapability_size;
  UE_RRC_INFO Info[NB_SIG_CNX_UE];
  SRB_INFO Srb0[NB_SIG_CNX_UE];
  SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE];
  SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE];
764
  HANDOVER_INFO_UE HandoverInfoUe;
765 766 767 768 769 770
  uint8_t *SIB1[NB_CNX_UE];
  uint8_t sizeof_SIB1[NB_CNX_UE];
  uint8_t *SI[NB_CNX_UE];
  uint8_t sizeof_SI[NB_CNX_UE];
  uint8_t SIB1Status[NB_CNX_UE];
  uint8_t SIStatus[NB_CNX_UE];
771 772 773 774 775 776 777 778 779 780 781 782
  LTE_SystemInformationBlockType1_t *sib1[NB_CNX_UE];
  LTE_SystemInformation_t *si[NB_CNX_UE]; //!< Temporary storage for an SI message. Decoding happens in decode_SI().
  LTE_SystemInformationBlockType2_t *sib2[NB_CNX_UE];
  LTE_SystemInformationBlockType3_t *sib3[NB_CNX_UE];
  LTE_SystemInformationBlockType4_t *sib4[NB_CNX_UE];
  LTE_SystemInformationBlockType5_t *sib5[NB_CNX_UE];
  LTE_SystemInformationBlockType6_t *sib6[NB_CNX_UE];
  LTE_SystemInformationBlockType7_t *sib7[NB_CNX_UE];
  LTE_SystemInformationBlockType8_t *sib8[NB_CNX_UE];
  LTE_SystemInformationBlockType9_t *sib9[NB_CNX_UE];
  LTE_SystemInformationBlockType10_t *sib10[NB_CNX_UE];
  LTE_SystemInformationBlockType11_t *sib11[NB_CNX_UE];
783
  uint8_t                           *MIB;
784
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
785
  //SIB18
786 787 788
  LTE_SystemInformationBlockType18_r12_t *sib18[NB_CNX_UE];
  LTE_SystemInformationBlockType19_r12_t *sib19[NB_CNX_UE];
  LTE_SystemInformationBlockType21_r14_t *sib21[NB_CNX_UE];
789

790
  LTE_SBCCH_SL_BCH_MessageType_t   mib_sl[NB_CNX_UE];
791
  /// Preconfiguration for Sidelink
792
  struct LTE_SL_Preconfiguration_r12 *SL_Preconfiguration[NB_CNX_UE];
793 794 795 796 797 798 799
  //source L2 Id
  uint32_t sourceL2Id;
  //group L2 Id
  uint32_t groupL2Id;
  //current destination
  uint32_t destinationL2Id;
  //List of destinations
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
800
  uint32_t destinationList[MAX_NUM_DEST];
801 802 803
  //sl_discovery..
  SRB_INFO SL_Discovery[NB_CNX_UE];
#endif
804

805
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
806
  uint8_t                           MBMS_flag;
807 808 809
  uint8_t *MCCH_MESSAGE[NB_CNX_UE];
  uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE];
  uint8_t MCCH_MESSAGEStatus[NB_CNX_UE];
810 811 812
  LTE_MBSFNAreaConfiguration_r9_t       *mcch_message[NB_CNX_UE];
  LTE_SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE];
  LTE_SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE];
813
#endif
814 815 816 817
#ifdef CBA
  uint8_t                         num_active_cba_groups;
  uint16_t                        cba_rnti[NUM_MAX_CBA_GROUP];
#endif
818
  uint8_t                         num_srb;
819 820 821
  struct LTE_SRB_ToAddMod         *SRB1_config[NB_CNX_UE];
  struct LTE_SRB_ToAddMod         *SRB2_config[NB_CNX_UE];
  struct LTE_DRB_ToAddMod         *DRB_config[NB_CNX_UE][8];
822
  rb_id_t                         *defaultDRB; // remember the ID of the default DRB
823 824 825 826 827 828 829 830 831 832 833 834
  LTE_MeasObjectToAddMod_t        *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ];
  struct LTE_ReportConfigToAddMod *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG];
  struct LTE_QuantityConfig       *QuantityConfig[NB_CNX_UE];
  struct LTE_MeasIdToAddMod       *MeasId[NB_CNX_UE][MAX_MEAS_ID];
  MEAS_REPORT_LIST                *measReportList[NB_CNX_UE][MAX_MEAS_ID];
  uint32_t                        measTimer[NB_CNX_UE][MAX_MEAS_ID][6]; // 6 neighboring cells
  LTE_RSRP_Range_t                s_measure;
  struct LTE_MeasConfig__speedStatePars *speedStatePars;
  struct LTE_PhysicalConfigDedicated  *physicalConfigDedicated[NB_CNX_UE];
  struct LTE_SPS_Config           *sps_Config[NB_CNX_UE];
  LTE_MAC_MainConfig_t            *mac_MainConfig[NB_CNX_UE];
  LTE_MeasGapConfig_t             *measGapConfig[NB_CNX_UE];
835
  double                          filter_coeff_rsrp; // [7] ???
836
  double                          filter_coeff_rsrq; // [7] ???
837 838 839 840
  float                           rsrp_db[7];
  float                           rsrq_db[7];
  float                           rsrp_db_filtered[7];
  float                           rsrq_db_filtered[7];
841 842
  /* KeNB as computed from parameters within USIM card */
  uint8_t kenb[32];
843 844
  uint8_t nh[32];
  int8_t  nh_ncc;
845 846

  /* Used integrity/ciphering algorithms */
847 848
  LTE_CipheringAlgorithm_r12_t                          ciphering_algorithm;
  e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
849

850
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
851
  /// Used for Sidelink Preconfiguration
852
  LTE_DRB_ToAddModList_t *DRB_configList;
853
#endif
winckel's avatar
winckel committed
854
} UE_RRC_INST;
855

856 857 858 859 860 861 862 863
typedef struct UE_PF_PO_s {
  boolean_t enable_flag;  /* flag indicate whether current object is used */
  uint16_t ue_index_value;  /* UE index value */
  uint8_t PF_min;  /* minimal value of Paging Frame (PF) */
  uint8_t PO;  /* Paging Occasion (PO) */
  uint32_t T;  /* DRX cycle */
} UE_PF_PO_t;

864
#include "rrc_proto.h"
winckel's avatar
winckel committed
865

866
#endif
867
/** @} */