summaryrefslogtreecommitdiff
path: root/src/transport/test_transport_plugin_cmd_simple_send_dv.c
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2022-03-17 14:28:40 +0100
committert3sserakt <t3ss@posteo.de>2022-03-17 14:28:40 +0100
commit95a1edacccd9b3bf769a144a12d41946d0ac25dc (patch)
treeb84608361cd836d29649f076589dd42943d1301f /src/transport/test_transport_plugin_cmd_simple_send_dv.c
parent16c9959d9b395b179446ee4a2cb70f3563c4fb20 (diff)
- Trying to exchange iptables with nft, first shot failed.
- Fixed small bug in UDP communicator. - Fixed bug in DV circle test case - Introduced a default value to wait for a reliability ack. - Introduced a FC retransmission threshold together with a retransmission count. - Introduced a original size value for TransportDVBoxMessage - Checking if we have the root pending messge, when removing the pending message from virtual link. - Added delay value to schedule_transmit_on_queue to wait for retransmitting. - Checking for confirmed virtual link, before routing. - Allow unconfirmed queues or DV routes when doing dv encapsulation for control traffic. - Changed check_vl_transmission to also check window size for DV next hop peer. - Fixed fragment box handling to also handle reliability boxed message which needed to be fragmented. - Fixed completing a message which was not only fragmented but also DV boxed. - Added logic to notify core about a new virtual link using distance vector without having validated next neighbour. - Added logic to create a virtual link to handle flow control messages. - fixed several smaller bugs in fragmentation logic. - Changed logic for adding the next_attempt value of PendingMessage.
Diffstat (limited to 'src/transport/test_transport_plugin_cmd_simple_send_dv.c')
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send_dv.c79
1 files changed, 42 insertions, 37 deletions
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_dv.c b/src/transport/test_transport_plugin_cmd_simple_send_dv.c
index 167120e2b..f1f168102 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.c
@@ -65,12 +65,12 @@ struct TestState
*/
struct GNUNET_TESTING_NetjailTopology *topology;
- /**
+};
+
+/**
* The number of messages received.
*/
- unsigned int number_received;
-
-};
+static unsigned int number_received;
static struct GNUNET_TESTING_Command block_send;
@@ -105,52 +105,61 @@ static void
handle_test (void *cls,
const struct GNUNET_TRANSPORT_TESTING_TestMessage *message)
{
- struct TestState *ts = cls;
+ struct GNUNET_PeerIdentity *peer = cls;
const struct GNUNET_TESTING_AsyncContext *ac_block;
const struct GNUNET_TESTING_AsyncContext *ac_start;
const struct GNUNET_TESTING_Command *cmd;
const struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map;
unsigned int connected;
struct BlockState *bs;
+ struct GNUNET_TRANSPORT_CoreHandle *ch;
+ const struct StartPeerState *sps;
-
+ GNUNET_TRANSPORT_get_trait_state (&start_peer,
+ &sps);
+ ch = sps->th;
GNUNET_TRANSPORT_get_trait_connected_peers_map (&start_peer,
&connected_peers_map);
- connected = GNUNET_CONTAINER_multishortmap_size (
- connected_peers_map);
+ if (NULL != connected_peers_map)
+ {
+ connected = GNUNET_CONTAINER_multishortmap_size (
+ connected_peers_map);
- ts->number_received++;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received %u test message(s) from %u connected peer(s)\n",
- ts->number_received,
- connected);
+ number_received++;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received %u test message(s) from %s, %u connected peer(s)\n",
+ number_received,
+ GNUNET_i2s (peer),
+ connected);
- GNUNET_TESTING_get_trait_async_context (&block_receive,
- &ac_block);
+ GNUNET_TESTING_get_trait_async_context (&block_receive,
+ &ac_block);
- if ( connected == ts->number_received)
- {
- if (NULL != ac_block->is)
+ if ( connected == number_received)
{
- GNUNET_assert (NULL != ac_block);
- if (NULL == ac_block->cont)
- GNUNET_TESTING_async_fail ((struct
- GNUNET_TESTING_AsyncContext *) ac_block);
- else
- GNUNET_TESTING_async_finish ((struct
+ if (NULL != ac_block->is)
+ {
+ GNUNET_assert (NULL != ac_block);
+ if (NULL == ac_block->cont)
+ GNUNET_TESTING_async_fail ((struct
GNUNET_TESTING_AsyncContext *) ac_block);
- }
- else
- {
- GNUNET_TESTING_get_trait_block_state (
- &block_receive,
- (const struct BlockState **) &bs);
- bs->asynchronous_finish = GNUNET_YES;
- }
+ else
+ GNUNET_TESTING_async_finish ((struct
+ GNUNET_TESTING_AsyncContext *) ac_block);
+ }
+ else
+ {
+ GNUNET_TESTING_get_trait_block_state (
+ &block_receive,
+ (const struct BlockState **) &bs);
+ bs->asynchronous_finish = GNUNET_YES;
+ }
+ }
}
+ GNUNET_TRANSPORT_core_receive_continue (ch, peer);
}
@@ -284,10 +293,6 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
GNUNET_MQ_handler_end ()
};
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "number_received %u\n",
- ts->number_received);
-
if (GNUNET_YES == *read_file)
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -347,7 +352,7 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
handlers,
ts->cfgname,
notify_connect,
- GNUNET_YES);
+ GNUNET_NO);
struct GNUNET_TESTING_Command commands[] = {
GNUNET_TESTING_cmd_system_create ("system-create",
ts->testdir),