nr_pdcp_oai_api.h 5.49 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

#ifndef NR_PDCP_OAI_API_H
#define NR_PDCP_OAI_API_H

#include "pdcp.h"
#include "nr_pdcp_ue_manager.h"

28
void nr_pdcp_layer_init(bool uses_e1);
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id);

void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
                     const srb_flag_t   srb_flagP,
                     const MBMS_flag_t  MBMS_flagP,
                     const rb_id_t      rb_idP,
                     const mui_t        muiP,
                     confirm_t    confirmP,
                     sdu_size_t   sdu_sizeP,
                     mem_block_t *sdu_pP);

bool pdcp_data_ind(const protocol_ctxt_t *const  ctxt_pP,
                   const srb_flag_t srb_flagP,
                   const MBMS_flag_t MBMS_flagP,
                   const rb_id_t rb_id,
                   const sdu_size_t sdu_buffer_size,
                   mem_block_t *const sdu_buffer,
                   const uint32_t *const srcID,
                   const uint32_t *const dstID);

void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
                      ue_id_t rntiMaybeUEid,
                      NR_DRB_ToAddModList_t *const drb2add_list,
                      const uint8_t security_modeP,
                      uint8_t *const kUPenc,
54 55
                      uint8_t *const kUPint);

francescomani's avatar
francescomani committed
56 57
void add_drb(int is_gnb,
             ue_id_t rntiMaybeUEid,
58 59 60 61 62
             struct NR_DRB_ToAddMod *s,
             int ciphering_algorithm,
             int integrity_algorithm,
             unsigned char *ciphering_key,
             unsigned char *integrity_key);
63 64 65 66

void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);

bool nr_pdcp_remove_UE(ue_id_t ue_id);
67
void nr_pdcp_reestablishment(ue_id_t ue_id);
68

69 70
void nr_pdcp_suspend_srb(ue_id_t ue_id, int srb_id);
void nr_pdcp_suspend_drb(ue_id_t ue_id, int drb_id);
francescomani's avatar
francescomani committed
71 72
void nr_pdcp_reconfigure_srb(ue_id_t ue_id, int srb_id, long t_Reordering);
void nr_pdcp_reconfigure_drb(ue_id_t ue_id, int drb_id, long t_Reordering);
73 74
void nr_pdcp_release_srb(ue_id_t ue_id, int srb_id);
void nr_pdcp_release_drb(ue_id_t ue_id, int drb_id);
75 76 77 78 79 80 81 82 83

void add_srb(int is_gnb,
             ue_id_t rntiMaybeUEid,
             struct NR_SRB_ToAddMod *s,
             int ciphering_algorithm,
             int integrity_algorithm,
             unsigned char *ciphering_key,
             unsigned char *integrity_key);

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
void nr_pdcp_config_set_security(ue_id_t ue_id,
                                 const rb_id_t rb_id,
                                 const uint8_t security_modeP,
                                 uint8_t *const kRRCenc_pP,
                                 uint8_t *const kRRCint_pP,
                                 uint8_t *const kUPenc_pP);

bool cu_f1u_data_req(protocol_ctxt_t  *ctxt_pP,
                     const srb_flag_t srb_flagP,
                     const rb_id_t rb_id,
                     const mui_t muiP,
                     const confirm_t confirmP,
                     const sdu_size_t sdu_buffer_size,
                     unsigned char *const sdu_buffer,
                     const pdcp_transmission_mode_t mode,
                     const uint32_t *const sourceL2Id,
                     const uint32_t *const destinationL2Id);

102
typedef void (*deliver_pdu)(void *data, ue_id_t ue_id, int srb_id,
103
                            char *buf, int size, int sdu_id);
104
/* default implementation of deliver_pdu */
105
void deliver_pdu_srb_rlc(void *data, ue_id_t ue_id, int srb_id, char *buf, int size, int sdu_id);
106 107 108 109
bool nr_pdcp_data_req_srb(ue_id_t ue_id,
                          const rb_id_t rb_id,
                          const mui_t muiP,
                          const sdu_size_t sdu_buffer_size,
110 111 112
                          unsigned char *const sdu_buffer,
                          deliver_pdu deliver_cb,
                          void *data);
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
bool nr_pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
                          const srb_flag_t srb_flagP,
                          const rb_id_t rb_id,
                          const mui_t muiP,
                          const confirm_t confirmP,
                          const sdu_size_t sdu_buffer_size,
                          unsigned char *const sdu_buffer,
                          const pdcp_transmission_mode_t mode,
                          const uint32_t *const sourceL2Id,
                          const uint32_t *const destinationL2Id);

void nr_pdcp_tick(int frame, int subframe);

nr_pdcp_ue_manager_t *nr_pdcp_sdap_get_ue_manager();

mir's avatar
mir committed
128
bool nr_pdcp_get_statistics(ue_id_t ue_id, int srb_flag, int rb_id, nr_pdcp_statistics_t *out);
129 130

#endif /* NR_PDCP_OAI_API_H */