s1ap_messages_types.h 19.2 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
 * 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
 */
21

22 23 24
#ifndef S1AP_MESSAGES_TYPES_H_
#define S1AP_MESSAGES_TYPES_H_

25 26 27
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.

28 29 30
#define S1AP_REGISTER_ENB_REQ(mSGpTR)           (mSGpTR)->ittiMsg.s1ap_register_enb_req

#define S1AP_REGISTER_ENB_CNF(mSGpTR)           (mSGpTR)->ittiMsg.s1ap_register_enb_cnf
31
#define S1AP_DEREGISTERED_ENB_IND(mSGpTR)       (mSGpTR)->ittiMsg.s1ap_deregistered_enb_ind
32

33 34 35 36 37 38 39 40 41
#define S1AP_NAS_FIRST_REQ(mSGpTR)              (mSGpTR)->ittiMsg.s1ap_nas_first_req
#define S1AP_UPLINK_NAS(mSGpTR)                 (mSGpTR)->ittiMsg.s1ap_uplink_nas
#define S1AP_UE_CAPABILITIES_IND(mSGpTR)        (mSGpTR)->ittiMsg.s1ap_ue_cap_info_ind
#define S1AP_INITIAL_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_resp
#define S1AP_INITIAL_CONTEXT_SETUP_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_fail
#define S1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR)    (mSGpTR)->ittiMsg.s1ap_ue_release_resp
#define S1AP_NAS_NON_DELIVERY_IND(mSGpTR)       (mSGpTR)->ittiMsg.s1ap_nas_non_delivery_ind
#define S1AP_UE_CTXT_MODIFICATION_RESP(mSGpTR)  (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_resp
#define S1AP_UE_CTXT_MODIFICATION_FAIL(mSGpTR)  (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_fail
42 43
#define S1AP_E_RAB_SETUP_RESP(mSGpTR)           (mSGpTR)->ittiMsg.s1ap_e_rab_setup_resp
#define S1AP_E_RAB_SETUP_FAIL(mSGpTR)           (mSGpTR)->ittiMsg.s1ap_e_rab_setup_req_fail
44
#define S1AP_E_RAB_MODIFY_RESP(mSGpTR)           (mSGpTR)->ittiMsg.s1ap_e_rab_modify_resp
45 46 47 48

#define S1AP_DOWNLINK_NAS(mSGpTR)               (mSGpTR)->ittiMsg.s1ap_downlink_nas
#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR)  (mSGpTR)->ittiMsg.s1ap_initial_context_setup_req
#define S1AP_UE_CTXT_MODIFICATION_REQ(mSGpTR)   (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_req
gauthier's avatar
gauthier committed
49
#define S1AP_UE_CONTEXT_RELEASE_COMMAND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_command
50
#define S1AP_UE_CONTEXT_RELEASE_COMPLETE(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_complete
51
#define S1AP_E_RAB_SETUP_REQ(mSGpTR)              (mSGpTR)->ittiMsg.s1ap_e_rab_setup_req
52 53
#define S1AP_E_RAB_MODIFY_REQ(mSGpTR)              (mSGpTR)->ittiMsg.s1ap_e_rab_modify_req
#define S1AP_PAGING_IND(mSGpTR)                 (mSGpTR)->ittiMsg.s1ap_paging_ind
54

55
#define S1AP_UE_CONTEXT_RELEASE_REQ(mSGpTR)     (mSGpTR)->ittiMsg.s1ap_ue_release_req
56 57
#define S1AP_E_RAB_RELEASE_COMMAND(mSGpTR)      (mSGpTR)->ittiMsg.s1ap_e_rab_release_command
#define S1AP_E_RAB_RELEASE_RESPONSE(mSGpTR)     (mSGpTR)->ittiMsg.s1ap_e_rab_release_resp
58

59
//-------------------------------------------------------------------------------------------//
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
/* Maximum number of e-rabs to be setup/deleted in a single message.
 * Even if only one bearer will be modified by message.
 */
#define S1AP_MAX_E_RAB  11

/* Length of the transport layer address string
 * 160 bits / 8 bits by char.
 */
#define S1AP_TRANSPORT_LAYER_ADDRESS_SIZE (160 / 8)

#define S1AP_MAX_NB_MME_IP_ADDRESS 10
#define S1AP_IMSI_LENGTH           16

/* Security key length used within eNB
 * Even if only 16 bytes will be effectively used,
 * the key length is 32 bytes (256 bits)
 */
#define SECURITY_KEY_LENGTH 32
laurent's avatar
laurent committed
78
#ifndef OCP_FRAMEWORK
winckel's avatar
winckel committed
79
typedef enum cell_type_e {
80 81
  CELL_MACRO_ENB,
  CELL_HOME_ENB
winckel's avatar
winckel committed
82
} cell_type_t;
83

winckel's avatar
winckel committed
84
typedef enum paging_drx_e {
85 86 87 88
  PAGING_DRX_32  = 0x0,
  PAGING_DRX_64  = 0x1,
  PAGING_DRX_128 = 0x2,
  PAGING_DRX_256 = 0x3
89 90
} paging_drx_t;

91 92 93 94
/* Lower value codepoint
 * indicates higher priority.
 */
typedef enum paging_priority_s {
95 96 97 98 99 100 101 102
  PAGING_PRIO_LEVEL1  = 0,
  PAGING_PRIO_LEVEL2  = 1,
  PAGING_PRIO_LEVEL3  = 2,
  PAGING_PRIO_LEVEL4  = 3,
  PAGING_PRIO_LEVEL5  = 4,
  PAGING_PRIO_LEVEL6  = 5,
  PAGING_PRIO_LEVEL7  = 6,
  PAGING_PRIO_LEVEL8  = 7
103 104 105
} paging_priority_t;

typedef enum cn_domain_s {
106 107
  CN_DOMAIN_PS = 1,
  CN_DOMAIN_CS = 2
108
} cn_domain_t;
laurent's avatar
laurent committed
109
#endif
110

winckel's avatar
winckel committed
111
typedef struct net_ip_address_s {
112 113 114
  unsigned ipv4:1;
  unsigned ipv6:1;
  char ipv4_address[16];
115
  char ipv6_address[46];
116 117
} net_ip_address_t;

118 119
typedef uint64_t bitrate_t;

120
typedef struct ambr_s {
121 122
  bitrate_t br_ul;
  bitrate_t br_dl;
123 124
} ambr_t;

laurent's avatar
laurent committed
125
#ifndef OCP_FRAMEWORK
126
typedef enum priority_level_s {
127 128 129 130
  PRIORITY_LEVEL_SPARE       = 0,
  PRIORITY_LEVEL_HIGHEST     = 1,
  PRIORITY_LEVEL_LOWEST      = 14,
  PRIORITY_LEVEL_NO_PRIORITY = 15
131 132
} priority_level_t;

133
typedef enum pre_emp_capability_e {
134 135 136
  PRE_EMPTION_CAPABILITY_ENABLED  = 0,
  PRE_EMPTION_CAPABILITY_DISABLED = 1,
  PRE_EMPTION_CAPABILITY_MAX,
137 138
} pre_emp_capability_t;

139
typedef enum pre_emp_vulnerability_e {
140 141 142
  PRE_EMPTION_VULNERABILITY_ENABLED  = 0,
  PRE_EMPTION_VULNERABILITY_DISABLED = 1,
  PRE_EMPTION_VULNERABILITY_MAX,
143
} pre_emp_vulnerability_t;
laurent's avatar
laurent committed
144
#endif
145

146
typedef struct allocation_retention_priority_s {
147 148 149
  priority_level_t        priority_level;
  pre_emp_capability_t    pre_emp_capability;
  pre_emp_vulnerability_t pre_emp_vulnerability;
150 151 152
} allocation_retention_priority_t;

typedef struct security_capabilities_s {
153 154
  uint16_t encryption_algorithms;
  uint16_t integrity_algorithms;
155 156
} security_capabilities_t;

157 158 159 160 161
/* Provides the establishment cause for the RRC connection request as provided
 * by the upper layers. W.r.t. the cause value names: highPriorityAccess
 * concerns AC11..AC15, ‘mt’ stands for ‘Mobile Terminating’ and ‘mo’ for
 * 'Mobile Originating'. Defined in TS 36.331.
 */
winckel's avatar
winckel committed
162
typedef enum rrc_establishment_cause_e {
163 164 165 166 167
  RRC_CAUSE_EMERGENCY             = 0x0,
  RRC_CAUSE_HIGH_PRIO_ACCESS      = 0x1,
  RRC_CAUSE_MT_ACCESS             = 0x2,
  RRC_CAUSE_MO_SIGNALLING         = 0x3,
  RRC_CAUSE_MO_DATA               = 0x4,
168
#if defined(UPDATE_RELEASE_10)
169
  RRC_CAUSE_DELAY_TOLERANT_ACCESS = 0x5,
170
#endif
171
  RRC_CAUSE_LAST
172 173
} rrc_establishment_cause_t;

winckel's avatar
winckel committed
174
typedef struct s1ap_gummei_s {
175 176 177 178 179
  uint16_t mcc;
  uint16_t mnc;
  uint8_t  mnc_len;
  uint8_t  mme_code;
  uint16_t mme_group_id;
winckel's avatar
winckel committed
180
} s1ap_gummei_t;
181

182 183 184 185 186
typedef struct s1ap_imsi_s {
  uint8_t  buffer[S1AP_IMSI_LENGTH];
  uint8_t  length;
} s1ap_imsi_t;

winckel's avatar
winckel committed
187
typedef struct s_tmsi_s {
188 189
  uint8_t  mme_code;
  uint32_t m_tmsi;
190 191
} s_tmsi_t;

192
typedef enum ue_paging_identity_presenceMask_e {
193 194 195
  UE_PAGING_IDENTITY_NONE   = 0,
  UE_PAGING_IDENTITY_imsi   = (1 << 1),
  UE_PAGING_IDENTITY_s_tmsi = (1 << 2),
196 197 198
} ue_paging_identity_presenceMask_t;

typedef struct ue_paging_identity_s {
199 200
  ue_paging_identity_presenceMask_t presenceMask;
  union {
201
    s1ap_imsi_t  imsi;
202 203
    s_tmsi_t s_tmsi;
  } choice;
204 205
} ue_paging_identity_t;

winckel's avatar
winckel committed
206
typedef enum ue_identities_presenceMask_e {
207
  UE_IDENTITIES_NONE   = 0,
winckel's avatar
winckel committed
208 209 210 211 212
  UE_IDENTITIES_s_tmsi = 1 << 1,
  UE_IDENTITIES_gummei = 1 << 2,
} ue_identities_presenceMask_t;

typedef struct ue_identity_s {
213 214 215
  ue_identities_presenceMask_t presenceMask;
  s_tmsi_t s_tmsi;
  s1ap_gummei_t gummei;
216 217
} ue_identity_t;

winckel's avatar
winckel committed
218
typedef struct nas_pdu_s {
219 220 221 222
  /* Octet string data */
  uint8_t  *buffer;
  /* Length of the octet string */
  uint32_t  length;
223 224
} nas_pdu_t, ue_radio_cap_t;

winckel's avatar
winckel committed
225
typedef struct transport_layer_addr_s {
226 227 228 229 230 231 232
  /* Length of the transport layer address buffer in bits. S1AP layer received a
   * bit string<1..160> containing one of the following addresses: ipv4,
   * ipv6, or ipv4 and ipv6. The layer doesn't interpret the buffer but
   * silently forward it to S1-U.
   */
  uint8_t length;
  uint8_t buffer[20]; // in network byte order
233 234
} transport_layer_addr_t;

235 236 237 238 239 240 241
#define TRANSPORT_LAYER_ADDR_COPY(dEST,sOURCE)        \
  do {                                                \
      AssertFatal(sOURCE.len <= 20);                  \
      memcpy(dEST.buffer, sOURCE.buffer, sOURCE.len); \
      dEST.length = sOURCE.length;                    \
  } while (0)

winckel's avatar
winckel committed
242
typedef struct e_rab_level_qos_parameter_s {
243
  uint8_t qci;
244

245
  allocation_retention_priority_t allocation_retention_priority;
246 247
} e_rab_level_qos_parameter_t;

winckel's avatar
winckel committed
248
typedef struct e_rab_s {
249 250 251 252 253 254 255 256 257 258
  /* Unique e_rab_id for the UE. */
  uint8_t                     e_rab_id;
  /* Quality of service for this e_rab */
  e_rab_level_qos_parameter_t qos;
  /* The NAS PDU should be forwarded by the RRC layer to the NAS layer */
  nas_pdu_t                   nas_pdu;
  /* The transport layer address for the IP packets */
  transport_layer_addr_t      sgw_addr;
  /* S-GW Tunnel endpoint identifier */
  uint32_t                    gtp_teid;
259 260
} e_rab_t;

winckel's avatar
winckel committed
261
typedef struct e_rab_setup_s {
262 263
  /* Unique e_rab_id for the UE. */
  uint8_t e_rab_id;
264

265 266
  /* The transport layer address for the IP packets */
  transport_layer_addr_t eNB_addr;
267

268 269
  /* S-GW Tunnel endpoint identifier */
  uint32_t gtp_teid;
270 271
} e_rab_setup_t;

272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
typedef struct e_rab_modify_s {
  /* Unique e_rab_id for the UE. */
  uint8_t e_rab_id;
} e_rab_modify_t;

typedef enum S1ap_Cause_e {
  S1AP_CAUSE_NOTHING,  /* No components present */
  S1AP_CAUSE_RADIO_NETWORK,
  S1AP_CAUSE_TRANSPORT,
  S1AP_CAUSE_NAS,
  S1AP_CAUSE_PROTOCOL,
  S1AP_CAUSE_MISC,
  /* Extensions may appear below */

} s1ap_Cause_t;

winckel's avatar
winckel committed
288
typedef struct e_rab_failed_s {
289 290 291 292
  /* Unique e_rab_id for the UE. */
  uint8_t e_rab_id;
  /* Cause of the failure */
  //     cause_t cause;
293 294
  s1ap_Cause_t cause;
  uint8_t cause_value;
295
} e_rab_failed_t;
296

297
typedef enum s1ap_ue_ctxt_modification_present_s {
298 299 300
  S1AP_UE_CONTEXT_MODIFICATION_SECURITY_KEY = (1 << 0),
  S1AP_UE_CONTEXT_MODIFICATION_UE_AMBR      = (1 << 1),
  S1AP_UE_CONTEXT_MODIFICATION_UE_SECU_CAP  = (1 << 2),
301 302 303
} s1ap_ue_ctxt_modification_present_t;

typedef enum s1ap_paging_ind_present_s {
304 305
  S1AP_PAGING_IND_PAGING_DRX      = (1 << 0),
  S1AP_PAGING_IND_PAGING_PRIORITY = (1 << 1),
306 307 308 309 310
} s1ap_paging_ind_present_t;

//-------------------------------------------------------------------------------------------//
// eNB application layer -> S1AP messages
typedef struct s1ap_register_enb_req_s {
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
  /* Unique eNB_id to identify the eNB within EPC.
   * For macro eNB ids this field should be 20 bits long.
   * For home eNB ids this field should be 28 bits long.
   */
  uint32_t eNB_id;
  /* The type of the cell */
  enum cell_type_e cell_type;

  /* Optional name for the cell
   * NOTE: the name can be NULL (i.e no name) and will be cropped to 150
   * characters.
   */
  char *eNB_name;

  /* Tracking area code */
  uint16_t tac;

  /* Mobile Country Code
   * Mobile Network Code
   */
  uint16_t mcc;
  uint16_t mnc;
  uint8_t  mnc_digit_length;

  /* Default Paging DRX of the eNB as defined in TS 36.304 */
  paging_drx_t default_drx;

  /* The eNB IP address to bind */
  net_ip_address_t enb_ip_address;

  /* Nb of MME to connect to */
  uint8_t          nb_mme;
  /* List of MME to connect to */
  net_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
345 346 347 348

  /* Number of SCTP streams used for a mme association */
  uint16_t sctp_in_streams;
  uint16_t sctp_out_streams;
349 350 351 352 353
} s1ap_register_enb_req_t;

//-------------------------------------------------------------------------------------------//
// S1AP -> eNB application layer messages
typedef struct s1ap_register_enb_cnf_s {
354 355
  /* Nb of MME connected */
  uint8_t          nb_mme;
356 357
} s1ap_register_enb_cnf_t;

358
typedef struct s1ap_deregistered_enb_ind_s {
359 360
  /* Nb of MME connected */
  uint8_t          nb_mme;
361 362
} s1ap_deregistered_enb_ind_t;

363 364
//-------------------------------------------------------------------------------------------//
// RRC -> S1AP messages
365

366 367 368 369 370
/* The NAS First Req is the first message exchanged between RRC and S1AP
 * for an UE.
 * The rnti uniquely identifies an UE within a cell. Later the enb_ue_s1ap_id
 * will be the unique identifier used between RRC and S1AP.
 */
winckel's avatar
winckel committed
371
typedef struct s1ap_nas_first_req_s {
372 373
  /* UE id for initial connection to S1AP */
  uint16_t ue_initial_id;
374

375 376
  /* Establishment cause as sent by UE */
  rrc_establishment_cause_t establishment_cause;
377

378 379
  /* NAS PDU */
  nas_pdu_t nas_pdu;
380

381 382 383 384
  /* If this flag is set S1AP layer is expecting the GUMMEI. If = 0,
   * the temporary s-tmsi is used.
   */
  ue_identity_t ue_identity;
385 386
} s1ap_nas_first_req_t;

winckel's avatar
winckel committed
387
typedef struct s1ap_uplink_nas_s {
388 389
  /* Unique UE identifier within an eNB */
  unsigned eNB_ue_s1ap_id:24;
390

391 392
  /* NAS pdu */
  nas_pdu_t nas_pdu;
393 394
} s1ap_uplink_nas_t;

395
typedef struct s1ap_ue_cap_info_ind_s {
396 397
  unsigned  eNB_ue_s1ap_id:24;
  ue_radio_cap_t ue_radio_cap;
398
} s1ap_ue_cap_info_ind_t;
399

winckel's avatar
winckel committed
400
typedef struct s1ap_initial_context_setup_resp_s {
401
  unsigned  eNB_ue_s1ap_id:24;
402

403 404 405 406
  /* Number of e_rab setup-ed in the list */
  uint8_t       nb_of_e_rabs;
  /* list of e_rab setup-ed by RRC layers */
  e_rab_setup_t e_rabs[S1AP_MAX_E_RAB];
407

408 409 410 411
  /* Number of e_rab failed to be setup in list */
  uint8_t        nb_of_e_rabs_failed;
  /* list of e_rabs that failed to be setup */
  e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB];
412 413
} s1ap_initial_context_setup_resp_t;

414
typedef struct s1ap_initial_context_setup_fail_s {
415
  unsigned  eNB_ue_s1ap_id:24;
416

417
  /* TODO add cause */
418
} s1ap_initial_context_setup_fail_t, s1ap_ue_ctxt_modification_fail_t, s1ap_e_rab_setup_req_fail_t;
419

420
typedef struct s1ap_nas_non_delivery_ind_s {
421 422 423
  unsigned  eNB_ue_s1ap_id:24;
  nas_pdu_t nas_pdu;
  /* TODO: add cause */
424
} s1ap_nas_non_delivery_ind_t;
425 426

typedef struct s1ap_ue_ctxt_modification_req_s {
427
  unsigned  eNB_ue_s1ap_id:24;
428

429 430
  /* Bit-mask of possible present parameters */
  s1ap_ue_ctxt_modification_present_t present;
431

432
  /* Following fields are optionnaly present */
433

434 435
  /* Security key */
  uint8_t security_key[SECURITY_KEY_LENGTH];
436

437 438
  /* UE aggregate maximum bitrate */
  ambr_t ue_ambr;
439

440 441
  /* Security capabilities */
  security_capabilities_t security_capabilities;
442 443 444
} s1ap_ue_ctxt_modification_req_t;

typedef struct s1ap_ue_ctxt_modification_resp_s {
445
  unsigned  eNB_ue_s1ap_id:24;
446 447
} s1ap_ue_ctxt_modification_resp_t;

448 449
typedef struct s1ap_ue_release_complete_s {

450
  unsigned eNB_ue_s1ap_id:24;
451 452 453

} s1ap_ue_release_complete_t;

454 455 456
//-------------------------------------------------------------------------------------------//
// S1AP -> RRC messages
typedef struct s1ap_downlink_nas_s {
457 458
  /* UE id for initial connection to S1AP */
  uint16_t ue_initial_id;
459

460 461
  /* Unique UE identifier within an eNB */
  unsigned eNB_ue_s1ap_id:24;
462

463 464
  /* NAS pdu */
  nas_pdu_t nas_pdu;
465 466
} s1ap_downlink_nas_t;

467

468
typedef struct s1ap_initial_context_setup_req_s {
469 470
  /* UE id for initial connection to S1AP */
  uint16_t ue_initial_id;
471

472 473
  /* eNB ue s1ap id as initialized by S1AP layer */
  unsigned eNB_ue_s1ap_id:24;
474

475 476
  /* UE aggregate maximum bitrate */
  ambr_t ue_ambr;
477

478 479
  /* Security algorithms */
  security_capabilities_t security_capabilities;
480

481 482
  /* Security key */
  uint8_t security_key[SECURITY_KEY_LENGTH];
483

484 485 486 487
  /* Number of e_rab to be setup in the list */
  uint8_t  nb_of_e_rabs;
  /* list of e_rab to be setup by RRC layers */
  e_rab_t  e_rab_param[S1AP_MAX_E_RAB];
488
} s1ap_initial_context_setup_req_t;
489

490 491 492 493 494 495
typedef struct tai_plmn_identity_s {
  uint16_t mcc;
  uint16_t mnc;
  uint8_t  mnc_digit_length;
} plmn_identity_t;

496
typedef struct s1ap_paging_ind_s {
497 498 499 500
  /* UE identity index value.
   * Specified in 3GPP TS 36.304
   */
  unsigned ue_index_value:10;
501

502 503
  /* UE paging identity */
  ue_paging_identity_t ue_paging_identity;
504

505 506
  /* Indicates origin of paging */
  cn_domain_t cn_domain;
507

508 509 510 511 512 513 514 515 516
  /* PLMN_identity in TAI of Paging*/
  plmn_identity_t plmn_identity[256];

  /* TAC in TAIList of Paging*/
  int16_t tac[256];

  /* size of TAIList*/
  int16_t tai_size;

517 518
  /* Optional fields */
  paging_drx_t paging_drx;
519

520
  paging_priority_t paging_priority;
521 522
} s1ap_paging_ind_t;

523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
typedef struct s1ap_e_rab_setup_req_s {
  /* UE id for initial connection to S1AP */
  uint16_t ue_initial_id;

  /* MME UE id  */
  uint16_t mme_ue_s1ap_id;

  /* eNB ue s1ap id as initialized by S1AP layer */
  unsigned eNB_ue_s1ap_id:24;

  /* Number of e_rab to be setup in the list */
  uint8_t nb_e_rabs_tosetup;

  /* E RAB setup request */
  e_rab_t e_rab_setup_params[S1AP_MAX_E_RAB];

} s1ap_e_rab_setup_req_t;

typedef struct s1ap_e_rab_setup_resp_s {
  unsigned  eNB_ue_s1ap_id:24;

  /* Number of e_rab setup-ed in the list */
  uint8_t       nb_of_e_rabs;
  /* list of e_rab setup-ed by RRC layers */
  e_rab_setup_t e_rabs[S1AP_MAX_E_RAB];

  /* Number of e_rab failed to be setup in list */
  uint8_t        nb_of_e_rabs_failed;
  /* list of e_rabs that failed to be setup */
  e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB];
} s1ap_e_rab_setup_resp_t;


gauthier's avatar
gauthier committed
556
// S1AP --> RRC messages
gauthier's avatar
gauthier committed
557 558
typedef struct s1ap_ue_release_command_s {

559
  unsigned eNB_ue_s1ap_id:24;
gauthier's avatar
gauthier committed
560 561 562 563

} s1ap_ue_release_command_t;


564
//-------------------------------------------------------------------------------------------//
gauthier's avatar
gauthier committed
565
// S1AP <-- RRC messages
566
typedef struct s1ap_ue_release_req_s {
567 568 569
  unsigned      eNB_ue_s1ap_id:24;
  s1ap_Cause_t  cause;
  long          cause_value;
570
} s1ap_ue_release_req_t, s1ap_ue_release_resp_t;
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 596 597 598 599 600 601 602 603 604 605 606 607 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
typedef struct s1ap_e_rab_modify_req_s {
  /* UE id for initial connection to S1AP */
  uint16_t ue_initial_id;

  /* MME UE id  */
  uint16_t mme_ue_s1ap_id;

  /* eNB ue s1ap id as initialized by S1AP layer */
  unsigned eNB_ue_s1ap_id:24;

  /* Number of e_rab to be modify in the list */
  uint8_t nb_e_rabs_tomodify;

  /* E RAB modify request */
  e_rab_t e_rab_modify_params[S1AP_MAX_E_RAB];
} s1ap_e_rab_modify_req_t;

typedef struct s1ap_e_rab_modify_resp_s {
  unsigned  eNB_ue_s1ap_id:24;

  /* Number of e_rab modify-ed in the list */
  uint8_t       nb_of_e_rabs;
  /* list of e_rab modify-ed by RRC layers */
  e_rab_modify_t e_rabs[S1AP_MAX_E_RAB];

  /* Number of e_rab failed to be modify in list */
  uint8_t        nb_of_e_rabs_failed;
  /* list of e_rabs that failed to be modify */
  e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB];
} s1ap_e_rab_modify_resp_t;

typedef struct e_rab_release_s {
  /* Unique e_rab_id for the UE. */
  uint8_t                     e_rab_id;
} e_rab_release_t;

typedef struct s1ap_e_rab_release_command_s {
  /* MME UE id  */
  uint16_t mme_ue_s1ap_id;

  /* eNB ue s1ap id as initialized by S1AP layer */
  unsigned eNB_ue_s1ap_id:24;

  /* The NAS PDU should be forwarded by the RRC layer to the NAS layer */
  nas_pdu_t                   nas_pdu;

  /* Number of e_rab to be released in the list */
  uint8_t nb_e_rabs_torelease;

  /* E RAB release command */
  e_rab_release_t e_rab_release_params[S1AP_MAX_E_RAB];

} s1ap_e_rab_release_command_t;

typedef struct s1ap_e_rab_release_resp_s {
  /* MME UE id  */
  uint16_t mme_ue_s1ap_id;

  /* eNB ue s1ap id as initialized by S1AP layer */
  unsigned eNB_ue_s1ap_id:24;

  /* Number of e_rab released in the list */
  uint8_t       nb_of_e_rabs_released;

  /* list of e_rabs released */
  e_rab_release_t e_rab_release[S1AP_MAX_E_RAB];

  /* Number of e_rab failed to be released in list */
  uint8_t        nb_of_e_rabs_failed;
  /* list of e_rabs that failed to be released */
  e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB];

} s1ap_e_rab_release_resp_t;

646
#endif /* S1AP_MESSAGES_TYPES_H_ */