aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tool
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-11-19 13:01:07 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-11-19 13:01:07 +0000
commit203bb6f1d36b66c0ea4c81b0aaada34f336a8ae2 (patch)
tree905a7eaed571f1edf6e7bb15395816730a22457c /src/ats-tool
parent08616da9eddd1b4d808e15fd620cc90ecf4fa1fb (diff)
downloadgnunet-203bb6f1d36b66c0ea4c81b0aaada34f336a8ae2.tar.gz
gnunet-203bb6f1d36b66c0ea4c81b0aaada34f336a8ae2.zip
- verbosity
Diffstat (limited to 'src/ats-tool')
-rw-r--r--src/ats-tool/gnunet-ats.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 0543549aa..b79ae9b32 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -45,6 +45,7 @@ static char *pid_str;
45 45
46static char *type_str; 46static char *type_str;
47static unsigned int value; 47static unsigned int value;
48static int verbose;
48 49
49static struct GNUNET_ATS_PerformanceHandle *ph; 50static struct GNUNET_ATS_PerformanceHandle *ph;
50 51
@@ -85,6 +86,8 @@ void transport_addr_to_str_cb (void *cls, const char *address)
85 if (NULL != address) 86 if (NULL != address)
86 { 87 {
87 ats_str = GNUNET_strdup(""); 88 ats_str = GNUNET_strdup("");
89 if (verbose)
90 {
88 for (c = 0; c < pr->ats_count; c++) 91 for (c = 0; c < pr->ats_count; c++)
89 { 92 {
90 ats_tmp = ats_str; 93 ats_tmp = ats_str;
@@ -115,9 +118,9 @@ void transport_addr_to_str_cb (void *cls, const char *address)
115 GNUNET_asprintf (&ats_str, "%s%s=%s, ", ats_tmp, ats_prop_arr[ats_type] , ats_prop_value); 118 GNUNET_asprintf (&ats_str, "%s%s=%s, ", ats_tmp, ats_prop_arr[ats_type] , ats_prop_value);
116 GNUNET_free (ats_tmp); 119 GNUNET_free (ats_tmp);
117 GNUNET_free (ats_prop_value); 120 GNUNET_free (ats_prop_value);
121 }
118 } 122 }
119 123
120
121 fprintf (stderr, _("Peer `%s' plugin `%s', address `%s', bw out: %u Bytes/s, bw in %u Bytes/s, %s\n"), 124 fprintf (stderr, _("Peer `%s' plugin `%s', address `%s', bw out: %u Bytes/s, bw in %u Bytes/s, %s\n"),
122 GNUNET_i2s (&pr->address->peer), pr->address->transport_name, address, 125 GNUNET_i2s (&pr->address->peer), pr->address->transport_name, address,
123 ntohl (pr->bandwidth_out.value__), ntohl (pr->bandwidth_in.value__),ats_str); 126 ntohl (pr->bandwidth_out.value__), ntohl (pr->bandwidth_in.value__),ats_str);
@@ -308,9 +311,12 @@ main (int argc, char *const *argv)
308 {'t', "type", "TYPE", 311 {'t', "type", "TYPE",
309 gettext_noop ("preference type to set: latency | bandwidth"), 312 gettext_noop ("preference type to set: latency | bandwidth"),
310 1, &GNUNET_GETOPT_set_string, &type_str}, 313 1, &GNUNET_GETOPT_set_string, &type_str},
311 {'k', "value", "VALUE", 314 {'k', "value", "VALUE",
312 gettext_noop ("preference value"), 315 gettext_noop ("preference value"),
313 1, &GNUNET_GETOPT_set_uint, &value}, 316 1, &GNUNET_GETOPT_set_uint, &value},
317 {'V', "verbose", NULL,
318 gettext_noop ("verbose output (include ATS address properties)"),
319 0, &GNUNET_GETOPT_set_one, &verbose},
314 GNUNET_GETOPT_OPTION_END 320 GNUNET_GETOPT_OPTION_END
315 }; 321 };
316 322