diff options
Diffstat (limited to 'src/transport/test_transport_api_manipulation_cfg.c')
-rw-r--r-- | src/transport/test_transport_api_manipulation_cfg.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/transport/test_transport_api_manipulation_cfg.c b/src/transport/test_transport_api_manipulation_cfg.c index fe3d31f7b..a6dc08429 100644 --- a/src/transport/test_transport_api_manipulation_cfg.c +++ b/src/transport/test_transport_api_manipulation_cfg.c | |||
@@ -71,15 +71,15 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
71 | 71 | ||
72 | static struct GNUNET_SCHEDULER_Task * send_task; | 72 | static struct GNUNET_SCHEDULER_Task * send_task; |
73 | 73 | ||
74 | static struct PeerContext *p1; | 74 | static struct GNUNET_TRANSPORT_TESTING_PeerContext *p1; |
75 | 75 | ||
76 | static struct PeerContext *p2; | 76 | static struct GNUNET_TRANSPORT_TESTING_PeerContext *p2; |
77 | 77 | ||
78 | static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc; | 78 | static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc; |
79 | 79 | ||
80 | static struct GNUNET_TRANSPORT_TransmitHandle *th; | 80 | static struct GNUNET_TRANSPORT_TransmitHandle *th; |
81 | 81 | ||
82 | static struct GNUNET_TRANSPORT_TESTING_handle *tth; | 82 | static struct GNUNET_TRANSPORT_TESTING_Handle *tth; |
83 | 83 | ||
84 | static char *cfg_file_p1; | 84 | static char *cfg_file_p1; |
85 | 85 | ||
@@ -103,8 +103,8 @@ end () | |||
103 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); | 103 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); |
104 | th = NULL; | 104 | th = NULL; |
105 | 105 | ||
106 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1); | 106 | GNUNET_TRANSPORT_TESTING_stop_peer (p1); |
107 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); | 107 | GNUNET_TRANSPORT_TESTING_stop_peer (p2); |
108 | } | 108 | } |
109 | 109 | ||
110 | 110 | ||
@@ -122,7 +122,7 @@ end_badly (void *cls) | |||
122 | if (cc != NULL) | 122 | if (cc != NULL) |
123 | { | 123 | { |
124 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Fail! Could not connect peers\n")); | 124 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Fail! Could not connect peers\n")); |
125 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc); | 125 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (cc); |
126 | cc = NULL; | 126 | cc = NULL; |
127 | } | 127 | } |
128 | 128 | ||
@@ -149,11 +149,11 @@ end_badly (void *cls) | |||
149 | th = NULL; | 149 | th = NULL; |
150 | 150 | ||
151 | if (p1 != NULL) | 151 | if (p1 != NULL) |
152 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1); | 152 | GNUNET_TRANSPORT_TESTING_stop_peer (p1); |
153 | else | 153 | else |
154 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer 1 was not started\n")); | 154 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer 1 was not started\n")); |
155 | if (p2 != NULL) | 155 | if (p2 != NULL) |
156 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); | 156 | GNUNET_TRANSPORT_TESTING_stop_peer (p2); |
157 | else | 157 | else |
158 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer 2 was not started\n")); | 158 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer 2 was not started\n")); |
159 | 159 | ||
@@ -164,7 +164,7 @@ end_badly (void *cls) | |||
164 | static size_t | 164 | static size_t |
165 | notify_request_ready (void *cls, size_t size, void *buf) | 165 | notify_request_ready (void *cls, size_t size, void *buf) |
166 | { | 166 | { |
167 | struct PeerContext *p = cls; | 167 | struct GNUNET_TRANSPORT_TESTING_PeerContext *p = cls; |
168 | struct GNUNET_MessageHeader *hdr; | 168 | struct GNUNET_MessageHeader *hdr; |
169 | 169 | ||
170 | th = NULL; | 170 | th = NULL; |
@@ -225,7 +225,7 @@ sendtask_request_task (void *cls) | |||
225 | static size_t | 225 | static size_t |
226 | notify_response_ready (void *cls, size_t size, void *buf) | 226 | notify_response_ready (void *cls, size_t size, void *buf) |
227 | { | 227 | { |
228 | struct PeerContext *p = cls; | 228 | struct GNUNET_TRANSPORT_TESTING_PeerContext *p = cls; |
229 | struct GNUNET_MessageHeader *hdr; | 229 | struct GNUNET_MessageHeader *hdr; |
230 | 230 | ||
231 | th = NULL; | 231 | th = NULL; |
@@ -296,8 +296,8 @@ static void | |||
296 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | 296 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, |
297 | const struct GNUNET_MessageHeader *message) | 297 | const struct GNUNET_MessageHeader *message) |
298 | { | 298 | { |
299 | struct PeerContext *p = cls; | 299 | struct GNUNET_TRANSPORT_TESTING_PeerContext *p = cls; |
300 | struct PeerContext *t = NULL; | 300 | struct GNUNET_TRANSPORT_TESTING_PeerContext *t = NULL; |
301 | struct GNUNET_TIME_Relative duration; | 301 | struct GNUNET_TIME_Relative duration; |
302 | 302 | ||
303 | if (0 == memcmp (peer, &p1->id, sizeof (struct GNUNET_PeerIdentity))) | 303 | if (0 == memcmp (peer, &p1->id, sizeof (struct GNUNET_PeerIdentity))) |
@@ -369,8 +369,8 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
369 | static int c; | 369 | static int c; |
370 | 370 | ||
371 | c++; | 371 | c++; |
372 | struct PeerContext *p = cls; | 372 | struct GNUNET_TRANSPORT_TESTING_PeerContext *p = cls; |
373 | struct PeerContext *t = NULL; | 373 | struct GNUNET_TRANSPORT_TESTING_PeerContext *t = NULL; |
374 | 374 | ||
375 | if (0 == memcmp (peer, &p1->id, sizeof (struct GNUNET_PeerIdentity))) | 375 | if (0 == memcmp (peer, &p1->id, sizeof (struct GNUNET_PeerIdentity))) |
376 | t = p1; | 376 | t = p1; |
@@ -390,7 +390,7 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
390 | static void | 390 | static void |
391 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | 391 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) |
392 | { | 392 | { |
393 | struct PeerContext *p = cls; | 393 | struct GNUNET_TRANSPORT_TESTING_PeerContext *p = cls; |
394 | char *ps = GNUNET_strdup (GNUNET_i2s (&p->id)); | 394 | char *ps = GNUNET_strdup (GNUNET_i2s (&p->id)); |
395 | 395 | ||
396 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 396 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -406,7 +406,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
406 | 406 | ||
407 | 407 | ||
408 | static void | 408 | static void |
409 | testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls) | 409 | testing_connect_cb (void *cls) |
410 | { | 410 | { |
411 | cc = NULL; | 411 | cc = NULL; |
412 | char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); | 412 | char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); |
@@ -421,7 +421,7 @@ testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls) | |||
421 | 421 | ||
422 | 422 | ||
423 | static void | 423 | static void |
424 | start_cb (struct PeerContext *p, void *cls) | 424 | start_cb (struct GNUNET_TRANSPORT_TESTING_PeerContext *p, void *cls) |
425 | { | 425 | { |
426 | static int started; | 426 | static int started; |
427 | started++; | 427 | started++; |
@@ -440,7 +440,7 @@ start_cb (struct PeerContext *p, void *cls) | |||
440 | p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id)); | 440 | p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id)); |
441 | GNUNET_free (sender_c); | 441 | GNUNET_free (sender_c); |
442 | 442 | ||
443 | cc = GNUNET_TRANSPORT_TESTING_connect_peers (tth, p1, p2, &testing_connect_cb, | 443 | cc = GNUNET_TRANSPORT_TESTING_connect_peers (p1, p2, &testing_connect_cb, |
444 | NULL); | 444 | NULL); |
445 | 445 | ||
446 | } | 446 | } |
@@ -503,18 +503,18 @@ main (int argc, char *argv[]) | |||
503 | { | 503 | { |
504 | int ret; | 504 | int ret; |
505 | 505 | ||
506 | GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name); | 506 | test_name = GNUNET_TRANSPORT_TESTING_get_test_name (argv[0]); |
507 | GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, &test_source); | 507 | test_source = GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__); |
508 | GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], test_source, | 508 | test_plugin = GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], |
509 | &test_plugin); | 509 | test_source); |
510 | 510 | ||
511 | GNUNET_log_setup (test_name, | 511 | GNUNET_log_setup (test_name, |
512 | "WARNING", | 512 | "WARNING", |
513 | NULL); | 513 | NULL); |
514 | tth = GNUNET_TRANSPORT_TESTING_init (); | 514 | tth = GNUNET_TRANSPORT_TESTING_init (); |
515 | 515 | ||
516 | GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p1, 1); | 516 | cfg_file_p1 = GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], 1); |
517 | GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p2, 2); | 517 | cfg_file_p2 = GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], 2); |
518 | 518 | ||
519 | ret = check (); | 519 | ret = check (); |
520 | 520 | ||