aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-transport.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-11-29 15:43:11 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-11-29 15:43:11 +0000
commit0c3e3371bcc2dad9c4f14561068a1752f01b1756 (patch)
tree6aa926c5f1ad962594f6c9ad9b238500ad644702 /src/transport/gnunet-transport.c
parentfd2601f3fce6eefbb7e0f9aaca61f9169b25d3f4 (diff)
downloadgnunet-0c3e3371bcc2dad9c4f14561068a1752f01b1756.tar.gz
gnunet-0c3e3371bcc2dad9c4f14561068a1752f01b1756.zip
- latest changes for refactoring: iterate sends disassembled hello-address
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r--src/transport/gnunet-transport.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index 1dc85a903..58d20e16d 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -150,6 +150,7 @@ struct TestContext
150 150
151}; 151};
152 152
153struct GNUNET_CONFIGURATION_Handle * cfg;
153 154
154/** 155/**
155 * Display the result of the test. 156 * Display the result of the test.
@@ -432,6 +433,11 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
432 traffic_received += ntohs (message->size); 433 traffic_received += ntohs (message->size);
433} 434}
434 435
436void process_string (void *cls,
437 const char *address)
438{
439 fprintf (stdout, _("process_string\n"));
440}
435 441
436/** 442/**
437 * Function to call with a human-readable format of an address 443 * Function to call with a human-readable format of an address
@@ -445,23 +451,23 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
445static void 451static void
446process_address (void *cls, const struct GNUNET_HELLO_Address *address) 452process_address (void *cls, const struct GNUNET_HELLO_Address *address)
447{ 453{
448 if ((address->transport_name != NULL) || 454 if (address == NULL)
449 ((address->address != NULL) && (address->address_length > 0)))
450 { 455 {
451 /* Call GNUNET_TRANSPORT_address_to_string to convert to human readable */ 456 return;
452 //GNUNET_TRANSPORT_address_to_string(cfg, address, GNUNET_NO)
453
454#if 0
455 fprintf (stdout, _("Peer `%s' plugin: `%s' address `%s'\n"),
456 (peer != NULL) ? GNUNET_i2s (peer) : "<unknown>",
457 (transport != NULL) ? transport : "<unknown>", ((addr != NULL) &&
458 (addrlen > 0) &&
459 (transport !=
460 NULL)) ?
461 "how do i resolve the name without transport service?" :
462 "<unknown>");
463#endif
464 } 457 }
458
459 fprintf (stdout, _("Peer `%s'\n"),
460 GNUNET_i2s (&address->peer));
461
462 /* Resolve address to string */
463 /*
464 GNUNET_TRANSPORT_address_to_string (cfg,
465 address,
466 GNUNET_NO,
467 GNUNET_TIME_UNIT_MINUTES,
468 &process_string,
469 NULL);
470 */
465} 471}
466 472
467 473
@@ -477,6 +483,7 @@ static void
477run (void *cls, char *const *args, const char *cfgfile, 483run (void *cls, char *const *args, const char *cfgfile,
478 const struct GNUNET_CONFIGURATION_Handle *cfg) 484 const struct GNUNET_CONFIGURATION_Handle *cfg)
479{ 485{
486 cfg = cfg;
480 if (test_configuration) 487 if (test_configuration)
481 { 488 {
482 do_test_configuration (cfg); 489 do_test_configuration (cfg);