diff options
author | xrs <xrs@mail36.net> | 2020-03-19 21:03:42 +0100 |
---|---|---|
committer | xrs <xrs@mail36.net> | 2020-05-21 22:46:49 +0200 |
commit | bb4940568b6ccf5915c8a4b5bcffd5dbdfe8e54d (patch) | |
tree | 6e85233924b2843341378cbbed3415fb2e9a634b | |
parent | 3abd69eb010eab9c5c218e0f5df14d46386758eb (diff) | |
download | gnunet-bb4940568b6ccf5915c8a4b5bcffd5dbdfe8e54d.tar.gz gnunet-bb4940568b6ccf5915c8a4b5bcffd5dbdfe8e54d.zip |
handle received message; fix format; fix testbed ops
-rw-r--r-- | src/cadet/test_cadeT.c | 19 | ||||
-rw-r--r-- | src/cadet/test_cadeT_util.c | 14 | ||||
-rw-r--r-- | src/cadet/test_cadeT_util.h | 3 |
3 files changed, 19 insertions, 17 deletions
diff --git a/src/cadet/test_cadeT.c b/src/cadet/test_cadeT.c index c939976b2..3bf8e2ad9 100644 --- a/src/cadet/test_cadeT.c +++ b/src/cadet/test_cadeT.c | |||
@@ -31,8 +31,8 @@ | |||
31 | * x setup cadet on peer B listening on port "cadet_port" | 31 | * x setup cadet on peer B listening on port "cadet_port" |
32 | * x create a channel from peer A to B | 32 | * x create a channel from peer A to B |
33 | * x create method to find out KX initiator | 33 | * x create method to find out KX initiator |
34 | * - send a message over channel | 34 | * x send a message over channel |
35 | * - check if message was received | 35 | * x check if message was received |
36 | * - breakup the connection without the receiver receiving a channel destroy message | 36 | * - breakup the connection without the receiver receiving a channel destroy message |
37 | * - assert tunnel is down | 37 | * - assert tunnel is down |
38 | * - resume channel (second handshake for tunnel) | 38 | * - resume channel (second handshake for tunnel) |
@@ -42,7 +42,9 @@ | |||
42 | * | 42 | * |
43 | * Questions: | 43 | * Questions: |
44 | * - can we simulate hard breakups with TESTBED? | 44 | * - can we simulate hard breakups with TESTBED? |
45 | * - yes, with GNUNET_TESTBED_underlay_configure_link | 45 | * - GNUNET_TESTBED_underlay_configure_link not implemented |
46 | * - GNUNET_TESTBED_underlaylinkmodel_set_link not usable | ||
47 | * - GNUNET_TESTBED_peer_stop evokes standard service disconnect | ||
46 | * - how can we test the sublayers of CADET, e.g. connection, tunnel, channel? | 48 | * - how can we test the sublayers of CADET, e.g. connection, tunnel, channel? |
47 | * | 49 | * |
48 | * Development | 50 | * Development |
@@ -61,8 +63,9 @@ | |||
61 | 63 | ||
62 | static int kx_initiator; | 64 | static int kx_initiator; |
63 | 65 | ||
64 | void | 66 | void |
65 | handle_message () | 67 | handle_message (void *cls, |
68 | const struct GNUNET_MessageHeader *msg) | ||
66 | { | 69 | { |
67 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); | 70 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); |
68 | } | 71 | } |
@@ -75,9 +78,11 @@ send_message () | |||
75 | 78 | ||
76 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); | 79 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); |
77 | 80 | ||
78 | envelope = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_DUMMY); | 81 | envelope = GNUNET_MQ_msg (msg, |
82 | GNUNET_MESSAGE_TYPE_DUMMY); | ||
79 | 83 | ||
80 | GNUNET_MQ_send (GNUNET_CADET_get_mq (test_peers[0].channel), envelope); | 84 | GNUNET_MQ_send (GNUNET_CADET_get_mq (test_peers[0].channel), |
85 | envelope); | ||
81 | } | 86 | } |
82 | 87 | ||
83 | /** | 88 | /** |
diff --git a/src/cadet/test_cadeT_util.c b/src/cadet/test_cadeT_util.c index e983dab12..f2082a006 100644 --- a/src/cadet/test_cadeT_util.c +++ b/src/cadet/test_cadeT_util.c | |||
@@ -58,7 +58,10 @@ shutdown_task (void *cls) | |||
58 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); | 58 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); |
59 | 59 | ||
60 | for (int i=0; i<REQUESTED_PEERS; i++) | 60 | for (int i=0; i<REQUESTED_PEERS; i++) |
61 | { | ||
61 | GNUNET_TESTBED_operation_done (testbed_to_svc[i]); | 62 | GNUNET_TESTBED_operation_done (testbed_to_svc[i]); |
63 | GNUNET_TESTBED_operation_done (testbed_info_req[i]); | ||
64 | } | ||
62 | } | 65 | } |
63 | 66 | ||
64 | static void | 67 | static void |
@@ -91,13 +94,6 @@ setup_initiating_peer (void *cls, | |||
91 | { | 94 | { |
92 | struct GNUNET_CADET_Handle *cadet; | 95 | struct GNUNET_CADET_Handle *cadet; |
93 | struct GNUNET_CADET_Channel *channel; | 96 | struct GNUNET_CADET_Channel *channel; |
94 | struct GNUNET_MQ_MessageHandler msg_handlers[] = { | ||
95 | GNUNET_MQ_hd_fixed_size (message, | ||
96 | GNUNET_MESSAGE_TYPE_DUMMY, | ||
97 | struct GNUNET_MessageHeader, | ||
98 | NULL), | ||
99 | GNUNET_MQ_handler_end () | ||
100 | }; | ||
101 | 97 | ||
102 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); | 98 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); |
103 | 99 | ||
@@ -113,7 +109,7 @@ setup_initiating_peer (void *cls, | |||
113 | &hashed_portname, | 109 | &hashed_portname, |
114 | NULL, | 110 | NULL, |
115 | &disconnect_channel, | 111 | &disconnect_channel, |
116 | msg_handlers); | 112 | NULL); |
117 | test_peers[0].channel = channel; | 113 | test_peers[0].channel = channel; |
118 | 114 | ||
119 | return cadet; | 115 | return cadet; |
@@ -184,7 +180,7 @@ peerinfo_complete () | |||
184 | return (REQUESTED_PEERS == ++peerinfo_cnt) ? GNUNET_YES : GNUNET_NO; | 180 | return (REQUESTED_PEERS == ++peerinfo_cnt) ? GNUNET_YES : GNUNET_NO; |
185 | } | 181 | } |
186 | 182 | ||
187 | void | 183 | static void |
188 | connect_to_service (void *cb_cls, | 184 | connect_to_service (void *cb_cls, |
189 | struct GNUNET_TESTBED_Operation *op, | 185 | struct GNUNET_TESTBED_Operation *op, |
190 | const struct GNUNET_TESTBED_PeerInformation *pinfo, | 186 | const struct GNUNET_TESTBED_PeerInformation *pinfo, |
diff --git a/src/cadet/test_cadeT_util.h b/src/cadet/test_cadeT_util.h index de1a24a26..1c85abab6 100644 --- a/src/cadet/test_cadeT_util.h +++ b/src/cadet/test_cadeT_util.h | |||
@@ -37,7 +37,8 @@ void prepare_test (); | |||
37 | 37 | ||
38 | void run_test (); | 38 | void run_test (); |
39 | 39 | ||
40 | void handle_message (); | 40 | void handle_message (void *cls, |
41 | const struct GNUNET_MessageHeader *msg); | ||
41 | 42 | ||
42 | /** | 43 | /** |
43 | * Structure for storing information of testbed peers. | 44 | * Structure for storing information of testbed peers. |