[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29425 - gnunet/src/ats-tests
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29425 - gnunet/src/ats-tests |
Date: |
Fri, 20 Sep 2013 10:07:35 +0200 |
Author: wachs
Date: 2013-09-20 10:07:35 +0200 (Fri, 20 Sep 2013)
New Revision: 29425
Modified:
gnunet/src/ats-tests/perf_ats.c
gnunet/src/ats-tests/perf_ats.h
Log:
ats parsing
Modified: gnunet/src/ats-tests/perf_ats.c
===================================================================
--- gnunet/src/ats-tests/perf_ats.c 2013-09-20 07:45:12 UTC (rev 29424)
+++ gnunet/src/ats-tests/perf_ats.c 2013-09-20 08:07:35 UTC (rev 29425)
@@ -905,32 +905,46 @@
const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
{
struct BenchmarkPeer *me = cls;
+ struct BenchmarkPartner *p;
+ int c_s;
int c_a;
char *peer_id;
+ p = NULL;
+ for (c_s = 0; c_s < me->num_partners; c_s++)
+ {
+
+ if (0 == memcmp (&address->peer, &me->partners[c_s].dest->id,
+ sizeof (struct GNUNET_PeerIdentity)))
+ {
+ p = &me->partners[c_s];
+ break;
+ }
+
+ }
+
+ if (NULL == p)
+ {
+ /* This is not one of my partners
+ * Will happen since the peers will connect to each other due to gossiping
+ */
+ return;
+ }
+
peer_id = GNUNET_strdup (GNUNET_i2s (&me->id));
+
for (c_a = 0; c_a < ats_count; c_a++)
{
- /*GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("%c %03u: %s %s %u\n"),
- (GNUNET_YES == p->master) ? 'M' : 'S',
- p->no,
+ /*
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%c %03u: %s %s %u\n"),
+ (GNUNET_YES == p->me->master) ? 'M' : 'S',
+ p->me->no,
GNUNET_i2s (&address->peer),
GNUNET_ATS_print_property_type(ntohl(ats[c_a].type)),
- ntohl(ats[c_a].value));*/
+ ntohl(ats[c_a].value));
+ */
}
-#if 0
- if ((GNUNET_YES == me->master)
- && (0 == memcmp (&address->peer, &me->destination->id,
- sizeof(struct GNUNET_PeerIdentity))))
- {
- GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Bandwidth for master %u: %lu %lu\n",
- me->no, (long unsigned int ) ntohl (bandwidth_in.value__),
- (long unsigned int ) ntohl (bandwidth_in.value__));
- }
- store_information (&bp->id, address, address_active, bandwidth_in,
- bandwidth_out, ats, ats_count);
-#endif
GNUNET_free(peer_id);
}
Modified: gnunet/src/ats-tests/perf_ats.h
===================================================================
--- gnunet/src/ats-tests/perf_ats.h 2013-09-20 07:45:12 UTC (rev 29424)
+++ gnunet/src/ats-tests/perf_ats.h 2013-09-20 08:07:35 UTC (rev 29425)
@@ -100,9 +100,15 @@
*/
unsigned int bytes_received;
+ /* Current ATS properties */
+ uint32_t ats_distance;
+ uint32_t ats_delay;
+ uint32_t bandwidth_in;
+
+ uint32_t bandwidth_out;
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29425 - gnunet/src/ats-tests,
gnunet <=