Commit 371aa83f authored by Jean Flavien Bussotti's avatar Jean Flavien Bussotti

removed comments

parent 822a8287
...@@ -127,7 +127,7 @@ RAN_CONTEXT_t RC; ...@@ -127,7 +127,7 @@ RAN_CONTEXT_t RC;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
printf("1"); // printf("1");
int resQ; int resQ;
resQ=1; resQ=1;
/*if(argc < 2) /*if(argc < 2)
...@@ -137,9 +137,9 @@ int main(int argc, char *argv[]) ...@@ -137,9 +137,9 @@ int main(int argc, char *argv[])
resQ = atoi(argv[1]); resQ = atoi(argv[1]);
*/pool_buffer_init(); */pool_buffer_init();
list_init(&pdu_tx_list, NULL); list_init(&pdu_tx_list, NULL);
printf("2"); // printf("2");
logInit(); logInit();
printf("3"); // printf("3");
pdcp_el.next_pdcp_tx_sn = 0; pdcp_el.next_pdcp_tx_sn = 0;
pdcp_el.next_pdcp_rx_sn = 0; pdcp_el.next_pdcp_rx_sn = 0;
pdcp_el.tx_hfn = 0; pdcp_el.tx_hfn = 0;
...@@ -147,9 +147,9 @@ int main(int argc, char *argv[]) ...@@ -147,9 +147,9 @@ int main(int argc, char *argv[])
pdcp_el.last_submitted_pdcp_rx_sn = 4095; pdcp_el.last_submitted_pdcp_rx_sn = 4095;
pdcp_el.seq_num_size = 12; pdcp_el.seq_num_size = 12;
pdcp_el.cipheringAlgorithm = (resQ==1?EEA1_128_ALG_ID:EEA2_128_ALG_ID); pdcp_el.cipheringAlgorithm = (resQ==1?EEA1_128_ALG_ID:EEA2_128_ALG_ID);
printf("4"); // printf("4");
pdcp_init_seq_numbers(&pdcp_el); pdcp_init_seq_numbers(&pdcp_el);
printf("5"); // printf("5");
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
ctxt.module_id = 0 ; ctxt.module_id = 0 ;
ctxt.instance = 0; ctxt.instance = 0;
......
...@@ -133,7 +133,7 @@ boolean_t pdcp_data_req( ...@@ -133,7 +133,7 @@ boolean_t pdcp_data_req(
T(T_ENB_PDCP_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP)); T(T_ENB_PDCP_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP));
#endif #endif
printf("I'm here !\n"); // printf("I'm here !\n");
if (sdu_buffer_sizeP == 0) { if (sdu_buffer_sizeP == 0) {
LOG_W(PDCP, "Handed SDU is of size 0! Ignoring...\n"); LOG_W(PDCP, "Handed SDU is of size 0! Ignoring...\n");
return FALSE; return FALSE;
...@@ -144,7 +144,7 @@ boolean_t pdcp_data_req( ...@@ -144,7 +144,7 @@ boolean_t pdcp_data_req(
*/ */
AssertFatal(sdu_buffer_sizeP<= MAX_IP_PACKET_SIZE,"Requested SDU size (%d) is bigger than that can be handled by PDCP (%u)!\n", AssertFatal(sdu_buffer_sizeP<= MAX_IP_PACKET_SIZE,"Requested SDU size (%d) is bigger than that can be handled by PDCP (%u)!\n",
sdu_buffer_sizeP, MAX_IP_PACKET_SIZE); sdu_buffer_sizeP, MAX_IP_PACKET_SIZE);
printf("line 147 ok\n"); //printf("line 147 ok\n");
if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) { if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%ld/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ctxt_pP->module_id, ctxt_pP->rnti); AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%ld/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ctxt_pP->module_id, ctxt_pP->rnti);
} else { } else {
...@@ -154,7 +154,7 @@ boolean_t pdcp_data_req( ...@@ -154,7 +154,7 @@ boolean_t pdcp_data_req(
AssertError (rb_idP < LTE_maxDRB, return FALSE, "RB id is too high (%ld/%d) %u %u!\n", rb_idP, LTE_maxDRB, ctxt_pP->module_id, ctxt_pP->rnti); AssertError (rb_idP < LTE_maxDRB, return FALSE, "RB id is too high (%ld/%d) %u %u!\n", rb_idP, LTE_maxDRB, ctxt_pP->module_id, ctxt_pP->rnti);
} }
} }
printf("line 157 ok\n"); //printf("line 157 ok\n");
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP); key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p); h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
//MODIFIED BELOW TO TRY-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //MODIFIED BELOW TO TRY--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
...@@ -177,7 +177,7 @@ boolean_t pdcp_data_req( ...@@ -177,7 +177,7 @@ boolean_t pdcp_data_req(
} else { } else {
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].data_req); start_meas(&UE_pdcp_stats[ctxt_pP->module_id].data_req);
} }
printf("line 179 ok \n"); //printf("line 179 ok \n");
// PDCP transparent mode for MBMS traffic // PDCP transparent mode for MBMS traffic
if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) { if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
...@@ -210,7 +210,7 @@ boolean_t pdcp_data_req( ...@@ -210,7 +210,7 @@ boolean_t pdcp_data_req(
pdcp_header_len = PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE; pdcp_header_len = PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
pdcp_tailer_len = 0; pdcp_tailer_len = 0;
} }
printf("line 212 ok\n"); // printf("line 212 ok\n");
pdcp_pdu_size = sdu_buffer_sizeP + pdcp_header_len + pdcp_tailer_len; pdcp_pdu_size = sdu_buffer_sizeP + pdcp_header_len + pdcp_tailer_len;
LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT"Data request notification pdu size %d (header%d, trailer%d)\n", LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT"Data request notification pdu size %d (header%d, trailer%d)\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p), PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p),
...@@ -272,7 +272,7 @@ boolean_t pdcp_data_req( ...@@ -272,7 +272,7 @@ boolean_t pdcp_data_req(
/* /*
* Validate incoming sequence number, there might be a problem with PDCP initialization * Validate incoming sequence number, there might be a problem with PDCP initialization
*/ */
printf("line 273 ok\n"); // printf("line 273 ok\n");
//BELOW COMMENTED FOR TEST ################################################################################################################## //BELOW COMMENTED FOR TEST ##################################################################################################################
/* /*
if (current_sn > pdcp_calculate_max_seq_num_for_given_size(pdcp_p->seq_num_size)) { if (current_sn > pdcp_calculate_max_seq_num_for_given_size(pdcp_p->seq_num_size)) {
...@@ -291,7 +291,7 @@ boolean_t pdcp_data_req( ...@@ -291,7 +291,7 @@ boolean_t pdcp_data_req(
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT);
return FALSE; return FALSE;
} }
*/ printf("line 292 ok\n"); */// printf("line 292 ok\n");
LOG_D(PDCP, "Sequence number %d is assigned to current PDU\n", current_sn); LOG_D(PDCP, "Sequence number %d is assigned to current PDU\n", current_sn);
/* Then append data... */ /* Then append data... */
memcpy(&pdcp_pdu_p->data[pdcp_header_len], sdu_buffer_pP, sdu_buffer_sizeP); memcpy(&pdcp_pdu_p->data[pdcp_header_len], sdu_buffer_pP, sdu_buffer_sizeP);
...@@ -302,7 +302,7 @@ boolean_t pdcp_data_req( ...@@ -302,7 +302,7 @@ boolean_t pdcp_data_req(
for (i=0; i<pdcp_tailer_len; i++) { for (i=0; i<pdcp_tailer_len; i++) {
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP + i] = 0x00;// pdu_header.mac_i[i]; pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP + i] = 0x00;// pdu_header.mac_i[i];
} }
printf("Just before the if \n"); // printf("Just before the if \n");
//BELOW COMMENTED FOR TEST ################################################################################################################## //BELOW COMMENTED FOR TEST ##################################################################################################################
/* /*
...@@ -352,12 +352,12 @@ memcpy(K+3,stream_cipher->key+0,4); /*K[3] = key[0]; we assume ...@@ -352,12 +352,12 @@ memcpy(K+3,stream_cipher->key+0,4); /*K[3] = key[0]; we assume
} }
pdcp_p->kUPenc=keyTest; pdcp_p->kUPenc=keyTest;
printf("4\n"); //printf("4\n");
pdcp_init_seq_numbers(pdcp_p); pdcp_init_seq_numbers(pdcp_p);
printf("4bis\n"); //printf("4bis\n");
printf("apply sec fct\n"); // printf("apply sec fct\n");
pdcp_apply_security(ctxt_pP, pdcp_apply_security(ctxt_pP,
pdcp_p, pdcp_p,
srb_flagP, srb_flagP,
......
...@@ -147,7 +147,7 @@ pdcp_apply_security( ...@@ -147,7 +147,7 @@ pdcp_apply_security(
} else { } else {
LOG_D(PDCP, "[OSA][RB %ld] %s Applying user-plane security\n", LOG_D(PDCP, "[OSA][RB %ld] %s Applying user-plane security\n",
rb_id, (pdcp_pP->is_ue != 0) ? "UE -> eNB" : "eNB -> UE"); rb_id, (pdcp_pP->is_ue != 0) ? "UE -> eNB" : "eNB -> UE");
printf("line 150 pdcp_security\n"); //printf("line 150 pdcp_security\n");
encrypt_params.key = pdcp_pP->kUPenc;// + 128; encrypt_params.key = pdcp_pP->kUPenc;// + 128;
} }
...@@ -157,13 +157,13 @@ pdcp_apply_security( ...@@ -157,13 +157,13 @@ pdcp_apply_security(
buffer_encrypted = &pdcp_pdu_buffer[pdcp_header_len]; buffer_encrypted = &pdcp_pdu_buffer[pdcp_header_len];
/* Apply ciphering if any requested */ /* Apply ciphering if any requested */
printf("l160 pdcp_security.c\n"); //printf("l160 pdcp_security.c\n");
stream_encrypt(pdcp_pP->cipheringAlgorithm, stream_encrypt(pdcp_pP->cipheringAlgorithm,
&encrypt_params, &encrypt_params,
&buffer_encrypted); &buffer_encrypted);
printf("l163 pdcp_security.c\n"); //printf("l163 pdcp_security.c\n");
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);
printf("l165 before return pdcp_security.c\n"); //printf("l165 before return pdcp_security.c\n");
return 0; return 0;
} }
......
...@@ -77,15 +77,15 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out) ...@@ -77,15 +77,15 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out)
DevAssert(stream_cipher->key != NULL); DevAssert(stream_cipher->key != NULL);
DevAssert(stream_cipher->key_length == 16); DevAssert(stream_cipher->key_length == 16);
DevAssert(out != NULL); DevAssert(out != NULL);
printf("stream encrypt eea1 (osa stream eea l80\n"); //printf("stream encrypt eea1 (osa stream eea l80\n");
n = ( stream_cipher->blength + 31 ) / 32; n = ( stream_cipher->blength + 31 ) / 32;
zero_bit = stream_cipher->blength & 0x7; zero_bit = stream_cipher->blength & 0x7;
printf("osa stream eea l82\n"); //printf("osa stream eea l82\n");
memset(&snow_3g_context, 0, sizeof(snow_3g_context)); memset(&snow_3g_context, 0, sizeof(snow_3g_context));
/*Initialisation*/ /*Initialisation*/
/* Load the confidentiality key for SNOW 3G initialization as in section /* Load the confidentiality key for SNOW 3G initialization as in section
3.4. */ 3.4. */
printf("osa stream eea l88\n"); //printf("osa stream eea l88\n");
memcpy(K+3,stream_cipher->key+0,4); /*K[3] = key[0]; we assume memcpy(K+3,stream_cipher->key+0,4); /*K[3] = key[0]; we assume
K[3]=key[0]||key[1]||...||key[31] , with key[0] the K[3]=key[0]||key[1]||...||key[31] , with key[0] the
* most important bit of key*/ * most important bit of key*/
...@@ -94,7 +94,7 @@ printf("osa stream eea l88\n"); ...@@ -94,7 +94,7 @@ printf("osa stream eea l88\n");
memcpy(K+0,stream_cipher->key+12,4); /*K[0] = key[3]; we assume memcpy(K+0,stream_cipher->key+12,4); /*K[0] = key[3]; we assume
K[0]=key[96]||key[97]||...||key[127] , with key[127] the K[0]=key[96]||key[97]||...||key[127] , with key[127] the
* least important bit of key*/ * least important bit of key*/
printf("osa stream eea l97\n"); //printf("osa stream eea l97\n");
K[3] = hton_int32(K[3]); K[3] = hton_int32(K[3]);
K[2] = hton_int32(K[2]); K[2] = hton_int32(K[2]);
K[1] = hton_int32(K[1]); K[1] = hton_int32(K[1]);
...@@ -105,12 +105,12 @@ printf("osa stream eea l97\n"); ...@@ -105,12 +105,12 @@ printf("osa stream eea l97\n");
IV[2] = ((((uint32_t)stream_cipher->bearer) << 3) | ((((uint32_t)stream_cipher->direction) & 0x1) << 2)) << 24; IV[2] = ((((uint32_t)stream_cipher->bearer) << 3) | ((((uint32_t)stream_cipher->direction) & 0x1) << 2)) << 24;
IV[1] = IV[3]; IV[1] = IV[3];
IV[0] = IV[2]; IV[0] = IV[2];
printf("osa stream eea l106\n"); //printf("osa stream eea l106\n");
/* Run SNOW 3G algorithm to generate sequence of key stream bits KS*/ /* Run SNOW 3G algorithm to generate sequence of key stream bits KS*/
osa_snow3g_initialize(K, IV, &snow_3g_context); osa_snow3g_initialize(K, IV, &snow_3g_context);
KS = (uint32_t *)malloc(4*n); KS = (uint32_t *)malloc(4*n);
osa_snow3g_generate_key_stream(n,(uint32_t*)KS, &snow_3g_context); osa_snow3g_generate_key_stream(n,(uint32_t*)KS, &snow_3g_context);
printf("osa stream eea l113\n"); //printf("osa stream eea l113\n");
if (zero_bit > 0) { if (zero_bit > 0) {
KS[n - 1] = KS[n - 1] & (uint32_t)(0xFFFFFFFF << (8 - zero_bit)); KS[n - 1] = KS[n - 1] & (uint32_t)(0xFFFFFFFF << (8 - zero_bit));
...@@ -119,7 +119,7 @@ printf("osa stream eea l113\n"); ...@@ -119,7 +119,7 @@ printf("osa stream eea l113\n");
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
KS[i] = hton_int32(KS[i]); KS[i] = hton_int32(KS[i]);
} }
printf("osa stream eea l122\n"); //printf("osa stream eea l122\n");
/* Exclusive-OR the input data with keystream to generate the output bit /* Exclusive-OR the input data with keystream to generate the output bit
stream */ stream */
for (i=0; i<n*4; i++) { for (i=0; i<n*4; i++) {
...@@ -130,12 +130,12 @@ printf("osa stream eea l122\n"); ...@@ -130,12 +130,12 @@ printf("osa stream eea l122\n");
int ceil_index = (stream_cipher->blength+7) >> 3; int ceil_index = (stream_cipher->blength+7) >> 3;
stream_cipher->message[ceil_index - 1] = stream_cipher->message[ceil_index - 1] & (uint8_t)(0xFF << (8 - zero_bit)); stream_cipher->message[ceil_index - 1] = stream_cipher->message[ceil_index - 1] & (uint8_t)(0xFF << (8 - zero_bit));
} }
printf("osa stream eea l133\n"); //printf("osa stream eea l133\n");
free(KS); free(KS);
*out = stream_cipher->message; *out = stream_cipher->message;
printf("osa stream eea l136\n"); //printf("osa stream eea l136\n");
return 0; return 0;
} }
...@@ -231,15 +231,15 @@ printf("stream encrypt eea2 (osa stream eea l150\n"); ...@@ -231,15 +231,15 @@ printf("stream encrypt eea2 (osa stream eea l150\n");
int stream_encrypt(uint8_t algorithm, stream_cipher_t *stream_cipher, uint8_t **out) int stream_encrypt(uint8_t algorithm, stream_cipher_t *stream_cipher, uint8_t **out)
{ {
printf("l232 eea file\n"); //printf("l232 eea file\n");
if (algorithm == EEA0_ALG_ID) { if (algorithm == EEA0_ALG_ID) {
return stream_encrypt_eea0(stream_cipher, out); return stream_encrypt_eea0(stream_cipher, out);
} else if (algorithm == EEA1_128_ALG_ID) { } else if (algorithm == EEA1_128_ALG_ID) {
printf("before stream encrypt\n"); //printf("before stream encrypt\n");
int res= stream_encrypt_eea1(stream_cipher, out); int res= stream_encrypt_eea1(stream_cipher, out);
printf("after stream encrypt res=%d \n",res); //printf("after stream encrypt res=%d \n",res);
return res; return res;
} else if (algorithm == EEA2_128_ALG_ID) { } else if (algorithm == EEA2_128_ALG_ID) {
return stream_encrypt_eea2(stream_cipher, out); return stream_encrypt_eea2(stream_cipher, out);
......
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