remove static function
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 15 Feb 2013 09:18:42 +0000 (09:18 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 15 Feb 2013 09:18:42 +0000 (09:18 +0000)
src/ats/gnunet-service-ats_addresses.c
src/ats/test_ats_simplistic_switch_networks.c

index f388602545f4edd100413b2c37575ba1bf583ab2..1ab47e63ad77c3aa711c4cbad7049a482ce206a8 100644 (file)
  *
  * 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
  *
index 47a4e44cb8e90ae5b81a8d04b5901c6f2361c540..6d15486517e3e856913a2e36c71214b4c80ee7fb 100644 (file)
@@ -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, &quota_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, &quota_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,