Commit 36ecc848 authored by gauthier's avatar gauthier

Put module identifiers, enb_flag, frame in a struct called protocol_ctxt_t

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6326 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 0fca6a23
......@@ -58,19 +58,15 @@
#undef GTP_DUMP_SOCKET
extern boolean_t
pdcp_data_req(
const module_id_t enb_mod_idP,
const module_id_t ue_mod_idP,
const frame_t frameP,
const eNB_flag_t enb_flagP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_buffer_sizeP,
unsigned char *const sdu_buffer_pP,
const pdcp_transmission_mode_t modeP);
extern boolean_t pdcp_data_req(
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_buffer_sizeP,
unsigned char *const sdu_buffer_pP,
const pdcp_transmission_mode_t modeP);
static int
......@@ -282,6 +278,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
teid_t teid = 0;
hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;
gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL;
protocol_ctxt_t ctxt;
switch(pUlpApi->apiType) {
/* Here there are two type of messages handled:
......@@ -319,12 +316,13 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
#endif
#warning "LG eps bearer mapping to DRB id to do (offset -4)"
ctxt.enb_module_id = gtpv1u_teid_data_p->enb_id;
ctxt.ue_module_id = gtpv1u_teid_data_p->ue_id;
ctxt.frame = 0;
ctxt.enb_flag = ENB_FLAG_YES;
result = pdcp_data_req(
gtpv1u_teid_data_p->enb_id,
gtpv1u_teid_data_p->ue_id,
0, // frame TO DO
ENB_FLAG_YES,
&ctxt,
SRB_FLAG_NO,
(gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4,
0, // mui
......
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
......@@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
......@@ -309,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
......@@ -367,4 +368,3 @@ operates.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
......@@ -170,4 +170,16 @@ typedef enum config_action_e {
//-----------------------------------------------------------------------------
typedef uint32_t teid_t; // tunnel endpoint identifier
typedef uint8_t ebi_t; // eps bearer id
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
typedef struct protocol_ctxt_s {
module_id_t enb_module_id; /*!< \brief Virtualized enb module identifier, Not used if eNB_flagP = 0. */
module_id_t ue_module_id; /*!< \brief Virtualized ue module identifier */
frame_t frame; /*!< \brief LTE Frame number.*/
eNB_flag_t enb_flag; /*!< \brief Flag to indicate eNB (1) or UE (0) */
} protocol_ctxt_t;
#endif
......@@ -83,6 +83,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
unsigned int nCCE[MAX_NUM_CCs];
int mbsfn_status[MAX_NUM_CCs];
uint32_t RBalloc[MAX_NUM_CCs];
protocol_ctxt_t ctxt;
#ifdef EXMIMO
int ret;
#endif
......@@ -181,14 +182,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
//if (subframeP%5 == 0)
//#ifdef EXMIMO
pdcp_run(frameP, 1, 0, module_idP);
ctxt.enb_module_id = module_idP;
ctxt.ue_module_id = 0;
ctxt.frame = frameP;
ctxt.enb_flag = ENB_FLAG_YES;
pdcp_run(&ctxt);
//#endif
// check HO
rrc_rx_tx(module_idP,
frameP,
1,
module_idP,
frameP,
1,
module_idP,
CC_id);
#ifdef Rel10
......
......@@ -1321,6 +1321,7 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
// int8_t lcg_id;
struct RACH_ConfigCommon *rach_ConfigCommon = (struct RACH_ConfigCommon *)NULL;
#ifdef EXMIMO
protocol_ctxt_t ctxt;
int ret;
#endif
#if defined(ENABLE_ITTI)
......@@ -1366,7 +1367,11 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
//Rrc_xface->Frame_index=Mac_rlc_xface->frameP;
//if (subframe%5 == 0)
#ifdef EXMIMO
pdcp_run(frameP, 0, module_idP, eNB_indexP);
ctxt.enb_module_id = eNB_indexP;
ctxt.ue_module_id = module_idP;
ctxt.frame = frameP;
ctxt.enb_flag = ENB_FLAG_NO;
pdcp_run(&ctxt);
#endif
UE_mac_inst[module_idP].frame = frameP;
UE_mac_inst[module_idP].subframe = subframeP;
......
This diff is collapsed.
......@@ -197,27 +197,21 @@ typedef struct pdcp_mbms_t {
* under targets/TEST/PDCP/
*/
/*! \fn boolean_t pdcp_data_req(module_id_t , module_id_t , frame_t , eNB_flag_t , srb_flag_t , rb_id_t , mui_t , confirm_t ,sdu_size_t , unsigned char* , pdcp_transmission_mode_t )
/*! \fn boolean_t pdcp_data_req(const protocol_ctxt_t* const , srb_flag_t , rb_id_t , mui_t , confirm_t ,sdu_size_t , unsigned char* , pdcp_transmission_mode_t )
* \brief This functions handles data transfer requests coming either from RRC or from IP
* \param[in] enb_mod_idP Virtualized enb module identifier, Not used if eNB_flagP = 0.
* \param[in] ue_mod_idP Virtualized ue module identifier.
* \param[in] frame Frame number
* \param[in] Shows if relevant PDCP entity is part of an eNB or a UE
* \param[in] rab_id Radio Bearer ID
* \param[in] ctxt_pP Running context.
* \param[in] rab_id Radio Bearer ID
* \param[in] muiP
* \param[in] confirmP
* \param[in] sdu_buffer_size Size of incoming SDU in bytes
* \param[in] sdu_buffer Buffer carrying SDU
* \param[in] mode flag to indicate whether the userplane data belong to the control plane or data plane or transparent
* \param[in] sdu_buffer Buffer carrying SDU
* \param[in] mode flag to indicate whether the userplane data belong to the control plane or data plane or transparent
* \return TRUE on success, FALSE otherwise
* \note None
* @ingroup _pdcp
*/
public_pdcp(boolean_t pdcp_data_req(
const module_id_t eNB_id,
const module_id_t UE_id,
const frame_t frame,
const eNB_flag_t eNB_flag,
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_id,
const mui_t muiP,
......@@ -226,12 +220,9 @@ public_pdcp(boolean_t pdcp_data_req(
unsigned char* const sdu_buffer,
const pdcp_transmission_mode_t mode));
/*! \fn boolean_t pdcp_data_ind(module_id_t, module_id_t, frame_t, eNB_flag_t, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, boolean_t)
/*! \fn boolean_t pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, boolean_t)
* \brief This functions handles data transfer indications coming from RLC
* \param[in] enb_mod_idP Virtualized enb module identifier, Not used if eNB_flagP = 0.
* \param[in] ue_mod_idP Virtualized ue module identifier.
* \param[in] frame Frame number
* \param[in] Shows if relevant PDCP entity is part of an eNB or a UE
* \param[in] ctxt_pP Running context.
* \param[in] Shows if rb is SRB
* \param[in] Tells if MBMS traffic
* \param[in] rab_id Radio Bearer ID
......@@ -243,22 +234,16 @@ public_pdcp(boolean_t pdcp_data_req(
* @ingroup _pdcp
*/
public_pdcp(boolean_t pdcp_data_ind(
const module_id_t eNB_id,
const module_id_t UE_id,
const frame_t frame,
const eNB_flag_t eNB_flag,
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));
/*! \fn void rrc_pdcp_config_req(module_id_t , module_id_t ,frame_t,eNB_flag_t,uint32_t,rb_id_t,uint8_t)
/*! \fn void rrc_pdcp_config_req(const protocol_ctxt_t* const ,uint32_t,rb_id_t,uint8_t)
* \brief This functions initializes relevant PDCP entity
* \param[in] enb_mod_idP Virtualized enb module identifier, Not used if eNB_flagP = 0.
* \param[in] ue_mod_idP Virtualized ue module identifier.
* \param[in] frameP frame counter (TTI)
* \param[in] eNB_flagP flag indicating the node type
* \param[in] ctxt_pP Running context.
* \param[in] actionP flag for action: add, remove , modify
* \param[in] rb_idP Radio Bearer ID of relevant PDCP entity
* \param[in] security_modeP Radio Bearer ID of relevant PDCP entity
......@@ -267,21 +252,15 @@ public_pdcp(boolean_t pdcp_data_ind(
* @ingroup _pdcp
*/
public_pdcp(void rrc_pdcp_config_req (
const module_id_t enb_idP,
const module_id_t ue_idP,
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const uint32_t actionP,
const rb_id_t rb_idP,
const uint8_t security_modeP);)
/*! \fn bool rrc_pdcp_config_asn1_req (module_id_t module_id, frame_t frame, eNB_flag_t eNB_flag, SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list)
/*! \fn bool rrc_pdcp_config_asn1_req (const protocol_ctxt_t* const , SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list)
* \brief Function for RRC to configure a Radio Bearer.
* \param[in] enb_mod_idP Virtualized enb module identifier.
* \param[in] ue_mod_idP Virtualized ue module identifier.
* \param[in] frame Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0)
* \param[in] ctxt_pP Running context.
* \param[in] index index of UE or eNB depending on the eNB_flag
* \param[in] srb2add_list SRB configuration list to be created.
* \param[in] drb2add_list DRB configuration list to be created.
......@@ -294,10 +273,7 @@ public_pdcp(void rrc_pdcp_config_req (
*/
public_pdcp(
boolean_t rrc_pdcp_config_asn1_req (
const module_id_t eNB_idP,
const module_id_t ue_idP,
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const protocol_ctxt_t* const ctxt_pP,
SRB_ToAddModList_t *const srb2add_list,
DRB_ToAddModList_t *const drb2add_list,
DRB_ToReleaseList_t *const drb2release_list,
......@@ -310,8 +286,9 @@ boolean_t rrc_pdcp_config_asn1_req (
#endif
));
/*! \fn boolean_t pdcp_config_req_asn1 (module_id_t module_id, frame_t frame, eNB_flag_t eNB_flag, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode)
/*! \fn boolean_t pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode)
* \brief Function for RRC to configure a Radio Bearer.
* \param[in] ctxt_pP Running context.
* \param[in] pdcp_pP Pointer on PDCP structure.
* \param[in] enb_mod_idP Virtualized enb module identifier, Not used if eNB_flagP = 0.
* \param[in] ue_mod_idP Virtualized ue module identifier.
......@@ -330,11 +307,8 @@ boolean_t rrc_pdcp_config_asn1_req (
* \return A status about the processing, OK or error code.
*/
public_pdcp(boolean_t pdcp_config_req_asn1 (
const protocol_ctxt_t* const ctxt_pP,
pdcp_t *const pdcp_pP,
const module_id_t enb_idP,
const module_id_t ue_idP,
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const srb_flag_t srb_flagP,
const rlc_mode_t rlc_mode,
const uint32_t action,
......@@ -350,43 +324,33 @@ public_pdcp(boolean_t pdcp_config_req_asn1 (
uint8_t *const kUPenc));
/*! \fn boolean_t pdcp_remove_UE(const module_id_t enb_mod_idP,const module_id_t ue_mod_idP,const frame_t frameP)
/*! \fn boolean_t pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP)
* \brief Function for RRC to configure a Radio Bearer clear all PDCP resources for a particular UE
* \param[in] enb_mod_idP index of eNB
* \param[in] enb_mod_idP index of UE
* \param[in] frameP frame
* \param[in] ctxt_pP Running context.
* \return A status about the processing, OK or error code.
*/
public_pdcp(boolean_t pdcp_remove_UE(
const module_id_t enb_mod_idP,
const module_id_t ue_mod_idP,
const frame_t frameP));
const protocol_ctxt_t* const ctxt_pP));
/*! \fn void rrc_pdcp_config_release(module_id_t, rb_id_t)
/*! \fn void rrc_pdcp_config_release( const protocol_ctxt_t* const, rb_id_t)
* \brief This functions is unused
* \param[in] module_id Module ID of relevant PDCP entity
* \param[in] ctxt_pP Running context.
* \param[in] rab_id Radio Bearer ID of relevant PDCP entity
* \return none
* \note None
* @ingroup _pdcp
*/
//public_pdcp(void rrc_pdcp_config_release (module_id_t, rb_id_t);)
//public_pdcp(void rrc_pdcp_config_release ( const protocol_ctxt_t* const ctxt_pP, rb_id_t);)
/*! \fn void pdcp_run(frame_t, eNB_flag_t, module_id_t,module_id_t)
/*! \fn void pdcp_run(const protocol_ctxt_t* const ctxt_pP)
* \brief Runs PDCP entity to let it handle incoming/outgoing SDUs
* \param[in] frame Frame number
* \param[in] eNB_flag Indicates if this PDCP entity belongs to an eNB or to a UE
* \param[in] enb_mod_idP Virtualized enb module identifier, Not used if eNB_flagP = 0.
* \param[in] ue_mod_idP Virtualized ue module identifier.
* \param[in] ctxt_pP Running context.
* \return none
* \note None
* @ingroup _pdcp
*/
public_pdcp(void pdcp_run (
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const module_id_t ue_mod_idP,
const module_id_t enb_mod_idP);)
const protocol_ctxt_t* const ctxt_pP);)
public_pdcp(int pdcp_module_init (void);)
public_pdcp(void pdcp_module_cleanup (void);)
public_pdcp(void pdcp_layer_init (void);)
......@@ -397,23 +361,13 @@ public_pdcp(int pdcp_netlink_init (void);)
#define NAS2PDCP_FIFO 22
protected_pdcp_fifo(int pdcp_fifo_flush_sdus (
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const module_id_t enb_idP,
const module_id_t ue_mod_idP);)
const protocol_ctxt_t* const ctxt_pP);)
protected_pdcp_fifo(int pdcp_fifo_read_input_sdus_remaining_bytes (
const frame_t frameP,
const eNB_flag_t eNB_flagP);)
const protocol_ctxt_t* const ctxt_pP);)
protected_pdcp_fifo(int pdcp_fifo_read_input_sdus (
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const module_id_t ue_mod_idP,
const module_id_t enb_mod_idP);)
const protocol_ctxt_t* const ctxt_pP);)
protected_pdcp_fifo(void pdcp_fifo_read_input_sdus_from_otg (
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const module_id_t ue_mod_idP,
const module_id_t enb_mod_idP);)
const protocol_ctxt_t* const ctxt_pP);)
//-----------------------------------------------------------------------------
......@@ -481,7 +435,7 @@ public_pdcp(pdcp_stats_t UE_pdcp_stats[NUMBER_OF_UE_MAX];)
public_pdcp(pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX];)
protected_pdcp(pdcp_t pdcp_array_srb_ue[NUMBER_OF_UE_MAX][2];)
protected_pdcp(pdcp_t pdcp_array_drb_ue[NUMBER_OF_UE_MAX][maxDRB];)
public_pdcp(pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][2];)
public_pdcp(pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][2];)
protected_pdcp(pdcp_t pdcp_array_drb_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][maxDRB];)
#if defined(Rel10)
public_pdcp(pdcp_mbms_t pdcp_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
......
This diff is collapsed.
......@@ -156,7 +156,7 @@ int pdcp_netlink_init(void) {
* should be avoided if we want a reliable link.
*/
if (pthread_create(&pdcp_netlink_thread, &attr, pdcp_netlink_thread_fct, NULL) != 0) {
LOG_E(PDCP, "[NETLINK]Failed to create new thread for Netlink/PDCP communcation (%d:%s)\n",
LOG_E(PDCP, "[NETLINK]Failed to create new thread for Netlink/PDCP communication (%d:%s)\n",
errno, strerror(errno));
exit(EXIT_FAILURE);
}
......@@ -164,23 +164,20 @@ int pdcp_netlink_init(void) {
return 0;
}
int pdcp_netlink_dequeue_element(
module_id_t enb_mod_idP,
module_id_t ue_mod_idP,
eNB_flag_t eNB_flagP,
int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP,
struct pdcp_netlink_element_s **data_ppP)
{
int ret = 0;
if (eNB_flagP) {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[enb_mod_idP], (void **)data_ppP);
if (ctxt_pP->enb_flag) {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[ctxt_pP->enb_module_id], (void **)data_ppP);
if (ret != 0) {
LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", enb_mod_idP);
LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", ctxt_pP->enb_module_id);
}
} else {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ue_mod_idP], (void **)data_ppP);
ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ctxt_pP->ue_module_id], (void **)data_ppP);
if (ret != 0) {
LOG_D(PDCP, "[NETLINK]De-queueing packet for UE instance %d\n", ue_mod_idP);
LOG_D(PDCP, "[NETLINK]De-queueing packet for UE instance %d\n", ctxt_pP->ue_module_id);
}
}
......@@ -219,7 +216,7 @@ void *pdcp_netlink_thread_fct(void *arg) {
for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf;
NLMSG_OK(nas_nlh_rx, (unsigned int)len);
nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, len)) {
start_meas(&ip_pdcp_stats_tmp);
start_meas(&ip_pdcp_stats_tmp);
/* There is no need to check for nlmsg_type because
* the header is not set in our drivers.
*/
......@@ -272,8 +269,8 @@ void *pdcp_netlink_thread_fct(void *arg) {
/* Enqueue the element in the right queue */
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_enb[new_data_p->pdcp_read_header.inst], new_data_p);
stop_meas(&ip_pdcp_stats_tmp);
copy_meas(&eNB_pdcp_stats[new_data_p->pdcp_read_header.inst].pdcp_ip,&ip_pdcp_stats_tmp);
stop_meas(&ip_pdcp_stats_tmp);
copy_meas(&eNB_pdcp_stats[new_data_p->pdcp_read_header.inst].pdcp_ip,&ip_pdcp_stats_tmp);
} else {
if (pdcp_netlink_nb_element_ue[new_data_p->pdcp_read_header.inst]
> PDCP_QUEUE_NB_ELEMENTS) {
......@@ -285,8 +282,8 @@ void *pdcp_netlink_thread_fct(void *arg) {
/* Enqueue the element in the right queue */
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_ue[new_data_p->pdcp_read_header.inst], new_data_p);
stop_meas(&ip_pdcp_stats_tmp);
copy_meas(&UE_pdcp_stats[new_data_p->pdcp_read_header.inst].pdcp_ip,&ip_pdcp_stats_tmp);
stop_meas(&ip_pdcp_stats_tmp);
copy_meas(&UE_pdcp_stats[new_data_p->pdcp_read_header.inst].pdcp_ip,&ip_pdcp_stats_tmp);
}
}
}
......
......@@ -174,23 +174,29 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
boolean_t pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer, \
uint8_t bitmap[512], pdcp_control_pdu_for_pdcp_status_report* pdu);
int pdcp_netlink_dequeue_element(module_id_t enb_mod_idP, module_id_t ue_mod_idP, eNB_flag_t eNB_flagP,
int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP,
struct pdcp_netlink_element_s **data_ppP);
void pdcp_config_set_security(pdcp_t *pdcp_pP, module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t eNB_flagP, rb_id_t rb_idP,
void pdcp_config_set_security(const protocol_ctxt_t* const ctxt_pP, pdcp_t *pdcp_pP, rb_id_t rb_idP,
uint16_t lc_idP, uint8_t security_modeP, uint8_t *kRRCenc_pP, uint8_t *kRRCint_pP, uint8_t *kUPenc_pP);
#if defined(ENABLE_SECURITY)
int pdcp_apply_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len, uint16_t current_sn, uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size);
int pdcp_validate_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len, uint16_t current_sn, uint8_t *pdcp_pdu_buffer,
int pdcp_apply_security(const protocol_ctxt_t* const ctxt_pP,
pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size);
int pdcp_validate_security(const protocol_ctxt_t* const ctxt_pP,
pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size);
#endif /* defined(ENABLE_SECURITY) */
......
......@@ -49,12 +49,17 @@
#if defined(ENABLE_SECURITY)
static
uint32_t pdcp_get_next_count_tx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint16_t pdcp_sn);
uint32_t pdcp_get_next_count_tx(pdcp_t *const pdcp_entity, const srb_flag_t srb_flagP, const uint16_t pdcp_sn);
static
uint32_t pdcp_get_next_count_rx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint16_t pdcp_sn);
uint32_t pdcp_get_next_count_rx(pdcp_t *const pdcp_entity, const srb_flag_t srb_flagP, const uint16_t pdcp_sn);
//-----------------------------------------------------------------------------
static
uint32_t pdcp_get_next_count_tx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint16_t pdcp_sn)
uint32_t pdcp_get_next_count_tx(
pdcp_t * const pdcp_entity,
const srb_flag_t srb_flagP,
const uint16_t pdcp_sn
)
{
uint32_t count;
/* For TX COUNT = TX_HFN << length of SN | pdcp SN */
......@@ -73,8 +78,12 @@ uint32_t pdcp_get_next_count_tx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint1
return count;
}
//-----------------------------------------------------------------------------
static
uint32_t pdcp_get_next_count_rx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint16_t pdcp_sn)
uint32_t pdcp_get_next_count_rx(
pdcp_t * const pdcp_entity,
const srb_flag_t srb_flagP,
const uint16_t pdcp_sn)
{
uint32_t count;
/* For RX COUNT = RX_HFN << length of SN | pdcp SN of received PDU */
......@@ -97,13 +106,19 @@ uint32_t pdcp_get_next_count_rx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint1
return count;
}
int pdcp_apply_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size)
//-----------------------------------------------------------------------------
int
pdcp_apply_security(
const protocol_ctxt_t* const ctxtP,
pdcp_t *const pdcp_entity,
const srb_flag_t srb_flagP,
const rb_id_t rb_id,
const uint8_t pdcp_header_len,
const uint16_t current_sn,
uint8_t * const pdcp_pdu_buffer,
const uint16_t sdu_buffer_size
)
{
uint8_t *buffer_encrypted = NULL;
stream_cipher_t encrypt_params;
......@@ -161,13 +176,18 @@ int pdcp_apply_security(pdcp_t *pdcp_entity,
return 0;
}
int pdcp_validate_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size)
//-----------------------------------------------------------------------------
int
pdcp_validate_security(
const protocol_ctxt_t* const ctxtP,
pdcp_t * const pdcp_entity,
const srb_flag_t srb_flagP,
const rb_id_t rb_id,
const uint8_t pdcp_header_len,
const uint16_t current_sn,
uint8_t *const pdcp_pdu_buffer,
const uint16_t sdu_buffer_size
)
{
uint8_t *buffer_decrypted = NULL;
stream_cipher_t decrypt_params;
......