aboutsummaryrefslogtreecommitdiff
path: root/src/transport
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/transport
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/transport')
-rw-r--r--src/transport/test_quota_compliance.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index 250d3279f..d1e388506 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -415,7 +415,6 @@ static char *
415generate_config (char *cfg_file, unsigned long long quota_in, 415generate_config (char *cfg_file, unsigned long long quota_in,
416 unsigned long long quota_out) 416 unsigned long long quota_out)
417{ 417{
418 char *networks[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkTypeString;
419 char *in_name; 418 char *in_name;
420 char *out_name; 419 char *out_name;
421 char *fname = NULL; 420 char *fname = NULL;
@@ -430,12 +429,16 @@ generate_config (char *cfg_file, unsigned long long quota_in,
430 429
431 for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++) 430 for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++)
432 { 431 {
433 GNUNET_asprintf (&in_name, "%s_QUOTA_IN", networks[c]); 432 GNUNET_asprintf (&in_name,
434 GNUNET_asprintf (&out_name, "%s_QUOTA_OUT", networks[c]); 433 "%s_QUOTA_IN",
435 GNUNET_CONFIGURATION_set_value_number (cfg, "ats", in_name, quota_in); 434 GNUNET_ATS_print_network_type (c));
436 GNUNET_CONFIGURATION_set_value_number (cfg, "ats", out_name, quota_out); 435 GNUNET_asprintf (&out_name,
437 GNUNET_free (in_name); 436 "%s_QUOTA_OUT",
438 GNUNET_free (out_name); 437 GNUNET_ATS_print_network_type (c));
438 GNUNET_CONFIGURATION_set_value_number (cfg, "ats", in_name, quota_in);
439 GNUNET_CONFIGURATION_set_value_number (cfg, "ats", out_name, quota_out);
440 GNUNET_free (in_name);
441 GNUNET_free (out_name);
439 } 442 }
440 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_write (cfg, fname)); 443 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_write (cfg, fname));
441 GNUNET_CONFIGURATION_destroy (cfg); 444 GNUNET_CONFIGURATION_destroy (cfg);