From 0b25a37936229bfd32e22ae47fc7ee9b22bb602e Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Fri, 15 Feb 2013 09:18:42 +0000 Subject: [PATCH] remove static function --- src/ats/gnunet-service-ats_addresses.c | 5 +- src/ats/test_ats_simplistic_switch_networks.c | 80 ------------------- 2 files changed, 4 insertions(+), 81 deletions(-) diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index f38860254..1ab47e63a 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c @@ -43,7 +43,10 @@ * * This component manages the addresses known to ATS service and suggests * addresses to transport service when it is interested in address suggestions - * for a peer. + * for a peer. ATS addresses also instantiates the bandwidth assignment + * mechanism, notifies it about changes to addresses and forwards changes + * to bandwidth assignments to transport, depending if transport is interested + * in this change. * * Address management and suggestions * diff --git a/src/ats/test_ats_simplistic_switch_networks.c b/src/ats/test_ats_simplistic_switch_networks.c index 47a4e44cb..6d1548651 100644 --- a/src/ats/test_ats_simplistic_switch_networks.c +++ b/src/ats/test_ats_simplistic_switch_networks.c @@ -301,86 +301,6 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, } } -static unsigned int -load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned long long *out_dest, unsigned long long *in_dest, int dest_length) -{ - int quotas[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkType; - char * entry_in = NULL; - char * entry_out = NULL; - char * quota_out_str; - char * quota_in_str; - int c; - - for (c = 0; (c < GNUNET_ATS_NetworkTypeCount) && (c < dest_length); c++) - { - in_dest[c] = 0; - out_dest[c] = 0; - switch (quotas[c]) { - case GNUNET_ATS_NET_UNSPECIFIED: - entry_out = "UNSPECIFIED_QUOTA_OUT"; - entry_in = "UNSPECIFIED_QUOTA_IN"; - break; - case GNUNET_ATS_NET_LOOPBACK: - entry_out = "LOOPBACK_QUOTA_OUT"; - entry_in = "LOOPBACK_QUOTA_IN"; - break; - case GNUNET_ATS_NET_LAN: - entry_out = "LAN_QUOTA_OUT"; - entry_in = "LAN_QUOTA_IN"; - break; - case GNUNET_ATS_NET_WAN: - entry_out = "WAN_QUOTA_OUT"; - entry_in = "WAN_QUOTA_IN"; - break; - case GNUNET_ATS_NET_WLAN: - entry_out = "WLAN_QUOTA_OUT"; - entry_in = "WLAN_QUOTA_IN"; - break; - default: - break; - } - - if ((entry_in == NULL) || (entry_out == NULL)) - continue; - - /* quota out */ - if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_out, "a_out_str)) - { - if (0 == strcmp(quota_out_str, BIG_M_STRING) || - (GNUNET_SYSERR == GNUNET_STRINGS_fancy_size_to_bytes (quota_out_str, &out_dest[c]))) - out_dest[c] = UINT32_MAX; - - GNUNET_free (quota_out_str); - quota_out_str = NULL; - } - else if (GNUNET_ATS_NET_UNSPECIFIED == quotas[c]) - out_dest[c] = UINT32_MAX; - else - out_dest[c] = UINT32_MAX; - - /* quota in */ - if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_in, "a_in_str)) - { - if (0 == strcmp(quota_in_str, BIG_M_STRING) || - (GNUNET_SYSERR == GNUNET_STRINGS_fancy_size_to_bytes (quota_in_str, &in_dest[c]))) - in_dest[c] = UINT32_MAX; - - GNUNET_free (quota_in_str); - quota_in_str = NULL; - } - else if (GNUNET_ATS_NET_UNSPECIFIED == quotas[c]) - { - in_dest[c] = UINT32_MAX; - } - else - { - in_dest[c] = UINT32_MAX; - } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Loaded quota: %s %u, %s %u\n", entry_in, in_dest[c], entry_out, out_dest[c]); - - } - return GNUNET_ATS_NetworkTypeCount; -} static void run (void *cls, -- 2.25.1