diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-11-23 17:19:53 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-11-23 17:19:53 +0100 |
commit | 61787bfa37e0ac5998e01d9c4806600033c19c74 (patch) | |
tree | 1ceb843f63aa076682ebfa2de2250dc32ee65004 /src/ats/gnunet-ats-solver-eval.c | |
parent | 4a3be482811fe8ed1502fea2c12a8449b560a99e (diff) | |
download | gnunet-61787bfa37e0ac5998e01d9c4806600033c19c74.tar.gz gnunet-61787bfa37e0ac5998e01d9c4806600033c19c74.zip |
rename fest: use new libgnunetnt instead of old libgnunetats logic for network type classification
Diffstat (limited to 'src/ats/gnunet-ats-solver-eval.c')
-rw-r--r-- | src/ats/gnunet-ats-solver-eval.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c index 13119dea0..e1a01207d 100644 --- a/src/ats/gnunet-ats-solver-eval.c +++ b/src/ats/gnunet-ats-solver-eval.c | |||
@@ -1315,27 +1315,27 @@ load_op_add_address (struct GNUNET_ATS_TEST_Operation *o, | |||
1315 | GNUNET_STRINGS_utf8_toupper (op_network,op_network); | 1315 | GNUNET_STRINGS_utf8_toupper (op_network,op_network); |
1316 | if (0 == strcmp(op_network, "UNSPECIFIED")) | 1316 | if (0 == strcmp(op_network, "UNSPECIFIED")) |
1317 | { | 1317 | { |
1318 | o->address_network = GNUNET_ATS_NET_UNSPECIFIED; | 1318 | o->address_network = GNUNET_NT_UNSPECIFIED; |
1319 | } | 1319 | } |
1320 | else if (0 == strcmp(op_network, "LOOPBACK")) | 1320 | else if (0 == strcmp(op_network, "LOOPBACK")) |
1321 | { | 1321 | { |
1322 | o->address_network = GNUNET_ATS_NET_LOOPBACK; | 1322 | o->address_network = GNUNET_NT_LOOPBACK; |
1323 | } | 1323 | } |
1324 | else if (0 == strcmp(op_network, "LAN")) | 1324 | else if (0 == strcmp(op_network, "LAN")) |
1325 | { | 1325 | { |
1326 | o->address_network = GNUNET_ATS_NET_LAN; | 1326 | o->address_network = GNUNET_NT_LAN; |
1327 | } | 1327 | } |
1328 | else if (0 == strcmp(op_network, "WAN")) | 1328 | else if (0 == strcmp(op_network, "WAN")) |
1329 | { | 1329 | { |
1330 | o->address_network = GNUNET_ATS_NET_WAN; | 1330 | o->address_network = GNUNET_NT_WAN; |
1331 | } | 1331 | } |
1332 | else if (0 == strcmp(op_network, "WLAN")) | 1332 | else if (0 == strcmp(op_network, "WLAN")) |
1333 | { | 1333 | { |
1334 | o->address_network = GNUNET_ATS_NET_WLAN; | 1334 | o->address_network = GNUNET_NT_WLAN; |
1335 | } | 1335 | } |
1336 | else if (0 == strcmp(op_network, "BT")) | 1336 | else if (0 == strcmp(op_network, "BT")) |
1337 | { | 1337 | { |
1338 | o->address_network = GNUNET_ATS_NET_BT; | 1338 | o->address_network = GNUNET_NT_BT; |
1339 | } | 1339 | } |
1340 | else | 1340 | else |
1341 | { | 1341 | { |
@@ -2214,7 +2214,7 @@ enforce_add_address (struct GNUNET_ATS_TEST_Operation *op) | |||
2214 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 2214 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
2215 | 2215 | ||
2216 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Adding address %u for peer %u in network `%s'\n", | 2216 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Adding address %u for peer %u in network `%s'\n", |
2217 | op->address_id, op->peer_id, GNUNET_ATS_print_network_type(a->network)); | 2217 | op->address_id, op->peer_id, GNUNET_NT_to_string(a->network)); |
2218 | 2218 | ||
2219 | sh->sf->s_add (sh->sf->cls, a->ats_addr, op->address_network); | 2219 | sh->sf->s_add (sh->sf->cls, a->ats_addr, op->address_network); |
2220 | 2220 | ||
@@ -2748,16 +2748,16 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2748 | int c; | 2748 | int c; |
2749 | int res; | 2749 | int res; |
2750 | 2750 | ||
2751 | for (c = 0; (c < GNUNET_ATS_NetworkTypeCount) && (c < dest_length); c++) | 2751 | for (c = 0; (c < GNUNET_NT_COUNT) && (c < dest_length); c++) |
2752 | { | 2752 | { |
2753 | in_dest[c] = 0; | 2753 | in_dest[c] = 0; |
2754 | out_dest[c] = 0; | 2754 | out_dest[c] = 0; |
2755 | GNUNET_asprintf (&entry_out, | 2755 | GNUNET_asprintf (&entry_out, |
2756 | "%s_QUOTA_OUT", | 2756 | "%s_QUOTA_OUT", |
2757 | GNUNET_ATS_print_network_type (c)); | 2757 | GNUNET_NT_to_string (c)); |
2758 | GNUNET_asprintf (&entry_in, | 2758 | GNUNET_asprintf (&entry_in, |
2759 | "%s_QUOTA_IN", | 2759 | "%s_QUOTA_IN", |
2760 | GNUNET_ATS_print_network_type (c)); | 2760 | GNUNET_NT_to_string (c)); |
2761 | 2761 | ||
2762 | /* quota out */ | 2762 | /* quota out */ |
2763 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_out, "a_out_str)) | 2763 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_out, "a_out_str)) |
@@ -2777,7 +2777,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2777 | { | 2777 | { |
2778 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2778 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2779 | _("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"), | 2779 | _("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"), |
2780 | GNUNET_ATS_print_network_type (c), | 2780 | GNUNET_NT_to_string (c), |
2781 | quota_out_str, | 2781 | quota_out_str, |
2782 | GNUNET_ATS_DefaultBandwidth); | 2782 | GNUNET_ATS_DefaultBandwidth); |
2783 | out_dest[c] = GNUNET_ATS_DefaultBandwidth; | 2783 | out_dest[c] = GNUNET_ATS_DefaultBandwidth; |
@@ -2786,7 +2786,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2786 | { | 2786 | { |
2787 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2787 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2788 | "Outbound quota configure for network `%s' is %llu\n", | 2788 | "Outbound quota configure for network `%s' is %llu\n", |
2789 | GNUNET_ATS_print_network_type (c), | 2789 | GNUNET_NT_to_string (c), |
2790 | out_dest[c]); | 2790 | out_dest[c]); |
2791 | } | 2791 | } |
2792 | GNUNET_free (quota_out_str); | 2792 | GNUNET_free (quota_out_str); |
@@ -2795,7 +2795,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2795 | { | 2795 | { |
2796 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2796 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2797 | _("No outbound quota configured for network `%s', assigning default bandwidth %llu\n"), | 2797 | _("No outbound quota configured for network `%s', assigning default bandwidth %llu\n"), |
2798 | GNUNET_ATS_print_network_type (c), | 2798 | GNUNET_NT_to_string (c), |
2799 | GNUNET_ATS_DefaultBandwidth); | 2799 | GNUNET_ATS_DefaultBandwidth); |
2800 | out_dest[c] = GNUNET_ATS_DefaultBandwidth; | 2800 | out_dest[c] = GNUNET_ATS_DefaultBandwidth; |
2801 | } | 2801 | } |
@@ -2818,7 +2818,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2818 | { | 2818 | { |
2819 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2819 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2820 | _("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"), | 2820 | _("Could not load quota for network `%s': `%s', assigning default bandwidth %llu\n"), |
2821 | GNUNET_ATS_print_network_type (c), | 2821 | GNUNET_NT_to_string (c), |
2822 | quota_in_str, | 2822 | quota_in_str, |
2823 | GNUNET_ATS_DefaultBandwidth); | 2823 | GNUNET_ATS_DefaultBandwidth); |
2824 | in_dest[c] = GNUNET_ATS_DefaultBandwidth; | 2824 | in_dest[c] = GNUNET_ATS_DefaultBandwidth; |
@@ -2827,7 +2827,7 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2827 | { | 2827 | { |
2828 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2828 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2829 | "Inbound quota configured for network `%s' is %llu\n", | 2829 | "Inbound quota configured for network `%s' is %llu\n", |
2830 | GNUNET_ATS_print_network_type (c), | 2830 | GNUNET_NT_to_string (c), |
2831 | in_dest[c]); | 2831 | in_dest[c]); |
2832 | } | 2832 | } |
2833 | GNUNET_free (quota_in_str); | 2833 | GNUNET_free (quota_in_str); |
@@ -2836,19 +2836,19 @@ GNUNET_ATS_solvers_load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2836 | { | 2836 | { |
2837 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2837 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2838 | _("No outbound quota configure for network `%s', assigning default bandwidth %llu\n"), | 2838 | _("No outbound quota configure for network `%s', assigning default bandwidth %llu\n"), |
2839 | GNUNET_ATS_print_network_type (c), | 2839 | GNUNET_NT_to_string (c), |
2840 | GNUNET_ATS_DefaultBandwidth); | 2840 | GNUNET_ATS_DefaultBandwidth); |
2841 | out_dest[c] = GNUNET_ATS_DefaultBandwidth; | 2841 | out_dest[c] = GNUNET_ATS_DefaultBandwidth; |
2842 | } | 2842 | } |
2843 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 2843 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
2844 | "Loaded quota for network `%s' (in/out): %llu %llu\n", | 2844 | "Loaded quota for network `%s' (in/out): %llu %llu\n", |
2845 | GNUNET_ATS_print_network_type (c), | 2845 | GNUNET_NT_to_string (c), |
2846 | in_dest[c], | 2846 | in_dest[c], |
2847 | out_dest[c]); | 2847 | out_dest[c]); |
2848 | GNUNET_free (entry_out); | 2848 | GNUNET_free (entry_out); |
2849 | GNUNET_free (entry_in); | 2849 | GNUNET_free (entry_in); |
2850 | } | 2850 | } |
2851 | return GNUNET_ATS_NetworkTypeCount; | 2851 | return GNUNET_NT_COUNT; |
2852 | } | 2852 | } |
2853 | 2853 | ||
2854 | 2854 | ||
@@ -3048,16 +3048,16 @@ GNUNET_ATS_solvers_solver_start (enum GNUNET_ATS_Solvers type) | |||
3048 | sh->env.addresses = sh->addresses; | 3048 | sh->env.addresses = sh->addresses; |
3049 | sh->env.bandwidth_changed_cb = &solver_bandwidth_changed_cb; | 3049 | sh->env.bandwidth_changed_cb = &solver_bandwidth_changed_cb; |
3050 | sh->env.get_preferences = &get_preferences_cb; | 3050 | sh->env.get_preferences = &get_preferences_cb; |
3051 | sh->env.network_count = GNUNET_ATS_NetworkTypeCount; | 3051 | sh->env.network_count = GNUNET_NT_COUNT; |
3052 | sh->env.info_cb = &solver_info_cb; | 3052 | sh->env.info_cb = &solver_info_cb; |
3053 | sh->env.network_count = GNUNET_ATS_NetworkTypeCount; | 3053 | sh->env.network_count = GNUNET_NT_COUNT; |
3054 | 3054 | ||
3055 | /* start normalization */ | 3055 | /* start normalization */ |
3056 | GAS_normalization_start (); | 3056 | GAS_normalization_start (); |
3057 | 3057 | ||
3058 | /* load quotas */ | 3058 | /* load quotas */ |
3059 | if (GNUNET_ATS_NetworkTypeCount != GNUNET_ATS_solvers_load_quotas (e->cfg, | 3059 | if (GNUNET_NT_COUNT != GNUNET_ATS_solvers_load_quotas (e->cfg, |
3060 | sh->env.out_quota, sh->env.in_quota, GNUNET_ATS_NetworkTypeCount)) | 3060 | sh->env.out_quota, sh->env.in_quota, GNUNET_NT_COUNT)) |
3061 | { | 3061 | { |
3062 | GNUNET_break(0); | 3062 | GNUNET_break(0); |
3063 | GNUNET_free (sh->plugin); | 3063 | GNUNET_free (sh->plugin); |