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( ...@@ -475,7 +475,6 @@ boolean_t pdcp_data_ind(
sdu_list_p = &pdcp_sdu_list; sdu_list_p = &pdcp_sdu_list;
if (sdu_buffer_sizeP == 0) { if (sdu_buffer_sizeP == 0) {
LOG_W(PDCP, "SDU buffer size is zero! Ignoring this chunk!\n"); LOG_W(PDCP, "SDU buffer size is zero! Ignoring this chunk!\n");
if (enb_flagP) if (enb_flagP)
...@@ -485,39 +484,23 @@ boolean_t pdcp_data_ind( ...@@ -485,39 +484,23 @@ boolean_t pdcp_data_ind(
return FALSE; 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 * Parse the PDU placed at the beginning of SDU to check
* if incoming SN is in line with RX window * if incoming SN is in line with RX window
*/ */
if (MBMS_flagP == 0 ) { if (MBMS_flagP == 0 ) {
if (srb_flagP) { //SRB1/2 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); sequence_number = pdcp_get_sequence_number_of_pdu_with_SRB_sn((unsigned char*)sdu_buffer_pP->data);
} else { // DRB } else { // DRB
pdcp_tailer_len = 0;
if (pdcp_p->seq_num_size == PDCP_SN_7BIT){ 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); 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){ }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); sequence_number = pdcp_get_sequence_number_of_pdu_with_long_sn((unsigned char*)sdu_buffer_pP->data);
} else { } else {
//sequence_number = 4095; //sequence_number = 4095;
...@@ -525,7 +508,20 @@ boolean_t pdcp_data_ind( ...@@ -525,7 +508,20 @@ boolean_t pdcp_data_ind(
} }
//uint8_t dc = pdcp_get_dc_filed((unsigned char*)sdu_buffer_pP->data); //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) { 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); LOG_D(PDCP, "Incoming PDU has a sequence number (%d) in accordance with RX window\n", sequence_number);
/* if (dc == PDCP_DATA_PDU ) /* if (dc == PDCP_DATA_PDU )
...@@ -569,7 +565,7 @@ boolean_t pdcp_data_ind( ...@@ -569,7 +565,7 @@ boolean_t pdcp_data_ind(
} }
#endif #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, pdcp_rrc_data_ind(enb_mod_idP,
ue_mod_idP, ue_mod_idP,
frameP, frameP,
...@@ -585,17 +581,36 @@ boolean_t pdcp_data_ind( ...@@ -585,17 +581,36 @@ boolean_t pdcp_data_ind(
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind); stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return TRUE; 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 defined(ENABLE_SECURITY)
if (pdcp_p->security_activated == 1) { if (pdcp_p->security_activated == 1) {
pdcp_validate_security(pdcp_p, rb_idP % maxDRB, pdcp_header_len, if (enb_flagP == ENB_FLAG_NO)
sequence_number, sdu_buffer_pP->data, 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); 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 #endif
} else { } else {
payload_offset=0; payload_offset=0;
} }
#if defined(USER_MODE) && defined(OAI_EMU) #if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.otg_enabled == 1) { if (oai_emulation.info.otg_enabled == 1) {
module_id_t src_id, dst_id; module_id_t src_id, dst_id;
......
...@@ -124,7 +124,7 @@ CFLAGS += -DEXMIMO_IOT ...@@ -124,7 +124,7 @@ CFLAGS += -DEXMIMO_IOT
endif endif
ifdef RRC_MSG_PRINT ifdef RRC_MSG_PRINT
CFLAG += ENABLE_RRG_MSG CFLAG += -DRRC_MSG_PRINT
endif endif
CFLAGS += $(L2_incl) $(ENB_APP_incl) $(UTIL_incl) $(UTILS_incl) CFLAGS += $(L2_incl) $(ENB_APP_incl) $(UTIL_incl) $(UTILS_incl)
......
...@@ -238,6 +238,7 @@ static uint32_t txgain[4] = {20,20,20,20}; ...@@ -238,6 +238,7 @@ static uint32_t txgain[4] = {20,20,20,20};
static runmode_t mode; static runmode_t mode;
static int rx_input_level_dBm; static int rx_input_level_dBm;
static int log_messages=0;
#ifdef XFORMS #ifdef XFORMS
extern int otg_enabled; extern int otg_enabled;
static char do_forms=0; static char do_forms=0;
...@@ -1119,7 +1120,7 @@ static void get_options (int argc, char **argv) ...@@ -1119,7 +1120,7 @@ static void get_options (int argc, char **argv)
{"no-L2-connect", no_argument, NULL, LONG_OPTION_NO_L2_CONNECT}, {"no-L2-connect", no_argument, NULL, LONG_OPTION_NO_L2_CONNECT},
{NULL, 0, NULL, 0}}; {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) switch (c)
{ {
...@@ -1255,10 +1256,12 @@ static void get_options (int argc, char **argv) ...@@ -1255,10 +1256,12 @@ static void get_options (int argc, char **argv)
case 'V': case 'V':
ouput_vcd = 1; ouput_vcd = 1;
break; break;
/* case 'q': case 'q':
opp_enabled = 1; opp_enabled = 1;
break; break;
*/ case 'R' :
log_messages =1;
break;
default: default:
break; break;
} }
...@@ -1382,7 +1385,9 @@ int main(int argc, char **argv) { ...@@ -1382,7 +1385,9 @@ int main(int argc, char **argv) {
set_comp_log(OSA, LOG_DEBUG, LOG_HIGH, 1); set_comp_log(OSA, LOG_DEBUG, LOG_HIGH, 1);
#endif #endif
#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) { 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