diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-01-18 14:07:05 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-01-18 14:07:05 +0000 |
commit | f0c32fd358a73a6c826539ba4ca214f4edd0c948 (patch) | |
tree | e153df0682801fce1d522f6ea518bda54d53c72a /src/ats-tool | |
parent | f62ff9256f67cec85b84273a77c7393e4a224399 (diff) | |
download | gnunet-f0c32fd358a73a6c826539ba4ca214f4edd0c948.tar.gz gnunet-f0c32fd358a73a6c826539ba4ca214f4edd0c948.zip |
print network type
Diffstat (limited to 'src/ats-tool')
-rw-r--r-- | src/ats-tool/gnunet-ats.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c index 5adb1ff21..20ce9700b 100644 --- a/src/ats-tool/gnunet-ats.c +++ b/src/ats-tool/gnunet-ats.c | |||
@@ -155,11 +155,12 @@ void transport_addr_to_str_cb (void *cls, const char *address) | |||
155 | unsigned int c; | 155 | unsigned int c; |
156 | uint32_t ats_type; | 156 | uint32_t ats_type; |
157 | uint32_t ats_value; | 157 | uint32_t ats_value; |
158 | uint32_t network; | ||
158 | if (NULL != address) | 159 | if (NULL != address) |
159 | { | 160 | { |
160 | ats_str = GNUNET_strdup(""); | 161 | ats_str = GNUNET_strdup(""); |
161 | if (verbose) | 162 | |
162 | { | 163 | |
163 | for (c = 0; c < pr->ats_count; c++) | 164 | for (c = 0; c < pr->ats_count; c++) |
164 | { | 165 | { |
165 | ats_tmp = ats_str; | 166 | ats_tmp = ats_str; |
@@ -180,23 +181,24 @@ void transport_addr_to_str_cb (void *cls, const char *address) | |||
180 | GNUNET_break (0); | 181 | GNUNET_break (0); |
181 | continue; | 182 | continue; |
182 | } | 183 | } |
184 | network = ats_value; | ||
183 | GNUNET_asprintf (&ats_prop_value, "%s", GNUNET_ATS_print_network_type(ats_value)); | 185 | GNUNET_asprintf (&ats_prop_value, "%s", GNUNET_ATS_print_network_type(ats_value)); |
184 | break; | 186 | break; |
185 | default: | 187 | default: |
186 | GNUNET_asprintf (&ats_prop_value, "%u", ats_value); | 188 | GNUNET_asprintf (&ats_prop_value, "%u", ats_value); |
187 | break; | 189 | break; |
188 | } | 190 | } |
189 | if (ats_type < GNUNET_ATS_PropertyCount) | 191 | if ((verbose) && (ats_type < GNUNET_ATS_PropertyCount)) |
190 | { | 192 | { |
191 | GNUNET_asprintf (&ats_str, "%s%s=%s, ", ats_tmp, ats_prop_arr[ats_type] , ats_prop_value); | 193 | GNUNET_asprintf (&ats_str, "%s%s=%s, ", ats_tmp, ats_prop_arr[ats_type] , ats_prop_value); |
192 | GNUNET_free (ats_tmp); | 194 | GNUNET_free (ats_tmp); |
193 | } | 195 | } |
194 | GNUNET_free (ats_prop_value); | 196 | GNUNET_free (ats_prop_value); |
195 | } | 197 | } |
196 | } | ||
197 | 198 | ||
198 | fprintf (stderr, _("Peer `%s' plugin `%s', address `%s', bw out: %u Bytes/s, bw in %u Bytes/s, %s\n"), | 199 | fprintf (stderr, _("Peer `%s' plugin `%s', address `%s', `%s' bw out: %u Bytes/s, bw in %u Bytes/s, %s\n"), |
199 | GNUNET_i2s (&pr->address->peer), pr->address->transport_name, address, | 200 | GNUNET_i2s (&pr->address->peer), pr->address->transport_name, address, |
201 | GNUNET_ATS_print_network_type(network), | ||
200 | ntohl (pr->bandwidth_out.value__), ntohl (pr->bandwidth_in.value__),ats_str); | 202 | ntohl (pr->bandwidth_out.value__), ntohl (pr->bandwidth_in.value__),ats_str); |
201 | GNUNET_free (ats_str); | 203 | GNUNET_free (ats_str); |
202 | } | 204 | } |