diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-20 08:07:35 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-20 08:07:35 +0000 |
commit | d6b447eb42ce0a45d210d35007d330d21448586f (patch) | |
tree | b1de0a02330c9aa735f4428d7efe81748c3aaf58 /src/ats-tests/perf_ats.c | |
parent | c0ed97f579f033d16fcfacf3db63dcd1377c66c3 (diff) | |
download | gnunet-d6b447eb42ce0a45d210d35007d330d21448586f.tar.gz gnunet-d6b447eb42ce0a45d210d35007d330d21448586f.zip |
ats parsing
Diffstat (limited to 'src/ats-tests/perf_ats.c')
-rw-r--r-- | src/ats-tests/perf_ats.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c index a3b4b2652..d18527d68 100644 --- a/src/ats-tests/perf_ats.c +++ b/src/ats-tests/perf_ats.c | |||
@@ -905,32 +905,46 @@ ats_performance_info_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
905 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) | 905 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) |
906 | { | 906 | { |
907 | struct BenchmarkPeer *me = cls; | 907 | struct BenchmarkPeer *me = cls; |
908 | struct BenchmarkPartner *p; | ||
909 | int c_s; | ||
908 | int c_a; | 910 | int c_a; |
909 | char *peer_id; | 911 | char *peer_id; |
910 | 912 | ||
913 | p = NULL; | ||
914 | for (c_s = 0; c_s < me->num_partners; c_s++) | ||
915 | { | ||
916 | |||
917 | if (0 == memcmp (&address->peer, &me->partners[c_s].dest->id, | ||
918 | sizeof (struct GNUNET_PeerIdentity))) | ||
919 | { | ||
920 | p = &me->partners[c_s]; | ||
921 | break; | ||
922 | } | ||
923 | |||
924 | } | ||
925 | |||
926 | if (NULL == p) | ||
927 | { | ||
928 | /* This is not one of my partners | ||
929 | * Will happen since the peers will connect to each other due to gossiping | ||
930 | */ | ||
931 | return; | ||
932 | } | ||
933 | |||
911 | peer_id = GNUNET_strdup (GNUNET_i2s (&me->id)); | 934 | peer_id = GNUNET_strdup (GNUNET_i2s (&me->id)); |
935 | |||
912 | for (c_a = 0; c_a < ats_count; c_a++) | 936 | for (c_a = 0; c_a < ats_count; c_a++) |
913 | { | 937 | { |
914 | /*GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("%c %03u: %s %s %u\n"), | 938 | /* |
915 | (GNUNET_YES == p->master) ? 'M' : 'S', | 939 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%c %03u: %s %s %u\n"), |
916 | p->no, | 940 | (GNUNET_YES == p->me->master) ? 'M' : 'S', |
941 | p->me->no, | ||
917 | GNUNET_i2s (&address->peer), | 942 | GNUNET_i2s (&address->peer), |
918 | GNUNET_ATS_print_property_type(ntohl(ats[c_a].type)), | 943 | GNUNET_ATS_print_property_type(ntohl(ats[c_a].type)), |
919 | ntohl(ats[c_a].value));*/ | 944 | ntohl(ats[c_a].value)); |
920 | } | 945 | */ |
921 | #if 0 | ||
922 | if ((GNUNET_YES == me->master) | ||
923 | && (0 == memcmp (&address->peer, &me->destination->id, | ||
924 | sizeof(struct GNUNET_PeerIdentity)))) | ||
925 | { | ||
926 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Bandwidth for master %u: %lu %lu\n", | ||
927 | me->no, (long unsigned int ) ntohl (bandwidth_in.value__), | ||
928 | (long unsigned int ) ntohl (bandwidth_in.value__)); | ||
929 | } | 946 | } |
930 | 947 | ||
931 | store_information (&bp->id, address, address_active, bandwidth_in, | ||
932 | bandwidth_out, ats, ats_count); | ||
933 | #endif | ||
934 | GNUNET_free(peer_id); | 948 | GNUNET_free(peer_id); |
935 | } | 949 | } |
936 | 950 | ||