aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh_local.c4
-rw-r--r--src/mesh/gnunet-service-mesh_peer.c2
-rw-r--r--src/mesh/mesh_api.c6
-rw-r--r--src/mesh/mesh_path.c2
-rw-r--r--src/mesh/mesh_test_lib.c4
-rw-r--r--src/mesh/mesh_tunnel_tree.c12
6 files changed, 15 insertions, 15 deletions
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c
index adac4cdf1..fa54fafa6 100644
--- a/src/mesh/gnunet-service-mesh_local.c
+++ b/src/mesh/gnunet-service-mesh_local.c
@@ -593,7 +593,7 @@ handle_ack (void *cls, struct GNUNET_SERVER_Client *client,
593// struct MeshChannel *ch = value; 593// struct MeshChannel *ch = value;
594// struct GNUNET_MESH_LocalMonitor *msg; 594// struct GNUNET_MESH_LocalMonitor *msg;
595// 595//
596// msg = GNUNET_malloc (sizeof(struct GNUNET_MESH_LocalMonitor)); 596// msg = GNUNET_new (struct GNUNET_MESH_LocalMonitor);
597// msg->channel_id = htonl (ch->gid); 597// msg->channel_id = htonl (ch->gid);
598// msg->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor)); 598// msg->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor));
599// msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS); 599// msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS);
@@ -688,7 +688,7 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
688 } 688 }
689 689
690 /* Initialize context */ 690 /* Initialize context */
691 resp = GNUNET_malloc (sizeof (struct GNUNET_MESH_LocalMonitor)); 691 resp = GNUNET_new (struct GNUNET_MESH_LocalMonitor);
692 *resp = *msg; 692 *resp = *msg;
693 resp->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor)); 693 resp->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor));
694 GNUNET_SERVER_notification_context_unicast (nc, c->handle, 694 GNUNET_SERVER_notification_context_unicast (nc, c->handle,
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c
index 741bffc2f..def57ba56 100644
--- a/src/mesh/gnunet-service-mesh_peer.c
+++ b/src/mesh/gnunet-service-mesh_peer.c
@@ -1051,7 +1051,7 @@ GMP_queue_add (struct MeshPeer *peer, void *cls, uint16_t type, size_t size,
1051 LOG (GNUNET_ERROR_TYPE_DEBUG, "priority %d\n", priority); 1051 LOG (GNUNET_ERROR_TYPE_DEBUG, "priority %d\n", priority);
1052 1052
1053 call_core = NULL == c ? GNUNET_YES : GMC_is_sendable (c, fwd); 1053 call_core = NULL == c ? GNUNET_YES : GMC_is_sendable (c, fwd);
1054 queue = GNUNET_malloc (sizeof (struct MeshPeerQueue)); 1054 queue = GNUNET_new (struct MeshPeerQueue);
1055 queue->cls = cls; 1055 queue->cls = cls;
1056 queue->type = type; 1056 queue->type = type;
1057 queue->size = size; 1057 queue->size = size;
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index 22ef3e19b..d670f4f30 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -404,7 +404,7 @@ create_channel (struct GNUNET_MESH_Handle *h, MESH_ChannelNumber chid)
404{ 404{
405 struct GNUNET_MESH_Channel *ch; 405 struct GNUNET_MESH_Channel *ch;
406 406
407 ch = GNUNET_malloc (sizeof (struct GNUNET_MESH_Channel)); 407 ch = GNUNET_new (struct GNUNET_MESH_Channel);
408 GNUNET_CONTAINER_DLL_insert (h->channels_head, h->channels_tail, ch); 408 GNUNET_CONTAINER_DLL_insert (h->channels_head, h->channels_tail, ch);
409 ch->mesh = h; 409 ch->mesh = h;
410 if (0 == chid) 410 if (0 == chid)
@@ -1243,7 +1243,7 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls,
1243 struct GNUNET_MESH_Handle *h; 1243 struct GNUNET_MESH_Handle *h;
1244 1244
1245 LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_MESH_connect()\n"); 1245 LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_MESH_connect()\n");
1246 h = GNUNET_malloc (sizeof (struct GNUNET_MESH_Handle)); 1246 h = GNUNET_new (struct GNUNET_MESH_Handle);
1247 LOG (GNUNET_ERROR_TYPE_DEBUG, " addr %p\n", h); 1247 LOG (GNUNET_ERROR_TYPE_DEBUG, " addr %p\n", h);
1248 h->cfg = cfg; 1248 h->cfg = cfg;
1249 h->new_channel = new_channel; 1249 h->new_channel = new_channel;
@@ -1496,7 +1496,7 @@ GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Channel *channel, int cork
1496 LOG (GNUNET_ERROR_TYPE_DEBUG, " payload size %u\n", notify_size); 1496 LOG (GNUNET_ERROR_TYPE_DEBUG, " payload size %u\n", notify_size);
1497 GNUNET_assert (NULL != notify); 1497 GNUNET_assert (NULL != notify);
1498 GNUNET_assert (0 == channel->packet_size); // Only one data packet allowed 1498 GNUNET_assert (0 == channel->packet_size); // Only one data packet allowed
1499 th = GNUNET_malloc (sizeof (struct GNUNET_MESH_TransmitHandle)); 1499 th = GNUNET_new (struct GNUNET_MESH_TransmitHandle);
1500 th->channel = channel; 1500 th->channel = channel;
1501 th->timeout = GNUNET_TIME_relative_to_absolute (maxdelay); 1501 th->timeout = GNUNET_TIME_relative_to_absolute (maxdelay);
1502 th->size = notify_size + sizeof (struct GNUNET_MESH_LocalData); 1502 th->size = notify_size + sizeof (struct GNUNET_MESH_LocalData);
diff --git a/src/mesh/mesh_path.c b/src/mesh/mesh_path.c
index f1c68c005..ad1f7f4db 100644
--- a/src/mesh/mesh_path.c
+++ b/src/mesh/mesh_path.c
@@ -60,7 +60,7 @@ path_new (unsigned int length)
60{ 60{
61 struct MeshPeerPath *p; 61 struct MeshPeerPath *p;
62 62
63 p = GNUNET_malloc (sizeof (struct MeshPeerPath)); 63 p = GNUNET_new (struct MeshPeerPath);
64 if (length > 0) 64 if (length > 0)
65 { 65 {
66 p->length = length; 66 p->length = length;
diff --git a/src/mesh/mesh_test_lib.c b/src/mesh/mesh_test_lib.c
index 7ad888da8..0229a5bb1 100644
--- a/src/mesh/mesh_test_lib.c
+++ b/src/mesh/mesh_test_lib.c
@@ -237,7 +237,7 @@ mesh_test_run (void *cls,
237 for (i = 0; i < num_peers; i++) 237 for (i = 0; i < num_peers; i++)
238 { 238 {
239 struct GNUNET_MESH_TEST_AdapterContext *newctx; 239 struct GNUNET_MESH_TEST_AdapterContext *newctx;
240 newctx = GNUNET_malloc (sizeof (struct GNUNET_MESH_TEST_AdapterContext)); 240 newctx = GNUNET_new (struct GNUNET_MESH_TEST_AdapterContext);
241 newctx->peer = i; 241 newctx->peer = i;
242 newctx->ctx = ctx; 242 newctx->ctx = ctx;
243 ctx->ops[i] = GNUNET_TESTBED_service_connect (ctx, 243 ctx->ops[i] = GNUNET_TESTBED_service_connect (ctx,
@@ -265,7 +265,7 @@ GNUNET_MESH_TEST_run (const char *testname,
265{ 265{
266 struct GNUNET_MESH_TEST_Context *ctx; 266 struct GNUNET_MESH_TEST_Context *ctx;
267 267
268 ctx = GNUNET_malloc (sizeof (struct GNUNET_MESH_TEST_Context)); 268 ctx = GNUNET_new (struct GNUNET_MESH_TEST_Context);
269 ctx->num_peers = num_peers; 269 ctx->num_peers = num_peers;
270 ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *)); 270 ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *));
271 ctx->meshes = GNUNET_malloc (num_peers * sizeof (struct GNUNET_MESH_Handle *)); 271 ctx->meshes = GNUNET_malloc (num_peers * sizeof (struct GNUNET_MESH_Handle *));
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c
index c2fe6c3d9..48d052ef7 100644
--- a/src/mesh/mesh_tunnel_tree.c
+++ b/src/mesh/mesh_tunnel_tree.c
@@ -119,7 +119,7 @@ path_new (unsigned int length)
119{ 119{
120 struct MeshPeerPath *p; 120 struct MeshPeerPath *p;
121 121
122 p = GNUNET_malloc (sizeof (struct MeshPeerPath)); 122 p = GNUNET_new (struct MeshPeerPath);
123 if (length > 0) 123 if (length > 0)
124 { 124 {
125 p->length = length; 125 p->length = length;
@@ -233,7 +233,7 @@ tree_node_new (struct MeshTunnelTreeNode *parent, GNUNET_PEER_Id peer)
233{ 233{
234 struct MeshTunnelTreeNode *node; 234 struct MeshTunnelTreeNode *node;
235 235
236 node = GNUNET_malloc (sizeof (struct MeshTunnelTreeNode)); 236 node = GNUNET_new (struct MeshTunnelTreeNode);
237 node->peer = peer; 237 node->peer = peer;
238 GNUNET_PEER_change_rc (peer, 1); 238 GNUNET_PEER_change_rc (peer, 1);
239 node->parent = parent; 239 node->parent = parent;
@@ -322,7 +322,7 @@ tree_node_update_first_hops (struct MeshTunnelTree *tree,
322 GNUNET_PEER_resolve (parent->peer, &id); 322 GNUNET_PEER_resolve (parent->peer, &id);
323 copy = GNUNET_CONTAINER_multihashmap_get (tree->first_hops, &id.hashPubKey); 323 copy = GNUNET_CONTAINER_multihashmap_get (tree->first_hops, &id.hashPubKey);
324 if (NULL == copy) 324 if (NULL == copy)
325 copy = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity)); 325 copy = GNUNET_new (struct GNUNET_PeerIdentity);
326 *copy = *hop; 326 *copy = *hop;
327 327
328 (void) GNUNET_CONTAINER_multihashmap_put (tree->first_hops, &id.hashPubKey, 328 (void) GNUNET_CONTAINER_multihashmap_put (tree->first_hops, &id.hashPubKey,
@@ -417,7 +417,7 @@ tree_new (GNUNET_PEER_Id peer)
417{ 417{
418 struct MeshTunnelTree *tree; 418 struct MeshTunnelTree *tree;
419 419
420 tree = GNUNET_malloc (sizeof (struct MeshTunnelTree)); 420 tree = GNUNET_new (struct MeshTunnelTree);
421 tree->first_hops = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); 421 tree->first_hops = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO);
422 tree->root = tree_node_new (NULL, peer); 422 tree->root = tree_node_new (NULL, peer);
423 tree->root->status = MESH_PEER_ROOT; 423 tree->root->status = MESH_PEER_ROOT;
@@ -647,7 +647,7 @@ tree_iterate_all (struct MeshTunnelTree *tree,
647 struct MeshTreePendingNode *pending; 647 struct MeshTreePendingNode *pending;
648 648
649 cb (cb_cls, tree->root->peer, 0); 649 cb (cb_cls, tree->root->peer, 0);
650 pending = GNUNET_malloc (sizeof (struct MeshTreePendingNode)); 650 pending = GNUNET_new (struct MeshTreePendingNode);
651 pending->node = tree->root; 651 pending->node = tree->root;
652 head = tail = NULL; 652 head = tail = NULL;
653 GNUNET_CONTAINER_DLL_insert (head, tail, pending); 653 GNUNET_CONTAINER_DLL_insert (head, tail, pending);
@@ -661,7 +661,7 @@ tree_iterate_all (struct MeshTunnelTree *tree,
661 for (n = parent->children_head; NULL != n; n = n->next) 661 for (n = parent->children_head; NULL != n; n = n->next)
662 { 662 {
663 cb (cb_cls, n->peer, parent->peer); 663 cb (cb_cls, n->peer, parent->peer);
664 pending = GNUNET_malloc (sizeof (struct MeshTreePendingNode)); 664 pending = GNUNET_new (struct MeshTreePendingNode);
665 pending->node = n; 665 pending->node = n;
666 /* Insert_tail: breadth first, Insert: depth first */ 666 /* Insert_tail: breadth first, Insert: depth first */
667 GNUNET_CONTAINER_DLL_insert (head, tail, pending); 667 GNUNET_CONTAINER_DLL_insert (head, tail, pending);