diff options
Diffstat (limited to 'src/ats/gnunet-ats-solver-eval.h')
-rw-r--r-- | src/ats/gnunet-ats-solver-eval.h | 78 |
1 files changed, 30 insertions, 48 deletions
diff --git a/src/ats/gnunet-ats-solver-eval.h b/src/ats/gnunet-ats-solver-eval.h index d5a68c5b0..e3afa02b1 100644 --- a/src/ats/gnunet-ats-solver-eval.h +++ b/src/ats/gnunet-ats-solver-eval.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010-2013 GNUnet e.V. | 3 | Copyright (C) 2010-2013 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -34,8 +34,7 @@ | |||
34 | #include "gnunet-service-ats_normalization.h" | 34 | #include "gnunet-service-ats_normalization.h" |
35 | #include "test_ats_api_common.h" | 35 | #include "test_ats_api_common.h" |
36 | 36 | ||
37 | enum GeneratorType | 37 | enum GeneratorType { |
38 | { | ||
39 | GNUNET_ATS_TEST_TG_LINEAR, | 38 | GNUNET_ATS_TEST_TG_LINEAR, |
40 | GNUNET_ATS_TEST_TG_CONSTANT, | 39 | GNUNET_ATS_TEST_TG_CONSTANT, |
41 | GNUNET_ATS_TEST_TG_RANDOM, | 40 | GNUNET_ATS_TEST_TG_RANDOM, |
@@ -43,8 +42,7 @@ enum GeneratorType | |||
43 | }; | 42 | }; |
44 | 43 | ||
45 | 44 | ||
46 | enum OperationType | 45 | enum OperationType { |
47 | { | ||
48 | SOLVER_OP_ADD_ADDRESS, | 46 | SOLVER_OP_ADD_ADDRESS, |
49 | SOLVER_OP_DEL_ADDRESS, | 47 | SOLVER_OP_DEL_ADDRESS, |
50 | SOLVER_OP_START_SET_PROPERTY, | 48 | SOLVER_OP_START_SET_PROPERTY, |
@@ -55,8 +53,7 @@ enum OperationType | |||
55 | SOLVER_OP_STOP_REQUEST, | 53 | SOLVER_OP_STOP_REQUEST, |
56 | }; | 54 | }; |
57 | 55 | ||
58 | struct SolverHandle | 56 | struct SolverHandle { |
59 | { | ||
60 | /** | 57 | /** |
61 | * Solver plugin name | 58 | * Solver plugin name |
62 | */ | 59 | */ |
@@ -78,15 +75,13 @@ struct SolverHandle | |||
78 | struct GNUNET_CONTAINER_MultiPeerMap *addresses; | 75 | struct GNUNET_CONTAINER_MultiPeerMap *addresses; |
79 | }; | 76 | }; |
80 | 77 | ||
81 | enum GNUNET_ATS_Solvers | 78 | enum GNUNET_ATS_Solvers { |
82 | { | ||
83 | GNUNET_ATS_SOLVER_PROPORTIONAL, | 79 | GNUNET_ATS_SOLVER_PROPORTIONAL, |
84 | GNUNET_ATS_SOLVER_MLP, | 80 | GNUNET_ATS_SOLVER_MLP, |
85 | GNUNET_ATS_SOLVER_RIL, | 81 | GNUNET_ATS_SOLVER_RIL, |
86 | }; | 82 | }; |
87 | 83 | ||
88 | struct LoggingFileHandle | 84 | struct LoggingFileHandle { |
89 | { | ||
90 | /* DLL list for logging time steps */ | 85 | /* DLL list for logging time steps */ |
91 | struct LoggingFileHandle *next; | 86 | struct LoggingFileHandle *next; |
92 | struct LoggingFileHandle *prev; | 87 | struct LoggingFileHandle *prev; |
@@ -98,11 +93,9 @@ struct LoggingFileHandle | |||
98 | long long unsigned int aid; | 93 | long long unsigned int aid; |
99 | 94 | ||
100 | struct GNUNET_DISK_FileHandle *f_hd; | 95 | struct GNUNET_DISK_FileHandle *f_hd; |
101 | |||
102 | }; | 96 | }; |
103 | 97 | ||
104 | struct LoggingTimeStep | 98 | struct LoggingTimeStep { |
105 | { | ||
106 | struct LoggingTimeStep *prev; | 99 | struct LoggingTimeStep *prev; |
107 | struct LoggingTimeStep *next; | 100 | struct LoggingTimeStep *next; |
108 | 101 | ||
@@ -113,8 +106,7 @@ struct LoggingTimeStep | |||
113 | struct GNUNET_TIME_Relative delta; | 106 | struct GNUNET_TIME_Relative delta; |
114 | }; | 107 | }; |
115 | 108 | ||
116 | struct LoggingPeer | 109 | struct LoggingPeer { |
117 | { | ||
118 | struct LoggingPeer *prev; | 110 | struct LoggingPeer *prev; |
119 | struct LoggingPeer *next; | 111 | struct LoggingPeer *next; |
120 | 112 | ||
@@ -128,8 +120,7 @@ struct LoggingPeer | |||
128 | struct LoggingAddress *addr_tail; | 120 | struct LoggingAddress *addr_tail; |
129 | }; | 121 | }; |
130 | 122 | ||
131 | struct LoggingAddress | 123 | struct LoggingAddress { |
132 | { | ||
133 | struct LoggingAddress *next; | 124 | struct LoggingAddress *next; |
134 | struct LoggingAddress *prev; | 125 | struct LoggingAddress *prev; |
135 | 126 | ||
@@ -144,8 +135,7 @@ struct LoggingAddress | |||
144 | }; | 135 | }; |
145 | 136 | ||
146 | 137 | ||
147 | struct TestPeer | 138 | struct TestPeer { |
148 | { | ||
149 | struct TestPeer *prev; | 139 | struct TestPeer *prev; |
150 | struct TestPeer *next; | 140 | struct TestPeer *next; |
151 | 141 | ||
@@ -165,8 +155,7 @@ struct TestPeer | |||
165 | }; | 155 | }; |
166 | 156 | ||
167 | 157 | ||
168 | struct TestAddress | 158 | struct TestAddress { |
169 | { | ||
170 | struct TestAddress *next; | 159 | struct TestAddress *next; |
171 | struct TestAddress *prev; | 160 | struct TestAddress *prev; |
172 | 161 | ||
@@ -183,16 +172,15 @@ struct Episode; | |||
183 | struct Experiment; | 172 | struct Experiment; |
184 | 173 | ||
185 | typedef void (*GNUNET_ATS_TESTING_EpisodeDoneCallback) ( | 174 | typedef void (*GNUNET_ATS_TESTING_EpisodeDoneCallback) ( |
186 | struct Episode *e); | 175 | struct Episode *e); |
187 | 176 | ||
188 | typedef void (*GNUNET_ATS_TESTING_ExperimentDoneCallback) (struct Experiment *e, | 177 | typedef void (*GNUNET_ATS_TESTING_ExperimentDoneCallback) (struct Experiment *e, |
189 | struct GNUNET_TIME_Relative duration,int success); | 178 | struct GNUNET_TIME_Relative duration, int success); |
190 | 179 | ||
191 | /** | 180 | /** |
192 | * An operation in an experiment | 181 | * An operation in an experiment |
193 | */ | 182 | */ |
194 | struct GNUNET_ATS_TEST_Operation | 183 | struct GNUNET_ATS_TEST_Operation { |
195 | { | ||
196 | struct GNUNET_ATS_TEST_Operation *next; | 184 | struct GNUNET_ATS_TEST_Operation *next; |
197 | struct GNUNET_ATS_TEST_Operation *prev; | 185 | struct GNUNET_ATS_TEST_Operation *prev; |
198 | 186 | ||
@@ -218,8 +206,7 @@ struct GNUNET_ATS_TEST_Operation | |||
218 | // enum GNUNET_ATS_Property prop_type; | 206 | // enum GNUNET_ATS_Property prop_type; |
219 | }; | 207 | }; |
220 | 208 | ||
221 | struct Episode | 209 | struct Episode { |
222 | { | ||
223 | int id; | 210 | int id; |
224 | struct Episode *next; | 211 | struct Episode *next; |
225 | struct GNUNET_TIME_Relative duration; | 212 | struct GNUNET_TIME_Relative duration; |
@@ -228,8 +215,7 @@ struct Episode | |||
228 | struct GNUNET_ATS_TEST_Operation *tail; | 215 | struct GNUNET_ATS_TEST_Operation *tail; |
229 | }; | 216 | }; |
230 | 217 | ||
231 | struct LoggingHandle | 218 | struct LoggingHandle { |
232 | { | ||
233 | struct GNUNET_SCHEDULER_Task * logging_task; | 219 | struct GNUNET_SCHEDULER_Task * logging_task; |
234 | struct GNUNET_TIME_Relative log_freq; | 220 | struct GNUNET_TIME_Relative log_freq; |
235 | 221 | ||
@@ -238,8 +224,7 @@ struct LoggingHandle | |||
238 | struct LoggingTimeStep *tail; | 224 | struct LoggingTimeStep *tail; |
239 | }; | 225 | }; |
240 | 226 | ||
241 | struct Experiment | 227 | struct Experiment { |
242 | { | ||
243 | char *name; | 228 | char *name; |
244 | char *log_prefix; | 229 | char *log_prefix; |
245 | char *cfg_file; | 230 | char *cfg_file; |
@@ -263,8 +248,7 @@ struct Experiment | |||
263 | GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb; | 248 | GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb; |
264 | }; | 249 | }; |
265 | 250 | ||
266 | struct PreferenceGenerator | 251 | struct PreferenceGenerator { |
267 | { | ||
268 | struct PreferenceGenerator *prev; | 252 | struct PreferenceGenerator *prev; |
269 | struct PreferenceGenerator *next; | 253 | struct PreferenceGenerator *next; |
270 | 254 | ||
@@ -302,12 +286,10 @@ struct PreferenceGenerator | |||
302 | uint32_t last_assigned_bw_in; | 286 | uint32_t last_assigned_bw_in; |
303 | uint32_t last_assigned_bw_out; | 287 | uint32_t last_assigned_bw_out; |
304 | double last_delay_value; | 288 | double last_delay_value; |
305 | |||
306 | }; | 289 | }; |
307 | 290 | ||
308 | 291 | ||
309 | struct PropertyGenerator | 292 | struct PropertyGenerator { |
310 | { | ||
311 | struct PropertyGenerator *prev; | 293 | struct PropertyGenerator *prev; |
312 | struct PropertyGenerator *next; | 294 | struct PropertyGenerator *next; |
313 | 295 | ||