diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-18 14:10:50 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-18 14:10:50 +0000 |
commit | 4ec3377776569a7affcaf6b69db9312ad1891ba5 (patch) | |
tree | 265d3f0faab96eb98800c3e3ad0b45c025d18c4a | |
parent | 564e4a46044821e3881777bd7d373c8c209ef890 (diff) | |
download | gnunet-4ec3377776569a7affcaf6b69db9312ad1891ba5.tar.gz gnunet-4ec3377776569a7affcaf6b69db9312ad1891ba5.zip |
remove ATS information from callback from ATS address selection, as the argument was never used in the first place
25 files changed, 165 insertions, 203 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index 7e44a8660..c7c79d289 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -525,8 +525,7 @@ process_ats_address_suggestion_message (void *cls, | |||
525 | &address, | 525 | &address, |
526 | s, | 526 | s, |
527 | m->bandwidth_out, | 527 | m->bandwidth_out, |
528 | m->bandwidth_in, | 528 | m->bandwidth_in); |
529 | atsi, ats_count); | ||
530 | } | 529 | } |
531 | 530 | ||
532 | 531 | ||
diff --git a/src/ats/test_ats_api_delayed_service_performance_list_all_addresses.c b/src/ats/test_ats_api_delayed_service_performance_list_all_addresses.c index 69507e71a..50707977b 100644 --- a/src/ats/test_ats_api_delayed_service_performance_list_all_addresses.c +++ b/src/ats/test_ats_api_delayed_service_performance_list_all_addresses.c | |||
@@ -146,19 +146,17 @@ stat_cb(void *cls, const char *subsystem, | |||
146 | return GNUNET_OK; | 146 | return GNUNET_OK; |
147 | } | 147 | } |
148 | 148 | ||
149 | |||
149 | static void | 150 | static void |
150 | address_suggest_cb (void *cls, | 151 | address_suggest_cb (void *cls, |
151 | const struct GNUNET_PeerIdentity *peer, | 152 | const struct GNUNET_PeerIdentity *peer, |
152 | const struct GNUNET_HELLO_Address *address, | 153 | const struct GNUNET_HELLO_Address *address, |
153 | struct Session *session, | 154 | struct Session *session, |
154 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 155 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
155 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 156 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
156 | const struct GNUNET_ATS_Information *atsi, | ||
157 | uint32_t ats_count) | ||
158 | { | 157 | { |
159 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 158 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
160 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 159 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
161 | return; | ||
162 | } | 160 | } |
163 | 161 | ||
164 | 162 | ||
@@ -277,7 +275,7 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, | |||
277 | GNUNET_i2s (&p[1].id)); | 275 | GNUNET_i2s (&p[1].id)); |
278 | 276 | ||
279 | /* Add addresses */ | 277 | /* Add addresses */ |
280 | sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL ); | 278 | sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL); |
281 | if (sched_ats == NULL ) | 279 | if (sched_ats == NULL ) |
282 | { | 280 | { |
283 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not setup peer!\n"); | 281 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not setup peer!\n"); |
diff --git a/src/ats/test_ats_api_delayed_service_performance_monitor.c b/src/ats/test_ats_api_delayed_service_performance_monitor.c index f09f7d58d..e19d1673f 100644 --- a/src/ats/test_ats_api_delayed_service_performance_monitor.c +++ b/src/ats/test_ats_api_delayed_service_performance_monitor.c | |||
@@ -37,12 +37,12 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
37 | /** | 37 | /** |
38 | * Statistics handle | 38 | * Statistics handle |
39 | */ | 39 | */ |
40 | struct GNUNET_STATISTICS_Handle *stats; | 40 | static struct GNUNET_STATISTICS_Handle *stats; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Configuration handle | 43 | * Configuration handle |
44 | */ | 44 | */ |
45 | struct GNUNET_CONFIGURATION_Handle *cfg; | 45 | static struct GNUNET_CONFIGURATION_Handle *cfg; |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * ATS scheduling handle | 48 | * ATS scheduling handle |
@@ -54,7 +54,6 @@ static struct GNUNET_ATS_SchedulingHandle *sched_ats; | |||
54 | */ | 54 | */ |
55 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; | 55 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; |
56 | 56 | ||
57 | struct GNUNET_ATS_AddressListHandle* phal; | ||
58 | 57 | ||
59 | static int ret; | 58 | static int ret; |
60 | 59 | ||
@@ -84,9 +83,9 @@ static struct PeerContext p[2]; | |||
84 | static struct Address p0_addresses[2]; | 83 | static struct Address p0_addresses[2]; |
85 | static struct Address p1_addresses[2]; | 84 | static struct Address p1_addresses[2]; |
86 | 85 | ||
87 | struct GNUNET_HELLO_Address p0_ha[2]; | 86 | static struct GNUNET_HELLO_Address p0_ha[2]; |
88 | struct GNUNET_HELLO_Address p1_ha[2]; | 87 | static struct GNUNET_HELLO_Address p1_ha[2]; |
89 | struct GNUNET_HELLO_Address *s_ha[2]; | 88 | |
90 | 89 | ||
91 | static void | 90 | static void |
92 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 91 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
@@ -148,20 +147,18 @@ stat_cb(void *cls, const char *subsystem, | |||
148 | 147 | ||
149 | } | 148 | } |
150 | 149 | ||
150 | |||
151 | static void | 151 | static void |
152 | address_suggest_cb (void *cls, | 152 | address_suggest_cb (void *cls, |
153 | const struct GNUNET_PeerIdentity *peer, | 153 | const struct GNUNET_PeerIdentity *peer, |
154 | const struct GNUNET_HELLO_Address *address, | 154 | const struct GNUNET_HELLO_Address *address, |
155 | struct Session *session, | 155 | struct Session *session, |
156 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 156 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
157 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 157 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
158 | const struct GNUNET_ATS_Information *atsi, | ||
159 | uint32_t ats_count) | ||
160 | 158 | ||
161 | { | 159 | { |
162 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 160 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
163 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 161 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
164 | return; | ||
165 | } | 162 | } |
166 | 163 | ||
167 | 164 | ||
diff --git a/src/ats/test_ats_api_delayed_service_scheduling_add_address.c b/src/ats/test_ats_api_delayed_service_scheduling_add_address.c index 4e45ed918..4d6b276fb 100644 --- a/src/ats/test_ats_api_delayed_service_scheduling_add_address.c +++ b/src/ats/test_ats_api_delayed_service_scheduling_add_address.c | |||
@@ -38,7 +38,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
38 | /** | 38 | /** |
39 | * Statistics handle | 39 | * Statistics handle |
40 | */ | 40 | */ |
41 | struct GNUNET_STATISTICS_Handle *stats; | 41 | static struct GNUNET_STATISTICS_Handle *stats; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * Scheduling handle | 44 | * Scheduling handle |
@@ -63,7 +63,7 @@ static struct PeerContext p; | |||
63 | /** | 63 | /** |
64 | * HELLO address | 64 | * HELLO address |
65 | */ | 65 | */ |
66 | struct GNUNET_HELLO_Address test_hello_address; | 66 | static struct GNUNET_HELLO_Address test_hello_address; |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Session | 69 | * Session |
@@ -73,24 +73,28 @@ static void *test_session; | |||
73 | /** | 73 | /** |
74 | * Test ats info | 74 | * Test ats info |
75 | */ | 75 | */ |
76 | struct GNUNET_ATS_Information test_ats_info[2]; | 76 | static struct GNUNET_ATS_Information test_ats_info[2]; |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Test ats count | 79 | * Test ats count |
80 | */ | 80 | */ |
81 | uint32_t test_ats_count; | 81 | static uint32_t test_ats_count; |
82 | 82 | ||
83 | 83 | ||
84 | static void end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 84 | static void |
85 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
86 | |||
85 | 87 | ||
86 | static int | 88 | static int |
87 | stat_cb(void *cls, const char *subsystem, | 89 | stat_cb(void *cls, const char *subsystem, |
88 | const char *name, uint64_t value, | 90 | const char *name, uint64_t value, |
89 | int is_persistent) | 91 | int is_persistent) |
90 | { | 92 | { |
91 | 93 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | |
92 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "ATS statistics: `%s' `%s' %llu\n", | 94 | "ATS statistics: `%s' `%s' %llu\n", |
93 | subsystem,name, value); | 95 | subsystem, |
96 | name, | ||
97 | value); | ||
94 | if (1 == value) | 98 | if (1 == value) |
95 | { | 99 | { |
96 | GNUNET_SCHEDULER_add_now (&end, NULL); | 100 | GNUNET_SCHEDULER_add_now (&end, NULL); |
@@ -100,7 +104,8 @@ stat_cb(void *cls, const char *subsystem, | |||
100 | 104 | ||
101 | 105 | ||
102 | static void | 106 | static void |
103 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 107 | end (void *cls, |
108 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
104 | { | 109 | { |
105 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); | 110 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); |
106 | 111 | ||
@@ -128,6 +133,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
128 | ret = 0; | 133 | ret = 0; |
129 | } | 134 | } |
130 | 135 | ||
136 | |||
131 | static void | 137 | static void |
132 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 138 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
133 | { | 139 | { |
@@ -136,19 +142,17 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
136 | ret = GNUNET_SYSERR; | 142 | ret = GNUNET_SYSERR; |
137 | } | 143 | } |
138 | 144 | ||
145 | |||
139 | static void | 146 | static void |
140 | address_suggest_cb (void *cls, | 147 | address_suggest_cb (void *cls, |
141 | const struct GNUNET_PeerIdentity *peer, | 148 | const struct GNUNET_PeerIdentity *peer, |
142 | const struct GNUNET_HELLO_Address *address, | 149 | const struct GNUNET_HELLO_Address *address, |
143 | struct Session *session, | 150 | struct Session *session, |
144 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 151 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
145 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 152 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
146 | const struct GNUNET_ATS_Information *atsi, | ||
147 | uint32_t ats_count) | ||
148 | { | 153 | { |
149 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 154 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
150 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 155 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
151 | return; | ||
152 | } | 156 | } |
153 | 157 | ||
154 | 158 | ||
@@ -189,8 +193,10 @@ got_initial_value (void *cls, int success) | |||
189 | test_hello_address.address_length = test_addr.addr_len; | 193 | test_hello_address.address_length = test_addr.addr_len; |
190 | 194 | ||
191 | /* Adding address */ | 195 | /* Adding address */ |
192 | GNUNET_ATS_address_add (sched_ats, &test_hello_address, test_session, test_ats_info, test_ats_count); | 196 | GNUNET_ATS_address_add (sched_ats, |
193 | 197 | &test_hello_address, | |
198 | test_session, | ||
199 | test_ats_info, test_ats_count); | ||
194 | } | 200 | } |
195 | 201 | ||
196 | 202 | ||
diff --git a/src/ats/test_ats_api_performance_list_all_addresses.c b/src/ats/test_ats_api_performance_list_all_addresses.c index 253598d49..714134321 100644 --- a/src/ats/test_ats_api_performance_list_all_addresses.c +++ b/src/ats/test_ats_api_performance_list_all_addresses.c | |||
@@ -35,12 +35,12 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
35 | /** | 35 | /** |
36 | * Statistics handle | 36 | * Statistics handle |
37 | */ | 37 | */ |
38 | struct GNUNET_STATISTICS_Handle *stats; | 38 | static struct GNUNET_STATISTICS_Handle *stats; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * Configuration handle | 41 | * Configuration handle |
42 | */ | 42 | */ |
43 | struct GNUNET_CONFIGURATION_Handle *cfg; | 43 | static struct GNUNET_CONFIGURATION_Handle *cfg; |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * ATS scheduling handle | 46 | * ATS scheduling handle |
@@ -52,7 +52,7 @@ static struct GNUNET_ATS_SchedulingHandle *sched_ats; | |||
52 | */ | 52 | */ |
53 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; | 53 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; |
54 | 54 | ||
55 | struct GNUNET_ATS_AddressListHandle* phal; | 55 | static struct GNUNET_ATS_AddressListHandle* phal; |
56 | 56 | ||
57 | static int ret; | 57 | static int ret; |
58 | 58 | ||
@@ -82,9 +82,9 @@ static struct PeerContext p[2]; | |||
82 | static struct Address p0_addresses[2]; | 82 | static struct Address p0_addresses[2]; |
83 | static struct Address p1_addresses[2]; | 83 | static struct Address p1_addresses[2]; |
84 | 84 | ||
85 | struct GNUNET_HELLO_Address p0_ha[2]; | 85 | static struct GNUNET_HELLO_Address p0_ha[2]; |
86 | struct GNUNET_HELLO_Address p1_ha[2]; | 86 | static struct GNUNET_HELLO_Address p1_ha[2]; |
87 | struct GNUNET_HELLO_Address *s_ha[2]; | 87 | |
88 | 88 | ||
89 | static void | 89 | static void |
90 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 90 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
@@ -152,13 +152,10 @@ address_suggest_cb (void *cls, | |||
152 | const struct GNUNET_HELLO_Address *address, | 152 | const struct GNUNET_HELLO_Address *address, |
153 | struct Session *session, | 153 | struct Session *session, |
154 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 154 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
155 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 155 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
156 | const struct GNUNET_ATS_Information *atsi, | ||
157 | uint32_t ats_count) | ||
158 | { | 156 | { |
159 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 157 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
160 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 158 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
161 | return; | ||
162 | } | 159 | } |
163 | 160 | ||
164 | 161 | ||
@@ -170,6 +167,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
170 | ret = GNUNET_SYSERR; | 167 | ret = GNUNET_SYSERR; |
171 | } | 168 | } |
172 | 169 | ||
170 | |||
173 | static void | 171 | static void |
174 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 172 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
175 | { | 173 | { |
diff --git a/src/ats/test_ats_api_performance_list_all_addresses_active.c b/src/ats/test_ats_api_performance_list_all_addresses_active.c index 8385203c5..a289db238 100644 --- a/src/ats/test_ats_api_performance_list_all_addresses_active.c +++ b/src/ats/test_ats_api_performance_list_all_addresses_active.c | |||
@@ -35,12 +35,12 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
35 | /** | 35 | /** |
36 | * Statistics handle | 36 | * Statistics handle |
37 | */ | 37 | */ |
38 | struct GNUNET_STATISTICS_Handle *stats; | 38 | static struct GNUNET_STATISTICS_Handle *stats; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * Configuration handle | 41 | * Configuration handle |
42 | */ | 42 | */ |
43 | struct GNUNET_CONFIGURATION_Handle *cfg; | 43 | static struct GNUNET_CONFIGURATION_Handle *cfg; |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * ATS scheduling handle | 46 | * ATS scheduling handle |
@@ -52,7 +52,7 @@ static struct GNUNET_ATS_SchedulingHandle *sched_ats; | |||
52 | */ | 52 | */ |
53 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; | 53 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; |
54 | 54 | ||
55 | struct GNUNET_ATS_AddressListHandle* phal; | 55 | static struct GNUNET_ATS_AddressListHandle* phal; |
56 | 56 | ||
57 | static int ret; | 57 | static int ret; |
58 | 58 | ||
@@ -82,9 +82,9 @@ static struct PeerContext p[2]; | |||
82 | static struct Address p0_addresses[2]; | 82 | static struct Address p0_addresses[2]; |
83 | static struct Address p1_addresses[2]; | 83 | static struct Address p1_addresses[2]; |
84 | 84 | ||
85 | struct GNUNET_HELLO_Address p0_ha[2]; | 85 | static struct GNUNET_HELLO_Address p0_ha[2]; |
86 | struct GNUNET_HELLO_Address p1_ha[2]; | 86 | static struct GNUNET_HELLO_Address p1_ha[2]; |
87 | struct GNUNET_HELLO_Address *s_ha[2]; | 87 | |
88 | 88 | ||
89 | static void | 89 | static void |
90 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 90 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
@@ -159,13 +159,10 @@ address_suggest_cb (void *cls, | |||
159 | const struct GNUNET_HELLO_Address *address, | 159 | const struct GNUNET_HELLO_Address *address, |
160 | struct Session *session, | 160 | struct Session *session, |
161 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 161 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
162 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 162 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
163 | const struct GNUNET_ATS_Information *atsi, | ||
164 | uint32_t ats_count) | ||
165 | { | 163 | { |
166 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 164 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
167 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 165 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
168 | return; | ||
169 | } | 166 | } |
170 | 167 | ||
171 | 168 | ||
diff --git a/src/ats/test_ats_api_performance_list_peer_addresses.c b/src/ats/test_ats_api_performance_list_peer_addresses.c index 3eb5b8e50..72d56c53a 100644 --- a/src/ats/test_ats_api_performance_list_peer_addresses.c +++ b/src/ats/test_ats_api_performance_list_peer_addresses.c | |||
@@ -35,12 +35,12 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
35 | /** | 35 | /** |
36 | * Statistics handle | 36 | * Statistics handle |
37 | */ | 37 | */ |
38 | struct GNUNET_STATISTICS_Handle *stats; | 38 | static struct GNUNET_STATISTICS_Handle *stats; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * Configuration handle | 41 | * Configuration handle |
42 | */ | 42 | */ |
43 | struct GNUNET_CONFIGURATION_Handle *cfg; | 43 | static struct GNUNET_CONFIGURATION_Handle *cfg; |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * ATS scheduling handle | 46 | * ATS scheduling handle |
@@ -52,7 +52,7 @@ static struct GNUNET_ATS_SchedulingHandle *sched_ats; | |||
52 | */ | 52 | */ |
53 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; | 53 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; |
54 | 54 | ||
55 | struct GNUNET_ATS_AddressListHandle* phal; | 55 | static struct GNUNET_ATS_AddressListHandle* phal; |
56 | 56 | ||
57 | static int ret; | 57 | static int ret; |
58 | 58 | ||
@@ -85,9 +85,8 @@ static struct PeerContext p[2]; | |||
85 | static struct Address p0_addresses[2]; | 85 | static struct Address p0_addresses[2]; |
86 | static struct Address p1_addresses[2]; | 86 | static struct Address p1_addresses[2]; |
87 | 87 | ||
88 | struct GNUNET_HELLO_Address p0_ha[2]; | 88 | static struct GNUNET_HELLO_Address p0_ha[2]; |
89 | struct GNUNET_HELLO_Address p1_ha[2]; | 89 | static struct GNUNET_HELLO_Address p1_ha[2]; |
90 | struct GNUNET_HELLO_Address *s_ha[2]; | ||
91 | 90 | ||
92 | 91 | ||
93 | static void | 92 | static void |
@@ -228,9 +227,7 @@ address_suggest_cb (void *cls, | |||
228 | const struct GNUNET_HELLO_Address *address, | 227 | const struct GNUNET_HELLO_Address *address, |
229 | struct Session *session, | 228 | struct Session *session, |
230 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 229 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
231 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 230 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
232 | const struct GNUNET_ATS_Information *atsi, | ||
233 | uint32_t ats_count) | ||
234 | { | 231 | { |
235 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 232 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
236 | "Did not expect suggestion callback!\n"); | 233 | "Did not expect suggestion callback!\n"); |
diff --git a/src/ats/test_ats_api_performance_monitor.c b/src/ats/test_ats_api_performance_monitor.c index 0c17ded87..9b70ccd76 100644 --- a/src/ats/test_ats_api_performance_monitor.c +++ b/src/ats/test_ats_api_performance_monitor.c | |||
@@ -36,12 +36,12 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
36 | /** | 36 | /** |
37 | * Statistics handle | 37 | * Statistics handle |
38 | */ | 38 | */ |
39 | struct GNUNET_STATISTICS_Handle *stats; | 39 | static struct GNUNET_STATISTICS_Handle *stats; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Configuration handle | 42 | * Configuration handle |
43 | */ | 43 | */ |
44 | struct GNUNET_CONFIGURATION_Handle *cfg; | 44 | static struct GNUNET_CONFIGURATION_Handle *cfg; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * ATS scheduling handle | 47 | * ATS scheduling handle |
@@ -53,8 +53,6 @@ static struct GNUNET_ATS_SchedulingHandle *sched_ats; | |||
53 | */ | 53 | */ |
54 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; | 54 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; |
55 | 55 | ||
56 | struct GNUNET_ATS_AddressListHandle* phal; | ||
57 | |||
58 | static int ret; | 56 | static int ret; |
59 | 57 | ||
60 | struct Address | 58 | struct Address |
@@ -83,9 +81,8 @@ static struct PeerContext p[2]; | |||
83 | static struct Address p0_addresses[2]; | 81 | static struct Address p0_addresses[2]; |
84 | static struct Address p1_addresses[2]; | 82 | static struct Address p1_addresses[2]; |
85 | 83 | ||
86 | struct GNUNET_HELLO_Address p0_ha[2]; | 84 | static struct GNUNET_HELLO_Address p0_ha[2]; |
87 | struct GNUNET_HELLO_Address p1_ha[2]; | 85 | static struct GNUNET_HELLO_Address p1_ha[2]; |
88 | struct GNUNET_HELLO_Address *s_ha[2]; | ||
89 | 86 | ||
90 | static void | 87 | static void |
91 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 88 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
@@ -153,14 +150,11 @@ address_suggest_cb (void *cls, | |||
153 | const struct GNUNET_HELLO_Address *address, | 150 | const struct GNUNET_HELLO_Address *address, |
154 | struct Session *session, | 151 | struct Session *session, |
155 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 152 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
156 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 153 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
157 | const struct GNUNET_ATS_Information *atsi, | ||
158 | uint32_t ats_count) | ||
159 | 154 | ||
160 | { | 155 | { |
161 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 156 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
162 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 157 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
163 | return; | ||
164 | } | 158 | } |
165 | 159 | ||
166 | 160 | ||
diff --git a/src/ats/test_ats_api_performance_monitor_initial_callback.c b/src/ats/test_ats_api_performance_monitor_initial_callback.c index 42d2951f7..1e9991b9c 100644 --- a/src/ats/test_ats_api_performance_monitor_initial_callback.c +++ b/src/ats/test_ats_api_performance_monitor_initial_callback.c | |||
@@ -36,12 +36,12 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
36 | /** | 36 | /** |
37 | * Statistics handle | 37 | * Statistics handle |
38 | */ | 38 | */ |
39 | struct GNUNET_STATISTICS_Handle *stats; | 39 | static struct GNUNET_STATISTICS_Handle *stats; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Configuration handle | 42 | * Configuration handle |
43 | */ | 43 | */ |
44 | struct GNUNET_CONFIGURATION_Handle *cfg; | 44 | static struct GNUNET_CONFIGURATION_Handle *cfg; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * ATS scheduling handle | 47 | * ATS scheduling handle |
@@ -53,10 +53,9 @@ static struct GNUNET_ATS_SchedulingHandle *sched_ats; | |||
53 | */ | 53 | */ |
54 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; | 54 | static struct GNUNET_ATS_PerformanceHandle *perf_ats; |
55 | 55 | ||
56 | struct GNUNET_ATS_AddressListHandle* phal; | ||
57 | |||
58 | static int ret; | 56 | static int ret; |
59 | 57 | ||
58 | |||
60 | struct Address | 59 | struct Address |
61 | { | 60 | { |
62 | char *plugin; | 61 | char *plugin; |
@@ -160,14 +159,11 @@ address_suggest_cb (void *cls, | |||
160 | const struct GNUNET_HELLO_Address *address, | 159 | const struct GNUNET_HELLO_Address *address, |
161 | struct Session *session, | 160 | struct Session *session, |
162 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 161 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
163 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 162 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
164 | const struct GNUNET_ATS_Information *atsi, | ||
165 | uint32_t ats_count) | ||
166 | 163 | ||
167 | { | 164 | { |
168 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 165 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
169 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 166 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
170 | return; | ||
171 | } | 167 | } |
172 | 168 | ||
173 | 169 | ||
diff --git a/src/ats/test_ats_api_scheduling_add_address.c b/src/ats/test_ats_api_scheduling_add_address.c index 92bd049f4..b7d6ce4b7 100644 --- a/src/ats/test_ats_api_scheduling_add_address.c +++ b/src/ats/test_ats_api_scheduling_add_address.c | |||
@@ -135,19 +135,17 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
135 | ret = GNUNET_SYSERR; | 135 | ret = GNUNET_SYSERR; |
136 | } | 136 | } |
137 | 137 | ||
138 | |||
138 | static void | 139 | static void |
139 | address_suggest_cb (void *cls, | 140 | address_suggest_cb (void *cls, |
140 | const struct GNUNET_PeerIdentity *peer, | 141 | const struct GNUNET_PeerIdentity *peer, |
141 | const struct GNUNET_HELLO_Address *address, | 142 | const struct GNUNET_HELLO_Address *address, |
142 | struct Session *session, | 143 | struct Session *session, |
143 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 144 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
144 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 145 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
145 | const struct GNUNET_ATS_Information *atsi, | ||
146 | uint32_t ats_count) | ||
147 | { | 146 | { |
148 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 147 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
149 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 148 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
150 | return; | ||
151 | } | 149 | } |
152 | 150 | ||
153 | 151 | ||
diff --git a/src/ats/test_ats_api_scheduling_add_address_duplicate.c b/src/ats/test_ats_api_scheduling_add_address_duplicate.c index 6130c0f7e..fc3890f6c 100644 --- a/src/ats/test_ats_api_scheduling_add_address_duplicate.c +++ b/src/ats/test_ats_api_scheduling_add_address_duplicate.c | |||
@@ -146,20 +146,17 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
146 | ret = GNUNET_SYSERR; | 146 | ret = GNUNET_SYSERR; |
147 | } | 147 | } |
148 | 148 | ||
149 | |||
149 | static void | 150 | static void |
150 | address_suggest_cb (void *cls, | 151 | address_suggest_cb (void *cls, |
151 | const struct GNUNET_PeerIdentity *peer, | 152 | const struct GNUNET_PeerIdentity *peer, |
152 | const struct GNUNET_HELLO_Address *address, | 153 | const struct GNUNET_HELLO_Address *address, |
153 | struct Session *session, | 154 | struct Session *session, |
154 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 155 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
155 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 156 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
156 | const struct GNUNET_ATS_Information *atsi, | ||
157 | uint32_t ats_count) | ||
158 | |||
159 | { | 157 | { |
160 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 158 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
161 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 159 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
162 | return; | ||
163 | } | 160 | } |
164 | 161 | ||
165 | 162 | ||
diff --git a/src/ats/test_ats_api_scheduling_add_address_inbound.c b/src/ats/test_ats_api_scheduling_add_address_inbound.c index 2c3ab9c02..3d0e5b2ca 100644 --- a/src/ats/test_ats_api_scheduling_add_address_inbound.c +++ b/src/ats/test_ats_api_scheduling_add_address_inbound.c | |||
@@ -37,7 +37,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
37 | /** | 37 | /** |
38 | * Statistics handle | 38 | * Statistics handle |
39 | */ | 39 | */ |
40 | struct GNUNET_STATISTICS_Handle *stats; | 40 | static struct GNUNET_STATISTICS_Handle *stats; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Scheduling handle | 43 | * Scheduling handle |
@@ -62,33 +62,31 @@ static struct PeerContext p; | |||
62 | /** | 62 | /** |
63 | * HELLO address | 63 | * HELLO address |
64 | */ | 64 | */ |
65 | struct GNUNET_HELLO_Address test_hello_address; | 65 | static struct GNUNET_HELLO_Address test_hello_address; |
66 | |||
67 | /** | ||
68 | * Session | ||
69 | */ | ||
70 | //static void *test_session; | ||
71 | 66 | ||
72 | /** | 67 | /** |
73 | * Test ats info | 68 | * Test ats info |
74 | */ | 69 | */ |
75 | struct GNUNET_ATS_Information test_ats_info[2]; | 70 | static struct GNUNET_ATS_Information test_ats_info[2]; |
76 | 71 | ||
77 | /** | 72 | /** |
78 | * Test ats count | 73 | * Test ats count |
79 | */ | 74 | */ |
80 | uint32_t test_ats_count; | 75 | static uint32_t test_ats_count; |
81 | 76 | ||
82 | 77 | ||
83 | static void end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 78 | static void |
84 | static void end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 79 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
80 | |||
81 | static void | ||
82 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
83 | |||
85 | 84 | ||
86 | static int | 85 | static int |
87 | stat_cb(void *cls, const char *subsystem, | 86 | stat_cb(void *cls, const char *subsystem, |
88 | const char *name, uint64_t value, | 87 | const char *name, uint64_t value, |
89 | int is_persistent) | 88 | int is_persistent) |
90 | { | 89 | { |
91 | |||
92 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "ATS statistics: `%s' `%s' %llu\n", | 90 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "ATS statistics: `%s' `%s' %llu\n", |
93 | subsystem,name, value); | 91 | subsystem,name, value); |
94 | if (1 == value) | 92 | if (1 == value) |
@@ -141,19 +139,17 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
141 | ret = GNUNET_SYSERR; | 139 | ret = GNUNET_SYSERR; |
142 | } | 140 | } |
143 | 141 | ||
142 | |||
144 | static void | 143 | static void |
145 | address_suggest_cb (void *cls, | 144 | address_suggest_cb (void *cls, |
146 | const struct GNUNET_PeerIdentity *peer, | 145 | const struct GNUNET_PeerIdentity *peer, |
147 | const struct GNUNET_HELLO_Address *address, | 146 | const struct GNUNET_HELLO_Address *address, |
148 | struct Session *session, | 147 | struct Session *session, |
149 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 148 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
150 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 149 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
151 | const struct GNUNET_ATS_Information *atsi, | ||
152 | uint32_t ats_count) | ||
153 | { | 150 | { |
154 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 151 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
155 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 152 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
156 | return; | ||
157 | } | 153 | } |
158 | 154 | ||
159 | 155 | ||
diff --git a/src/ats/test_ats_api_scheduling_add_session.c b/src/ats/test_ats_api_scheduling_add_session.c index 243ecd22e..2aac84ee5 100644 --- a/src/ats/test_ats_api_scheduling_add_session.c +++ b/src/ats/test_ats_api_scheduling_add_session.c | |||
@@ -37,7 +37,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
37 | /** | 37 | /** |
38 | * Statistics handle | 38 | * Statistics handle |
39 | */ | 39 | */ |
40 | struct GNUNET_STATISTICS_Handle *stats; | 40 | static struct GNUNET_STATISTICS_Handle *stats; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Scheduling handle | 43 | * Scheduling handle |
@@ -62,7 +62,7 @@ static struct PeerContext p; | |||
62 | /** | 62 | /** |
63 | * HELLO address | 63 | * HELLO address |
64 | */ | 64 | */ |
65 | struct GNUNET_HELLO_Address test_hello_address; | 65 | static struct GNUNET_HELLO_Address test_hello_address; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * Session | 68 | * Session |
@@ -72,16 +72,21 @@ static void *test_session; | |||
72 | /** | 72 | /** |
73 | * Test ats info | 73 | * Test ats info |
74 | */ | 74 | */ |
75 | struct GNUNET_ATS_Information test_ats_info[2]; | 75 | static struct GNUNET_ATS_Information test_ats_info[2]; |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * Test ats count | 78 | * Test ats count |
79 | */ | 79 | */ |
80 | uint32_t test_ats_count; | 80 | static uint32_t test_ats_count; |
81 | 81 | ||
82 | 82 | ||
83 | static void end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 83 | static void |
84 | static void end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 84 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
85 | |||
86 | |||
87 | static void | ||
88 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
89 | |||
85 | 90 | ||
86 | static int | 91 | static int |
87 | stat_cb(void *cls, const char *subsystem, | 92 | stat_cb(void *cls, const char *subsystem, |
@@ -154,13 +159,10 @@ address_suggest_cb (void *cls, | |||
154 | const struct GNUNET_HELLO_Address *address, | 159 | const struct GNUNET_HELLO_Address *address, |
155 | struct Session *session, | 160 | struct Session *session, |
156 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 161 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
157 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 162 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
158 | const struct GNUNET_ATS_Information *atsi, | ||
159 | uint32_t ats_count) | ||
160 | { | 163 | { |
161 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 164 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
162 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 165 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
163 | return; | ||
164 | } | 166 | } |
165 | 167 | ||
166 | 168 | ||
diff --git a/src/ats/test_ats_api_scheduling_destroy_address.c b/src/ats/test_ats_api_scheduling_destroy_address.c index a286ab8a4..323128ac2 100644 --- a/src/ats/test_ats_api_scheduling_destroy_address.c +++ b/src/ats/test_ats_api_scheduling_destroy_address.c | |||
@@ -163,9 +163,7 @@ address_suggest_cb (void *cls, | |||
163 | const struct GNUNET_HELLO_Address *address, | 163 | const struct GNUNET_HELLO_Address *address, |
164 | struct Session *session, | 164 | struct Session *session, |
165 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 165 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
166 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 166 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
167 | const struct GNUNET_ATS_Information *atsi, | ||
168 | uint32_t ats_count) | ||
169 | { | 167 | { |
170 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 168 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
171 | "Did not expect suggestion callback!\n"); | 169 | "Did not expect suggestion callback!\n"); |
diff --git a/src/ats/test_ats_api_scheduling_destroy_address_twice.c b/src/ats/test_ats_api_scheduling_destroy_address_twice.c index 1991199ab..995538e7e 100644 --- a/src/ats/test_ats_api_scheduling_destroy_address_twice.c +++ b/src/ats/test_ats_api_scheduling_destroy_address_twice.c | |||
@@ -38,7 +38,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
38 | /** | 38 | /** |
39 | * Statistics handle | 39 | * Statistics handle |
40 | */ | 40 | */ |
41 | struct GNUNET_STATISTICS_Handle *stats; | 41 | static struct GNUNET_STATISTICS_Handle *stats; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * Scheduling handle | 44 | * Scheduling handle |
@@ -78,11 +78,12 @@ struct GNUNET_ATS_Information test_ats_info[2]; | |||
78 | /** | 78 | /** |
79 | * Test ats count | 79 | * Test ats count |
80 | */ | 80 | */ |
81 | uint32_t test_ats_count; | 81 | static uint32_t test_ats_count; |
82 | 82 | ||
83 | 83 | ||
84 | static void end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 84 | static void end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
85 | 85 | ||
86 | |||
86 | static int | 87 | static int |
87 | stat_cb(void *cls, const char *subsystem, | 88 | stat_cb(void *cls, const char *subsystem, |
88 | const char *name, uint64_t value, | 89 | const char *name, uint64_t value, |
@@ -140,6 +141,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
140 | ret = 0; | 141 | ret = 0; |
141 | } | 142 | } |
142 | 143 | ||
144 | |||
143 | static void | 145 | static void |
144 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 146 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
145 | { | 147 | { |
@@ -148,30 +150,34 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
148 | ret = GNUNET_SYSERR; | 150 | ret = GNUNET_SYSERR; |
149 | } | 151 | } |
150 | 152 | ||
153 | |||
151 | static void | 154 | static void |
152 | address_suggest_cb (void *cls, | 155 | address_suggest_cb (void *cls, |
153 | const struct GNUNET_PeerIdentity *peer, | 156 | const struct GNUNET_PeerIdentity *peer, |
154 | const struct GNUNET_HELLO_Address *address, | 157 | const struct GNUNET_HELLO_Address *address, |
155 | struct Session *session, | 158 | struct Session *session, |
156 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 159 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
157 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 160 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
158 | const struct GNUNET_ATS_Information *atsi, | ||
159 | uint32_t ats_count) | ||
160 | { | 161 | { |
161 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 162 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
162 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 163 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
163 | return; | ||
164 | } | 164 | } |
165 | 165 | ||
166 | |||
166 | static int | 167 | static int |
167 | dummy_stat (void *cls, const char *subsystem, const char *name, uint64_t value, | 168 | dummy_stat (void *cls, |
169 | const char *subsystem, | ||
170 | const char *name, | ||
171 | uint64_t value, | ||
168 | int is_persistent) | 172 | int is_persistent) |
169 | { | 173 | { |
170 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got dummy stat %s%s:%s = %llu\n", | 174 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
175 | "Got dummy stat %s%s:%s = %llu\n", | ||
171 | is_persistent ? "!" : " ", subsystem, name, value); | 176 | is_persistent ? "!" : " ", subsystem, name, value); |
172 | return GNUNET_OK; | 177 | return GNUNET_OK; |
173 | } | 178 | } |
174 | 179 | ||
180 | |||
175 | static void | 181 | static void |
176 | got_initial_value (void *cls, int success) | 182 | got_initial_value (void *cls, int success) |
177 | { | 183 | { |
diff --git a/src/ats/test_ats_api_scheduling_destroy_session.c b/src/ats/test_ats_api_scheduling_destroy_session.c index 0c6cf156d..2b46bdc88 100644 --- a/src/ats/test_ats_api_scheduling_destroy_session.c +++ b/src/ats/test_ats_api_scheduling_destroy_session.c | |||
@@ -41,7 +41,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
41 | /** | 41 | /** |
42 | * Statistics handle | 42 | * Statistics handle |
43 | */ | 43 | */ |
44 | struct GNUNET_STATISTICS_Handle *stats; | 44 | static struct GNUNET_STATISTICS_Handle *stats; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Scheduling handle | 47 | * Scheduling handle |
@@ -66,7 +66,7 @@ static struct PeerContext p; | |||
66 | /** | 66 | /** |
67 | * HELLO address | 67 | * HELLO address |
68 | */ | 68 | */ |
69 | struct GNUNET_HELLO_Address test_hello_address; | 69 | static struct GNUNET_HELLO_Address test_hello_address; |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * Session | 72 | * Session |
@@ -76,16 +76,21 @@ static void *test_session; | |||
76 | /** | 76 | /** |
77 | * Test ats info | 77 | * Test ats info |
78 | */ | 78 | */ |
79 | struct GNUNET_ATS_Information test_ats_info[2]; | 79 | static struct GNUNET_ATS_Information test_ats_info[2]; |
80 | 80 | ||
81 | /** | 81 | /** |
82 | * Test ats count | 82 | * Test ats count |
83 | */ | 83 | */ |
84 | uint32_t test_ats_count; | 84 | static uint32_t test_ats_count; |
85 | 85 | ||
86 | 86 | ||
87 | static void end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 87 | static void |
88 | static void end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 88 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
89 | |||
90 | |||
91 | static void | ||
92 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
93 | |||
89 | 94 | ||
90 | static int | 95 | static int |
91 | stat_cb(void *cls, const char *subsystem, | 96 | stat_cb(void *cls, const char *subsystem, |
@@ -158,13 +163,10 @@ address_suggest_cb (void *cls, | |||
158 | const struct GNUNET_HELLO_Address *address, | 163 | const struct GNUNET_HELLO_Address *address, |
159 | struct Session *session, | 164 | struct Session *session, |
160 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 165 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
161 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 166 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
162 | const struct GNUNET_ATS_Information *atsi, | ||
163 | uint32_t ats_count) | ||
164 | { | 167 | { |
165 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 168 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
166 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 169 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
167 | return; | ||
168 | } | 170 | } |
169 | 171 | ||
170 | static void | 172 | static void |
diff --git a/src/ats/test_ats_api_scheduling_init.c b/src/ats/test_ats_api_scheduling_init.c index d6e823a56..a896f9a31 100644 --- a/src/ats/test_ats_api_scheduling_init.c +++ b/src/ats/test_ats_api_scheduling_init.c | |||
@@ -115,21 +115,20 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
115 | ret = GNUNET_SYSERR; | 115 | ret = GNUNET_SYSERR; |
116 | } | 116 | } |
117 | 117 | ||
118 | |||
118 | static void | 119 | static void |
119 | address_suggest_cb (void *cls, | 120 | address_suggest_cb (void *cls, |
120 | const struct GNUNET_PeerIdentity *peer, | 121 | const struct GNUNET_PeerIdentity *peer, |
121 | const struct GNUNET_HELLO_Address *address, | 122 | const struct GNUNET_HELLO_Address *address, |
122 | struct Session *session, | 123 | struct Session *session, |
123 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 124 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
124 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 125 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
125 | const struct GNUNET_ATS_Information *atsi, | ||
126 | uint32_t ats_count) | ||
127 | { | 126 | { |
128 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 127 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
129 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 128 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
130 | return; | ||
131 | } | 129 | } |
132 | 130 | ||
131 | |||
133 | static void | 132 | static void |
134 | got_initial_value (void *cls, int success) | 133 | got_initial_value (void *cls, int success) |
135 | { | 134 | { |
diff --git a/src/ats/test_ats_solver_add_address.c b/src/ats/test_ats_solver_add_address.c index 37c37cc84..5113aea20 100644 --- a/src/ats/test_ats_solver_add_address.c +++ b/src/ats/test_ats_solver_add_address.c | |||
@@ -37,7 +37,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
37 | /** | 37 | /** |
38 | * Statistics handle | 38 | * Statistics handle |
39 | */ | 39 | */ |
40 | struct GNUNET_STATISTICS_Handle *stats; | 40 | static struct GNUNET_STATISTICS_Handle *stats; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Scheduling handle | 43 | * Scheduling handle |
@@ -62,7 +62,7 @@ static struct PeerContext p; | |||
62 | /** | 62 | /** |
63 | * HELLO address | 63 | * HELLO address |
64 | */ | 64 | */ |
65 | struct GNUNET_HELLO_Address test_hello_address; | 65 | static struct GNUNET_HELLO_Address test_hello_address; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * Session | 68 | * Session |
@@ -72,18 +72,19 @@ static void *test_session; | |||
72 | /** | 72 | /** |
73 | * Test ats info | 73 | * Test ats info |
74 | */ | 74 | */ |
75 | struct GNUNET_ATS_Information test_ats_info[2]; | 75 | static struct GNUNET_ATS_Information test_ats_info[2]; |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * Test ats count | 78 | * Test ats count |
79 | */ | 79 | */ |
80 | uint32_t test_ats_count; | 80 | static uint32_t test_ats_count; |
81 | 81 | ||
82 | 82 | ||
83 | static int | 83 | static int |
84 | stat_cb(void *cls, const char *subsystem, const char *name, uint64_t value, | 84 | stat_cb(void *cls, const char *subsystem, const char *name, uint64_t value, |
85 | int is_persistent); | 85 | int is_persistent); |
86 | 86 | ||
87 | |||
87 | static void | 88 | static void |
88 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 89 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
89 | { | 90 | { |
@@ -122,19 +123,17 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
122 | ret = GNUNET_SYSERR; | 123 | ret = GNUNET_SYSERR; |
123 | } | 124 | } |
124 | 125 | ||
126 | |||
125 | static void | 127 | static void |
126 | address_suggest_cb (void *cls, | 128 | address_suggest_cb (void *cls, |
127 | const struct GNUNET_PeerIdentity *peer, | 129 | const struct GNUNET_PeerIdentity *peer, |
128 | const struct GNUNET_HELLO_Address *address, | 130 | const struct GNUNET_HELLO_Address *address, |
129 | struct Session *session, | 131 | struct Session *session, |
130 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 132 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
131 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 133 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
132 | const struct GNUNET_ATS_Information *atsi, | ||
133 | uint32_t ats_count) | ||
134 | { | 134 | { |
135 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); | 135 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not expect suggestion callback!\n"); |
136 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 136 | GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
137 | return; | ||
138 | } | 137 | } |
139 | 138 | ||
140 | 139 | ||
diff --git a/src/ats/test_ats_solver_add_address_and_request.c b/src/ats/test_ats_solver_add_address_and_request.c index 0fb678166..df7cdae70 100644 --- a/src/ats/test_ats_solver_add_address_and_request.c +++ b/src/ats/test_ats_solver_add_address_and_request.c | |||
@@ -43,7 +43,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
43 | /** | 43 | /** |
44 | * Statistics handle | 44 | * Statistics handle |
45 | */ | 45 | */ |
46 | struct GNUNET_STATISTICS_Handle *stats; | 46 | static struct GNUNET_STATISTICS_Handle *stats; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * Scheduling handle | 49 | * Scheduling handle |
@@ -68,7 +68,7 @@ static struct PeerContext p; | |||
68 | /** | 68 | /** |
69 | * HELLO address | 69 | * HELLO address |
70 | */ | 70 | */ |
71 | struct GNUNET_HELLO_Address test_hello_address; | 71 | static struct GNUNET_HELLO_Address test_hello_address; |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * Session | 74 | * Session |
@@ -78,12 +78,12 @@ static void *test_session; | |||
78 | /** | 78 | /** |
79 | * Test ats info | 79 | * Test ats info |
80 | */ | 80 | */ |
81 | struct GNUNET_ATS_Information test_ats_info[2]; | 81 | static struct GNUNET_ATS_Information test_ats_info[2]; |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Test ats count | 84 | * Test ats count |
85 | */ | 85 | */ |
86 | uint32_t test_ats_count; | 86 | static uint32_t test_ats_count; |
87 | 87 | ||
88 | 88 | ||
89 | static int | 89 | static int |
@@ -133,21 +133,17 @@ address_suggest_cb (void *cls, | |||
133 | const struct GNUNET_HELLO_Address *address, | 133 | const struct GNUNET_HELLO_Address *address, |
134 | struct Session *session, | 134 | struct Session *session, |
135 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 135 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
136 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 136 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
137 | const struct GNUNET_ATS_Information *atsi, | ||
138 | uint32_t ats_count) | ||
139 | { | 137 | { |
140 | |||
141 | GNUNET_assert (NULL != address); | 138 | GNUNET_assert (NULL != address); |
142 | GNUNET_assert (NULL == session); | 139 | GNUNET_assert (NULL == session); |
143 | GNUNET_assert (ntohl(bandwidth_in.value__) > 0); | 140 | GNUNET_assert (ntohl(bandwidth_in.value__) > 0); |
144 | GNUNET_assert (ntohl(bandwidth_out.value__) > 0); | 141 | GNUNET_assert (ntohl(bandwidth_out.value__) > 0); |
145 | 142 | ||
146 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received sugggestion for peer `%s'\n", | 143 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
147 | GNUNET_i2s (&address->peer)); | 144 | "Received sugggestion for peer `%s'\n", |
148 | 145 | GNUNET_i2s (&address->peer)); | |
149 | GNUNET_SCHEDULER_add_now (&end, NULL); | 146 | GNUNET_SCHEDULER_add_now (&end, NULL); |
150 | return; | ||
151 | } | 147 | } |
152 | 148 | ||
153 | 149 | ||
diff --git a/src/ats/test_ats_solver_alternative_after_delete_address.c b/src/ats/test_ats_solver_alternative_after_delete_address.c index fd6a5188a..85216419a 100644 --- a/src/ats/test_ats_solver_alternative_after_delete_address.c +++ b/src/ats/test_ats_solver_alternative_after_delete_address.c | |||
@@ -37,7 +37,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
37 | /** | 37 | /** |
38 | * Statistics handle | 38 | * Statistics handle |
39 | */ | 39 | */ |
40 | struct GNUNET_STATISTICS_Handle *stats; | 40 | static struct GNUNET_STATISTICS_Handle *stats; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Scheduling handle | 43 | * Scheduling handle |
@@ -92,15 +92,15 @@ static uint32_t test_ats_count; | |||
92 | /** | 92 | /** |
93 | * Test state | 93 | * Test state |
94 | */ | 94 | */ |
95 | int addresses_added = GNUNET_NO; | 95 | static int addresses_added = GNUNET_NO; |
96 | 96 | ||
97 | int first_address_suggested = GNUNET_NO; | 97 | static int first_address_suggested = GNUNET_NO; |
98 | 98 | ||
99 | int first_address_deleted = GNUNET_NO; | 99 | static int first_address_deleted = GNUNET_NO; |
100 | 100 | ||
101 | int second_address_deleted = GNUNET_NO; | 101 | static int second_address_deleted = GNUNET_NO; |
102 | 102 | ||
103 | int second_address_suggested = GNUNET_YES; | 103 | static int second_address_suggested = GNUNET_YES; |
104 | 104 | ||
105 | static struct GNUNET_HELLO_Address *first_suggestion = NULL; | 105 | static struct GNUNET_HELLO_Address *first_suggestion = NULL; |
106 | 106 | ||
@@ -166,9 +166,7 @@ address_suggest_cb (void *cls, | |||
166 | const struct GNUNET_HELLO_Address *address, | 166 | const struct GNUNET_HELLO_Address *address, |
167 | struct Session *session, | 167 | struct Session *session, |
168 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 168 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
169 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 169 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
170 | const struct GNUNET_ATS_Information *atsi, | ||
171 | uint32_t ats_count) | ||
172 | { | 170 | { |
173 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received a sugggestion for peer `%s' : `%s'\n", | 171 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received a sugggestion for peer `%s' : `%s'\n", |
174 | GNUNET_i2s (&address->peer), (char *) address->address); | 172 | GNUNET_i2s (&address->peer), (char *) address->address); |
diff --git a/src/ats/test_ats_solver_preferences.c b/src/ats/test_ats_solver_preferences.c index 048e19b6b..611f639bf 100644 --- a/src/ats/test_ats_solver_preferences.c +++ b/src/ats/test_ats_solver_preferences.c | |||
@@ -43,7 +43,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
43 | /** | 43 | /** |
44 | * Statistics handle | 44 | * Statistics handle |
45 | */ | 45 | */ |
46 | struct GNUNET_STATISTICS_Handle *stats; | 46 | static struct GNUNET_STATISTICS_Handle *stats; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * Scheduling handle | 49 | * Scheduling handle |
@@ -83,12 +83,13 @@ static void *test_session; | |||
83 | /** | 83 | /** |
84 | * Test ats info | 84 | * Test ats info |
85 | */ | 85 | */ |
86 | struct GNUNET_ATS_Information test_ats_info[3]; | 86 | static struct GNUNET_ATS_Information test_ats_info[3]; |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * Test ats count | 89 | * Test ats count |
90 | */ | 90 | */ |
91 | uint32_t test_ats_count; | 91 | static uint32_t test_ats_count; |
92 | |||
92 | 93 | ||
93 | static int | 94 | static int |
94 | stat_cb (void *cls, const char *subsystem, const char *name, uint64_t value, | 95 | stat_cb (void *cls, const char *subsystem, const char *name, uint64_t value, |
@@ -129,6 +130,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
129 | ret = 0; | 130 | ret = 0; |
130 | } | 131 | } |
131 | 132 | ||
133 | |||
132 | static void | 134 | static void |
133 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 135 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
134 | { | 136 | { |
@@ -142,8 +144,8 @@ static void | |||
142 | perf_info_cb (void *cls, | 144 | perf_info_cb (void *cls, |
143 | const struct GNUNET_HELLO_Address *address, int address_active, | 145 | const struct GNUNET_HELLO_Address *address, int address_active, |
144 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 146 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
145 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 147 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
146 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) | 148 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) |
147 | { | 149 | { |
148 | if (NULL == address) | 150 | if (NULL == address) |
149 | return; | 151 | return; |
@@ -152,15 +154,14 @@ perf_info_cb (void *cls, | |||
152 | GNUNET_i2s (&address->peer)); | 154 | GNUNET_i2s (&address->peer)); |
153 | } | 155 | } |
154 | 156 | ||
157 | |||
155 | static void | 158 | static void |
156 | address_suggest_cb (void *cls, | 159 | address_suggest_cb (void *cls, |
157 | const struct GNUNET_PeerIdentity *peer, | 160 | const struct GNUNET_PeerIdentity *peer, |
158 | const struct GNUNET_HELLO_Address *address, | 161 | const struct GNUNET_HELLO_Address *address, |
159 | struct Session *session, | 162 | struct Session *session, |
160 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 163 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
161 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 164 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
162 | const struct GNUNET_ATS_Information *atsi, | ||
163 | uint32_t ats_count) | ||
164 | { | 165 | { |
165 | int c; | 166 | int c; |
166 | double pref_val; | 167 | double pref_val; |
@@ -175,6 +176,7 @@ address_suggest_cb (void *cls, | |||
175 | } | 176 | } |
176 | } | 177 | } |
177 | 178 | ||
179 | |||
178 | static int | 180 | static int |
179 | stat_cb (void *cls, const char *subsystem, const char *name, uint64_t value, | 181 | stat_cb (void *cls, const char *subsystem, const char *name, uint64_t value, |
180 | int is_persistent) | 182 | int is_persistent) |
diff --git a/src/ats/test_ats_solver_request_and_add_address.c b/src/ats/test_ats_solver_request_and_add_address.c index a70d3e4a5..664861b82 100644 --- a/src/ats/test_ats_solver_request_and_add_address.c +++ b/src/ats/test_ats_solver_request_and_add_address.c | |||
@@ -43,7 +43,7 @@ static struct GNUNET_SCHEDULER_Task * die_task; | |||
43 | /** | 43 | /** |
44 | * Statistics handle | 44 | * Statistics handle |
45 | */ | 45 | */ |
46 | struct GNUNET_STATISTICS_Handle *stats; | 46 | static struct GNUNET_STATISTICS_Handle *stats; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * Scheduling handle | 49 | * Scheduling handle |
@@ -68,7 +68,7 @@ static struct PeerContext p; | |||
68 | /** | 68 | /** |
69 | * HELLO address | 69 | * HELLO address |
70 | */ | 70 | */ |
71 | struct GNUNET_HELLO_Address test_hello_address; | 71 | static struct GNUNET_HELLO_Address test_hello_address; |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * Session | 74 | * Session |
@@ -78,12 +78,12 @@ static void *test_session; | |||
78 | /** | 78 | /** |
79 | * Test ats info | 79 | * Test ats info |
80 | */ | 80 | */ |
81 | struct GNUNET_ATS_Information test_ats_info[2]; | 81 | static struct GNUNET_ATS_Information test_ats_info[2]; |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Test ats count | 84 | * Test ats count |
85 | */ | 85 | */ |
86 | uint32_t test_ats_count; | 86 | static uint32_t test_ats_count; |
87 | 87 | ||
88 | 88 | ||
89 | static int | 89 | static int |
@@ -133,9 +133,7 @@ address_suggest_cb (void *cls, | |||
133 | const struct GNUNET_HELLO_Address *address, | 133 | const struct GNUNET_HELLO_Address *address, |
134 | struct Session *session, | 134 | struct Session *session, |
135 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 135 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
136 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 136 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
137 | const struct GNUNET_ATS_Information *atsi, | ||
138 | uint32_t ats_count) | ||
139 | { | 137 | { |
140 | 138 | ||
141 | GNUNET_assert (NULL != address); | 139 | GNUNET_assert (NULL != address); |
@@ -145,7 +143,6 @@ address_suggest_cb (void *cls, | |||
145 | GNUNET_i2s (&address->peer)); | 143 | GNUNET_i2s (&address->peer)); |
146 | 144 | ||
147 | GNUNET_SCHEDULER_add_now (&end, NULL); | 145 | GNUNET_SCHEDULER_add_now (&end, NULL); |
148 | return; | ||
149 | } | 146 | } |
150 | 147 | ||
151 | 148 | ||
diff --git a/src/ats/test_ats_solver_request_and_delete_address.c b/src/ats/test_ats_solver_request_and_delete_address.c index 38e7ffc8b..e1dad6dcf 100644 --- a/src/ats/test_ats_solver_request_and_delete_address.c +++ b/src/ats/test_ats_solver_request_and_delete_address.c | |||
@@ -138,9 +138,7 @@ address_suggest_cb (void *cls, | |||
138 | const struct GNUNET_HELLO_Address *address, | 138 | const struct GNUNET_HELLO_Address *address, |
139 | struct Session *session, | 139 | struct Session *session, |
140 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 140 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
141 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 141 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
142 | const struct GNUNET_ATS_Information *atsi, | ||
143 | uint32_t ats_count) | ||
144 | { | 142 | { |
145 | if (GNUNET_NO == address_deleted) | 143 | if (GNUNET_NO == address_deleted) |
146 | { | 144 | { |
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index ea70614cf..b0ffc1271 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -325,18 +325,13 @@ struct Session; | |||
325 | * Signature of a function called by ATS with the current bandwidth | 325 | * Signature of a function called by ATS with the current bandwidth |
326 | * and address preferences as determined by ATS. | 326 | * and address preferences as determined by ATS. |
327 | * | 327 | * |
328 | * If an address is available immediately the address will be included. If no | ||
329 | * address can be suggested, address, session, bandwidth and ATS information will | ||
330 | * be NULL/0. ATS will suggest an address as soon as it can provide such an | ||
331 | * address | ||
332 | * | ||
333 | * @param cls closure | 328 | * @param cls closure |
334 | * @param address suggested address (including peer identity of the peer) | 329 | * @param address suggested address (including peer identity of the peer) |
335 | * @param session session to use | 330 | * @param session session to use, NULL to establish a new outgoing session |
336 | * @param bandwidth_out assigned outbound bandwidth for the connection | 331 | * @param bandwidth_out assigned outbound bandwidth for the connection, |
337 | * @param bandwidth_in assigned inbound bandwidth for the connection | 332 | * 0 to disconnect |
338 | * @param ats performance data for the address (as far as known) | 333 | * @param bandwidth_in assigned inbound bandwidth for the connection, |
339 | * @param ats_count number of performance records in @a ats | 334 | * 0 to disconnect |
340 | */ | 335 | */ |
341 | typedef void | 336 | typedef void |
342 | (*GNUNET_ATS_AddressSuggestionCallback) (void *cls, | 337 | (*GNUNET_ATS_AddressSuggestionCallback) (void *cls, |
@@ -344,8 +339,7 @@ typedef void | |||
344 | const struct GNUNET_HELLO_Address *address, | 339 | const struct GNUNET_HELLO_Address *address, |
345 | struct Session *session, | 340 | struct Session *session, |
346 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 341 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
347 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 342 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); |
348 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count); | ||
349 | 343 | ||
350 | 344 | ||
351 | /** | 345 | /** |
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 4e96b0091..330382604 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -908,9 +908,7 @@ ats_request_address_change (void *cls, | |||
908 | const struct GNUNET_HELLO_Address *address, | 908 | const struct GNUNET_HELLO_Address *address, |
909 | struct Session *session, | 909 | struct Session *session, |
910 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 910 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
911 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 911 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
912 | const struct GNUNET_ATS_Information *ats, | ||
913 | uint32_t ats_count) | ||
914 | { | 912 | { |
915 | uint32_t bw_in = ntohl (bandwidth_in.value__); | 913 | uint32_t bw_in = ntohl (bandwidth_in.value__); |
916 | uint32_t bw_out = ntohl (bandwidth_out.value__); | 914 | uint32_t bw_out = ntohl (bandwidth_out.value__); |