diff options
Diffstat (limited to 'src/transport')
18 files changed, 82 insertions, 73 deletions
diff --git a/src/transport/gnunet-communicator-quic.c b/src/transport/gnunet-communicator-quic.c index 700fd0ca4..76b0ebd62 100644 --- a/src/transport/gnunet-communicator-quic.c +++ b/src/transport/gnunet-communicator-quic.c | |||
@@ -21,9 +21,9 @@ | |||
21 | /* Currently equivalent to QUICHE_MAX_CONN_ID_LEN */ | 21 | /* Currently equivalent to QUICHE_MAX_CONN_ID_LEN */ |
22 | #define LOCAL_CONN_ID_LEN 20 | 22 | #define LOCAL_CONN_ID_LEN 20 |
23 | #define MAX_TOKEN_LEN \ | 23 | #define MAX_TOKEN_LEN \ |
24 | sizeof("quiche") - 1 + \ | 24 | sizeof("quiche") - 1 \ |
25 | sizeof(struct sockaddr_storage) + \ | 25 | + sizeof(struct sockaddr_storage) \ |
26 | QUICHE_MAX_CONN_ID_LEN | 26 | + QUICHE_MAX_CONN_ID_LEN |
27 | #define CID_LEN sizeof(uint8_t) * QUICHE_MAX_CONN_ID_LEN | 27 | #define CID_LEN sizeof(uint8_t) * QUICHE_MAX_CONN_ID_LEN |
28 | #define TOKEN_LEN sizeof(uint8_t) * MAX_TOKEN_LEN | 28 | #define TOKEN_LEN sizeof(uint8_t) * MAX_TOKEN_LEN |
29 | /* Generic, bidirectional, client-initiated quic stream id */ | 29 | /* Generic, bidirectional, client-initiated quic stream id */ |
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c index d8d37bbb7..faacb3aab 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c | |||
@@ -52,7 +52,7 @@ | |||
52 | * the other peer should revalidate). | 52 | * the other peer should revalidate). |
53 | */ | 53 | */ |
54 | #define ADDRESS_VALIDITY_PERIOD \ | 54 | #define ADDRESS_VALIDITY_PERIOD \ |
55 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) | 55 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * How many messages do we keep at most in the queue to the | 58 | * How many messages do we keep at most in the queue to the |
@@ -91,16 +91,16 @@ | |||
91 | * directions. | 91 | * directions. |
92 | */ | 92 | */ |
93 | #define INITIAL_KX_SIZE \ | 93 | #define INITIAL_KX_SIZE \ |
94 | (sizeof(struct GNUNET_CRYPTO_EcdhePublicKey) \ | 94 | (sizeof(struct GNUNET_CRYPTO_EcdhePublicKey) \ |
95 | + sizeof(struct TCPConfirmation)) | 95 | + sizeof(struct TCPConfirmation)) |
96 | 96 | ||
97 | /** | 97 | /** |
98 | * Size of the initial core key exchange messages. | 98 | * Size of the initial core key exchange messages. |
99 | */ | 99 | */ |
100 | #define INITIAL_CORE_KX_SIZE \ | 100 | #define INITIAL_CORE_KX_SIZE \ |
101 | (sizeof(struct EphemeralKeyMessage) \ | 101 | (sizeof(struct EphemeralKeyMessage) \ |
102 | + sizeof(struct PingMessage) \ | 102 | + sizeof(struct PingMessage) \ |
103 | + sizeof(struct PongMessage)) | 103 | + sizeof(struct PongMessage)) |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * Address prefix used by the communicator. | 106 | * Address prefix used by the communicator. |
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c index 50e66e13a..f5cf7ab0f 100644 --- a/src/transport/gnunet-communicator-udp.c +++ b/src/transport/gnunet-communicator-udp.c | |||
@@ -68,7 +68,7 @@ | |||
68 | * How often do we scan for changes to our network interfaces? | 68 | * How often do we scan for changes to our network interfaces? |
69 | */ | 69 | */ |
70 | #define INTERFACE_SCAN_FREQUENCY \ | 70 | #define INTERFACE_SCAN_FREQUENCY \ |
71 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) | 71 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * How long do we believe our addresses to remain up (before | 74 | * How long do we believe our addresses to remain up (before |
@@ -77,7 +77,7 @@ | |||
77 | #define ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS | 77 | #define ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS |
78 | 78 | ||
79 | #define WORKING_QUEUE_INTERVALL \ | 79 | #define WORKING_QUEUE_INTERVALL \ |
80 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1) | 80 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1) |
81 | 81 | ||
82 | /** | 82 | /** |
83 | * AES key size. | 83 | * AES key size. |
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index a008daff3..083db325e 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -186,20 +186,20 @@ | |||
186 | * the value chosen here might be too aggressively low! | 186 | * the value chosen here might be too aggressively low! |
187 | */ | 187 | */ |
188 | #define DELAY_WARN_THRESHOLD \ | 188 | #define DELAY_WARN_THRESHOLD \ |
189 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) | 189 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) |
190 | 190 | ||
191 | /** | 191 | /** |
192 | * If a DVBox could not be forwarded after this number of | 192 | * If a DVBox could not be forwarded after this number of |
193 | * seconds we drop it. | 193 | * seconds we drop it. |
194 | */ | 194 | */ |
195 | #define DV_FORWARD_TIMEOUT \ | 195 | #define DV_FORWARD_TIMEOUT \ |
196 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) | 196 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) |
197 | 197 | ||
198 | /** | 198 | /** |
199 | * Default value for how long we wait for reliability ack. | 199 | * Default value for how long we wait for reliability ack. |
200 | */ | 200 | */ |
201 | #define DEFAULT_ACK_WAIT_DURATION \ | 201 | #define DEFAULT_ACK_WAIT_DURATION \ |
202 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) | 202 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) |
203 | 203 | ||
204 | /** | 204 | /** |
205 | * We only consider queues as "quality" connections when | 205 | * We only consider queues as "quality" connections when |
@@ -207,53 +207,53 @@ | |||
207 | * the latency of the queue is below this threshold. | 207 | * the latency of the queue is below this threshold. |
208 | */ | 208 | */ |
209 | #define DV_QUALITY_RTT_THRESHOLD \ | 209 | #define DV_QUALITY_RTT_THRESHOLD \ |
210 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) | 210 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) |
211 | 211 | ||
212 | /** | 212 | /** |
213 | * How long do we consider a DV path valid if we see no | 213 | * How long do we consider a DV path valid if we see no |
214 | * further updates on it? Note: the value chosen here might be too low! | 214 | * further updates on it? Note: the value chosen here might be too low! |
215 | */ | 215 | */ |
216 | #define DV_PATH_VALIDITY_TIMEOUT \ | 216 | #define DV_PATH_VALIDITY_TIMEOUT \ |
217 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) | 217 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
218 | 218 | ||
219 | /** | 219 | /** |
220 | * How long do we cache backchannel (struct Backtalker) information | 220 | * How long do we cache backchannel (struct Backtalker) information |
221 | * after a backchannel goes inactive? | 221 | * after a backchannel goes inactive? |
222 | */ | 222 | */ |
223 | #define BACKCHANNEL_INACTIVITY_TIMEOUT \ | 223 | #define BACKCHANNEL_INACTIVITY_TIMEOUT \ |
224 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) | 224 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) |
225 | 225 | ||
226 | /** | 226 | /** |
227 | * How long before paths expire would we like to (re)discover DV paths? Should | 227 | * How long before paths expire would we like to (re)discover DV paths? Should |
228 | * be below #DV_PATH_VALIDITY_TIMEOUT. | 228 | * be below #DV_PATH_VALIDITY_TIMEOUT. |
229 | */ | 229 | */ |
230 | #define DV_PATH_DISCOVERY_FREQUENCY \ | 230 | #define DV_PATH_DISCOVERY_FREQUENCY \ |
231 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) | 231 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * How long are ephemeral keys valid? | 234 | * How long are ephemeral keys valid? |
235 | */ | 235 | */ |
236 | #define EPHEMERAL_VALIDITY \ | 236 | #define EPHEMERAL_VALIDITY \ |
237 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) | 237 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
238 | 238 | ||
239 | /** | 239 | /** |
240 | * How long do we keep partially reassembled messages around before giving up? | 240 | * How long do we keep partially reassembled messages around before giving up? |
241 | */ | 241 | */ |
242 | #define REASSEMBLY_EXPIRATION \ | 242 | #define REASSEMBLY_EXPIRATION \ |
243 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) | 243 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4) |
244 | 244 | ||
245 | /** | 245 | /** |
246 | * What is the fastest rate at which we send challenges *if* we keep learning | 246 | * What is the fastest rate at which we send challenges *if* we keep learning |
247 | * an address (gossip, DHT, etc.)? | 247 | * an address (gossip, DHT, etc.)? |
248 | */ | 248 | */ |
249 | #define FAST_VALIDATION_CHALLENGE_FREQ \ | 249 | #define FAST_VALIDATION_CHALLENGE_FREQ \ |
250 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1) | 250 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1) |
251 | 251 | ||
252 | /** | 252 | /** |
253 | * What is the slowest rate at which we send challenges? | 253 | * What is the slowest rate at which we send challenges? |
254 | */ | 254 | */ |
255 | #define MAX_VALIDATION_CHALLENGE_FREQ \ | 255 | #define MAX_VALIDATION_CHALLENGE_FREQ \ |
256 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1) | 256 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1) |
257 | 257 | ||
258 | /** | 258 | /** |
259 | * How long until we forget about historic accumulators and thus | 259 | * How long until we forget about historic accumulators and thus |
@@ -261,7 +261,7 @@ | |||
261 | * active connection experiences without an ACK. | 261 | * active connection experiences without an ACK. |
262 | */ | 262 | */ |
263 | #define ACK_CUMMULATOR_TIMEOUT \ | 263 | #define ACK_CUMMULATOR_TIMEOUT \ |
264 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) | 264 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
265 | 265 | ||
266 | /** | 266 | /** |
267 | * What is the non-randomized base frequency at which we | 267 | * What is the non-randomized base frequency at which we |
@@ -279,13 +279,13 @@ | |||
279 | * When do we forget an invalid address for sure? | 279 | * When do we forget an invalid address for sure? |
280 | */ | 280 | */ |
281 | #define MAX_ADDRESS_VALID_UNTIL \ | 281 | #define MAX_ADDRESS_VALID_UNTIL \ |
282 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1) | 282 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1) |
283 | 283 | ||
284 | /** | 284 | /** |
285 | * How long do we consider an address valid if we just checked? | 285 | * How long do we consider an address valid if we just checked? |
286 | */ | 286 | */ |
287 | #define ADDRESS_VALIDATION_LIFETIME \ | 287 | #define ADDRESS_VALIDATION_LIFETIME \ |
288 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) | 288 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
289 | 289 | ||
290 | /** | 290 | /** |
291 | * What is the maximum frequency at which we do address validation? | 291 | * What is the maximum frequency at which we do address validation? |
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c index 40353daeb..a033985e1 100644 --- a/src/transport/plugin_transport_http_common.c +++ b/src/transport/plugin_transport_http_common.c | |||
@@ -604,7 +604,7 @@ http_common_plugin_address_to_string (const char *plugin, | |||
604 | if (addr_str[ntohl (address->urlen) - 1] != '\0') | 604 | if (addr_str[ntohl (address->urlen) - 1] != '\0') |
605 | return NULL; | 605 | return NULL; |
606 | GNUNET_asprintf (&res, "%s.%u.%s", plugin, ntohl (address->options), | 606 | GNUNET_asprintf (&res, "%s.%u.%s", plugin, ntohl (address->options), |
607 | (char*)&address[1]); | 607 | (char*) &address[1]); |
608 | if (strlen (res) + 1 < 500) | 608 | if (strlen (res) + 1 < 500) |
609 | { | 609 | { |
610 | GNUNET_memcpy (rbuf, res, strlen (res) + 1); | 610 | GNUNET_memcpy (rbuf, res, strlen (res) + 1); |
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 138fb5080..3ac106859 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -1873,7 +1873,8 @@ handle_helper_message (void *cls, | |||
1873 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1873 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1874 | "Size of packet is too small (%llu bytes < %llu)\n", | 1874 | "Size of packet is too small (%llu bytes < %llu)\n", |
1875 | (unsigned long long) msize, | 1875 | (unsigned long long) msize, |
1876 | (unsigned long long) sizeof(struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage)); | 1876 | (unsigned long long) sizeof(struct |
1877 | GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage)); | ||
1877 | break; | 1878 | break; |
1878 | } | 1879 | } |
1879 | rxinfo = (const struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage *) hdr; | 1880 | rxinfo = (const struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage *) hdr; |
diff --git a/src/transport/test_communicator_basic.c b/src/transport/test_communicator_basic.c index 1658c2151..713275fd3 100644 --- a/src/transport/test_communicator_basic.c +++ b/src/transport/test_communicator_basic.c | |||
@@ -104,13 +104,13 @@ static unsigned int iterations_left[NUM_PEERS]; | |||
104 | #define TIMEOUT_MULTIPLIER 1 | 104 | #define TIMEOUT_MULTIPLIER 1 |
105 | 105 | ||
106 | #define DELAY \ | 106 | #define DELAY \ |
107 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,200) | 107 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,200) |
108 | 108 | ||
109 | #define SHORT_BURST_WINDOW \ | 109 | #define SHORT_BURST_WINDOW \ |
110 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,2) | 110 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,2) |
111 | 111 | ||
112 | #define LONG_BURST_WINDOW \ | 112 | #define LONG_BURST_WINDOW \ |
113 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,2) | 113 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,2) |
114 | 114 | ||
115 | enum TestPhase | 115 | enum TestPhase |
116 | { | 116 | { |
diff --git a/src/transport/test_transport_api2.c b/src/transport/test_transport_api2.c index e1606e0be..4d423f7c2 100644 --- a/src/transport/test_transport_api2.c +++ b/src/transport/test_transport_api2.c | |||
@@ -28,7 +28,7 @@ | |||
28 | * C code apparently. | 28 | * C code apparently. |
29 | */ | 29 | */ |
30 | #include "platform.h" | 30 | #include "platform.h" |
31 | //#include "gnunet_transport_service.h" | 31 | // #include "gnunet_transport_service.h" |
32 | #include "transport-testing2.h" | 32 | #include "transport-testing2.h" |
33 | 33 | ||
34 | /** | 34 | /** |
diff --git a/src/transport/test_transport_plugin_cmd_nat_upnp.c b/src/transport/test_transport_plugin_cmd_nat_upnp.c index 1b02fbfc2..bb1c2be0a 100644 --- a/src/transport/test_transport_plugin_cmd_nat_upnp.c +++ b/src/transport/test_transport_plugin_cmd_nat_upnp.c | |||
@@ -90,7 +90,7 @@ handle_test (void *cls, | |||
90 | struct GNUNET_TESTING_BarrierList* | 90 | struct GNUNET_TESTING_BarrierList* |
91 | get_waiting_for_barriers () | 91 | get_waiting_for_barriers () |
92 | { | 92 | { |
93 | struct GNUNET_TESTING_BarrierList* barriers; | 93 | struct GNUNET_TESTING_BarrierList*barriers; |
94 | struct GNUNET_TESTING_BarrierListEntry *ble; | 94 | struct GNUNET_TESTING_BarrierListEntry *ble; |
95 | 95 | ||
96 | barriers = GNUNET_new (struct GNUNET_TESTING_BarrierList); | 96 | barriers = GNUNET_new (struct GNUNET_TESTING_BarrierList); |
@@ -209,7 +209,7 @@ all_local_tests_prepared () | |||
209 | * the topology configuration. | 209 | * the topology configuration. |
210 | * @param read_file If read_file is GNUNET_YES this string is the filename for the topology configuration, | 210 | * @param read_file If read_file is GNUNET_YES this string is the filename for the topology configuration, |
211 | * if read_file is GNUNET_NO the string contains the topology configuration. | 211 | * if read_file is GNUNET_NO the string contains the topology configuration. |
212 | * @param finish_cb Callback function which writes a message from the helper process running on a netjail | 212 | * @param finish_cb Callback function which writes a message from the helper process running on a netjail |
213 | * node to the master process * signaling that the test case running on the netjail node finished. | 213 | * node to the master process * signaling that the test case running on the netjail node finished. |
214 | * @return Returns the struct GNUNET_TESTING_Interpreter of the command loop running on this netjail node. | 214 | * @return Returns the struct GNUNET_TESTING_Interpreter of the command loop running on this netjail node. |
215 | */ | 215 | */ |
@@ -357,9 +357,9 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, | |||
357 | ts->write_message = write_message; | 357 | ts->write_message = write_message; |
358 | 358 | ||
359 | is = GNUNET_TESTING_run (commands, | 359 | is = GNUNET_TESTING_run (commands, |
360 | TIMEOUT, | 360 | TIMEOUT, |
361 | &handle_result, | 361 | &handle_result, |
362 | ts); | 362 | ts); |
363 | return is; | 363 | return is; |
364 | } | 364 | } |
365 | 365 | ||
diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c b/src/transport/test_transport_plugin_cmd_simple_send.c index 375796dff..8a96e19f9 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send.c +++ b/src/transport/test_transport_plugin_cmd_simple_send.c | |||
@@ -90,7 +90,7 @@ handle_test (void *cls, | |||
90 | struct GNUNET_TESTING_BarrierList * | 90 | struct GNUNET_TESTING_BarrierList * |
91 | get_waiting_for_barriers () | 91 | get_waiting_for_barriers () |
92 | { | 92 | { |
93 | //No Barrier | 93 | // No Barrier |
94 | return GNUNET_new (struct GNUNET_TESTING_BarrierList); | 94 | return GNUNET_new (struct GNUNET_TESTING_BarrierList); |
95 | } | 95 | } |
96 | 96 | ||
@@ -326,9 +326,9 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, | |||
326 | ts->write_message = write_message; | 326 | ts->write_message = write_message; |
327 | 327 | ||
328 | is = GNUNET_TESTING_run (commands, | 328 | is = GNUNET_TESTING_run (commands, |
329 | TIMEOUT, | 329 | TIMEOUT, |
330 | &handle_result, | 330 | &handle_result, |
331 | ts); | 331 | ts); |
332 | return is; | 332 | return is; |
333 | } | 333 | } |
334 | 334 | ||
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c index 7381b1d7e..7000851c4 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c | |||
@@ -90,7 +90,7 @@ handle_test (void *cls, | |||
90 | struct GNUNET_TESTING_BarrierList * | 90 | struct GNUNET_TESTING_BarrierList * |
91 | get_waiting_for_barriers () | 91 | get_waiting_for_barriers () |
92 | { | 92 | { |
93 | //No Barrier | 93 | // No Barrier |
94 | return GNUNET_new (struct GNUNET_TESTING_BarrierList); | 94 | return GNUNET_new (struct GNUNET_TESTING_BarrierList); |
95 | } | 95 | } |
96 | 96 | ||
@@ -147,12 +147,11 @@ static void * | |||
147 | notify_connect (struct GNUNET_TESTING_Interpreter *is, | 147 | notify_connect (struct GNUNET_TESTING_Interpreter *is, |
148 | const struct GNUNET_PeerIdentity *peer) | 148 | const struct GNUNET_PeerIdentity *peer) |
149 | { | 149 | { |
150 | const struct GNUNET_TESTING_AsyncContext *ac; | 150 | struct GNUNET_TESTING_AsyncContext *ac; |
151 | void *ret = NULL; | 151 | void *ret = NULL; |
152 | const struct GNUNET_TESTING_Command *cmd; | 152 | const struct GNUNET_TESTING_Command *cmd; |
153 | struct GNUNET_TESTING_BlockState *bs; | 153 | struct GNUNET_TESTING_BlockState *bs; |
154 | 154 | ||
155 | |||
156 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 155 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
157 | "notify_connect\n"); | 156 | "notify_connect\n"); |
158 | 157 | ||
@@ -165,9 +164,9 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
165 | "notify_connect running\n"); | 164 | "notify_connect running\n"); |
166 | GNUNET_assert (NULL != ac); | 165 | GNUNET_assert (NULL != ac); |
167 | if (NULL == ac->cont) | 166 | if (NULL == ac->cont) |
168 | GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) ac); | 167 | GNUNET_TESTING_async_fail (ac); |
169 | else | 168 | else |
170 | GNUNET_TESTING_async_finish ((struct GNUNET_TESTING_AsyncContext *) ac); | 169 | GNUNET_TESTING_async_finish (ac); |
171 | } | 170 | } |
172 | else | 171 | else |
173 | { | 172 | { |
@@ -179,7 +178,7 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
179 | cmd->label); | 178 | cmd->label); |
180 | GNUNET_TESTING_get_trait_block_state ( | 179 | GNUNET_TESTING_get_trait_block_state ( |
181 | cmd, | 180 | cmd, |
182 | (const struct GNUNET_TESTING_BlockState **) &bs); | 181 | &bs); |
183 | 182 | ||
184 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 183 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
185 | "block state %u\n", | 184 | "block state %u\n", |
@@ -353,9 +352,9 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, | |||
353 | ts->write_message = write_message; | 352 | ts->write_message = write_message; |
354 | 353 | ||
355 | is = GNUNET_TESTING_run (commands, | 354 | is = GNUNET_TESTING_run (commands, |
356 | TIMEOUT, | 355 | TIMEOUT, |
357 | &handle_result, | 356 | &handle_result, |
358 | ts); | 357 | ts); |
359 | return is; | 358 | return is; |
360 | } | 359 | } |
361 | 360 | ||
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 55ab4a48f..52174e539 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.c | |||
@@ -113,7 +113,7 @@ handle_test (void *cls, | |||
113 | GNUNET_TESTING_get_trait_async_context (&block_receive, | 113 | GNUNET_TESTING_get_trait_async_context (&block_receive, |
114 | &ac_block); | 114 | &ac_block); |
115 | 115 | ||
116 | if ( connected == number_received) | 116 | if (connected == number_received) |
117 | { | 117 | { |
118 | if (NULL != ac_block->is) | 118 | if (NULL != ac_block->is) |
119 | { | 119 | { |
@@ -142,7 +142,7 @@ handle_test (void *cls, | |||
142 | struct GNUNET_TESTING_BarrierList * | 142 | struct GNUNET_TESTING_BarrierList * |
143 | get_waiting_for_barriers () | 143 | get_waiting_for_barriers () |
144 | { | 144 | { |
145 | //No Barrier | 145 | // No Barrier |
146 | return GNUNET_new (struct GNUNET_TESTING_BarrierList); | 146 | return GNUNET_new (struct GNUNET_TESTING_BarrierList); |
147 | } | 147 | } |
148 | 148 | ||
@@ -201,19 +201,21 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
201 | { | 201 | { |
202 | const struct ConnectPeersState *cps; | 202 | const struct ConnectPeersState *cps; |
203 | const struct GNUNET_TESTING_Command *cmd; | 203 | const struct GNUNET_TESTING_Command *cmd; |
204 | void *ret = NULL; | ||
205 | 204 | ||
206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 205 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
207 | "notify_connect peer %s\n", | 206 | "notify_connect peer %s\n", |
208 | GNUNET_i2s (peer)); | 207 | GNUNET_i2s (peer)); |
208 | // FIXME: modifying future is a bit unclean, not easy to follow logic; | ||
209 | // might be better to when reaching the future command to look into | ||
210 | // the past... | ||
209 | cmd = GNUNET_TESTING_interpreter_lookup_command_all (is, | 211 | cmd = GNUNET_TESTING_interpreter_lookup_command_all (is, |
210 | "connect-peers"); | 212 | "connect-peers"); |
213 | // FIXME: check return value! | ||
211 | GNUNET_TRANSPORT_get_trait_connect_peer_state (cmd, | 214 | GNUNET_TRANSPORT_get_trait_connect_peer_state (cmd, |
212 | &cps); | 215 | &cps); |
213 | cps->notify_connect (is, | 216 | cps->notify_connect (is, |
214 | peer); | 217 | peer); |
215 | 218 | return NULL; | |
216 | return ret; | ||
217 | } | 219 | } |
218 | 220 | ||
219 | 221 | ||
@@ -381,9 +383,9 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, | |||
381 | ts->write_message = write_message; | 383 | ts->write_message = write_message; |
382 | 384 | ||
383 | is = GNUNET_TESTING_run (commands, | 385 | is = GNUNET_TESTING_run (commands, |
384 | TIMEOUT, | 386 | TIMEOUT, |
385 | &handle_result, | 387 | &handle_result, |
386 | ts); | 388 | ts); |
387 | return is; | 389 | return is; |
388 | } | 390 | } |
389 | 391 | ||
diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/transport/test_transport_plugin_cmd_udp_backchannel.c index 5e931fbe3..28cbd33ba 100644 --- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c +++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c | |||
@@ -155,6 +155,7 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
155 | return ret; | 155 | return ret; |
156 | } | 156 | } |
157 | 157 | ||
158 | |||
158 | /** | 159 | /** |
159 | * Callback to set the flag indicating all peers are prepared to finish. Will be called via the plugin api. | 160 | * Callback to set the flag indicating all peers are prepared to finish. Will be called via the plugin api. |
160 | */ | 161 | */ |
@@ -173,6 +174,7 @@ all_local_tests_prepared () | |||
173 | GNUNET_TESTING_AsyncContext *) &lfs->ac); | 174 | GNUNET_TESTING_AsyncContext *) &lfs->ac); |
174 | } | 175 | } |
175 | 176 | ||
177 | |||
176 | /** | 178 | /** |
177 | * Function to start a local test case. | 179 | * Function to start a local test case. |
178 | * | 180 | * |
diff --git a/src/transport/test_transport_start_with_config.c b/src/transport/test_transport_start_with_config.c index 8a7a3dbb5..9a8b5ee05 100644 --- a/src/transport/test_transport_start_with_config.c +++ b/src/transport/test_transport_start_with_config.c | |||
@@ -95,13 +95,13 @@ main (int argc, | |||
95 | topology_data_script, | 95 | topology_data_script, |
96 | &read_file), | 96 | &read_file), |
97 | GNUNET_TESTING_cmd_netjail_start_cmds_helper ("netjail-start-testbed", | 97 | GNUNET_TESTING_cmd_netjail_start_cmds_helper ("netjail-start-testbed", |
98 | topology, | 98 | topology, |
99 | &read_file, | 99 | &read_file, |
100 | topology_data_script, | 100 | topology_data_script, |
101 | TIMEOUT), | 101 | TIMEOUT), |
102 | GNUNET_TESTING_cmd_stop_cmds_helper ("stop-testbed", | 102 | GNUNET_TESTING_cmd_stop_cmds_helper ("stop-testbed", |
103 | "netjail-start-testbed", | 103 | "netjail-start-testbed", |
104 | topology), | 104 | topology), |
105 | GNUNET_TESTING_cmd_netjail_stop ("netjail-stop", | 105 | GNUNET_TESTING_cmd_netjail_stop ("netjail-stop", |
106 | topology_data_script, | 106 | topology_data_script, |
107 | &read_file), | 107 | &read_file), |
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c index 566e0db71..ec27ac8ba 100644 --- a/src/transport/transport-testing2.c +++ b/src/transport/transport-testing2.c | |||
@@ -329,6 +329,7 @@ notify_disconnect (void *cls, | |||
329 | } | 329 | } |
330 | } | 330 | } |
331 | 331 | ||
332 | |||
332 | static void | 333 | static void |
333 | retrieve_hello (void *cls); | 334 | retrieve_hello (void *cls); |
334 | 335 | ||
diff --git a/src/transport/transport_api_cmd_backchannel_check.c b/src/transport/transport_api_cmd_backchannel_check.c index d672e3ae8..1bdb8817f 100644 --- a/src/transport/transport_api_cmd_backchannel_check.c +++ b/src/transport/transport_api_cmd_backchannel_check.c | |||
@@ -330,6 +330,7 @@ will_the_other_node_connect_via_udp ( | |||
330 | return GNUNET_NO; | 330 | return GNUNET_NO; |
331 | } | 331 | } |
332 | 332 | ||
333 | |||
333 | static void | 334 | static void |
334 | add_search_string (struct CheckState *cs, const struct | 335 | add_search_string (struct CheckState *cs, const struct |
335 | GNUNET_TESTING_NetjailNode *node) | 336 | GNUNET_TESTING_NetjailNode *node) |
diff --git a/src/transport/transport_api_cmd_connecting_peers.c b/src/transport/transport_api_cmd_connecting_peers.c index 7feecbcc7..6bc145880 100644 --- a/src/transport/transport_api_cmd_connecting_peers.c +++ b/src/transport/transport_api_cmd_connecting_peers.c | |||
@@ -126,10 +126,10 @@ connect_peers_run (void *cls, | |||
126 | char *rest2; | 126 | char *rest2; |
127 | char *address; | 127 | char *address; |
128 | 128 | ||
129 | prefix = strtok(addr, "_"); | 129 | prefix = strtok (addr, "_"); |
130 | rest = strtok(NULL, "_"); | 130 | rest = strtok (NULL, "_"); |
131 | rest2 = strtok(rest, "-"); | 131 | rest2 = strtok (rest, "-"); |
132 | address = strtok(NULL, "-"); | 132 | address = strtok (NULL, "-"); |
133 | 133 | ||
134 | GNUNET_asprintf (&addr_and_port, | 134 | GNUNET_asprintf (&addr_and_port, |
135 | "%s-%s:0", | 135 | "%s-%s:0", |
@@ -172,20 +172,23 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
172 | const struct GNUNET_TESTING_Command *cmd; | 172 | const struct GNUNET_TESTING_Command *cmd; |
173 | struct ConnectPeersState *cps; | 173 | struct ConnectPeersState *cps; |
174 | struct GNUNET_PeerIdentity *peer_connection; | 174 | struct GNUNET_PeerIdentity *peer_connection; |
175 | struct GNUNET_TESTING_NodeConnection *pos_connection; | ||
176 | unsigned int num; | 175 | unsigned int num; |
177 | unsigned int con_num; | 176 | unsigned int con_num; |
178 | void *ret = NULL; | 177 | void *ret = NULL; |
179 | 178 | ||
180 | cmd = GNUNET_TESTING_interpreter_lookup_command_all (is, | 179 | cmd = GNUNET_TESTING_interpreter_lookup_command_all (is, |
181 | "connect-peers"); | 180 | "connect-peers"); |
182 | cps = cmd->cls; | 181 | cps = cmd->cls; // WTF? Never go directly into cls of another command! FIXME! |
183 | con_num = cps->con_num_notified; | 182 | con_num = cps->con_num_notified; |
184 | for (pos_connection = cps->node_connections_head; NULL != pos_connection; | 183 | for (struct GNUNET_TESTING_NodeConnection *pos_connection = |
184 | cps->node_connections_head; | ||
185 | NULL != pos_connection; | ||
185 | pos_connection = pos_connection->next) | 186 | pos_connection = pos_connection->next) |
186 | { | 187 | { |
187 | num = GNUNET_TESTING_calculate_num (pos_connection, cps->topology); | 188 | num = GNUNET_TESTING_calculate_num (pos_connection, |
188 | peer_connection = GNUNET_TESTING_get_peer (num, cps->tl_system); | 189 | cps->topology); |
190 | peer_connection = GNUNET_TESTING_get_peer (num, | ||
191 | cps->tl_system); | ||
189 | if (0 == GNUNET_memcmp (peer, | 192 | if (0 == GNUNET_memcmp (peer, |
190 | peer_connection)) | 193 | peer_connection)) |
191 | cps->con_num_notified++; | 194 | cps->con_num_notified++; |
diff --git a/src/transport/transport_api_cmd_start_peer.c b/src/transport/transport_api_cmd_start_peer.c index 1f8ef2f8f..244f8d79b 100644 --- a/src/transport/transport_api_cmd_start_peer.c +++ b/src/transport/transport_api_cmd_start_peer.c | |||
@@ -385,7 +385,7 @@ start_peer_cleanup (void *cls) | |||
385 | GNUNET_free (sps->handlers); | 385 | GNUNET_free (sps->handlers); |
386 | sps->handlers = NULL; | 386 | sps->handlers = NULL; |
387 | } | 387 | } |
388 | //TODO Investigate why this caused problems during shutdown. | 388 | // TODO Investigate why this caused problems during shutdown. |
389 | /*if (NULL != sps->cfg) | 389 | /*if (NULL != sps->cfg) |
390 | { | 390 | { |
391 | GNUNET_CONFIGURATION_destroy (sps->cfg); | 391 | GNUNET_CONFIGURATION_destroy (sps->cfg); |