diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-24 13:44:47 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-24 13:44:47 +0000 |
commit | 2a57bf1628b29641597740dbd5b1dd734539bca6 (patch) | |
tree | 4f36483732db73887ac4da9c35c02e5672150241 /src/ats | |
parent | 7c8ddc62cfb81bfc9edc228234e29fee73bed909 (diff) | |
download | gnunet-2a57bf1628b29641597740dbd5b1dd734539bca6.tar.gz gnunet-2a57bf1628b29641597740dbd5b1dd734539bca6.zip |
- more
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-ats.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/ats/gnunet-ats.c b/src/ats/gnunet-ats.c index 16dff5de3..8770a085f 100644 --- a/src/ats/gnunet-ats.c +++ b/src/ats/gnunet-ats.c | |||
@@ -31,10 +31,39 @@ | |||
31 | * Final status code. | 31 | * Final status code. |
32 | */ | 32 | */ |
33 | static int ret; | 33 | static int ret; |
34 | static int results; | ||
34 | 35 | ||
35 | static struct GNUNET_ATS_PerformanceHandle *ph; | 36 | static struct GNUNET_ATS_PerformanceHandle *ph; |
36 | 37 | ||
37 | GNUNET_SCHEDULER_Task end_task; | 38 | GNUNET_SCHEDULER_TaskIdentifier end_task; |
39 | |||
40 | void ats_perf_cb (void *cls, | ||
41 | const struct | ||
42 | GNUNET_HELLO_Address * | ||
43 | address, | ||
44 | struct | ||
45 | GNUNET_BANDWIDTH_Value32NBO | ||
46 | bandwidth_out, | ||
47 | struct | ||
48 | GNUNET_BANDWIDTH_Value32NBO | ||
49 | bandwidth_in, | ||
50 | const struct | ||
51 | GNUNET_ATS_Information * | ||
52 | ats, uint32_t ats_count) | ||
53 | { | ||
54 | fprintf (stderr, "Peer `%s'\n", GNUNET_i2s (&address->peer)); | ||
55 | results++; | ||
56 | } | ||
57 | |||
58 | void end (void *cls, | ||
59 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
60 | { | ||
61 | GNUNET_ATS_performance_done (ph); | ||
62 | ph = NULL; | ||
63 | /*FIXME */fprintf (stderr, "NOT IMPLEMENTED!\n"); | ||
64 | fprintf (stderr, "ATS returned %u addresses\n", results); | ||
65 | ret = 0; | ||
66 | } | ||
38 | 67 | ||
39 | void testservice_task (void *cls, | 68 | void testservice_task (void *cls, |
40 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 69 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -51,11 +80,8 @@ void testservice_task (void *cls, | |||
51 | if (NULL == ph) | 80 | if (NULL == ph) |
52 | fprintf (stderr, "Cannot connect to ATS service, exiting...\n"); | 81 | fprintf (stderr, "Cannot connect to ATS service, exiting...\n"); |
53 | 82 | ||
54 | /* FIXME do work here*/ | 83 | end_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &end, NULL); |
55 | fprintf (stderr, "NOT IMPLEMENTED\n"); | 84 | ret = 1; |
56 | |||
57 | GNUNET_ATS_performance_done (ph); | ||
58 | ret = 0; | ||
59 | } | 85 | } |
60 | 86 | ||
61 | /** | 87 | /** |