aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-02-15 09:18:42 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-02-15 09:18:42 +0000
commit0b25a37936229bfd32e22ae47fc7ee9b22bb602e (patch)
tree0ac27d102dccd076108012f3bb77c555fcc258ea /src/ats
parent0e9d7f60c2ebe8b3072f9d1bc233fb6c8204de00 (diff)
downloadgnunet-0b25a37936229bfd32e22ae47fc7ee9b22bb602e.tar.gz
gnunet-0b25a37936229bfd32e22ae47fc7ee9b22bb602e.zip
remove static function
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/gnunet-service-ats_addresses.c5
-rw-r--r--src/ats/test_ats_simplistic_switch_networks.c80
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 @@
43 * 43 *
44 * This component manages the addresses known to ATS service and suggests 44 * This component manages the addresses known to ATS service and suggests
45 * addresses to transport service when it is interested in address suggestions 45 * addresses to transport service when it is interested in address suggestions
46 * for a peer. 46 * for a peer. ATS addresses also instantiates the bandwidth assignment
47 * mechanism, notifies it about changes to addresses and forwards changes
48 * to bandwidth assignments to transport, depending if transport is interested
49 * in this change.
47 * 50 *
48 * Address management and suggestions 51 * Address management and suggestions
49 * 52 *
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,
301 } 301 }
302} 302}
303 303
304static unsigned int
305load_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned long long *out_dest, unsigned long long *in_dest, int dest_length)
306{
307 int quotas[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkType;
308 char * entry_in = NULL;
309 char * entry_out = NULL;
310 char * quota_out_str;
311 char * quota_in_str;
312 int c;
313
314 for (c = 0; (c < GNUNET_ATS_NetworkTypeCount) && (c < dest_length); c++)
315 {
316 in_dest[c] = 0;
317 out_dest[c] = 0;
318 switch (quotas[c]) {
319 case GNUNET_ATS_NET_UNSPECIFIED:
320 entry_out = "UNSPECIFIED_QUOTA_OUT";
321 entry_in = "UNSPECIFIED_QUOTA_IN";
322 break;
323 case GNUNET_ATS_NET_LOOPBACK:
324 entry_out = "LOOPBACK_QUOTA_OUT";
325 entry_in = "LOOPBACK_QUOTA_IN";
326 break;
327 case GNUNET_ATS_NET_LAN:
328 entry_out = "LAN_QUOTA_OUT";
329 entry_in = "LAN_QUOTA_IN";
330 break;
331 case GNUNET_ATS_NET_WAN:
332 entry_out = "WAN_QUOTA_OUT";
333 entry_in = "WAN_QUOTA_IN";
334 break;
335 case GNUNET_ATS_NET_WLAN:
336 entry_out = "WLAN_QUOTA_OUT";
337 entry_in = "WLAN_QUOTA_IN";
338 break;
339 default:
340 break;
341 }
342
343 if ((entry_in == NULL) || (entry_out == NULL))
344 continue;
345
346 /* quota out */
347 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_out, &quota_out_str))
348 {
349 if (0 == strcmp(quota_out_str, BIG_M_STRING) ||
350 (GNUNET_SYSERR == GNUNET_STRINGS_fancy_size_to_bytes (quota_out_str, &out_dest[c])))
351 out_dest[c] = UINT32_MAX;
352
353 GNUNET_free (quota_out_str);
354 quota_out_str = NULL;
355 }
356 else if (GNUNET_ATS_NET_UNSPECIFIED == quotas[c])
357 out_dest[c] = UINT32_MAX;
358 else
359 out_dest[c] = UINT32_MAX;
360
361 /* quota in */
362 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "ats", entry_in, &quota_in_str))
363 {
364 if (0 == strcmp(quota_in_str, BIG_M_STRING) ||
365 (GNUNET_SYSERR == GNUNET_STRINGS_fancy_size_to_bytes (quota_in_str, &in_dest[c])))
366 in_dest[c] = UINT32_MAX;
367
368 GNUNET_free (quota_in_str);
369 quota_in_str = NULL;
370 }
371 else if (GNUNET_ATS_NET_UNSPECIFIED == quotas[c])
372 {
373 in_dest[c] = UINT32_MAX;
374 }
375 else
376 {
377 in_dest[c] = UINT32_MAX;
378 }
379 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Loaded quota: %s %u, %s %u\n", entry_in, in_dest[c], entry_out, out_dest[c]);
380
381 }
382 return GNUNET_ATS_NetworkTypeCount;
383}
384 304
385static void 305static void
386run (void *cls, 306run (void *cls,