aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api_hosts.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-07-18 13:25:11 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-07-18 13:25:11 +0000
commitf195d42a6b8e24b8e2f31709b49e2be72e25983f (patch)
tree8e8b2044eae9d92cf140335e9fd2bfb2837e728d /src/testbed/testbed_api_hosts.c
parent1a956f969b0166ee609a88d37ace19486bd6bcee (diff)
downloadgnunet-f195d42a6b8e24b8e2f31709b49e2be72e25983f.tar.gz
gnunet-f195d42a6b8e24b8e2f31709b49e2be72e25983f.zip
API internal function call changes
Diffstat (limited to 'src/testbed/testbed_api_hosts.c')
-rw-r--r--src/testbed/testbed_api_hosts.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index dd08d3a50..066f0a254 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -390,43 +390,4 @@ GNUNET_TESTBED_is_host_registered_ (const struct GNUNET_TESTBED_Host *host,
390} 390}
391 391
392 392
393/**
394 * Creates a helper initialization message. Only for testing.
395 *
396 * @param cname the ip address of the controlling host
397 * @param cfg the configuration that has to used to start the testbed service
398 * thru helper
399 * @return the initialization message
400 */
401struct GNUNET_TESTBED_HelperInit *
402GNUNET_TESTBED_create_helper_init_msg_ (const char *cname,
403 const struct GNUNET_CONFIGURATION_Handle *cfg)
404{
405 struct GNUNET_TESTBED_HelperInit *msg;
406 char *config;
407 char *xconfig;
408 size_t config_size;
409 size_t xconfig_size;
410 uint16_t cname_len;
411 uint16_t msg_size;
412
413 config = GNUNET_CONFIGURATION_serialize (cfg, &config_size);
414 GNUNET_assert (NULL != config);
415 xconfig_size =
416 GNUNET_TESTBED_compress_config (config, config_size, &xconfig);
417 GNUNET_free (config);
418 cname_len = strlen (cname);
419 msg_size = xconfig_size + cname_len + 1 +
420 sizeof (struct GNUNET_TESTBED_HelperInit);
421 msg = GNUNET_realloc (xconfig, msg_size);
422 (void) memmove ( ((void *) &msg[1]) + cname_len + 1, msg, xconfig_size);
423 msg->header.size = htons (msg_size);
424 msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_HELPER_INIT);
425 msg->cname_size = htons (cname_len);
426 msg->config_size = htons (config_size);
427 (void) strcpy ((char *) &msg[1], cname);
428 return msg;
429}
430
431
432/* end of testbed_api_hosts.c */ 393/* end of testbed_api_hosts.c */