trace
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5857 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -59,14 +59,14 @@ uint32_t pdcp_get_next_count_tx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint1
|
|||||||
uint32_t count;
|
uint32_t count;
|
||||||
/* For TX COUNT = TX_HFN << length of SN | pdcp SN */
|
/* For TX COUNT = TX_HFN << length of SN | pdcp SN */
|
||||||
if (srb_flagP) {
|
if (srb_flagP) {
|
||||||
/* 5 bits length SN */
|
/* 5 bits length SN */
|
||||||
count = ((pdcp_entity->tx_hfn << 5) | (pdcp_sn & 0x001F));
|
count = ((pdcp_entity->tx_hfn << 5) | (pdcp_sn & 0x001F));
|
||||||
} else {
|
} else {
|
||||||
if (pdcp_entity->seq_num_size == PDCP_Config__rlc_UM__pdcp_SN_Size_len7bits) {
|
if (pdcp_entity->seq_num_size == PDCP_Config__rlc_UM__pdcp_SN_Size_len7bits) {
|
||||||
count = ((pdcp_entity->tx_hfn << 7) | (pdcp_sn & 0x07F));
|
count = ((pdcp_entity->tx_hfn << 7) | (pdcp_sn & 0x07F));
|
||||||
} else { /*Default is the 12 bits length SN */
|
} else { /*Default is the 12 bits length SN */
|
||||||
count = ((pdcp_entity->tx_hfn << 12) | (pdcp_sn & 0x0FFF));
|
count = ((pdcp_entity->tx_hfn << 12) | (pdcp_sn & 0x0FFF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG_D(PDCP, "[OSA] TX COUNT = 0x%08x\n", count);
|
LOG_D(PDCP, "[OSA] TX COUNT = 0x%08x\n", count);
|
||||||
|
|
||||||
@@ -79,17 +79,16 @@ uint32_t pdcp_get_next_count_rx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint1
|
|||||||
uint32_t count;
|
uint32_t count;
|
||||||
/* For RX COUNT = RX_HFN << length of SN | pdcp SN of received PDU */
|
/* For RX COUNT = RX_HFN << length of SN | pdcp SN of received PDU */
|
||||||
if (srb_flagP) {
|
if (srb_flagP) {
|
||||||
/* 5 bits length SN */
|
/* 5 bits length SN */
|
||||||
count = (((pdcp_entity->rx_hfn + pdcp_entity->rx_hfn_offset) << 5) | (pdcp_sn & 0x001F));
|
count = (((pdcp_entity->rx_hfn + pdcp_entity->rx_hfn_offset) << 5) | (pdcp_sn & 0x001F));
|
||||||
} else {
|
} else {
|
||||||
if (pdcp_entity->seq_num_size == PDCP_Config__rlc_UM__pdcp_SN_Size_len7bits) {
|
if (pdcp_entity->seq_num_size == PDCP_Config__rlc_UM__pdcp_SN_Size_len7bits) {
|
||||||
/* 7 bits length SN */
|
/* 7 bits length SN */
|
||||||
count = (((pdcp_entity->rx_hfn + pdcp_entity->rx_hfn_offset) << 7) | (pdcp_sn & 0x007F));
|
count = (((pdcp_entity->rx_hfn + pdcp_entity->rx_hfn_offset) << 7) | (pdcp_sn & 0x007F));
|
||||||
} else { // default
|
} else { // default
|
||||||
/* 12 bits length SN */
|
/* 12 bits length SN */
|
||||||
count = (((pdcp_entity->rx_hfn + pdcp_entity->rx_hfn_offset) << 12) | (pdcp_sn & 0x0FFF));
|
count = (((pdcp_entity->rx_hfn + pdcp_entity->rx_hfn_offset) << 12) | (pdcp_sn & 0x0FFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// reset the hfn offset
|
// reset the hfn offset
|
||||||
pdcp_entity->rx_hfn_offset =0;
|
pdcp_entity->rx_hfn_offset =0;
|
||||||
@@ -136,8 +135,8 @@ int pdcp_apply_security(pdcp_t *pdcp_entity,
|
|||||||
/* Both header and data parts are integrity protected for
|
/* Both header and data parts are integrity protected for
|
||||||
* control-plane PDUs */
|
* control-plane PDUs */
|
||||||
stream_compute_integrity(pdcp_entity->integrityProtAlgorithm,
|
stream_compute_integrity(pdcp_entity->integrityProtAlgorithm,
|
||||||
&encrypt_params,
|
&encrypt_params,
|
||||||
mac_i);
|
mac_i);
|
||||||
|
|
||||||
encrypt_params.key = pdcp_entity->kRRCenc; // + 128 // bit key
|
encrypt_params.key = pdcp_entity->kRRCenc; // + 128 // bit key
|
||||||
} else {
|
} else {
|
||||||
@@ -154,8 +153,8 @@ int pdcp_apply_security(pdcp_t *pdcp_entity,
|
|||||||
|
|
||||||
/* Apply ciphering if any requested */
|
/* Apply ciphering if any requested */
|
||||||
stream_encrypt(pdcp_entity->cipheringAlgorithm,
|
stream_encrypt(pdcp_entity->cipheringAlgorithm,
|
||||||
&encrypt_params,
|
&encrypt_params,
|
||||||
&buffer_encrypted);
|
&buffer_encrypted);
|
||||||
|
|
||||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_APPLY_SECURITY, VCD_FUNCTION_OUT);
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_APPLY_SECURITY, VCD_FUNCTION_OUT);
|
||||||
|
|
||||||
@@ -163,12 +162,12 @@ int pdcp_apply_security(pdcp_t *pdcp_entity,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int pdcp_validate_security(pdcp_t *pdcp_entity,
|
int pdcp_validate_security(pdcp_t *pdcp_entity,
|
||||||
srb_flag_t srb_flagP,
|
srb_flag_t srb_flagP,
|
||||||
rb_id_t rb_id,
|
rb_id_t rb_id,
|
||||||
uint8_t pdcp_header_len,
|
uint8_t pdcp_header_len,
|
||||||
uint16_t current_sn,
|
uint16_t current_sn,
|
||||||
uint8_t *pdcp_pdu_buffer,
|
uint8_t *pdcp_pdu_buffer,
|
||||||
uint16_t sdu_buffer_size)
|
uint16_t sdu_buffer_size)
|
||||||
{
|
{
|
||||||
uint8_t *buffer_decrypted = NULL;
|
uint8_t *buffer_decrypted = NULL;
|
||||||
stream_cipher_t decrypt_params;
|
stream_cipher_t decrypt_params;
|
||||||
@@ -214,7 +213,8 @@ int pdcp_validate_security(pdcp_t *pdcp_entity,
|
|||||||
&decrypt_params,
|
&decrypt_params,
|
||||||
&pdcp_pdu_buffer[sdu_buffer_size]) != 0)
|
&pdcp_pdu_buffer[sdu_buffer_size]) != 0)
|
||||||
{
|
{
|
||||||
LOG_E(PDCP, "[OSA] failed to validate MAC-I of incoming PDU\n");
|
LOG_E(PDCP, "[OSA][RB %d] %s failed to validate MAC-I of incoming PDU\n",
|
||||||
|
rb_id, (pdcp_entity->is_ue != 0) ? "UE" : "eNB");
|
||||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_FUNCTION_OUT);
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_FUNCTION_OUT);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user