diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-07-08 12:06:31 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-07-08 12:06:31 +0000 |
commit | 25a6082f9f63a999b5ce35c7fe55908988c2486a (patch) | |
tree | 9e1114cf02fd25d0d9c018a52d86113b21461d0f /src/transport/test_transport_ats.c | |
parent | 9bb55ab8ca1c61d6719c3e48a7b66fc1d827fb43 (diff) | |
download | gnunet-25a6082f9f63a999b5ce35c7fe55908988c2486a.tar.gz gnunet-25a6082f9f63a999b5ce35c7fe55908988c2486a.zip |
more changes to ATS
it's running, minor changes have to completed
Diffstat (limited to 'src/transport/test_transport_ats.c')
-rw-r--r-- | src/transport/test_transport_ats.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/transport/test_transport_ats.c b/src/transport/test_transport_ats.c index 41d1ff0d6..549a3a863 100644 --- a/src/transport/test_transport_ats.c +++ b/src/transport/test_transport_ats.c | |||
@@ -31,12 +31,40 @@ struct GNUNET_CONFIGURATION_Handle *cfg; | |||
31 | 31 | ||
32 | static struct ATS_Handle * ats; | 32 | static struct ATS_Handle * ats; |
33 | 33 | ||
34 | void ats_result_cb () | ||
35 | { | ||
36 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
37 | "ATS Result callback\n"); | ||
38 | } | ||
39 | |||
40 | |||
41 | void create_ats_information (struct ATS_peer **p, int * c_p, | ||
42 | struct ATS_mechanism ** m, int * c_m) | ||
43 | { | ||
44 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
45 | "ATS needs addresses\n"); | ||
46 | (*c_m) = 100; | ||
47 | (*c_p) = 10; | ||
48 | } | ||
49 | |||
50 | int run_ats (void) | ||
51 | { | ||
52 | int ret = 0; | ||
53 | |||
54 | ats_calculate_bandwidth_distribution(ats, NULL); | ||
55 | |||
56 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
57 | "Running ATS: %s \n", (ret==0)? "SUCCESFULL": "FAILED"); | ||
58 | return ret; | ||
59 | } | ||
34 | 60 | ||
35 | int init_ats (void) | 61 | int init_ats (void) |
36 | { | 62 | { |
37 | int ret = 0; | 63 | int ret = 0; |
38 | 64 | ||
39 | //ats = ats_init(cfg); | 65 | ats = ats_init(1.0, 1.0, 1.0, 50000, 5, 10, ATS_MAX_EXEC_DURATION, |
66 | create_ats_information, | ||
67 | ats_result_cb); | ||
40 | //GNUNET_assert (ats != NULL); | 68 | //GNUNET_assert (ats != NULL); |
41 | 69 | ||
42 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 70 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -93,6 +121,7 @@ main (int argc, char *argv[]) | |||
93 | /* Testing */ | 121 | /* Testing */ |
94 | ats = NULL; | 122 | ats = NULL; |
95 | ret += init_ats (); | 123 | ret += init_ats (); |
124 | ret += run_ats (); | ||
96 | ret += shutdown_ats (); | 125 | ret += shutdown_ats (); |
97 | 126 | ||
98 | /* Shutdown */ | 127 | /* Shutdown */ |