aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_addresses.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-24 14:11:17 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-24 14:11:17 +0000
commit6e03d509075d2cd38fabab6568b4c2bf2451505e (patch)
tree245379e96866662db100eb35c75be1206f1f661b /src/ats/gnunet-service-ats_addresses.c
parentc77bdc9b0fec7ce8201c5f3f5c915485abaf2dcd (diff)
downloadgnunet-6e03d509075d2cd38fabab6568b4c2bf2451505e.tar.gz
gnunet-6e03d509075d2cd38fabab6568b4c2bf2451505e.zip
-fixing misc format strings
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses.c')
-rw-r--r--src/ats/gnunet-service-ats_addresses.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 8e47ae74c..366010afb 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -1323,9 +1323,10 @@ GAS_addresses_handle_backoff_reset (struct GAS_Addresses_Handle *handle,
1323} 1323}
1324 1324
1325 1325
1326
1327static int 1326static int
1328eval_count_active_it (void *cls, const struct GNUNET_PeerIdentity *id, void *obj) 1327eval_count_active_it (void *cls,
1328 const struct GNUNET_PeerIdentity *id,
1329 void *obj)
1329{ 1330{
1330 int *request_fulfilled = cls; 1331 int *request_fulfilled = cls;
1331 struct ATS_Address *addr = obj; 1332 struct ATS_Address *addr = obj;
@@ -1343,7 +1344,8 @@ eval_count_active_it (void *cls, const struct GNUNET_PeerIdentity *id, void *obj
1343/** 1344/**
1344 * Summary context 1345 * Summary context
1345 */ 1346 */
1346struct SummaryContext { 1347struct SummaryContext
1348{
1347 /** 1349 /**
1348 * Sum of the utilized inbound bandwidth per network 1350 * Sum of the utilized inbound bandwidth per network
1349 */ 1351 */
@@ -1364,11 +1366,10 @@ struct SummaryContext {
1364static int 1366static int
1365eval_sum_bw_used (void *cls, const struct GNUNET_PeerIdentity *id, void *obj) 1367eval_sum_bw_used (void *cls, const struct GNUNET_PeerIdentity *id, void *obj)
1366{ 1368{
1369 struct SummaryContext *ctx = cls;
1367 struct ATS_Address *addr = obj; 1370 struct ATS_Address *addr = obj;
1368 int networks[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkType; 1371 int networks[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkType;
1369 int net; 1372 int net;
1370 struct SummaryContext *ctx = cls;
1371
1372 int c; 1373 int c;
1373 1374
1374 if (GNUNET_YES == addr->active) 1375 if (GNUNET_YES == addr->active)
@@ -1384,22 +1385,25 @@ eval_sum_bw_used (void *cls, const struct GNUNET_PeerIdentity *id, void *obj)
1384 } 1385 }
1385 } 1386 }
1386 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1387 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1387 "Active address in %s with (in/out) %lu/%lu Bps\n", 1388 "Active address in %s with (in/out) %u/%u Bps\n",
1388 GNUNET_ATS_print_network_type (net), 1389 GNUNET_ATS_print_network_type (net),
1389 ntohl (addr->assigned_bw_in.value__), 1390 (unsigned int) ntohl (addr->assigned_bw_in.value__),
1390 ntohl (addr->assigned_bw_out.value__)); 1391 (unsigned int) ntohl (addr->assigned_bw_out.value__));
1391 } 1392 }
1392 return GNUNET_OK; 1393 return GNUNET_OK;
1393} 1394}
1394 1395
1396
1395/** 1397/**
1396 * Summary context 1398 * Summary context
1397 */ 1399 */
1398struct RelativityContext { 1400struct RelativityContext
1401{
1399 1402
1400 struct GAS_Addresses_Handle *ah; 1403 struct GAS_Addresses_Handle *ah;
1401}; 1404};
1402 1405
1406
1403static int 1407static int
1404find_active_address (void *cls, const struct GNUNET_PeerIdentity *id, void *obj) 1408find_active_address (void *cls, const struct GNUNET_PeerIdentity *id, void *obj)
1405{ 1409{
@@ -2045,24 +2049,26 @@ bandwidth_changed_cb (void *cls, struct ATS_Address *address)
2045 } 2049 }
2046 if (NULL == cur) 2050 if (NULL == cur)
2047 { 2051 {
2048 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Nobody is interested in peer `%s' :(\n", 2052 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
2049 GNUNET_i2s (&address->peer)); 2053 "Nobody is interested in peer `%s' :(\n",
2054 GNUNET_i2s (&address->peer));
2050 return; 2055 return;
2051 } 2056 }
2052 2057
2053 if ((0 == ntohl (address->assigned_bw_in.value__)) 2058 if ((0 == ntohl (address->assigned_bw_in.value__))
2054 && (0 == ntohl (address->assigned_bw_out.value__))) 2059 && (0 == ntohl (address->assigned_bw_out.value__)))
2055 { 2060 {
2056 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 2061 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
2057 "Telling transport to disconnect peer `%s'\n", 2062 "Telling transport to disconnect peer `%s'\n",
2058 GNUNET_i2s (&address->peer)); 2063 GNUNET_i2s (&address->peer));
2059 } 2064 }
2060 else 2065 else
2061 { 2066 {
2062 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 2067 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
2063 "Sending bandwidth update for peer `%s': %lu %lu\n", 2068 "Sending bandwidth update for peer `%s': %u %u\n",
2064 GNUNET_i2s (&address->peer), address->assigned_bw_out.value__, 2069 GNUNET_i2s (&address->peer),
2065 address->assigned_bw_out.value__); 2070 (unsigned int) ntohl (address->assigned_bw_out.value__),
2071 (unsigned int) ntohl (address->assigned_bw_out.value__));
2066 } 2072 }
2067 2073
2068 /* *Notify scheduling clients about suggestion */ 2074 /* *Notify scheduling clients about suggestion */
@@ -2071,6 +2077,7 @@ bandwidth_changed_cb (void *cls, struct ATS_Address *address)
2071 address->atsi_count, address->assigned_bw_out, address->assigned_bw_in); 2077 address->atsi_count, address->assigned_bw_out, address->assigned_bw_in);
2072} 2078}
2073 2079
2080
2074/** 2081/**
2075 * Initialize address subsystem. The addresses subsystem manages the addresses 2082 * Initialize address subsystem. The addresses subsystem manages the addresses
2076 * known and current performance information. It has a solver component 2083 * known and current performance information. It has a solver component