diff options
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/dht_api.c | 10 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht.c | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_clients.c | 36 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_hello.c | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 24 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_routing.c | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-wdht_clients.c | 28 | ||||
-rw-r--r-- | src/dht/gnunet-service-wdht_datacache.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-wdht_neighbours.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-xdht_clients.c | 28 | ||||
-rw-r--r-- | src/dht/gnunet-service-xdht_hello.c | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-xdht_neighbours.c | 70 | ||||
-rw-r--r-- | src/dht/gnunet-service-xdht_routing.c | 4 |
13 files changed, 108 insertions, 108 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index f67c1075f..0ada41662 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -291,7 +291,7 @@ send_get (struct GNUNET_DHT_GetHandle *gh) | |||
291 | get_msg->type = htonl (gh->type); | 291 | get_msg->type = htonl (gh->type); |
292 | get_msg->key = gh->key; | 292 | get_msg->key = gh->key; |
293 | get_msg->unique_id = gh->unique_id; | 293 | get_msg->unique_id = gh->unique_id; |
294 | memcpy (&get_msg[1], | 294 | GNUNET_memcpy (&get_msg[1], |
295 | &gh[1], | 295 | &gh[1], |
296 | gh->xquery_size); | 296 | gh->xquery_size); |
297 | GNUNET_MQ_send (h->mq, | 297 | GNUNET_MQ_send (h->mq, |
@@ -332,7 +332,7 @@ send_get_known_results (struct GNUNET_DHT_GetHandle *gh, | |||
332 | GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN); | 332 | GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN); |
333 | msg->key = gh->key; | 333 | msg->key = gh->key; |
334 | msg->unique_id = gh->unique_id; | 334 | msg->unique_id = gh->unique_id; |
335 | memcpy (&msg[1], | 335 | GNUNET_memcpy (&msg[1], |
336 | &gh->seen_results[transmission_offset], | 336 | &gh->seen_results[transmission_offset], |
337 | sizeof (struct GNUNET_HashCode) * delta); | 337 | sizeof (struct GNUNET_HashCode) * delta); |
338 | GNUNET_MQ_send (h->mq, | 338 | GNUNET_MQ_send (h->mq, |
@@ -1014,7 +1014,7 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, | |||
1014 | put_msg->unique_id = ph->unique_id; | 1014 | put_msg->unique_id = ph->unique_id; |
1015 | put_msg->expiration = GNUNET_TIME_absolute_hton (exp); | 1015 | put_msg->expiration = GNUNET_TIME_absolute_hton (exp); |
1016 | put_msg->key = *key; | 1016 | put_msg->key = *key; |
1017 | memcpy (&put_msg[1], | 1017 | GNUNET_memcpy (&put_msg[1], |
1018 | data, | 1018 | data, |
1019 | size); | 1019 | size); |
1020 | GNUNET_MQ_send (handle->mq, | 1020 | GNUNET_MQ_send (handle->mq, |
@@ -1098,7 +1098,7 @@ GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, | |||
1098 | gh->desired_replication_level = desired_replication_level; | 1098 | gh->desired_replication_level = desired_replication_level; |
1099 | gh->type = type; | 1099 | gh->type = type; |
1100 | gh->options = options; | 1100 | gh->options = options; |
1101 | memcpy (&gh[1], | 1101 | GNUNET_memcpy (&gh[1], |
1102 | xquery, | 1102 | xquery, |
1103 | xquery_size); | 1103 | xquery_size); |
1104 | GNUNET_CONTAINER_multihashmap_put (handle->active_requests, | 1104 | GNUNET_CONTAINER_multihashmap_put (handle->active_requests, |
@@ -1135,7 +1135,7 @@ GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle, | |||
1135 | GNUNET_array_grow (get_handle->seen_results, | 1135 | GNUNET_array_grow (get_handle->seen_results, |
1136 | get_handle->seen_results_size, | 1136 | get_handle->seen_results_size, |
1137 | needed); | 1137 | needed); |
1138 | memcpy (&get_handle->seen_results[get_handle->seen_results_end], | 1138 | GNUNET_memcpy (&get_handle->seen_results[get_handle->seen_results_end], |
1139 | results, | 1139 | results, |
1140 | num_results * sizeof (struct GNUNET_HashCode)); | 1140 | num_results * sizeof (struct GNUNET_HashCode)); |
1141 | get_handle->seen_results_end += num_results; | 1141 | get_handle->seen_results_end += num_results; |
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index e3b9d59a4..9de76ab7a 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -90,7 +90,7 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message) | |||
90 | GNUNET_assert (message != NULL); | 90 | GNUNET_assert (message != NULL); |
91 | GNUNET_free_non_null (GDS_my_hello); | 91 | GNUNET_free_non_null (GDS_my_hello); |
92 | GDS_my_hello = GNUNET_malloc (ntohs (message->size)); | 92 | GDS_my_hello = GNUNET_malloc (ntohs (message->size)); |
93 | memcpy (GDS_my_hello, message, ntohs (message->size)); | 93 | GNUNET_memcpy (GDS_my_hello, message, ntohs (message->size)); |
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index b508df68a..2e8d309db 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c | |||
@@ -61,7 +61,7 @@ struct PendingMessage | |||
61 | /** | 61 | /** |
62 | * Actual message to be sent, allocated at the end of the struct: | 62 | * Actual message to be sent, allocated at the end of the struct: |
63 | * // msg = (cast) &pm[1]; | 63 | * // msg = (cast) &pm[1]; |
64 | * // memcpy (&pm[1], data, len); | 64 | * // GNUNET_memcpy (&pm[1], data, len); |
65 | */ | 65 | */ |
66 | const struct GNUNET_MessageHeader *msg; | 66 | const struct GNUNET_MessageHeader *msg; |
67 | 67 | ||
@@ -604,7 +604,7 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client, | |||
604 | cqr->key = get->key; | 604 | cqr->key = get->key; |
605 | cqr->client = find_active_client (client); | 605 | cqr->client = find_active_client (client); |
606 | cqr->xquery = (void *) &cqr[1]; | 606 | cqr->xquery = (void *) &cqr[1]; |
607 | memcpy (&cqr[1], xquery, xquery_size); | 607 | GNUNET_memcpy (&cqr[1], xquery, xquery_size); |
608 | cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); | 608 | cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); |
609 | cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; | 609 | cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; |
610 | cqr->retry_time = GNUNET_TIME_absolute_get (); | 610 | cqr->retry_time = GNUNET_TIME_absolute_get (); |
@@ -725,7 +725,7 @@ handle_dht_local_get_result_seen (void *cls, struct GNUNET_SERVER_Client *client | |||
725 | GNUNET_array_grow (cqr->seen_replies, | 725 | GNUNET_array_grow (cqr->seen_replies, |
726 | cqr->seen_replies_count, | 726 | cqr->seen_replies_count, |
727 | cqr->seen_replies_count + hash_count); | 727 | cqr->seen_replies_count + hash_count); |
728 | memcpy (&cqr->seen_replies[old_count], | 728 | GNUNET_memcpy (&cqr->seen_replies[old_count], |
729 | hc, | 729 | hc, |
730 | sizeof (struct GNUNET_HashCode) * hash_count); | 730 | sizeof (struct GNUNET_HashCode) * hash_count); |
731 | } | 731 | } |
@@ -834,7 +834,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client, | |||
834 | else | 834 | else |
835 | { | 835 | { |
836 | r->key = GNUNET_new (struct GNUNET_HashCode); | 836 | r->key = GNUNET_new (struct GNUNET_HashCode); |
837 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); | 837 | GNUNET_memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); |
838 | } | 838 | } |
839 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); | 839 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); |
840 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 840 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -926,7 +926,7 @@ send_reply_to_client (void *cls, size_t size, void *buf) | |||
926 | { | 926 | { |
927 | GNUNET_CONTAINER_DLL_remove (client->pending_head, client->pending_tail, | 927 | GNUNET_CONTAINER_DLL_remove (client->pending_head, client->pending_tail, |
928 | reply); | 928 | reply); |
929 | memcpy (&cbuf[off], reply->msg, msize); | 929 | GNUNET_memcpy (&cbuf[off], reply->msg, msize); |
930 | GNUNET_free (reply); | 930 | GNUNET_free (reply); |
931 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 931 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
932 | "Transmitting %u bytes to client %p\n", | 932 | "Transmitting %u bytes to client %p\n", |
@@ -1117,7 +1117,7 @@ forward_reply (void *cls, | |||
1117 | /* two clients waiting for same reply, must copy for queueing */ | 1117 | /* two clients waiting for same reply, must copy for queueing */ |
1118 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + | 1118 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + |
1119 | ntohs (frc->pm->msg->size)); | 1119 | ntohs (frc->pm->msg->size)); |
1120 | memcpy (pm, frc->pm, | 1120 | GNUNET_memcpy (pm, frc->pm, |
1121 | sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); | 1121 | sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); |
1122 | pm->next = pm->prev = NULL; | 1122 | pm->next = pm->prev = NULL; |
1123 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; | 1123 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; |
@@ -1204,11 +1204,11 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | |||
1204 | reply->expiration = GNUNET_TIME_absolute_hton (expiration); | 1204 | reply->expiration = GNUNET_TIME_absolute_hton (expiration); |
1205 | reply->key = *key; | 1205 | reply->key = *key; |
1206 | paths = (struct GNUNET_PeerIdentity *) &reply[1]; | 1206 | paths = (struct GNUNET_PeerIdentity *) &reply[1]; |
1207 | memcpy (paths, put_path, | 1207 | GNUNET_memcpy (paths, put_path, |
1208 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); | 1208 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); |
1209 | memcpy (&paths[put_path_length], get_path, | 1209 | GNUNET_memcpy (&paths[put_path_length], get_path, |
1210 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); | 1210 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); |
1211 | memcpy (&paths[get_path_length + put_path_length], data, data_size); | 1211 | GNUNET_memcpy (&paths[get_path_length + put_path_length], data, data_size); |
1212 | frc.do_copy = GNUNET_NO; | 1212 | frc.do_copy = GNUNET_NO; |
1213 | frc.pm = pm; | 1213 | frc.pm = pm; |
1214 | frc.data = data; | 1214 | frc.data = data; |
@@ -1291,10 +1291,10 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
1291 | mmsg->hop_count = htonl(hop_count); | 1291 | mmsg->hop_count = htonl(hop_count); |
1292 | mmsg->desired_replication_level = htonl(desired_replication_level); | 1292 | mmsg->desired_replication_level = htonl(desired_replication_level); |
1293 | mmsg->get_path_length = htonl(path_length); | 1293 | mmsg->get_path_length = htonl(path_length); |
1294 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 1294 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1295 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 1295 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
1296 | if (path_length > 0) | 1296 | if (path_length > 0) |
1297 | memcpy (msg_path, path, | 1297 | GNUNET_memcpy (msg_path, path, |
1298 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 1298 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
1299 | add_pending_message (m->client, pm); | 1299 | add_pending_message (m->client, pm); |
1300 | } | 1300 | } |
@@ -1370,17 +1370,17 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
1370 | path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 1370 | path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
1371 | if (put_path_length > 0) | 1371 | if (put_path_length > 0) |
1372 | { | 1372 | { |
1373 | memcpy (path, put_path, | 1373 | GNUNET_memcpy (path, put_path, |
1374 | put_path_length * sizeof (struct GNUNET_PeerIdentity)); | 1374 | put_path_length * sizeof (struct GNUNET_PeerIdentity)); |
1375 | path = &path[put_path_length]; | 1375 | path = &path[put_path_length]; |
1376 | } | 1376 | } |
1377 | if (get_path_length > 0) | 1377 | if (get_path_length > 0) |
1378 | memcpy (path, get_path, | 1378 | GNUNET_memcpy (path, get_path, |
1379 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 1379 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
1380 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 1380 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
1381 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 1381 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1382 | if (size > 0) | 1382 | if (size > 0) |
1383 | memcpy (&path[get_path_length], data, size); | 1383 | GNUNET_memcpy (&path[get_path_length], data, size); |
1384 | add_pending_message (m->client, pm); | 1384 | add_pending_message (m->client, pm); |
1385 | } | 1385 | } |
1386 | } | 1386 | } |
@@ -1458,14 +1458,14 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
1458 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 1458 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
1459 | if (path_length > 0) | 1459 | if (path_length > 0) |
1460 | { | 1460 | { |
1461 | memcpy (msg_path, | 1461 | GNUNET_memcpy (msg_path, |
1462 | path, | 1462 | path, |
1463 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 1463 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
1464 | } | 1464 | } |
1465 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 1465 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
1466 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 1466 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1467 | if (size > 0) | 1467 | if (size > 0) |
1468 | memcpy (&msg_path[path_length], data, size); | 1468 | GNUNET_memcpy (&msg_path[path_length], data, size); |
1469 | add_pending_message (m->client, pm); | 1469 | add_pending_message (m->client, pm); |
1470 | } | 1470 | } |
1471 | } | 1471 | } |
diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c index 0e7e4dec5..3716ea3af 100644 --- a/src/dht/gnunet-service-dht_hello.c +++ b/src/dht/gnunet-service-dht_hello.c | |||
@@ -86,7 +86,7 @@ process_hello (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
86 | hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer); | 86 | hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer); |
87 | GNUNET_free_non_null (hm); | 87 | GNUNET_free_non_null (hm); |
88 | hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); | 88 | hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); |
89 | memcpy (hm, hello, GNUNET_HELLO_size (hello)); | 89 | GNUNET_memcpy (hm, hello, GNUNET_HELLO_size (hello)); |
90 | GNUNET_assert (GNUNET_SYSERR != | 90 | GNUNET_assert (GNUNET_SYSERR != |
91 | GNUNET_CONTAINER_multipeermap_put (peer_to_hello, | 91 | GNUNET_CONTAINER_multipeermap_put (peer_to_hello, |
92 | peer, hm, | 92 | peer, hm, |
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index b24a95ab2..b7a2f89a2 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -283,7 +283,7 @@ struct P2PPendingMessage | |||
283 | /** | 283 | /** |
284 | * Actual message to be sent, allocated at the end of the struct: | 284 | * Actual message to be sent, allocated at the end of the struct: |
285 | * // msg = (cast) &pm[1]; | 285 | * // msg = (cast) &pm[1]; |
286 | * // memcpy (&pm[1], data, len); | 286 | * // GNUNET_memcpy (&pm[1], data, len); |
287 | */ | 287 | */ |
288 | const struct GNUNET_MessageHeader *msg; | 288 | const struct GNUNET_MessageHeader *msg; |
289 | 289 | ||
@@ -993,7 +993,7 @@ core_transmit_notify (void *cls, | |||
993 | "Transmitting message of type %u to %s\n", | 993 | "Transmitting message of type %u to %s\n", |
994 | ntohs (pending->msg->type), | 994 | ntohs (pending->msg->type), |
995 | GNUNET_i2s (&peer->id)); | 995 | GNUNET_i2s (&peer->id)); |
996 | memcpy (&cbuf[off], | 996 | GNUNET_memcpy (&cbuf[off], |
997 | pending->msg, | 997 | pending->msg, |
998 | msize); | 998 | msize); |
999 | off += msize; | 999 | off += msize; |
@@ -1560,9 +1560,9 @@ GDS_NEIGHBOURS_handle_put (enum GNUNET_BLOCK_Type type, | |||
1560 | DHT_BLOOM_SIZE)); | 1560 | DHT_BLOOM_SIZE)); |
1561 | ppm->key = *key; | 1561 | ppm->key = *key; |
1562 | pp = (struct GNUNET_PeerIdentity *) &ppm[1]; | 1562 | pp = (struct GNUNET_PeerIdentity *) &ppm[1]; |
1563 | memcpy (pp, put_path, | 1563 | GNUNET_memcpy (pp, put_path, |
1564 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); | 1564 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); |
1565 | memcpy (&pp[put_path_length], | 1565 | GNUNET_memcpy (&pp[put_path_length], |
1566 | data, | 1566 | data, |
1567 | data_size); | 1567 | data_size); |
1568 | GNUNET_CONTAINER_DLL_insert_tail (target->head, | 1568 | GNUNET_CONTAINER_DLL_insert_tail (target->head, |
@@ -1693,7 +1693,7 @@ GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type, | |||
1693 | DHT_BLOOM_SIZE)); | 1693 | DHT_BLOOM_SIZE)); |
1694 | pgm->key = *key; | 1694 | pgm->key = *key; |
1695 | xq = (char *) &pgm[1]; | 1695 | xq = (char *) &pgm[1]; |
1696 | memcpy (xq, xquery, xquery_size); | 1696 | GNUNET_memcpy (xq, xquery, xquery_size); |
1697 | if (NULL != reply_bf) | 1697 | if (NULL != reply_bf) |
1698 | GNUNET_assert (GNUNET_OK == | 1698 | GNUNET_assert (GNUNET_OK == |
1699 | GNUNET_CONTAINER_bloomfilter_get_raw_data (reply_bf, | 1699 | GNUNET_CONTAINER_bloomfilter_get_raw_data (reply_bf, |
@@ -1804,13 +1804,13 @@ GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target, | |||
1804 | prm->expiration_time = GNUNET_TIME_absolute_hton (expiration_time); | 1804 | prm->expiration_time = GNUNET_TIME_absolute_hton (expiration_time); |
1805 | prm->key = *key; | 1805 | prm->key = *key; |
1806 | paths = (struct GNUNET_PeerIdentity *) &prm[1]; | 1806 | paths = (struct GNUNET_PeerIdentity *) &prm[1]; |
1807 | memcpy (paths, | 1807 | GNUNET_memcpy (paths, |
1808 | put_path, | 1808 | put_path, |
1809 | put_path_length * sizeof (struct GNUNET_PeerIdentity)); | 1809 | put_path_length * sizeof (struct GNUNET_PeerIdentity)); |
1810 | memcpy (&paths[put_path_length], | 1810 | GNUNET_memcpy (&paths[put_path_length], |
1811 | get_path, | 1811 | get_path, |
1812 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 1812 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
1813 | memcpy (&paths[put_path_length + get_path_length], | 1813 | GNUNET_memcpy (&paths[put_path_length + get_path_length], |
1814 | data, | 1814 | data, |
1815 | data_size); | 1815 | data_size); |
1816 | GNUNET_CONTAINER_DLL_insert (pi->head, | 1816 | GNUNET_CONTAINER_DLL_insert (pi->head, |
@@ -1983,7 +1983,7 @@ handle_dht_p2p_put (void *cls, | |||
1983 | /* extend 'put path' by sender */ | 1983 | /* extend 'put path' by sender */ |
1984 | if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE)) | 1984 | if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE)) |
1985 | { | 1985 | { |
1986 | memcpy (pp, put_path, putlen * sizeof (struct GNUNET_PeerIdentity)); | 1986 | GNUNET_memcpy (pp, put_path, putlen * sizeof (struct GNUNET_PeerIdentity)); |
1987 | pp[putlen] = *peer; | 1987 | pp[putlen] = *peer; |
1988 | putlen++; | 1988 | putlen++; |
1989 | } | 1989 | } |
@@ -2401,7 +2401,7 @@ handle_dht_p2p_result (void *cls, | |||
2401 | { | 2401 | { |
2402 | struct GNUNET_PeerIdentity xget_path[get_path_length + 1]; | 2402 | struct GNUNET_PeerIdentity xget_path[get_path_length + 1]; |
2403 | 2403 | ||
2404 | memcpy (xget_path, | 2404 | GNUNET_memcpy (xget_path, |
2405 | get_path, | 2405 | get_path, |
2406 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 2406 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
2407 | xget_path[get_path_length] = *peer; | 2407 | xget_path[get_path_length] = *peer; |
@@ -2429,8 +2429,8 @@ handle_dht_p2p_result (void *cls, | |||
2429 | { | 2429 | { |
2430 | struct GNUNET_PeerIdentity xput_path[get_path_length + 1 + put_path_length]; | 2430 | struct GNUNET_PeerIdentity xput_path[get_path_length + 1 + put_path_length]; |
2431 | 2431 | ||
2432 | memcpy (xput_path, put_path, put_path_length * sizeof (struct GNUNET_PeerIdentity)); | 2432 | GNUNET_memcpy (xput_path, put_path, put_path_length * sizeof (struct GNUNET_PeerIdentity)); |
2433 | memcpy (&xput_path[put_path_length], | 2433 | GNUNET_memcpy (&xput_path[put_path_length], |
2434 | xget_path, | 2434 | xget_path, |
2435 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 2435 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
2436 | 2436 | ||
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c index bda43d435..d078c865d 100644 --- a/src/dht/gnunet-service-dht_routing.c +++ b/src/dht/gnunet-service-dht_routing.c | |||
@@ -412,7 +412,7 @@ GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender, | |||
412 | recent_req->type = type; | 412 | recent_req->type = type; |
413 | recent_req->options = options; | 413 | recent_req->options = options; |
414 | recent_req->xquery = &recent_req[1]; | 414 | recent_req->xquery = &recent_req[1]; |
415 | memcpy (&recent_req[1], xquery, xquery_size); | 415 | GNUNET_memcpy (&recent_req[1], xquery, xquery_size); |
416 | recent_req->xquery_size = xquery_size; | 416 | recent_req->xquery_size = xquery_size; |
417 | recent_req->reply_bf_mutator = reply_bf_mutator; | 417 | recent_req->reply_bf_mutator = reply_bf_mutator; |
418 | if (GNUNET_SYSERR == | 418 | if (GNUNET_SYSERR == |
diff --git a/src/dht/gnunet-service-wdht_clients.c b/src/dht/gnunet-service-wdht_clients.c index 6d5c477ad..2d9730b08 100644 --- a/src/dht/gnunet-service-wdht_clients.c +++ b/src/dht/gnunet-service-wdht_clients.c | |||
@@ -64,7 +64,7 @@ struct PendingMessage | |||
64 | /** | 64 | /** |
65 | * Actual message to be sent, allocated at the end of the struct: | 65 | * Actual message to be sent, allocated at the end of the struct: |
66 | * // msg = (cast) &pm[1]; | 66 | * // msg = (cast) &pm[1]; |
67 | * // memcpy (&pm[1], data, len); | 67 | * // GNUNET_memcpy (&pm[1], data, len); |
68 | */ | 68 | */ |
69 | const struct GNUNET_MessageHeader *msg; | 69 | const struct GNUNET_MessageHeader *msg; |
70 | 70 | ||
@@ -316,7 +316,7 @@ send_reply_to_client (void *cls, size_t size, void *buf) | |||
316 | { | 316 | { |
317 | GNUNET_CONTAINER_DLL_remove (client->pending_head, client->pending_tail, | 317 | GNUNET_CONTAINER_DLL_remove (client->pending_head, client->pending_tail, |
318 | reply); | 318 | reply); |
319 | memcpy (&cbuf[off], reply->msg, msize); | 319 | GNUNET_memcpy (&cbuf[off], reply->msg, msize); |
320 | GNUNET_free (reply); | 320 | GNUNET_free (reply); |
321 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 321 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
322 | "Transmitting %u bytes to client %p\n", | 322 | "Transmitting %u bytes to client %p\n", |
@@ -580,7 +580,7 @@ forward_reply (void *cls, | |||
580 | /* two clients waiting for same reply, must copy for queueing */ | 580 | /* two clients waiting for same reply, must copy for queueing */ |
581 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + | 581 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + |
582 | ntohs (frc->pm->msg->size)); | 582 | ntohs (frc->pm->msg->size)); |
583 | memcpy (pm, frc->pm, | 583 | GNUNET_memcpy (pm, frc->pm, |
584 | sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); | 584 | sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); |
585 | pm->next = pm->prev = NULL; | 585 | pm->next = pm->prev = NULL; |
586 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; | 586 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; |
@@ -666,11 +666,11 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | |||
666 | reply->expiration = GNUNET_TIME_absolute_hton (expiration); | 666 | reply->expiration = GNUNET_TIME_absolute_hton (expiration); |
667 | reply->key = *key; | 667 | reply->key = *key; |
668 | paths = (struct GNUNET_PeerIdentity *) &reply[1]; | 668 | paths = (struct GNUNET_PeerIdentity *) &reply[1]; |
669 | memcpy (paths, put_path, | 669 | GNUNET_memcpy (paths, put_path, |
670 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); | 670 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); |
671 | memcpy (&paths[put_path_length], get_path, | 671 | GNUNET_memcpy (&paths[put_path_length], get_path, |
672 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); | 672 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); |
673 | memcpy (&paths[get_path_length + put_path_length], data, data_size); | 673 | GNUNET_memcpy (&paths[get_path_length + put_path_length], data, data_size); |
674 | frc.do_copy = GNUNET_NO; | 674 | frc.do_copy = GNUNET_NO; |
675 | frc.pm = pm; | 675 | frc.pm = pm; |
676 | frc.data = data; | 676 | frc.data = data; |
@@ -750,10 +750,10 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
750 | mmsg->hop_count = htonl(hop_count); | 750 | mmsg->hop_count = htonl(hop_count); |
751 | mmsg->desired_replication_level = htonl(desired_replication_level); | 751 | mmsg->desired_replication_level = htonl(desired_replication_level); |
752 | mmsg->get_path_length = htonl(path_length); | 752 | mmsg->get_path_length = htonl(path_length); |
753 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 753 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
754 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 754 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
755 | if (path_length > 0) | 755 | if (path_length > 0) |
756 | memcpy (msg_path, path, | 756 | GNUNET_memcpy (msg_path, path, |
757 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 757 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
758 | add_pending_message (m->client, pm); | 758 | add_pending_message (m->client, pm); |
759 | } | 759 | } |
@@ -832,13 +832,13 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
832 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 832 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
833 | if (path_length > 0) | 833 | if (path_length > 0) |
834 | { | 834 | { |
835 | memcpy (msg_path, path, | 835 | GNUNET_memcpy (msg_path, path, |
836 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 836 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
837 | } | 837 | } |
838 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 838 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
839 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 839 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
840 | if (size > 0) | 840 | if (size > 0) |
841 | memcpy (&msg_path[path_length], data, size); | 841 | GNUNET_memcpy (&msg_path[path_length], data, size); |
842 | add_pending_message (m->client, pm); | 842 | add_pending_message (m->client, pm); |
843 | } | 843 | } |
844 | } | 844 | } |
@@ -1015,7 +1015,7 @@ handle_dht_local_get (void *cls, | |||
1015 | cqr->key = get->key; | 1015 | cqr->key = get->key; |
1016 | cqr->client = find_active_client (client); | 1016 | cqr->client = find_active_client (client); |
1017 | cqr->xquery = (void *) &cqr[1]; | 1017 | cqr->xquery = (void *) &cqr[1]; |
1018 | memcpy (&cqr[1], xquery, xquery_size); | 1018 | GNUNET_memcpy (&cqr[1], xquery, xquery_size); |
1019 | cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); | 1019 | cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); |
1020 | cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; | 1020 | cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; |
1021 | cqr->retry_time = GNUNET_TIME_absolute_get (); | 1021 | cqr->retry_time = GNUNET_TIME_absolute_get (); |
@@ -1141,7 +1141,7 @@ handle_dht_local_get_result_seen (void *cls, | |||
1141 | GNUNET_array_grow (cqr->seen_replies, | 1141 | GNUNET_array_grow (cqr->seen_replies, |
1142 | cqr->seen_replies_count, | 1142 | cqr->seen_replies_count, |
1143 | cqr->seen_replies_count + hash_count); | 1143 | cqr->seen_replies_count + hash_count); |
1144 | memcpy (&cqr->seen_replies[old_count], | 1144 | GNUNET_memcpy (&cqr->seen_replies[old_count], |
1145 | hc, | 1145 | hc, |
1146 | sizeof (struct GNUNET_HashCode) * hash_count); | 1146 | sizeof (struct GNUNET_HashCode) * hash_count); |
1147 | } | 1147 | } |
@@ -1253,7 +1253,7 @@ handle_dht_local_monitor (void *cls, | |||
1253 | else | 1253 | else |
1254 | { | 1254 | { |
1255 | r->key = GNUNET_new (struct GNUNET_HashCode); | 1255 | r->key = GNUNET_new (struct GNUNET_HashCode); |
1256 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); | 1256 | GNUNET_memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); |
1257 | } | 1257 | } |
1258 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); | 1258 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); |
1259 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1259 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
diff --git a/src/dht/gnunet-service-wdht_datacache.c b/src/dht/gnunet-service-wdht_datacache.c index d739c6bdd..40d54bf5a 100644 --- a/src/dht/gnunet-service-wdht_datacache.c +++ b/src/dht/gnunet-service-wdht_datacache.c | |||
@@ -87,10 +87,10 @@ GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration, | |||
87 | GNUNET_break (0); | 87 | GNUNET_break (0); |
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | memcpy (path, | 90 | GNUNET_memcpy (path, |
91 | put_path, | 91 | put_path, |
92 | put_path_length * sizeof (struct GNUNET_PeerIdentity)); | 92 | put_path_length * sizeof (struct GNUNET_PeerIdentity)); |
93 | memcpy (&path[put_path_length], | 93 | GNUNET_memcpy (&path[put_path_length], |
94 | get_path, | 94 | get_path, |
95 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 95 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
96 | /* Put size is actual data size plus struct overhead plus path length (if any) */ | 96 | /* Put size is actual data size plus struct overhead plus path length (if any) */ |
diff --git a/src/dht/gnunet-service-wdht_neighbours.c b/src/dht/gnunet-service-wdht_neighbours.c index 54c52507e..6f5b93c7c 100644 --- a/src/dht/gnunet-service-wdht_neighbours.c +++ b/src/dht/gnunet-service-wdht_neighbours.c | |||
@@ -761,12 +761,12 @@ forward_message_on_trail (struct FriendInfo *next_target, | |||
761 | new_path = (struct GNUNET_PeerIdentity *) &trm[1]; | 761 | new_path = (struct GNUNET_PeerIdentity *) &trm[1]; |
762 | if (have_path) | 762 | if (have_path) |
763 | { | 763 | { |
764 | memcpy (new_path, | 764 | GNUNET_memcpy (new_path, |
765 | path, | 765 | path, |
766 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 766 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
767 | new_path[path_length] = *predecessor; | 767 | new_path[path_length] = *predecessor; |
768 | } | 768 | } |
769 | memcpy (&new_path[plen], | 769 | GNUNET_memcpy (&new_path[plen], |
770 | payload, | 770 | payload, |
771 | payload_len); | 771 | payload_len); |
772 | GNUNET_MQ_send (next_target->mq, | 772 | GNUNET_MQ_send (next_target->mq, |
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c index 2de3576b7..9e489b6d9 100644 --- a/src/dht/gnunet-service-xdht_clients.c +++ b/src/dht/gnunet-service-xdht_clients.c | |||
@@ -64,7 +64,7 @@ struct PendingMessage | |||
64 | /** | 64 | /** |
65 | * Actual message to be sent, allocated at the end of the struct: | 65 | * Actual message to be sent, allocated at the end of the struct: |
66 | * // msg = (cast) &pm[1]; | 66 | * // msg = (cast) &pm[1]; |
67 | * // memcpy (&pm[1], data, len); | 67 | * // GNUNET_memcpy (&pm[1], data, len); |
68 | */ | 68 | */ |
69 | const struct GNUNET_MessageHeader *msg; | 69 | const struct GNUNET_MessageHeader *msg; |
70 | 70 | ||
@@ -316,7 +316,7 @@ send_reply_to_client (void *cls, size_t size, void *buf) | |||
316 | { | 316 | { |
317 | GNUNET_CONTAINER_DLL_remove (client->pending_head, client->pending_tail, | 317 | GNUNET_CONTAINER_DLL_remove (client->pending_head, client->pending_tail, |
318 | reply); | 318 | reply); |
319 | memcpy (&cbuf[off], reply->msg, msize); | 319 | GNUNET_memcpy (&cbuf[off], reply->msg, msize); |
320 | GNUNET_free (reply); | 320 | GNUNET_free (reply); |
321 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 321 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
322 | "Transmitting %u bytes to client %p\n", | 322 | "Transmitting %u bytes to client %p\n", |
@@ -578,7 +578,7 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
578 | /* two clients waiting for same reply, must copy for queueing */ | 578 | /* two clients waiting for same reply, must copy for queueing */ |
579 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + | 579 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + |
580 | ntohs (frc->pm->msg->size)); | 580 | ntohs (frc->pm->msg->size)); |
581 | memcpy (pm, frc->pm, | 581 | GNUNET_memcpy (pm, frc->pm, |
582 | sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); | 582 | sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); |
583 | pm->next = pm->prev = NULL; | 583 | pm->next = pm->prev = NULL; |
584 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; | 584 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; |
@@ -664,11 +664,11 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | |||
664 | reply->expiration = GNUNET_TIME_absolute_hton (expiration); | 664 | reply->expiration = GNUNET_TIME_absolute_hton (expiration); |
665 | reply->key = *key; | 665 | reply->key = *key; |
666 | paths = (struct GNUNET_PeerIdentity *) &reply[1]; | 666 | paths = (struct GNUNET_PeerIdentity *) &reply[1]; |
667 | memcpy (paths, put_path, | 667 | GNUNET_memcpy (paths, put_path, |
668 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); | 668 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); |
669 | memcpy (&paths[put_path_length], get_path, | 669 | GNUNET_memcpy (&paths[put_path_length], get_path, |
670 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); | 670 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); |
671 | memcpy (&paths[get_path_length + put_path_length], data, data_size); | 671 | GNUNET_memcpy (&paths[get_path_length + put_path_length], data, data_size); |
672 | frc.do_copy = GNUNET_NO; | 672 | frc.do_copy = GNUNET_NO; |
673 | frc.pm = pm; | 673 | frc.pm = pm; |
674 | frc.data = data; | 674 | frc.data = data; |
@@ -747,10 +747,10 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
747 | mmsg->hop_count = htonl(hop_count); | 747 | mmsg->hop_count = htonl(hop_count); |
748 | mmsg->desired_replication_level = htonl(desired_replication_level); | 748 | mmsg->desired_replication_level = htonl(desired_replication_level); |
749 | mmsg->get_path_length = htonl(path_length); | 749 | mmsg->get_path_length = htonl(path_length); |
750 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 750 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
751 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 751 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
752 | if (path_length > 0) | 752 | if (path_length > 0) |
753 | memcpy (msg_path, path, | 753 | GNUNET_memcpy (msg_path, path, |
754 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 754 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
755 | add_pending_message (m->client, pm); | 755 | add_pending_message (m->client, pm); |
756 | } | 756 | } |
@@ -829,13 +829,13 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
829 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 829 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
830 | if (path_length > 0) | 830 | if (path_length > 0) |
831 | { | 831 | { |
832 | memcpy (msg_path, path, | 832 | GNUNET_memcpy (msg_path, path, |
833 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 833 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
834 | } | 834 | } |
835 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 835 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
836 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 836 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
837 | if (size > 0) | 837 | if (size > 0) |
838 | memcpy (&msg_path[path_length], data, size); | 838 | GNUNET_memcpy (&msg_path[path_length], data, size); |
839 | add_pending_message (m->client, pm); | 839 | add_pending_message (m->client, pm); |
840 | } | 840 | } |
841 | } | 841 | } |
@@ -1010,7 +1010,7 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client, | |||
1010 | cqr->key = get->key; | 1010 | cqr->key = get->key; |
1011 | cqr->client = find_active_client (client); | 1011 | cqr->client = find_active_client (client); |
1012 | cqr->xquery = (void *) &cqr[1]; | 1012 | cqr->xquery = (void *) &cqr[1]; |
1013 | memcpy (&cqr[1], xquery, xquery_size); | 1013 | GNUNET_memcpy (&cqr[1], xquery, xquery_size); |
1014 | cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); | 1014 | cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); |
1015 | cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; | 1015 | cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; |
1016 | cqr->retry_time = GNUNET_TIME_absolute_get (); | 1016 | cqr->retry_time = GNUNET_TIME_absolute_get (); |
@@ -1132,7 +1132,7 @@ handle_dht_local_get_result_seen (void *cls, struct GNUNET_SERVER_Client *client | |||
1132 | GNUNET_array_grow (cqr->seen_replies, | 1132 | GNUNET_array_grow (cqr->seen_replies, |
1133 | cqr->seen_replies_count, | 1133 | cqr->seen_replies_count, |
1134 | cqr->seen_replies_count + hash_count); | 1134 | cqr->seen_replies_count + hash_count); |
1135 | memcpy (&cqr->seen_replies[old_count], | 1135 | GNUNET_memcpy (&cqr->seen_replies[old_count], |
1136 | hc, | 1136 | hc, |
1137 | sizeof (struct GNUNET_HashCode) * hash_count); | 1137 | sizeof (struct GNUNET_HashCode) * hash_count); |
1138 | } | 1138 | } |
@@ -1240,7 +1240,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client, | |||
1240 | else | 1240 | else |
1241 | { | 1241 | { |
1242 | r->key = GNUNET_new (struct GNUNET_HashCode); | 1242 | r->key = GNUNET_new (struct GNUNET_HashCode); |
1243 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); | 1243 | GNUNET_memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); |
1244 | } | 1244 | } |
1245 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); | 1245 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); |
1246 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1246 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
diff --git a/src/dht/gnunet-service-xdht_hello.c b/src/dht/gnunet-service-xdht_hello.c index f74700778..ceaf6f853 100644 --- a/src/dht/gnunet-service-xdht_hello.c +++ b/src/dht/gnunet-service-xdht_hello.c | |||
@@ -84,7 +84,7 @@ process_hello (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
84 | hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer); | 84 | hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer); |
85 | GNUNET_free_non_null (hm); | 85 | GNUNET_free_non_null (hm); |
86 | hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); | 86 | hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); |
87 | memcpy (hm, hello, GNUNET_HELLO_size (hello)); | 87 | GNUNET_memcpy (hm, hello, GNUNET_HELLO_size (hello)); |
88 | GNUNET_assert (GNUNET_SYSERR != | 88 | GNUNET_assert (GNUNET_SYSERR != |
89 | GNUNET_CONTAINER_multipeermap_put (peer_to_hello, | 89 | GNUNET_CONTAINER_multipeermap_put (peer_to_hello, |
90 | peer, hm, | 90 | peer, hm, |
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index 3464de844..b5c17361b 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c | |||
@@ -653,7 +653,7 @@ struct P2PPendingMessage | |||
653 | /** | 653 | /** |
654 | * Actual message to be sent, allocated at the end of the struct: | 654 | * Actual message to be sent, allocated at the end of the struct: |
655 | * // msg = (cast) &pm[1]; | 655 | * // msg = (cast) &pm[1]; |
656 | * // memcpy (&pm[1], data, len); | 656 | * // GNUNET_memcpy (&pm[1], data, len); |
657 | */ | 657 | */ |
658 | const struct GNUNET_MessageHeader *msg; | 658 | const struct GNUNET_MessageHeader *msg; |
659 | 659 | ||
@@ -1012,7 +1012,7 @@ core_transmit_notify (void *cls, size_t size, void *buf) | |||
1012 | ("# Bytes transmitted to other peers"), | 1012 | ("# Bytes transmitted to other peers"), |
1013 | msize, | 1013 | msize, |
1014 | GNUNET_NO); | 1014 | GNUNET_NO); |
1015 | memcpy (&cbuf[off], pending->msg, msize); | 1015 | GNUNET_memcpy (&cbuf[off], pending->msg, msize); |
1016 | off += msize; | 1016 | off += msize; |
1017 | peer->pending_count--; | 1017 | peer->pending_count--; |
1018 | GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, pending); | 1018 | GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, pending); |
@@ -1125,7 +1125,7 @@ GDS_NEIGHBOURS_send_trail_setup (struct GNUNET_PeerIdentity source_peer, | |||
1125 | if (trail_length > 0) | 1125 | if (trail_length > 0) |
1126 | { | 1126 | { |
1127 | peer_list = (struct GNUNET_PeerIdentity *) &tsm[1]; | 1127 | peer_list = (struct GNUNET_PeerIdentity *) &tsm[1]; |
1128 | memcpy (peer_list, trail_peer_list, trail_length * sizeof(struct GNUNET_PeerIdentity)); | 1128 | GNUNET_memcpy (peer_list, trail_peer_list, trail_length * sizeof(struct GNUNET_PeerIdentity)); |
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); | 1131 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); |
@@ -1193,7 +1193,7 @@ GDS_NEIGHBOURS_send_trail_setup_result (struct GNUNET_PeerIdentity querying_peer | |||
1193 | tsrm->ulitmate_destination_finger_value = | 1193 | tsrm->ulitmate_destination_finger_value = |
1194 | GNUNET_htonll (ultimate_destination_finger_value); | 1194 | GNUNET_htonll (ultimate_destination_finger_value); |
1195 | peer_list = (struct GNUNET_PeerIdentity *) &tsrm[1]; | 1195 | peer_list = (struct GNUNET_PeerIdentity *) &tsrm[1]; |
1196 | memcpy (peer_list, trail_peer_list, trail_length * sizeof (struct GNUNET_PeerIdentity)); | 1196 | GNUNET_memcpy (peer_list, trail_peer_list, trail_length * sizeof (struct GNUNET_PeerIdentity)); |
1197 | 1197 | ||
1198 | /* Send the message to chosen friend. */ | 1198 | /* Send the message to chosen friend. */ |
1199 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); | 1199 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); |
@@ -1311,7 +1311,7 @@ GDS_NEIGHBOURS_send_trail_rejection (struct GNUNET_PeerIdentity source_peer, | |||
1311 | peer_list = (struct GNUNET_PeerIdentity *) &trm[1]; | 1311 | peer_list = (struct GNUNET_PeerIdentity *) &trm[1]; |
1312 | if (trail_length > 0) | 1312 | if (trail_length > 0) |
1313 | { | 1313 | { |
1314 | memcpy (peer_list, trail_peer_list, trail_length * sizeof (struct GNUNET_PeerIdentity)); | 1314 | GNUNET_memcpy (peer_list, trail_peer_list, trail_length * sizeof (struct GNUNET_PeerIdentity)); |
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | /* Send the message to chosen friend. */ | 1317 | /* Send the message to chosen friend. */ |
@@ -1371,7 +1371,7 @@ GDS_NEIGHBOURS_send_verify_successor_message (struct GNUNET_PeerIdentity source_ | |||
1371 | vsm->successor = successor; | 1371 | vsm->successor = successor; |
1372 | vsm->trail_id = trail_id; | 1372 | vsm->trail_id = trail_id; |
1373 | peer_list = (struct GNUNET_PeerIdentity *) &vsm[1]; | 1373 | peer_list = (struct GNUNET_PeerIdentity *) &vsm[1]; |
1374 | memcpy (peer_list, trail, trail_length * sizeof (struct GNUNET_PeerIdentity)); | 1374 | GNUNET_memcpy (peer_list, trail, trail_length * sizeof (struct GNUNET_PeerIdentity)); |
1375 | 1375 | ||
1376 | /* Send the message to chosen friend. */ | 1376 | /* Send the message to chosen friend. */ |
1377 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); | 1377 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); |
@@ -1497,7 +1497,7 @@ GDS_NEIGHBOURS_send_verify_successor_result (struct GNUNET_PeerIdentity querying | |||
1497 | vsmr->trail_direction = htonl (trail_direction); | 1497 | vsmr->trail_direction = htonl (trail_direction); |
1498 | vsmr->trail_id = trail_id; | 1498 | vsmr->trail_id = trail_id; |
1499 | peer_list = (struct GNUNET_PeerIdentity *) &vsmr[1]; | 1499 | peer_list = (struct GNUNET_PeerIdentity *) &vsmr[1]; |
1500 | memcpy (peer_list, trail, trail_length * sizeof (struct GNUNET_PeerIdentity)); | 1500 | GNUNET_memcpy (peer_list, trail, trail_length * sizeof (struct GNUNET_PeerIdentity)); |
1501 | 1501 | ||
1502 | /* Send the message to chosen friend. */ | 1502 | /* Send the message to chosen friend. */ |
1503 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); | 1503 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); |
@@ -1557,7 +1557,7 @@ GDS_NEIGHBOURS_send_notify_new_successor (struct GNUNET_PeerIdentity source_peer | |||
1557 | nsm->source_peer = source_peer; | 1557 | nsm->source_peer = source_peer; |
1558 | nsm->trail_id = succesor_trail_id; | 1558 | nsm->trail_id = succesor_trail_id; |
1559 | peer_list = (struct GNUNET_PeerIdentity *) &nsm[1]; | 1559 | peer_list = (struct GNUNET_PeerIdentity *) &nsm[1]; |
1560 | memcpy (peer_list, successor_trail, | 1560 | GNUNET_memcpy (peer_list, successor_trail, |
1561 | successor_trail_length * sizeof (struct GNUNET_PeerIdentity)); | 1561 | successor_trail_length * sizeof (struct GNUNET_PeerIdentity)); |
1562 | 1562 | ||
1563 | /* Send the message to chosen friend. */ | 1563 | /* Send the message to chosen friend. */ |
@@ -1617,7 +1617,7 @@ GDS_NEIGHBOURS_send_add_trail (struct GNUNET_PeerIdentity source_peer, | |||
1617 | adm->destination_peer = destination_peer; | 1617 | adm->destination_peer = destination_peer; |
1618 | adm->trail_id = trail_id; | 1618 | adm->trail_id = trail_id; |
1619 | peer_list = (struct GNUNET_PeerIdentity *)&adm[1]; | 1619 | peer_list = (struct GNUNET_PeerIdentity *)&adm[1]; |
1620 | memcpy (peer_list, trail, sizeof (struct GNUNET_PeerIdentity) * trail_length); | 1620 | GNUNET_memcpy (peer_list, trail, sizeof (struct GNUNET_PeerIdentity) * trail_length); |
1621 | 1621 | ||
1622 | /* Send the message to chosen friend. */ | 1622 | /* Send the message to chosen friend. */ |
1623 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); | 1623 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); |
@@ -1699,8 +1699,8 @@ select_closest_finger (const struct GNUNET_PeerIdentity *peer1, | |||
1699 | uint64_t peer1_value; | 1699 | uint64_t peer1_value; |
1700 | uint64_t peer2_value; | 1700 | uint64_t peer2_value; |
1701 | 1701 | ||
1702 | memcpy (&peer1_value, peer1, sizeof (uint64_t)); | 1702 | GNUNET_memcpy (&peer1_value, peer1, sizeof (uint64_t)); |
1703 | memcpy (&peer2_value, peer2, sizeof (uint64_t)); | 1703 | GNUNET_memcpy (&peer2_value, peer2, sizeof (uint64_t)); |
1704 | peer1_value = GNUNET_ntohll (peer1_value); | 1704 | peer1_value = GNUNET_ntohll (peer1_value); |
1705 | peer2_value = GNUNET_ntohll (peer2_value); | 1705 | peer2_value = GNUNET_ntohll (peer2_value); |
1706 | 1706 | ||
@@ -1756,8 +1756,8 @@ select_closest_predecessor (const struct GNUNET_PeerIdentity *peer1, | |||
1756 | uint64_t peer1_value; | 1756 | uint64_t peer1_value; |
1757 | uint64_t peer2_value; | 1757 | uint64_t peer2_value; |
1758 | 1758 | ||
1759 | memcpy (&peer1_value, peer1, sizeof (uint64_t)); | 1759 | GNUNET_memcpy (&peer1_value, peer1, sizeof (uint64_t)); |
1760 | memcpy (&peer2_value, peer2, sizeof (uint64_t)); | 1760 | GNUNET_memcpy (&peer2_value, peer2, sizeof (uint64_t)); |
1761 | peer1_value = GNUNET_ntohll (peer1_value); | 1761 | peer1_value = GNUNET_ntohll (peer1_value); |
1762 | peer2_value = GNUNET_ntohll (peer2_value); | 1762 | peer2_value = GNUNET_ntohll (peer2_value); |
1763 | 1763 | ||
@@ -1843,7 +1843,7 @@ test_friend_peermap_print () | |||
1843 | &key_ret, | 1843 | &key_ret, |
1844 | (const void **)&friend)) | 1844 | (const void **)&friend)) |
1845 | { | 1845 | { |
1846 | memcpy (&print_peer, &key_ret, sizeof (struct GNUNET_PeerIdentity)); | 1846 | GNUNET_memcpy (&print_peer, &key_ret, sizeof (struct GNUNET_PeerIdentity)); |
1847 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, friend = %s, friend->trails_count = %d"), | 1847 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, friend = %s, friend->trails_count = %d"), |
1848 | __FILE__, __func__,__LINE__, GNUNET_i2s(&print_peer), friend->trails_count); | 1848 | __FILE__, __func__,__LINE__, GNUNET_i2s(&print_peer), friend->trails_count); |
1849 | } | 1849 | } |
@@ -2215,10 +2215,10 @@ GDS_NEIGHBOURS_send_put (const struct GNUNET_HashCode *key, | |||
2215 | ppm->put_path_length = htonl (put_path_length); | 2215 | ppm->put_path_length = htonl (put_path_length); |
2216 | if(put_path_length > 0) | 2216 | if(put_path_length > 0) |
2217 | { | 2217 | { |
2218 | memcpy (pp, put_path, | 2218 | GNUNET_memcpy (pp, put_path, |
2219 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); | 2219 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); |
2220 | } | 2220 | } |
2221 | memcpy (&pp[put_path_length], data, data_size); | 2221 | GNUNET_memcpy (&pp[put_path_length], data, data_size); |
2222 | GNUNET_assert (NULL != target_friend); | 2222 | GNUNET_assert (NULL != target_friend); |
2223 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); | 2223 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); |
2224 | target_friend->pending_count++; | 2224 | target_friend->pending_count++; |
@@ -2250,7 +2250,7 @@ GDS_NEIGHBOURS_handle_put (const struct GNUNET_HashCode *key, | |||
2250 | uint64_t key_value; | 2250 | uint64_t key_value; |
2251 | struct Closest_Peer successor; | 2251 | struct Closest_Peer successor; |
2252 | 2252 | ||
2253 | memcpy (&key_value, key, sizeof (uint64_t)); | 2253 | GNUNET_memcpy (&key_value, key, sizeof (uint64_t)); |
2254 | key_value = GNUNET_ntohll (key_value); | 2254 | key_value = GNUNET_ntohll (key_value); |
2255 | successor = find_local_best_known_next_hop (key_value, | 2255 | successor = find_local_best_known_next_hop (key_value, |
2256 | GDS_FINGER_TYPE_NON_PREDECESSOR); | 2256 | GDS_FINGER_TYPE_NON_PREDECESSOR); |
@@ -2339,7 +2339,7 @@ GDS_NEIGHBOURS_send_get (const struct GNUNET_HashCode *key, | |||
2339 | pgm->hop_count = htonl (hop_count + 1); | 2339 | pgm->hop_count = htonl (hop_count + 1); |
2340 | pgm->get_path_length = htonl (get_path_length); | 2340 | pgm->get_path_length = htonl (get_path_length); |
2341 | gp = (struct GNUNET_PeerIdentity *) &pgm[1]; | 2341 | gp = (struct GNUNET_PeerIdentity *) &pgm[1]; |
2342 | memcpy (gp, get_path, | 2342 | GNUNET_memcpy (gp, get_path, |
2343 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); | 2343 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); |
2344 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); | 2344 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); |
2345 | target_friend->pending_count++; | 2345 | target_friend->pending_count++; |
@@ -2367,7 +2367,7 @@ GDS_NEIGHBOURS_handle_get(const struct GNUNET_HashCode *key, | |||
2367 | struct GNUNET_HashCode intermediate_trail_id; | 2367 | struct GNUNET_HashCode intermediate_trail_id; |
2368 | uint64_t key_value; | 2368 | uint64_t key_value; |
2369 | 2369 | ||
2370 | memcpy (&key_value, key, sizeof (uint64_t)); | 2370 | GNUNET_memcpy (&key_value, key, sizeof (uint64_t)); |
2371 | key_value = GNUNET_ntohll (key_value); | 2371 | key_value = GNUNET_ntohll (key_value); |
2372 | 2372 | ||
2373 | successor = find_local_best_known_next_hop (key_value, | 2373 | successor = find_local_best_known_next_hop (key_value, |
@@ -2478,11 +2478,11 @@ GDS_NEIGHBOURS_send_get_result (const struct GNUNET_HashCode *key, | |||
2478 | get_result->get_path_length = htonl (get_path_length); | 2478 | get_result->get_path_length = htonl (get_path_length); |
2479 | get_result->put_path_length = htonl (put_path_length); | 2479 | get_result->put_path_length = htonl (put_path_length); |
2480 | paths = (struct GNUNET_PeerIdentity *)&get_result[1]; | 2480 | paths = (struct GNUNET_PeerIdentity *)&get_result[1]; |
2481 | memcpy (paths, put_path, | 2481 | GNUNET_memcpy (paths, put_path, |
2482 | put_path_length * sizeof (struct GNUNET_PeerIdentity)); | 2482 | put_path_length * sizeof (struct GNUNET_PeerIdentity)); |
2483 | memcpy (&paths[put_path_length], get_path, | 2483 | GNUNET_memcpy (&paths[put_path_length], get_path, |
2484 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 2484 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
2485 | memcpy (&paths[put_path_length + get_path_length], data, data_size); | 2485 | GNUNET_memcpy (&paths[put_path_length + get_path_length], data, data_size); |
2486 | 2486 | ||
2487 | GNUNET_assert (NULL != | 2487 | GNUNET_assert (NULL != |
2488 | (target_friend = | 2488 | (target_friend = |
@@ -2571,7 +2571,7 @@ compute_finger_identity_value (unsigned int finger_index) | |||
2571 | { | 2571 | { |
2572 | uint64_t my_id64; | 2572 | uint64_t my_id64; |
2573 | 2573 | ||
2574 | memcpy (&my_id64, &my_identity, sizeof (uint64_t)); | 2574 | GNUNET_memcpy (&my_id64, &my_identity, sizeof (uint64_t)); |
2575 | my_id64 = GNUNET_ntohll (my_id64); | 2575 | my_id64 = GNUNET_ntohll (my_id64); |
2576 | 2576 | ||
2577 | /* Are we looking for immediate predecessor? */ | 2577 | /* Are we looking for immediate predecessor? */ |
@@ -3353,7 +3353,7 @@ get_finger_table_index (uint64_t ultimate_destination_finger_value, | |||
3353 | uint64_t diff; | 3353 | uint64_t diff; |
3354 | unsigned int finger_table_index; | 3354 | unsigned int finger_table_index; |
3355 | 3355 | ||
3356 | memcpy (&my_id64, &my_identity, sizeof (uint64_t)); | 3356 | GNUNET_memcpy (&my_id64, &my_identity, sizeof (uint64_t)); |
3357 | my_id64 = GNUNET_ntohll (my_id64); | 3357 | my_id64 = GNUNET_ntohll (my_id64); |
3358 | 3358 | ||
3359 | /* Is this a predecessor finger? */ | 3359 | /* Is this a predecessor finger? */ |
@@ -3682,14 +3682,14 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3682 | //if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE)) | 3682 | //if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE)) |
3683 | if (1) | 3683 | if (1) |
3684 | { | 3684 | { |
3685 | memcpy (pp, put_path, putlen * sizeof (struct GNUNET_PeerIdentity)); | 3685 | GNUNET_memcpy (pp, put_path, putlen * sizeof (struct GNUNET_PeerIdentity)); |
3686 | pp[putlen] = my_identity; | 3686 | pp[putlen] = my_identity; |
3687 | putlen++; | 3687 | putlen++; |
3688 | } | 3688 | } |
3689 | else | 3689 | else |
3690 | putlen = 0; | 3690 | putlen = 0; |
3691 | 3691 | ||
3692 | memcpy (&key_value, &(put->key), sizeof (uint64_t)); | 3692 | GNUNET_memcpy (&key_value, &(put->key), sizeof (uint64_t)); |
3693 | struct Closest_Peer successor; | 3693 | struct Closest_Peer successor; |
3694 | key_value = GNUNET_ntohll (key_value); | 3694 | key_value = GNUNET_ntohll (key_value); |
3695 | successor = find_local_best_known_next_hop (key_value, | 3695 | successor = find_local_best_known_next_hop (key_value, |
@@ -3799,7 +3799,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3799 | ("# Bytes received from other peers"), msize, | 3799 | ("# Bytes received from other peers"), msize, |
3800 | GNUNET_NO); | 3800 | GNUNET_NO); |
3801 | 3801 | ||
3802 | memcpy (&key_value, &(get->key), sizeof (uint64_t)); | 3802 | GNUNET_memcpy (&key_value, &(get->key), sizeof (uint64_t)); |
3803 | key_value = GNUNET_ntohll (key_value); | 3803 | key_value = GNUNET_ntohll (key_value); |
3804 | 3804 | ||
3805 | /* Check if you are already a part of get path. */ | 3805 | /* Check if you are already a part of get path. */ |
@@ -3815,7 +3815,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3815 | 3815 | ||
3816 | /* Add yourself in the get path. */ | 3816 | /* Add yourself in the get path. */ |
3817 | struct GNUNET_PeerIdentity gp[get_length + 1]; | 3817 | struct GNUNET_PeerIdentity gp[get_length + 1]; |
3818 | memcpy (gp, get_path, get_length * sizeof (struct GNUNET_PeerIdentity)); | 3818 | GNUNET_memcpy (gp, get_path, get_length * sizeof (struct GNUNET_PeerIdentity)); |
3819 | gp[get_length] = my_identity; | 3819 | gp[get_length] = my_identity; |
3820 | get_length = get_length + 1; | 3820 | get_length = get_length + 1; |
3821 | GDS_CLIENTS_process_get (get->options, get->block_type, hop_count, | 3821 | GDS_CLIENTS_process_get (get->options, get->block_type, hop_count, |
@@ -4185,7 +4185,7 @@ handle_dht_p2p_trail_setup (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4185 | /* Add yourself to list of peers. */ | 4185 | /* Add yourself to list of peers. */ |
4186 | struct GNUNET_PeerIdentity peer_list[trail_length + 1]; | 4186 | struct GNUNET_PeerIdentity peer_list[trail_length + 1]; |
4187 | 4187 | ||
4188 | memcpy (peer_list, trail_peer_list, | 4188 | GNUNET_memcpy (peer_list, trail_peer_list, |
4189 | trail_length * sizeof (struct GNUNET_PeerIdentity)); | 4189 | trail_length * sizeof (struct GNUNET_PeerIdentity)); |
4190 | peer_list[trail_length] = my_identity; | 4190 | peer_list[trail_length] = my_identity; |
4191 | GDS_NEIGHBOURS_send_trail_setup (source, | 4191 | GDS_NEIGHBOURS_send_trail_setup (source, |
@@ -4956,9 +4956,9 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ, | |||
4956 | uint64_t succ; | 4956 | uint64_t succ; |
4957 | char *key; | 4957 | char *key; |
4958 | uint64_t my_id; | 4958 | uint64_t my_id; |
4959 | memcpy (&my_id, &my_identity, sizeof(uint64_t)); | 4959 | GNUNET_memcpy (&my_id, &my_identity, sizeof(uint64_t)); |
4960 | my_id_str = GNUNET_strdup (GNUNET_i2s_full (&my_identity)); | 4960 | my_id_str = GNUNET_strdup (GNUNET_i2s_full (&my_identity)); |
4961 | memcpy(&succ, ¤t_successor->finger_identity, sizeof(uint64_t)); | 4961 | GNUNET_memcpy(&succ, ¤t_successor->finger_identity, sizeof(uint64_t)); |
4962 | succ = GNUNET_ntohll(succ); | 4962 | succ = GNUNET_ntohll(succ); |
4963 | GNUNET_asprintf (&key, "XDHT:%s:", my_id_str); | 4963 | GNUNET_asprintf (&key, "XDHT:%s:", my_id_str); |
4964 | GNUNET_free (my_id_str); | 4964 | GNUNET_free (my_id_str); |
@@ -4989,7 +4989,7 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ, | |||
4989 | char *key; | 4989 | char *key; |
4990 | 4990 | ||
4991 | my_id_str = GNUNET_strdup (GNUNET_i2s_full (&my_identity)); | 4991 | my_id_str = GNUNET_strdup (GNUNET_i2s_full (&my_identity)); |
4992 | memcpy(&succ, ¤t_successor->finger_identity, sizeof(uint64_t)); | 4992 | GNUNET_memcpy(&succ, ¤t_successor->finger_identity, sizeof(uint64_t)); |
4993 | GNUNET_asprintf (&key, "XDHT:%s:", my_id_str); | 4993 | GNUNET_asprintf (&key, "XDHT:%s:", my_id_str); |
4994 | GNUNET_free (my_id_str); | 4994 | GNUNET_free (my_id_str); |
4995 | GNUNET_STATISTICS_set (GDS_stats, key, succ, 0); | 4995 | GNUNET_STATISTICS_set (GDS_stats, key, succ, 0); |
@@ -5066,7 +5066,7 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ, | |||
5066 | notify_ctx->successor = probable_successor; | 5066 | notify_ctx->successor = probable_successor; |
5067 | notify_ctx->successor_trail = | 5067 | notify_ctx->successor_trail = |
5068 | GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity) * trail_me_to_probable_succ_len); | 5068 | GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity) * trail_me_to_probable_succ_len); |
5069 | memcpy(notify_ctx->successor_trail, trail_me_to_probable_succ, | 5069 | GNUNET_memcpy(notify_ctx->successor_trail, trail_me_to_probable_succ, |
5070 | sizeof(struct GNUNET_PeerIdentity) * trail_me_to_probable_succ_len); | 5070 | sizeof(struct GNUNET_PeerIdentity) * trail_me_to_probable_succ_len); |
5071 | notify_ctx->successor_trail_length = trail_me_to_probable_succ_len; | 5071 | notify_ctx->successor_trail_length = trail_me_to_probable_succ_len; |
5072 | notify_ctx->succesor_trail_id = trail_id; | 5072 | notify_ctx->succesor_trail_id = trail_id; |
@@ -5477,7 +5477,7 @@ handle_dht_p2p_trail_setup_rejection (void *cls, | |||
5477 | unsigned int new_trail_length = trail_length - 1; | 5477 | unsigned int new_trail_length = trail_length - 1; |
5478 | struct GNUNET_PeerIdentity trail[new_trail_length]; | 5478 | struct GNUNET_PeerIdentity trail[new_trail_length]; |
5479 | 5479 | ||
5480 | memcpy (trail, trail_peer_list, new_trail_length * sizeof(struct GNUNET_PeerIdentity)); | 5480 | GNUNET_memcpy (trail, trail_peer_list, new_trail_length * sizeof(struct GNUNET_PeerIdentity)); |
5481 | if (0 == trail_length) | 5481 | if (0 == trail_length) |
5482 | next_peer = source; | 5482 | next_peer = source; |
5483 | else | 5483 | else |
@@ -5510,7 +5510,7 @@ handle_dht_p2p_trail_setup_rejection (void *cls, | |||
5510 | unsigned int new_trail_length = trail_length - 1; | 5510 | unsigned int new_trail_length = trail_length - 1; |
5511 | struct GNUNET_PeerIdentity trail[new_trail_length]; | 5511 | struct GNUNET_PeerIdentity trail[new_trail_length]; |
5512 | 5512 | ||
5513 | memcpy (trail, trail_peer_list, new_trail_length * sizeof(struct GNUNET_PeerIdentity)); | 5513 | GNUNET_memcpy (trail, trail_peer_list, new_trail_length * sizeof(struct GNUNET_PeerIdentity)); |
5514 | 5514 | ||
5515 | if (0 == new_trail_length) | 5515 | if (0 == new_trail_length) |
5516 | next_peer = source; | 5516 | next_peer = source; |
diff --git a/src/dht/gnunet-service-xdht_routing.c b/src/dht/gnunet-service-xdht_routing.c index 4a85a1ce5..d705a92a5 100644 --- a/src/dht/gnunet-service-xdht_routing.c +++ b/src/dht/gnunet-service-xdht_routing.c | |||
@@ -263,10 +263,10 @@ GDS_ROUTING_test_print (void) | |||
263 | { | 263 | { |
264 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, trail->trail_id = %s"), | 264 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, trail->trail_id = %s"), |
265 | __FILE__, __func__,__LINE__, GNUNET_h2s(&trail->trail_id)); | 265 | __FILE__, __func__,__LINE__, GNUNET_h2s(&trail->trail_id)); |
266 | memcpy (&print_peer, &trail->next_hop, sizeof (struct GNUNET_PeerIdentity)); | 266 | GNUNET_memcpy (&print_peer, &trail->next_hop, sizeof (struct GNUNET_PeerIdentity)); |
267 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, trail->next_hop = %s"), | 267 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, trail->next_hop = %s"), |
268 | __FILE__, __func__,__LINE__, GNUNET_i2s(&print_peer)); | 268 | __FILE__, __func__,__LINE__, GNUNET_i2s(&print_peer)); |
269 | memcpy (&print_peer, &trail->prev_hop, sizeof (struct GNUNET_PeerIdentity)); | 269 | GNUNET_memcpy (&print_peer, &trail->prev_hop, sizeof (struct GNUNET_PeerIdentity)); |
270 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, trail->prev_hop = %s"), | 270 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, trail->prev_hop = %s"), |
271 | __FILE__, __func__,__LINE__, GNUNET_i2s(&print_peer)); | 271 | __FILE__, __func__,__LINE__, GNUNET_i2s(&print_peer)); |
272 | } | 272 | } |