aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxrs <xrs@mail36.net>2020-03-18 21:17:43 +0100
committerxrs <xrs@mail36.net>2020-05-21 22:46:49 +0200
commit3abd69eb010eab9c5c218e0f5df14d46386758eb (patch)
tree5ce25616701f243f70b51f3e36509ea16acc6782
parentd65ca2bef7393aa517f50f86f0921047f02a34dc (diff)
downloadgnunet-3abd69eb010eab9c5c218e0f5df14d46386758eb.tar.gz
gnunet-3abd69eb010eab9c5c218e0f5df14d46386758eb.zip
send a message from A to B
-rw-r--r--src/cadet/test_cadeT.c14
-rw-r--r--src/cadet/test_cadeT_util.c18
-rw-r--r--src/cadet/test_cadeT_util.h2
3 files changed, 32 insertions, 2 deletions
diff --git a/src/cadet/test_cadeT.c b/src/cadet/test_cadeT.c
index 17db2418b..c939976b2 100644
--- a/src/cadet/test_cadeT.c
+++ b/src/cadet/test_cadeT.c
@@ -61,9 +61,23 @@
61 61
62static int kx_initiator; 62static int kx_initiator;
63 63
64void
65handle_message ()
66{
67 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__);
68}
69
64static void 70static void
65send_message () 71send_message ()
66{ 72{
73 struct GNUNET_MQ_Envelope *envelope;
74 struct GNUNET_MessageHeader *msg;
75
76 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__);
77
78 envelope = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_DUMMY);
79
80 GNUNET_MQ_send (GNUNET_CADET_get_mq (test_peers[0].channel), envelope);
67} 81}
68 82
69/** 83/**
diff --git a/src/cadet/test_cadeT_util.c b/src/cadet/test_cadeT_util.c
index fc59349aa..e983dab12 100644
--- a/src/cadet/test_cadeT_util.c
+++ b/src/cadet/test_cadeT_util.c
@@ -91,6 +91,13 @@ setup_initiating_peer (void *cls,
91{ 91{
92 struct GNUNET_CADET_Handle *cadet; 92 struct GNUNET_CADET_Handle *cadet;
93 struct GNUNET_CADET_Channel *channel; 93 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 };
94 101
95 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); 102 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__);
96 103
@@ -106,7 +113,7 @@ setup_initiating_peer (void *cls,
106 &hashed_portname, 113 &hashed_portname,
107 NULL, 114 NULL,
108 &disconnect_channel, 115 &disconnect_channel,
109 NULL); 116 msg_handlers);
110 test_peers[0].channel = channel; 117 test_peers[0].channel = channel;
111 118
112 return cadet; 119 return cadet;
@@ -132,6 +139,13 @@ setup_listening_peer (void *cls,
132{ 139{
133 struct GNUNET_CADET_Handle *cadet; 140 struct GNUNET_CADET_Handle *cadet;
134 struct GNUNET_CADET_Port *port; 141 struct GNUNET_CADET_Port *port;
142 struct GNUNET_MQ_MessageHandler msg_handlers[] = {
143 GNUNET_MQ_hd_fixed_size (message,
144 GNUNET_MESSAGE_TYPE_DUMMY,
145 struct GNUNET_MessageHeader,
146 NULL),
147 GNUNET_MQ_handler_end ()
148 };
135 149
136 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); 150 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__);
137 151
@@ -147,7 +161,7 @@ setup_listening_peer (void *cls,
147 NULL, 161 NULL,
148 NULL, 162 NULL,
149 &handle_port_disconnects, 163 &handle_port_disconnects,
150 NULL); 164 msg_handlers);
151 165
152 return cadet; 166 return cadet;
153} 167}
diff --git a/src/cadet/test_cadeT_util.h b/src/cadet/test_cadeT_util.h
index 7b92dc2cb..de1a24a26 100644
--- a/src/cadet/test_cadeT_util.h
+++ b/src/cadet/test_cadeT_util.h
@@ -37,6 +37,8 @@ void prepare_test ();
37 37
38void run_test (); 38void run_test ();
39 39
40void handle_message ();
41
40/** 42/**
41 * Structure for storing information of testbed peers. 43 * Structure for storing information of testbed peers.
42 */ 44 */