diff options
Diffstat (limited to 'src/testbed/testbed_api.c')
-rw-r--r-- | src/testbed/testbed_api.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 2ee17c9e0..a65102ead 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -200,7 +200,7 @@ exop_insert (struct GNUNET_TESTBED_Operation *op) | |||
200 | { | 200 | { |
201 | struct ExpireOperationEntry *entry; | 201 | struct ExpireOperationEntry *entry; |
202 | 202 | ||
203 | entry = GNUNET_malloc (sizeof (struct ExpireOperationEntry)); | 203 | entry = GNUNET_new (struct ExpireOperationEntry); |
204 | entry->op = op; | 204 | entry->op = op; |
205 | GNUNET_CONTAINER_DLL_insert_tail (exop_head, exop_tail, entry); | 205 | GNUNET_CONTAINER_DLL_insert_tail (exop_head, exop_tail, entry); |
206 | } | 206 | } |
@@ -737,7 +737,7 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c, | |||
737 | peer = data->peer; | 737 | peer = data->peer; |
738 | GNUNET_assert (NULL != peer); | 738 | GNUNET_assert (NULL != peer); |
739 | GNUNET_assert (ntohl (msg->peer_id) == peer->unique_id); | 739 | GNUNET_assert (ntohl (msg->peer_id) == peer->unique_id); |
740 | pinfo = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_PeerInformation)); | 740 | pinfo = GNUNET_new (struct GNUNET_TESTBED_PeerInformation); |
741 | pinfo->pit = data->pit; | 741 | pinfo->pit = data->pit; |
742 | cb = data->cb; | 742 | cb = data->cb; |
743 | cb_cls = data->cb_cls; | 743 | cb_cls = data->cb_cls; |
@@ -747,7 +747,7 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c, | |||
747 | switch (pinfo->pit) | 747 | switch (pinfo->pit) |
748 | { | 748 | { |
749 | case GNUNET_TESTBED_PIT_IDENTITY: | 749 | case GNUNET_TESTBED_PIT_IDENTITY: |
750 | pinfo->result.id = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity)); | 750 | pinfo->result.id = GNUNET_new (struct GNUNET_PeerIdentity); |
751 | (void) memcpy (pinfo->result.id, &msg->peer_identity, | 751 | (void) memcpy (pinfo->result.id, &msg->peer_identity, |
752 | sizeof (struct GNUNET_PeerIdentity)); | 752 | sizeof (struct GNUNET_PeerIdentity)); |
753 | break; | 753 | break; |
@@ -1253,7 +1253,7 @@ GNUNET_TESTBED_queue_message_ (struct GNUNET_TESTBED_Controller *controller, | |||
1253 | size = ntohs (msg->size); | 1253 | size = ntohs (msg->size); |
1254 | GNUNET_assert ((GNUNET_MESSAGE_TYPE_TESTBED_INIT <= type) && | 1254 | GNUNET_assert ((GNUNET_MESSAGE_TYPE_TESTBED_INIT <= type) && |
1255 | (GNUNET_MESSAGE_TYPE_TESTBED_MAX > type)); | 1255 | (GNUNET_MESSAGE_TYPE_TESTBED_MAX > type)); |
1256 | mq_entry = GNUNET_malloc (sizeof (struct MessageQueue)); | 1256 | mq_entry = GNUNET_new (struct MessageQueue); |
1257 | mq_entry->msg = msg; | 1257 | mq_entry->msg = msg; |
1258 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1258 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1259 | "Queueing message of type %u, size %u for sending\n", type, | 1259 | "Queueing message of type %u, size %u for sending\n", type, |
@@ -1295,10 +1295,10 @@ GNUNET_TESTBED_forward_operation_msg_ (struct GNUNET_TESTBED_Controller | |||
1295 | struct GNUNET_MessageHeader *dup_msg; | 1295 | struct GNUNET_MessageHeader *dup_msg; |
1296 | uint16_t msize; | 1296 | uint16_t msize; |
1297 | 1297 | ||
1298 | data = GNUNET_malloc (sizeof (struct ForwardedOperationData)); | 1298 | data = GNUNET_new (struct ForwardedOperationData); |
1299 | data->cc = cc; | 1299 | data->cc = cc; |
1300 | data->cc_cls = cc_cls; | 1300 | data->cc_cls = cc_cls; |
1301 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 1301 | opc = GNUNET_new (struct OperationContext); |
1302 | opc->c = controller; | 1302 | opc->c = controller; |
1303 | opc->type = OP_FORWARDED; | 1303 | opc->type = OP_FORWARDED; |
1304 | opc->data = data; | 1304 | opc->data = data; |
@@ -1482,7 +1482,7 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, | |||
1482 | GNUNET_break (0); | 1482 | GNUNET_break (0); |
1483 | return NULL; | 1483 | return NULL; |
1484 | } | 1484 | } |
1485 | controller = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Controller)); | 1485 | controller = GNUNET_new (struct GNUNET_TESTBED_Controller); |
1486 | controller->cc = cc; | 1486 | controller->cc = cc; |
1487 | controller->cc_cls = cc_cls; | 1487 | controller->cc_cls = cc_cls; |
1488 | controller->event_mask = event_mask; | 1488 | controller->event_mask = event_mask; |
@@ -1706,10 +1706,10 @@ GNUNET_TESTBED_controller_link (void *op_cls, | |||
1706 | msg->delegated_host_id = htonl (delegated_host_id); | 1706 | msg->delegated_host_id = htonl (delegated_host_id); |
1707 | msg->slave_host_id = htonl (slave_host_id); | 1707 | msg->slave_host_id = htonl (slave_host_id); |
1708 | msg->is_subordinate = (GNUNET_YES == is_subordinate) ? 1 : 0; | 1708 | msg->is_subordinate = (GNUNET_YES == is_subordinate) ? 1 : 0; |
1709 | data = GNUNET_malloc (sizeof (struct ControllerLinkData)); | 1709 | data = GNUNET_new (struct ControllerLinkData); |
1710 | data->msg = msg; | 1710 | data->msg = msg; |
1711 | data->host_id = delegated_host_id; | 1711 | data->host_id = delegated_host_id; |
1712 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 1712 | opc = GNUNET_new (struct OperationContext); |
1713 | opc->c = master; | 1713 | opc->c = master; |
1714 | opc->data = data; | 1714 | opc->data = data; |
1715 | opc->type = OP_LINK_CONTROLLERS; | 1715 | opc->type = OP_LINK_CONTROLLERS; |
@@ -1747,9 +1747,9 @@ GNUNET_TESTBED_get_slave_config_ (void *op_cls, | |||
1747 | struct OperationContext *opc; | 1747 | struct OperationContext *opc; |
1748 | struct GetSlaveConfigData *data; | 1748 | struct GetSlaveConfigData *data; |
1749 | 1749 | ||
1750 | data = GNUNET_malloc (sizeof (struct GetSlaveConfigData)); | 1750 | data = GNUNET_new (struct GetSlaveConfigData); |
1751 | data->slave_id = slave_host_id; | 1751 | data->slave_id = slave_host_id; |
1752 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 1752 | opc = GNUNET_new (struct OperationContext); |
1753 | opc->state = OPC_STATE_INIT; | 1753 | opc->state = OPC_STATE_INIT; |
1754 | opc->c = master; | 1754 | opc->c = master; |
1755 | opc->id = GNUNET_TESTBED_get_next_op_id (master); | 1755 | opc->id = GNUNET_TESTBED_get_next_op_id (master); |
@@ -2076,7 +2076,7 @@ opstart_shutdown_peers (void *cls) | |||
2076 | struct GNUNET_TESTBED_ShutdownPeersMessage *msg; | 2076 | struct GNUNET_TESTBED_ShutdownPeersMessage *msg; |
2077 | 2077 | ||
2078 | opc->state = OPC_STATE_STARTED; | 2078 | opc->state = OPC_STATE_STARTED; |
2079 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); | 2079 | msg = GNUNET_new (struct GNUNET_TESTBED_ShutdownPeersMessage); |
2080 | msg->header.size = | 2080 | msg->header.size = |
2081 | htons (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); | 2081 | htons (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); |
2082 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS); | 2082 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS); |
@@ -2137,10 +2137,10 @@ GNUNET_TESTBED_shutdown_peers (struct GNUNET_TESTBED_Controller *c, | |||
2137 | 2137 | ||
2138 | if (0 != GNUNET_CONTAINER_multihashmap32_size (c->opc_map)) | 2138 | if (0 != GNUNET_CONTAINER_multihashmap32_size (c->opc_map)) |
2139 | return NULL; | 2139 | return NULL; |
2140 | data = GNUNET_malloc (sizeof (struct ShutdownPeersData)); | 2140 | data = GNUNET_new (struct ShutdownPeersData); |
2141 | data->cb = cb; | 2141 | data->cb = cb; |
2142 | data->cb_cls = cb_cls; | 2142 | data->cb_cls = cb_cls; |
2143 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 2143 | opc = GNUNET_new (struct OperationContext); |
2144 | opc->c = c; | 2144 | opc->c = c; |
2145 | opc->op_cls = op_cls; | 2145 | opc->op_cls = op_cls; |
2146 | opc->data = data; | 2146 | opc->data = data; |