diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-12-17 16:02:32 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-12-17 16:02:32 +0000 |
commit | c408abb9b9069c9eee62f1ca78ee3a815b491f14 (patch) | |
tree | 64610e0f1e625ef51319ef85cd703a7ae658bf69 /src/testbed/gnunet-helper-testbed.c | |
parent | 69f4cbdda8969ba3325f831d93b6e21660f1a276 (diff) | |
download | gnunet-c408abb9b9069c9eee62f1ca78ee3a815b491f14.tar.gz gnunet-c408abb9b9069c9eee62f1ca78ee3a815b491f14.zip |
- rename controller_ip to trusted_ip
Diffstat (limited to 'src/testbed/gnunet-helper-testbed.c')
-rw-r--r-- | src/testbed/gnunet-helper-testbed.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index 55e73c109..97409c451 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c | |||
@@ -242,14 +242,14 @@ tokenizer_cb (void *cls, void *client, | |||
242 | struct GNUNET_CONFIGURATION_Handle *cfg; | 242 | struct GNUNET_CONFIGURATION_Handle *cfg; |
243 | struct WriteContext *wc; | 243 | struct WriteContext *wc; |
244 | char *binary; | 244 | char *binary; |
245 | char *controller; | 245 | char *trusted_ip; |
246 | char *hostname; | 246 | char *hostname; |
247 | char *config; | 247 | char *config; |
248 | char *xconfig; | 248 | char *xconfig; |
249 | size_t config_size; | 249 | size_t config_size; |
250 | uLongf ul_config_size; | 250 | uLongf ul_config_size; |
251 | size_t xconfig_size; | 251 | size_t xconfig_size; |
252 | uint16_t cname_size; | 252 | uint16_t trusted_ip_size; |
253 | uint16_t hostname_size; | 253 | uint16_t hostname_size; |
254 | uint16_t msize; | 254 | uint16_t msize; |
255 | 255 | ||
@@ -261,16 +261,16 @@ tokenizer_cb (void *cls, void *client, | |||
261 | goto error; | 261 | goto error; |
262 | } | 262 | } |
263 | msg = (const struct GNUNET_TESTBED_HelperInit *) message; | 263 | msg = (const struct GNUNET_TESTBED_HelperInit *) message; |
264 | cname_size = ntohs (msg->cname_size); | 264 | trusted_ip_size = ntohs (msg->trusted_ip_size); |
265 | controller = (char *) &msg[1]; | 265 | trusted_ip = (char *) &msg[1]; |
266 | if ('\0' != controller[cname_size]) | 266 | if ('\0' != trusted_ip[trusted_ip_size]) |
267 | { | 267 | { |
268 | LOG (GNUNET_ERROR_TYPE_WARNING, | 268 | LOG (GNUNET_ERROR_TYPE_WARNING, |
269 | "Controller name cannot be empty -- exiting\n"); | 269 | "Trusted IP cannot be empty -- exiting\n"); |
270 | goto error; | 270 | goto error; |
271 | } | 271 | } |
272 | hostname_size = ntohs (msg->hostname_size); | 272 | hostname_size = ntohs (msg->hostname_size); |
273 | if ((sizeof (struct GNUNET_TESTBED_HelperInit) + cname_size + 1 + | 273 | if ((sizeof (struct GNUNET_TESTBED_HelperInit) + trusted_ip_size + 1 + |
274 | hostname_size) >= msize) | 274 | hostname_size) >= msize) |
275 | { | 275 | { |
276 | GNUNET_break (0); | 276 | GNUNET_break (0); |
@@ -280,11 +280,11 @@ tokenizer_cb (void *cls, void *client, | |||
280 | ul_config_size = (uLongf) ntohs (msg->config_size); | 280 | ul_config_size = (uLongf) ntohs (msg->config_size); |
281 | config = GNUNET_malloc (ul_config_size); | 281 | config = GNUNET_malloc (ul_config_size); |
282 | xconfig_size = | 282 | xconfig_size = |
283 | ntohs (message->size) - (cname_size + 1 + | 283 | ntohs (message->size) - (trusted_ip_size + 1 + |
284 | sizeof (struct GNUNET_TESTBED_HelperInit)); | 284 | sizeof (struct GNUNET_TESTBED_HelperInit)); |
285 | if (Z_OK != | 285 | if (Z_OK != |
286 | uncompress ((Bytef *) config, &ul_config_size, | 286 | uncompress ((Bytef *) config, &ul_config_size, |
287 | (const Bytef *) (controller + cname_size + 1 + hostname_size), | 287 | (const Bytef *) (trusted_ip + trusted_ip_size + 1 + hostname_size), |
288 | (uLongf) xconfig_size)) | 288 | (uLongf) xconfig_size)) |
289 | { | 289 | { |
290 | LOG (GNUNET_ERROR_TYPE_WARNING, | 290 | LOG (GNUNET_ERROR_TYPE_WARNING, |
@@ -306,10 +306,10 @@ tokenizer_cb (void *cls, void *client, | |||
306 | if (0 != hostname_size) | 306 | if (0 != hostname_size) |
307 | { | 307 | { |
308 | hostname = GNUNET_malloc (hostname_size + 1); | 308 | hostname = GNUNET_malloc (hostname_size + 1); |
309 | (void) strncpy (hostname, ((char *) &msg[1]) + cname_size + 1, hostname_size); | 309 | (void) strncpy (hostname, ((char *) &msg[1]) + trusted_ip_size + 1, hostname_size); |
310 | hostname[hostname_size] = '\0'; | 310 | hostname[hostname_size] = '\0'; |
311 | } | 311 | } |
312 | test_system = GNUNET_TESTING_system_create ("testbed-helper", controller, | 312 | test_system = GNUNET_TESTING_system_create ("testbed-helper", trusted_ip, |
313 | hostname); | 313 | hostname); |
314 | GNUNET_free_non_null (hostname); | 314 | GNUNET_free_non_null (hostname); |
315 | hostname = NULL; | 315 | hostname = NULL; |
@@ -341,7 +341,7 @@ tokenizer_cb (void *cls, void *client, | |||
341 | if (NULL == testbed) | 341 | if (NULL == testbed) |
342 | { | 342 | { |
343 | LOG (GNUNET_ERROR_TYPE_WARNING, | 343 | LOG (GNUNET_ERROR_TYPE_WARNING, |
344 | "Error staring gnunet-service-testbed -- exiting\n"); | 344 | "Error starting gnunet-service-testbed -- exiting\n"); |
345 | GNUNET_CONFIGURATION_destroy (cfg); | 345 | GNUNET_CONFIGURATION_destroy (cfg); |
346 | goto error; | 346 | goto error; |
347 | } | 347 | } |