aboutsummaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r--src/rps/gnunet-service-rps.c20
1 files changed, 10 insertions, 10 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