Commit c19de0db authored by Navid Nikaein's avatar Navid Nikaein

* fix the call to pdcp validate security function



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5308 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 286c092c
......@@ -475,7 +475,6 @@ boolean_t pdcp_data_ind(
sdu_list_p = &pdcp_sdu_list;
if (sdu_buffer_sizeP == 0) {
LOG_W(PDCP, "SDU buffer size is zero! Ignoring this chunk!\n");
if (enb_flagP)
......@@ -485,39 +484,23 @@ boolean_t pdcp_data_ind(
return FALSE;
}
/*
* Check if incoming SDU is long enough to carry a PDU header
*/
if (MBMS_flagP == 0 ) {
if (srb_flagP) {
pdcp_header_len = PDCP_CONTROL_PLANE_DATA_PDU_SN_SIZE;
pdcp_tailer_len = PDCP_CONTROL_PLANE_DATA_PDU_MAC_I_SIZE;
} else {
pdcp_header_len = PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
pdcp_tailer_len = 0;
}
if (sdu_buffer_sizeP < pdcp_header_len + pdcp_tailer_len ) {
LOG_W(PDCP, "Incoming (from RLC) SDU is short of size (size:%d)! Ignoring...\n", sdu_buffer_sizeP);
free_mem_block(sdu_buffer_pP);
if (enb_flagP)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_ind);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return FALSE;
}
/*
* Parse the PDU placed at the beginning of SDU to check
* if incoming SN is in line with RX window
*/
if (MBMS_flagP == 0 ) {
if (srb_flagP) { //SRB1/2
pdcp_header_len = PDCP_CONTROL_PLANE_DATA_PDU_SN_SIZE;
pdcp_tailer_len = PDCP_CONTROL_PLANE_DATA_PDU_MAC_I_SIZE;
sequence_number = pdcp_get_sequence_number_of_pdu_with_SRB_sn((unsigned char*)sdu_buffer_pP->data);
} else { // DRB
pdcp_tailer_len = 0;
if (pdcp_p->seq_num_size == PDCP_SN_7BIT){
pdcp_header_len = PDCP_USER_PLANE_DATA_PDU_SHORT_SN_HEADER_SIZE;
sequence_number = pdcp_get_sequence_number_of_pdu_with_short_sn((unsigned char*)sdu_buffer_pP->data);
}else if (pdcp_p->seq_num_size == PDCP_SN_12BIT){
pdcp_header_len = PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
sequence_number = pdcp_get_sequence_number_of_pdu_with_long_sn((unsigned char*)sdu_buffer_pP->data);
} else {
//sequence_number = 4095;
......@@ -525,7 +508,20 @@ boolean_t pdcp_data_ind(
}
//uint8_t dc = pdcp_get_dc_filed((unsigned char*)sdu_buffer_pP->data);
}
/*
* Check if incoming SDU is long enough to carry a PDU header
*/
if (sdu_buffer_sizeP < pdcp_header_len + pdcp_tailer_len ) {
LOG_W(PDCP, "Incoming (from RLC) SDU is short of size (size:%d)! Ignoring...\n", sdu_buffer_sizeP);
free_mem_block(sdu_buffer_pP);
if (enb_flagP)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_ind);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return FALSE;
}
if (pdcp_is_rx_seq_number_valid(sequence_number, pdcp_p, srb_flagP) == TRUE) {
LOG_D(PDCP, "Incoming PDU has a sequence number (%d) in accordance with RX window\n", sequence_number);
/* if (dc == PDCP_DATA_PDU )
......@@ -569,7 +565,7 @@ boolean_t pdcp_data_ind(
}
#endif
//rrc_lite_data_ind(module_id, //Modified MW - L2 Interface
//rrc_lite_data_ind(module_id, //Modified MW - L2 Interface
pdcp_rrc_data_ind(enb_mod_idP,
ue_mod_idP,
frameP,
......@@ -585,17 +581,36 @@ boolean_t pdcp_data_ind(
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return TRUE;
}
payload_offset=PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
/*
* DRBs
*/
payload_offset=pdcp_header_len;// PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
#if defined(ENABLE_SECURITY)
if (pdcp_p->security_activated == 1) {
pdcp_validate_security(pdcp_p, rb_idP % maxDRB, pdcp_header_len,
sequence_number, sdu_buffer_pP->data,
if (enb_flagP == ENB_FLAG_NO)
start_meas(&eNB_pdcp_stats[enb_mod_idP].validate_security);
else
start_meas(&UE_pdcp_stats[ue_mod_idP].validate_security);
pdcp_validate_security(pdcp_p,
srb_flagP,
rb_idP,
pdcp_header_len,
sequence_number,
sdu_buffer_pP->data,
sdu_buffer_sizeP - pdcp_tailer_len);
if (enb_flagP == ENB_FLAG_NO)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].validate_security);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].validate_security);
}
#endif
} else {
payload_offset=0;
}
#if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.otg_enabled == 1) {
module_id_t src_id, dst_id;
......
......@@ -124,7 +124,7 @@ CFLAGS += -DEXMIMO_IOT
endif
ifdef RRC_MSG_PRINT
CFLAG += ENABLE_RRG_MSG
CFLAG += -DRRC_MSG_PRINT
endif
CFLAGS += $(L2_incl) $(ENB_APP_incl) $(UTIL_incl) $(UTILS_incl)
......
......@@ -238,6 +238,7 @@ static uint32_t txgain[4] = {20,20,20,20};
static runmode_t mode;
static int rx_input_level_dBm;
static int log_messages=0;
#ifdef XFORMS
extern int otg_enabled;
static char do_forms=0;
......@@ -1119,7 +1120,7 @@ static void get_options (int argc, char **argv)
{"no-L2-connect", no_argument, NULL, LONG_OPTION_NO_L2_CONNECT},
{NULL, 0, NULL, 0}};
while ((c = getopt_long (argc, argv, "C:dF:K:qO:ST:UV",long_options,NULL)) != -1)
while ((c = getopt_long (argc, argv, "C:dF:K:qO:ST:UVR",long_options,NULL)) != -1)
{
switch (c)
{
......@@ -1255,10 +1256,12 @@ static void get_options (int argc, char **argv)
case 'V':
ouput_vcd = 1;
break;
/* case 'q':
case 'q':
opp_enabled = 1;
break;
*/
case 'R' :
log_messages =1;
break;
default:
break;
}
......@@ -1382,7 +1385,9 @@ int main(int argc, char **argv) {
set_comp_log(OSA, LOG_DEBUG, LOG_HIGH, 1);
#endif
#endif
set_comp_log(ENB_APP, LOG_INFO, LOG_HIGH, 1);;
set_comp_log(ENB_APP, LOG_INFO, LOG_HIGH, 1);
if (log_messages == 1)
set_component_filelog(RRC);
}
if (ouput_vcd) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment