aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tool/gnunet-ats.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-17 21:31:48 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-17 21:31:48 +0000
commitc76f29f898f6b1a73f33ce6d2578e06ce8e0a24e (patch)
tree4d9fbf87fa9d65b8b966b51739af96205943be8f /src/ats-tool/gnunet-ats.c
parentf6323d915af7494ecfeba39407d1c30dc06dc238 (diff)
downloadgnunet-c76f29f898f6b1a73f33ce6d2578e06ce8e0a24e.tar.gz
gnunet-c76f29f898f6b1a73f33ce6d2578e06ce8e0a24e.zip
use ATS functions to convert quality network type to string, instead of using string API
Diffstat (limited to 'src/ats-tool/gnunet-ats.c')
-rw-r--r--src/ats-tool/gnunet-ats.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 217c075b2..111b8b78b 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -327,7 +327,6 @@ transport_addr_to_str_cb (void *cls,
327 struct PendingResolutions *pr = cls; 327 struct PendingResolutions *pr = cls;
328 char *ats_str; 328 char *ats_str;
329 char *ats_tmp; 329 char *ats_tmp;
330 char *ats_prop_arr[GNUNET_ATS_PropertyCount] = GNUNET_ATS_PropertyStrings;
331 char *ats_prop_value; 330 char *ats_prop_value;
332 unsigned int c; 331 unsigned int c;
333 uint32_t ats_type; 332 uint32_t ats_type;
@@ -416,7 +415,7 @@ transport_addr_to_str_cb (void *cls,
416 GNUNET_asprintf (&ats_str, 415 GNUNET_asprintf (&ats_str,
417 "%s%s=%s, ", 416 "%s%s=%s, ",
418 ats_tmp, 417 ats_tmp,
419 ats_prop_arr[ats_type], 418 GNUNET_ATS_print_property_type (ats_type),
420 ats_prop_value); 419 ats_prop_value);
421 GNUNET_free(ats_tmp); 420 GNUNET_free(ats_tmp);
422 } 421 }
@@ -675,7 +674,6 @@ ats_perf_cb (void *cls,
675static unsigned int 674static unsigned int
676print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg) 675print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
677{ 676{
678 char *network_str[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkTypeString;
679 char * entry_in = NULL; 677 char * entry_in = NULL;
680 char * entry_out = NULL; 678 char * entry_out = NULL;
681 char * quota_out_str; 679 char * quota_out_str;
@@ -689,10 +687,10 @@ print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
689 687
690 GNUNET_asprintf (&entry_out, 688 GNUNET_asprintf (&entry_out,
691 "%s_QUOTA_OUT", 689 "%s_QUOTA_OUT",
692 network_str[c]); 690 GNUNET_ATS_print_network_type (c));
693 GNUNET_asprintf (&entry_in, 691 GNUNET_asprintf (&entry_in,
694 "%s_QUOTA_IN", 692 "%s_QUOTA_IN",
695 network_str[c]); 693 GNUNET_ATS_print_network_type (c));
696 694
697 /* quota out */ 695 /* quota out */
698 if (GNUNET_OK == 696 if (GNUNET_OK ==
@@ -714,7 +712,7 @@ print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
714 { 712 {
715 FPRINTF (stderr, 713 FPRINTF (stderr,
716 "Outbound quota for network `%11s' not configured!\n", 714 "Outbound quota for network `%11s' not configured!\n",
717 network_str[c]); 715 GNUNET_ATS_print_network_type (c));
718 GNUNET_asprintf (&quota_out_str, "-"); 716 GNUNET_asprintf (&quota_out_str, "-");
719 } 717 }
720 GNUNET_free(entry_out); 718 GNUNET_free(entry_out);
@@ -737,14 +735,14 @@ print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
737 { 735 {
738 FPRINTF (stderr, 736 FPRINTF (stderr,
739 "Inbound quota for network `%11s' not configured!\n", 737 "Inbound quota for network `%11s' not configured!\n",
740 network_str[c]); 738 GNUNET_ATS_print_network_type (c));
741 GNUNET_asprintf (&quota_in_str, "-"); 739 GNUNET_asprintf (&quota_in_str, "-");
742 } 740 }
743 GNUNET_free(entry_in); 741 GNUNET_free(entry_in);
744 742
745 FPRINTF (stderr, 743 FPRINTF (stderr,
746 _("Quota for network `%11s' (in/out): %10s / %10s\n"), 744 _("Quota for network `%11s' (in/out): %10s / %10s\n"),
747 network_str[c], 745 GNUNET_ATS_print_network_type (c),
748 quota_in_str, 746 quota_in_str,
749 quota_out_str); 747 quota_out_str);
750 GNUNET_free(quota_out_str); 748 GNUNET_free(quota_out_str);