diff options
Diffstat (limited to 'src/testing/gnunet-cmds-helper.c')
-rw-r--r-- | src/testing/gnunet-cmds-helper.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/testing/gnunet-cmds-helper.c b/src/testing/gnunet-cmds-helper.c index 8f9e77709..e50db0cf6 100644 --- a/src/testing/gnunet-cmds-helper.c +++ b/src/testing/gnunet-cmds-helper.c | |||
@@ -57,6 +57,8 @@ testing_api_cmd_block_until_all_peers_started.c */ | |||
57 | 57 | ||
58 | #define NODE_BASE_IP "192.168.15." | 58 | #define NODE_BASE_IP "192.168.15." |
59 | 59 | ||
60 | #define KNOWN_BASE_IP "92.68.151." | ||
61 | |||
60 | #define ROUTER_BASE_IP "92.68.150." | 62 | #define ROUTER_BASE_IP "92.68.150." |
61 | 63 | ||
62 | /** | 64 | /** |
@@ -343,6 +345,7 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message) | |||
343 | size_t msg_length; | 345 | size_t msg_length; |
344 | char *router_ip; | 346 | char *router_ip; |
345 | char *node_ip; | 347 | char *node_ip; |
348 | unsigned int namespace_n; | ||
346 | 349 | ||
347 | msize = ntohs (message->size); | 350 | msize = ntohs (message->size); |
348 | if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT == ntohs (message->type)) | 351 | if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT == ntohs (message->type)) |
@@ -378,8 +381,24 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message) | |||
378 | strcpy (router_ip, ROUTER_BASE_IP); | 381 | strcpy (router_ip, ROUTER_BASE_IP); |
379 | strcat (router_ip, plugin->n); | 382 | strcat (router_ip, plugin->n); |
380 | 383 | ||
381 | node_ip = GNUNET_malloc (strlen (NODE_BASE_IP) + strlen (plugin->m) + 1); | 384 | sscanf (plugin->n, "%u", &namespace_n); |
382 | strcat (node_ip, NODE_BASE_IP); | 385 | |
386 | if (0 == namespace_n) | ||
387 | { | ||
388 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
389 | "known node n: %s\n", | ||
390 | plugin->n); | ||
391 | node_ip = GNUNET_malloc (strlen (KNOWN_BASE_IP) + strlen (plugin->m) + 1); | ||
392 | strcat (node_ip, KNOWN_BASE_IP); | ||
393 | } | ||
394 | else | ||
395 | { | ||
396 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
397 | "subnet node n: %s\n", | ||
398 | plugin->n); | ||
399 | node_ip = GNUNET_malloc (strlen (NODE_BASE_IP) + strlen (plugin->m) + 1); | ||
400 | strcat (node_ip, NODE_BASE_IP); | ||
401 | } | ||
383 | strcat (node_ip, plugin->m); | 402 | strcat (node_ip, plugin->m); |
384 | 403 | ||
385 | plugin->api->start_testcase (&write_message, router_ip, node_ip, plugin->m, | 404 | plugin->api->start_testcase (&write_message, router_ip, node_ip, plugin->m, |