aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-05-17 07:56:37 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-05-17 07:56:37 +0000
commita4eea61eb191e8151ec0e2be01e4ec41b88ad062 (patch)
treeb75c46be184fb88aad5718c983b1cf572dc4c2fa /src
parentd8223ffc4f6662d4de7c9fb02d0de364ca54f5cf (diff)
downloadgnunet-a4eea61eb191e8151ec0e2be01e4ec41b88ad062.tar.gz
gnunet-a4eea61eb191e8151ec0e2be01e4ec41b88ad062.zip
- fallback to using ip addresses for hosts
Diffstat (limited to 'src')
-rw-r--r--src/testbed/testbed_api_hosts.c23
-rw-r--r--src/testbed/testbed_api_hosts.h9
-rw-r--r--src/testbed/testbed_api_testbed.c3
3 files changed, 35 insertions, 0 deletions
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index 99625cba0..4b9d12f80 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -1887,4 +1887,27 @@ GNUNET_TESTBED_host_handle_addhostconfirm_ (struct GNUNET_TESTBED_Controller *c,
1887 return GNUNET_OK; 1887 return GNUNET_OK;
1888} 1888}
1889 1889
1890
1891/**
1892 * Resolves the hostname of the host to an ip address
1893 *
1894 * @param host the host whose hostname is to be resolved
1895 */
1896void
1897GNUNET_TESTBED_host_resolve_ (struct GNUNET_TESTBED_Host *host)
1898{
1899 char *hostname;
1900
1901 hostname = (char *) host->hostname;
1902 host->hostname = simple_resolve (hostname);
1903 if (NULL == host->hostname)
1904 {
1905 GNUNET_break (0);
1906 host->hostname = hostname;
1907 return;
1908 }
1909 GNUNET_free (hostname);
1910 host->hostname = GNUNET_strdup (hostname);
1911}
1912
1890/* end of testbed_api_hosts.c */ 1913/* end of testbed_api_hosts.c */
diff --git a/src/testbed/testbed_api_hosts.h b/src/testbed/testbed_api_hosts.h
index 3cef4412a..6c305c340 100644
--- a/src/testbed/testbed_api_hosts.h
+++ b/src/testbed/testbed_api_hosts.h
@@ -253,5 +253,14 @@ GNUNET_TESTBED_controller_destroy_ (struct GNUNET_TESTBED_ControllerProc
253 *cproc); 253 *cproc);
254 254
255 255
256/**
257 * Resolves the hostname of the host to an ip address
258 *
259 * @param host the host whose hostname is to be resolved
260 */
261void
262GNUNET_TESTBED_host_resolve_ (struct GNUNET_TESTBED_Host *host);
263
264
256#endif 265#endif
257/* end of testbed_api_hosts.h */ 266/* end of testbed_api_hosts.h */
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c
index ccef18a4b..7f7627858 100644
--- a/src/testbed/testbed_api_testbed.c
+++ b/src/testbed/testbed_api_testbed.c
@@ -1349,6 +1349,9 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host,
1349#if ENABLE_LL 1349#if ENABLE_LL
1350 parse_islands (rc); 1350 parse_islands (rc);
1351#endif 1351#endif
1352 GNUNET_TESTBED_host_resolve_ (rc->h);
1353 for (nhost = 0; nhost < rc->num_hosts; nhost++)
1354 GNUNET_TESTBED_host_resolve_ (rc->hosts[nhost]);
1352 GNUNET_OS_network_interfaces_list (netint_proc, rc); 1355 GNUNET_OS_network_interfaces_list (netint_proc, rc);
1353 if (NULL == rc->trusted_ip) 1356 if (NULL == rc->trusted_ip)
1354 rc->trusted_ip = GNUNET_strdup ("127.0.0.1"); 1357 rc->trusted_ip = GNUNET_strdup ("127.0.0.1");