aboutsummaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-service-rps.c20
-rw-r--r--src/rps/rps_api.c8
2 files changed, 14 insertions, 14 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 7a52a7dfe..bb2bd0881 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -393,7 +393,7 @@ rem_from_list (struct GNUNET_PeerIdentity **peer_list,
393 { 393 {
394 if (i < *list_size -1) 394 if (i < *list_size -1)
395 { /* Not at the last entry -- shift peers left */ 395 { /* Not at the last entry -- shift peers left */
396 memcpy (&tmp[i], &tmp[i +1], 396 GNUNET_memcpy (&tmp[i], &tmp[i +1],
397 ((*list_size) - i -1) * sizeof (struct GNUNET_PeerIdentity)); 397 ((*list_size) - i -1) * sizeof (struct GNUNET_PeerIdentity));
398 } 398 }
399 /* Remove last entry (should be now useless PeerID) */ 399 /* Remove last entry (should be now useless PeerID) */
@@ -555,7 +555,7 @@ est_request_rate()
555 if ( 1 < req_counter) 555 if ( 1 < req_counter)
556 { 556 {
557 /* Shift last request deltas to the right */ 557 /* Shift last request deltas to the right */
558 memcpy (&request_deltas[1], 558 GNUNET_memcpy (&request_deltas[1],
559 request_deltas, 559 request_deltas,
560 (req_counter - 1) * sizeof (struct GNUNET_TIME_Relative)); 560 (req_counter - 1) * sizeof (struct GNUNET_TIME_Relative));
561 561
@@ -654,7 +654,7 @@ send_pull_reply (const struct GNUNET_PeerIdentity *peer_id,
654 send_size * sizeof (struct GNUNET_PeerIdentity), 654 send_size * sizeof (struct GNUNET_PeerIdentity),
655 GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY); 655 GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY);
656 out_msg->num_peers = htonl (send_size); 656 out_msg->num_peers = htonl (send_size);
657 memcpy (&out_msg[1], peer_ids, 657 GNUNET_memcpy (&out_msg[1], peer_ids,
658 send_size * sizeof (struct GNUNET_PeerIdentity)); 658 send_size * sizeof (struct GNUNET_PeerIdentity));
659 659
660 Peers_send_message (peer_id, ev, "PULL REPLY"); 660 Peers_send_message (peer_id, ev, "PULL REPLY");
@@ -1018,7 +1018,7 @@ client_respond (void *cls,
1018 out_msg->num_peers = htonl (num_peers); 1018 out_msg->num_peers = htonl (num_peers);
1019 out_msg->id = htonl (reply_cls->id); 1019 out_msg->id = htonl (reply_cls->id);
1020 1020
1021 memcpy (&out_msg[1], 1021 GNUNET_memcpy (&out_msg[1],
1022 peer_ids, 1022 peer_ids,
1023 num_peers * sizeof (struct GNUNET_PeerIdentity)); 1023 num_peers * sizeof (struct GNUNET_PeerIdentity));
1024 GNUNET_free (peer_ids); 1024 GNUNET_free (peer_ids);
@@ -1151,7 +1151,7 @@ handle_client_seed (void *cls,
1151 num_peers = ntohl (in_msg->num_peers); 1151 num_peers = ntohl (in_msg->num_peers);
1152 peers = (struct GNUNET_PeerIdentity *) &in_msg[1]; 1152 peers = (struct GNUNET_PeerIdentity *) &in_msg[1];
1153 //peers = GNUNET_new_array (num_peers, struct GNUNET_PeerIdentity); 1153 //peers = GNUNET_new_array (num_peers, struct GNUNET_PeerIdentity);
1154 //memcpy (peers, &in_msg[1], num_peers * sizeof (struct GNUNET_PeerIdentity)); 1154 //GNUNET_memcpy (peers, &in_msg[1], num_peers * sizeof (struct GNUNET_PeerIdentity));
1155 1155
1156 if ((ntohs (message->size) - sizeof (struct GNUNET_RPS_CS_SeedMessage)) / 1156 if ((ntohs (message->size) - sizeof (struct GNUNET_RPS_CS_SeedMessage)) /
1157 sizeof (struct GNUNET_PeerIdentity) != num_peers) 1157 sizeof (struct GNUNET_PeerIdentity) != num_peers)
@@ -1219,7 +1219,7 @@ handle_peer_push (void *cls,
1219 struct AttackedPeer *tmp_att_peer; 1219 struct AttackedPeer *tmp_att_peer;
1220 1220
1221 tmp_att_peer = GNUNET_new (struct AttackedPeer); 1221 tmp_att_peer = GNUNET_new (struct AttackedPeer);
1222 memcpy (&tmp_att_peer->peer_id, peer, sizeof (struct GNUNET_PeerIdentity)); 1222 GNUNET_memcpy (&tmp_att_peer->peer_id, peer, sizeof (struct GNUNET_PeerIdentity));
1223 if (1 == mal_type 1223 if (1 == mal_type
1224 || 3 == mal_type) 1224 || 3 == mal_type)
1225 { /* Try to maximise representation */ 1225 { /* Try to maximise representation */
@@ -1594,7 +1594,7 @@ handle_client_act_malicious (void *cls,
1594 GNUNET_array_grow (mal_peers, 1594 GNUNET_array_grow (mal_peers,
1595 num_mal_peers, 1595 num_mal_peers,
1596 num_mal_peers + num_mal_peers_sent); 1596 num_mal_peers + num_mal_peers_sent);
1597 memcpy (&mal_peers[num_mal_peers_old], 1597 GNUNET_memcpy (&mal_peers[num_mal_peers_old],
1598 peers, 1598 peers,
1599 num_mal_peers_sent * sizeof (struct GNUNET_PeerIdentity)); 1599 num_mal_peers_sent * sizeof (struct GNUNET_PeerIdentity));
1600 1600
@@ -1621,7 +1621,7 @@ handle_client_act_malicious (void *cls,
1621 if (NULL != mal_peers && 1621 if (NULL != mal_peers &&
1622 0 != num_mal_peers) 1622 0 != num_mal_peers)
1623 { 1623 {
1624 memcpy (&mal_peers[num_mal_peers_old], 1624 GNUNET_memcpy (&mal_peers[num_mal_peers_old],
1625 peers, 1625 peers,
1626 num_mal_peers_sent * sizeof (struct GNUNET_PeerIdentity)); 1626 num_mal_peers_sent * sizeof (struct GNUNET_PeerIdentity));
1627 1627
@@ -1632,7 +1632,7 @@ handle_client_act_malicious (void *cls,
1632 } 1632 }
1633 1633
1634 /* Store the one attacked peer */ 1634 /* Store the one attacked peer */
1635 memcpy (&attacked_peer, 1635 GNUNET_memcpy (&attacked_peer,
1636 &in_msg->attacked_peer, 1636 &in_msg->attacked_peer,
1637 sizeof (struct GNUNET_PeerIdentity)); 1637 sizeof (struct GNUNET_PeerIdentity));
1638 /* Set the flag of the attacked peer to valid to avoid problems */ 1638 /* Set the flag of the attacked peer to valid to avoid problems */
@@ -1896,7 +1896,7 @@ do_round (void *cls)
1896 peers_to_clean = NULL; 1896 peers_to_clean = NULL;
1897 peers_to_clean_size = 0; 1897 peers_to_clean_size = 0;
1898 GNUNET_array_grow (peers_to_clean, peers_to_clean_size, View_size ()); 1898 GNUNET_array_grow (peers_to_clean, peers_to_clean_size, View_size ());
1899 memcpy (peers_to_clean, 1899 GNUNET_memcpy (peers_to_clean,
1900 view_array, 1900 view_array,
1901 View_size () * sizeof (struct GNUNET_PeerIdentity)); 1901 View_size () * sizeof (struct GNUNET_PeerIdentity));
1902 1902
diff --git a/src/rps/rps_api.c b/src/rps/rps_api.c
index 7b0d57d59..39fb0168b 100644
--- a/src/rps/rps_api.c
+++ b/src/rps/rps_api.c
@@ -339,7 +339,7 @@ GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h,
339 ev = GNUNET_MQ_msg_extra (msg, num_peers_max * sizeof (struct GNUNET_PeerIdentity), 339 ev = GNUNET_MQ_msg_extra (msg, num_peers_max * sizeof (struct GNUNET_PeerIdentity),
340 GNUNET_MESSAGE_TYPE_RPS_CS_SEED); 340 GNUNET_MESSAGE_TYPE_RPS_CS_SEED);
341 msg->num_peers = htonl (num_peers_max); 341 msg->num_peers = htonl (num_peers_max);
342 memcpy (&msg[1], tmp_peer_pointer, num_peers_max * sizeof (struct GNUNET_PeerIdentity)); 342 GNUNET_memcpy (&msg[1], tmp_peer_pointer, num_peers_max * sizeof (struct GNUNET_PeerIdentity));
343 GNUNET_MQ_send (h->mq, ev); 343 GNUNET_MQ_send (h->mq, ev);
344 344
345 n -= num_peers_max; 345 n -= num_peers_max;
@@ -352,7 +352,7 @@ GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h,
352 ev = GNUNET_MQ_msg_extra (msg, n * sizeof (struct GNUNET_PeerIdentity), 352 ev = GNUNET_MQ_msg_extra (msg, n * sizeof (struct GNUNET_PeerIdentity),
353 GNUNET_MESSAGE_TYPE_RPS_CS_SEED); 353 GNUNET_MESSAGE_TYPE_RPS_CS_SEED);
354 msg->num_peers = htonl (n); 354 msg->num_peers = htonl (n);
355 memcpy (&msg[1], tmp_peer_pointer, n * sizeof (struct GNUNET_PeerIdentity)); 355 GNUNET_memcpy (&msg[1], tmp_peer_pointer, n * sizeof (struct GNUNET_PeerIdentity));
356 356
357 GNUNET_MQ_send (h->mq, ev); 357 GNUNET_MQ_send (h->mq, ev);
358} 358}
@@ -421,7 +421,7 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h,
421 if ( (2 == type) || 421 if ( (2 == type) ||
422 (3 == type) ) 422 (3 == type) )
423 msg->attacked_peer = peer_ids[num_peers]; 423 msg->attacked_peer = peer_ids[num_peers];
424 memcpy (&msg[1], 424 GNUNET_memcpy (&msg[1],
425 tmp_peer_pointer, 425 tmp_peer_pointer,
426 num_peers_max * sizeof (struct GNUNET_PeerIdentity)); 426 num_peers_max * sizeof (struct GNUNET_PeerIdentity));
427 427
@@ -442,7 +442,7 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h,
442 if ( (2 == type) || 442 if ( (2 == type) ||
443 (3 == type) ) 443 (3 == type) )
444 msg->attacked_peer = *target_peer; 444 msg->attacked_peer = *target_peer;
445 memcpy (&msg[1], tmp_peer_pointer, num_peers * sizeof (struct GNUNET_PeerIdentity)); 445 GNUNET_memcpy (&msg[1], tmp_peer_pointer, num_peers * sizeof (struct GNUNET_PeerIdentity));
446 446
447 GNUNET_MQ_send (h->mq, ev); 447 GNUNET_MQ_send (h->mq, ev);
448} 448}