aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
committerChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
commit7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch)
treebdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/ats
parent01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff)
downloadgnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz
gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip
tighten formatting rules
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/ats.h2
-rw-r--r--src/ats/ats_api_performance.c1
-rw-r--r--src/ats/gnunet-ats-solver-eval.c40
-rw-r--r--src/ats/gnunet-service-ats.c1
-rw-r--r--src/ats/gnunet-service-ats_addresses.c1
-rw-r--r--src/ats/gnunet-service-ats_performance.c1
-rw-r--r--src/ats/gnunet-service-ats_reservations.c1
-rw-r--r--src/ats/perf_ats_solver.c4
-rw-r--r--src/ats/plugin_ats_proportional.c3
-rw-r--r--src/ats/test_ats_api.c50
-rw-r--r--src/ats/test_ats_lib.c2
-rw-r--r--src/ats/test_ats_reservation_api.c22
12 files changed, 112 insertions, 16 deletions
diff --git a/src/ats/ats.h b/src/ats/ats.h
index 3a3d12cfa..711c1c103 100644
--- a/src/ats/ats.h
+++ b/src/ats/ats.h
@@ -235,7 +235,6 @@ struct GNUNET_ATS_SessionReleaseMessage
235}; 235};
236 236
237 237
238
239/** 238/**
240 * ATS Service suggests to the transport service to use the address 239 * ATS Service suggests to the transport service to use the address
241 * identified by the given @e session_id for the given @e peer with 240 * identified by the given @e session_id for the given @e peer with
@@ -490,5 +489,4 @@ struct FeedbackPreferenceMessage
490GNUNET_NETWORK_STRUCT_END 489GNUNET_NETWORK_STRUCT_END
491 490
492 491
493
494#endif 492#endif
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index 8defd6022..acc9356ed 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -992,4 +992,5 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
992 env); 992 env);
993} 993}
994 994
995
995/* end of ats_api_performance.c */ 996/* end of ats_api_performance.c */
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index 9866ca929..6a014357e 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -123,6 +123,7 @@ find_peer_by_id (int id)
123 return NULL; 123 return NULL;
124} 124}
125 125
126
126static struct TestPeer * 127static struct TestPeer *
127find_peer_by_pid (const struct GNUNET_PeerIdentity *pid) 128find_peer_by_pid (const struct GNUNET_PeerIdentity *pid)
128{ 129{
@@ -134,6 +135,7 @@ find_peer_by_pid (const struct GNUNET_PeerIdentity *pid)
134 return NULL; 135 return NULL;
135} 136}
136 137
138
137static struct TestAddress * 139static struct TestAddress *
138find_address_by_id (struct TestPeer *peer, int aid) 140find_address_by_id (struct TestPeer *peer, int aid)
139{ 141{
@@ -238,6 +240,7 @@ logging_task (void *cls)
238 l); 240 l);
239} 241}
240 242
243
241struct LoggingHandle * 244struct LoggingHandle *
242GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq) 245GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq)
243{ 246{
@@ -252,6 +255,7 @@ GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq)
252 return l; 255 return l;
253} 256}
254 257
258
255void 259void
256GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l) 260GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l)
257{ 261{
@@ -263,6 +267,7 @@ GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l)
263 l->logging_task = NULL; 267 l->logging_task = NULL;
264} 268}
265 269
270
266static struct LoggingFileHandle * 271static struct LoggingFileHandle *
267find_logging_file_handle (struct LoggingFileHandle *lf_head, 272find_logging_file_handle (struct LoggingFileHandle *lf_head,
268 struct LoggingFileHandle *lf_tail, 273 struct LoggingFileHandle *lf_tail,
@@ -276,6 +281,7 @@ find_logging_file_handle (struct LoggingFileHandle *lf_head,
276 return NULL; 281 return NULL;
277} 282}
278 283
284
279void 285void
280GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int 286GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int
281 add_time_stamp, 287 add_time_stamp,
@@ -391,8 +397,7 @@ GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int
391 fprintf(stderr,"\t %s = %.2f %.2f [abs/rel]\n", 397 fprintf(stderr,"\t %s = %.2f %.2f [abs/rel]\n",
392 GNUNET_ATS_print_preference_type(c), 398 GNUNET_ATS_print_preference_type(c),
393 log_p->pref_abs[c], log_p->pref_norm[c]); 399 log_p->pref_abs[c], log_p->pref_norm[c]);
394 */ 400 */GNUNET_asprintf (&prefstring_tmp, "%s;%.3f;%.3f",
395 GNUNET_asprintf (&prefstring_tmp, "%s;%.3f;%.3f",
396 prefstring, log_p->pref_abs[c], log_p->pref_norm[c]); 401 prefstring, log_p->pref_abs[c], log_p->pref_norm[c]);
397 402
398 403
@@ -449,6 +454,7 @@ cleanup:
449 } 454 }
450} 455}
451 456
457
452void 458void
453GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l) 459GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l)
454{ 460{
@@ -493,6 +499,7 @@ GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l)
493 } 499 }
494} 500}
495 501
502
496void 503void
497GNUNET_ATS_solver_logging_free (struct LoggingHandle *l) 504GNUNET_ATS_solver_logging_free (struct LoggingHandle *l)
498{ 505{
@@ -538,6 +545,7 @@ GNUNET_ATS_solver_logging_free (struct LoggingHandle *l)
538 GNUNET_free (l); 545 GNUNET_free (l);
539} 546}
540 547
548
541/** 549/**
542 * Property Generators 550 * Property Generators
543 */ 551 */
@@ -701,6 +709,7 @@ find_prop_gen (unsigned int peer, unsigned int address,
701 return NULL; 709 return NULL;
702} 710}
703 711
712
704void 713void
705GNUNET_ATS_solver_generate_property_stop (struct PropertyGenerator *pg) 714GNUNET_ATS_solver_generate_property_stop (struct PropertyGenerator *pg)
706{ 715{
@@ -1056,6 +1065,7 @@ find_pref_gen (unsigned int peer, enum GNUNET_ATS_PreferenceKind kind)
1056 return NULL; 1065 return NULL;
1057} 1066}
1058 1067
1068
1059void 1069void
1060GNUNET_ATS_solver_generate_preferences_stop (struct PreferenceGenerator *pg) 1070GNUNET_ATS_solver_generate_preferences_stop (struct PreferenceGenerator *pg)
1061{ 1071{
@@ -1210,7 +1220,6 @@ GNUNET_ATS_solver_generate_preferences_start (unsigned int peer,
1210} 1220}
1211 1221
1212 1222
1213
1214/** 1223/**
1215 * Stop all preferences generators 1224 * Stop all preferences generators
1216 */ 1225 */
@@ -1229,7 +1238,6 @@ GNUNET_ATS_solver_generate_preferences_stop_all ()
1229} 1238}
1230 1239
1231 1240
1232
1233/** 1241/**
1234 * Experiments 1242 * Experiments
1235 */ 1243 */
@@ -1983,6 +1991,7 @@ load_op_start_set_property (struct GNUNET_ATS_TEST_Operation *o,
1983 return GNUNET_OK; 1991 return GNUNET_OK;
1984} 1992}
1985 1993
1994
1986static int 1995static int
1987load_op_stop_set_property (struct GNUNET_ATS_TEST_Operation *o, 1996load_op_stop_set_property (struct GNUNET_ATS_TEST_Operation *o,
1988 struct Episode *e, 1997 struct Episode *e,
@@ -2078,6 +2087,7 @@ load_op_start_request (struct GNUNET_ATS_TEST_Operation *o,
2078 return GNUNET_OK; 2087 return GNUNET_OK;
2079} 2088}
2080 2089
2090
2081static int 2091static int
2082load_op_stop_request (struct GNUNET_ATS_TEST_Operation *o, 2092load_op_stop_request (struct GNUNET_ATS_TEST_Operation *o,
2083 struct Episode *e, 2093 struct Episode *e,
@@ -2205,6 +2215,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
2205 return GNUNET_OK; 2215 return GNUNET_OK;
2206} 2216}
2207 2217
2218
2208static int 2219static int
2209load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg) 2220load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
2210{ 2221{
@@ -2280,6 +2291,7 @@ timeout_experiment (void *cls)
2280 GNUNET_SYSERR); 2291 GNUNET_SYSERR);
2281} 2292}
2282 2293
2294
2283struct ATS_Address * 2295struct ATS_Address *
2284create_ats_address (const struct GNUNET_PeerIdentity *peer, 2296create_ats_address (const struct GNUNET_PeerIdentity *peer,
2285 const char *plugin_name, 2297 const char *plugin_name,
@@ -2309,7 +2321,6 @@ create_ats_address (const struct GNUNET_PeerIdentity *peer,
2309} 2321}
2310 2322
2311 2323
2312
2313static void 2324static void
2314enforce_add_address (struct GNUNET_ATS_TEST_Operation *op) 2325enforce_add_address (struct GNUNET_ATS_TEST_Operation *op)
2315{ 2326{
@@ -2413,6 +2424,7 @@ enforce_del_address (struct GNUNET_ATS_TEST_Operation *op)
2413 GNUNET_free (a); 2424 GNUNET_free (a);
2414} 2425}
2415 2426
2427
2416static void 2428static void
2417enforce_start_property (struct GNUNET_ATS_TEST_Operation *op) 2429enforce_start_property (struct GNUNET_ATS_TEST_Operation *op)
2418{ 2430{
@@ -2454,6 +2466,7 @@ enforce_start_property (struct GNUNET_ATS_TEST_Operation *op)
2454 op->prop_type); 2466 op->prop_type);
2455} 2467}
2456 2468
2469
2457static void 2470static void
2458enforce_stop_property (struct GNUNET_ATS_TEST_Operation *op) 2471enforce_stop_property (struct GNUNET_ATS_TEST_Operation *op)
2459{ 2472{
@@ -2477,6 +2490,7 @@ enforce_stop_property (struct GNUNET_ATS_TEST_Operation *op)
2477 } 2490 }
2478} 2491}
2479 2492
2493
2480static void 2494static void
2481enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op) 2495enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op)
2482{ 2496{
@@ -2509,6 +2523,7 @@ enforce_start_preference (struct GNUNET_ATS_TEST_Operation *op)
2509 op->frequency); 2523 op->frequency);
2510} 2524}
2511 2525
2526
2512static void 2527static void
2513enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op) 2528enforce_stop_preference (struct GNUNET_ATS_TEST_Operation *op)
2514{ 2529{
@@ -2581,7 +2596,9 @@ enforce_stop_request (struct GNUNET_ATS_TEST_Operation *op)
2581 } 2596 }
2582} 2597}
2583 2598
2584static void enforce_episode (struct Episode *ep) 2599
2600static void
2601enforce_episode (struct Episode *ep)
2585{ 2602{
2586 struct GNUNET_ATS_TEST_Operation *cur; 2603 struct GNUNET_ATS_TEST_Operation *cur;
2587 2604
@@ -2719,6 +2736,7 @@ GNUNET_ATS_solvers_experimentation_run (struct Experiment *e,
2719 enforce_episode (e->cur); 2736 enforce_episode (e->cur);
2720} 2737}
2721 2738
2739
2722void 2740void
2723GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e) 2741GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
2724{ 2742{
@@ -2872,7 +2890,6 @@ GNUNET_ATS_solvers_experimentation_load (char *filename)
2872} 2890}
2873 2891
2874 2892
2875
2876/** 2893/**
2877 * Solver 2894 * Solver
2878 */ 2895 */
@@ -2892,6 +2909,7 @@ free_all_it (void *cls,
2892 return GNUNET_OK; 2909 return GNUNET_OK;
2893} 2910}
2894 2911
2912
2895void 2913void
2896GNUNET_ATS_solvers_solver_stop (struct SolverHandle *sh) 2914GNUNET_ATS_solvers_solver_stop (struct SolverHandle *sh)
2897{ 2915{
@@ -3178,6 +3196,7 @@ solver_info_cb (void *cls,
3178 } 3196 }
3179} 3197}
3180 3198
3199
3181static void 3200static void
3182solver_bandwidth_changed_cb (void *cls, struct ATS_Address *address) 3201solver_bandwidth_changed_cb (void *cls, struct ATS_Address *address)
3183{ 3202{
@@ -3229,6 +3248,7 @@ solver_bandwidth_changed_cb (void *cls, struct ATS_Address *address)
3229 return; 3248 return;
3230} 3249}
3231 3250
3251
3232const double * 3252const double *
3233get_preferences_cb (void *cls, const struct GNUNET_PeerIdentity *id) 3253get_preferences_cb (void *cls, const struct GNUNET_PeerIdentity *id)
3234{ 3254{
@@ -3385,6 +3405,7 @@ done ()
3385 end_now (); 3405 end_now ();
3386} 3406}
3387 3407
3408
3388static void 3409static void
3389experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration, 3410experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration,
3390 int success) 3411 int success)
@@ -3398,6 +3419,7 @@ experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration,
3398 GNUNET_SCHEDULER_add_now (&done, NULL); 3419 GNUNET_SCHEDULER_add_now (&done, NULL);
3399} 3420}
3400 3421
3422
3401static void 3423static void
3402episode_done_cb (struct Episode *ep) 3424episode_done_cb (struct Episode *ep)
3403{ 3425{
@@ -3405,7 +3427,6 @@ episode_done_cb (struct Episode *ep)
3405} 3427}
3406 3428
3407 3429
3408
3409/** 3430/**
3410 * Do shutdown 3431 * Do shutdown
3411 */ 3432 */
@@ -3424,6 +3445,7 @@ end_now ()
3424 } 3445 }
3425} 3446}
3426 3447
3448
3427static void 3449static void
3428run (void *cls, char *const *args, const char *cfgfile, 3450run (void *cls, char *const *args, const char *cfgfile,
3429 const struct GNUNET_CONFIGURATION_Handle *cfg) 3451 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -3560,4 +3582,6 @@ main (int argc, char *argv[])
3560 3582
3561 return res; 3583 return res;
3562} 3584}
3585
3586
3563/* end of file ats-testing-experiment.c*/ 3587/* end of file ats-testing-experiment.c*/
diff --git a/src/ats/gnunet-service-ats.c b/src/ats/gnunet-service-ats.c
index fbef6f166..5e27ecbd0 100644
--- a/src/ats/gnunet-service-ats.c
+++ b/src/ats/gnunet-service-ats.c
@@ -94,7 +94,6 @@ handle_ats_start (void *cls,
94} 94}
95 95
96 96
97
98/** 97/**
99 * Handle 'reservation request' messages from clients. 98 * Handle 'reservation request' messages from clients.
100 * 99 *
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 7c73cbf5b..e8a95c65e 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -712,5 +712,4 @@ GAS_handle_request_address_list (struct GNUNET_SERVICE_Client *client,
712} 712}
713 713
714 714
715
716/* end of gnunet-service-ats_addresses.c */ 715/* end of gnunet-service-ats_addresses.c */
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c
index 441c6610e..a4d7b36b6 100644
--- a/src/ats/gnunet-service-ats_performance.c
+++ b/src/ats/gnunet-service-ats_performance.c
@@ -278,4 +278,5 @@ GAS_performance_done ()
278 nc_pic = NULL; 278 nc_pic = NULL;
279} 279}
280 280
281
281/* end of gnunet-service-ats_performance.c */ 282/* end of gnunet-service-ats_performance.c */
diff --git a/src/ats/gnunet-service-ats_reservations.c b/src/ats/gnunet-service-ats_reservations.c
index c4367fb85..a50e9d5b7 100644
--- a/src/ats/gnunet-service-ats_reservations.c
+++ b/src/ats/gnunet-service-ats_reservations.c
@@ -213,4 +213,5 @@ GAS_reservations_done ()
213 GNUNET_CONTAINER_multipeermap_destroy (trackers); 213 GNUNET_CONTAINER_multipeermap_destroy (trackers);
214} 214}
215 215
216
216/* end of gnunet-service-ats_reservations.c */ 217/* end of gnunet-service-ats_reservations.c */
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c
index 5f10addaf..8e20f4454 100644
--- a/src/ats/perf_ats_solver.c
+++ b/src/ats/perf_ats_solver.c
@@ -530,6 +530,7 @@ perf_update_all_addresses (unsigned int cp, unsigned int ca, unsigned int
530 } 530 }
531} 531}
532 532
533
533/** 534/**
534 * Create an address for a peer 535 * Create an address for a peer
535 * 536 *
@@ -818,6 +819,7 @@ solver_info_cb (void *cls,
818 } 819 }
819} 820}
820 821
822
821/** 823/**
822 * Evaluate results for a specific iteration 824 * Evaluate results for a specific iteration
823 * 825 *
@@ -1016,7 +1018,6 @@ write_all_iterations (void)
1016 struct Result *cur_upd_res; 1018 struct Result *cur_upd_res;
1017 1019
1018 1020
1019
1020 // fprintf (stderr, "P: %u I: %u == %p \n", c_peer, c_iteration, cur_res); 1021 // fprintf (stderr, "P: %u I: %u == %p \n", c_peer, c_iteration, cur_res);
1021 cur_full_res = ph.iterations_results[c_iteration].results_array[c_peer]; 1022 cur_full_res = ph.iterations_results[c_iteration].results_array[c_peer];
1022 if (c_peer == 0) 1023 if (c_peer == 0)
@@ -1505,4 +1506,5 @@ main (int argc, char *argv[])
1505 return ret; 1506 return ret;
1506} 1507}
1507 1508
1509
1508/* end of file perf_ats_solver.c */ 1510/* end of file perf_ats_solver.c */
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c
index a1e995013..f4324d238 100644
--- a/src/ats/plugin_ats_proportional.c
+++ b/src/ats/plugin_ats_proportional.c
@@ -773,8 +773,7 @@ update_active_address (struct GAS_PROPORTIONAL_Handle *s,
773 * suggest one. Therefore we have to disconnect the peer. 773 * suggest one. Therefore we have to disconnect the peer.
774 * The above call to "distribute_bandwidth_in_network() 774 * The above call to "distribute_bandwidth_in_network()
775 * does not see 'current_address' so we need to trigger 775 * does not see 'current_address' so we need to trigger
776 * the update here. */ 776 * the update here. */LOG (GNUNET_ERROR_TYPE_DEBUG,
777 LOG (GNUNET_ERROR_TYPE_DEBUG,
778 "Disconnecting peer `%s'.\n", 777 "Disconnecting peer `%s'.\n",
779 GNUNET_i2s (peer)); 778 GNUNET_i2s (peer));
780 s->env->bandwidth_changed_cb (s->env->cls, 779 s->env->bandwidth_changed_cb (s->env->cls,
diff --git a/src/ats/test_ats_api.c b/src/ats/test_ats_api.c
index 0ec1bbdef..390cafe0f 100644
--- a/src/ats/test_ats_api.c
+++ b/src/ats/test_ats_api.c
@@ -45,7 +45,11 @@ static struct Command test_commands[] = {
45 .properties = { 45 .properties = {
46 .scope = GNUNET_NT_LAN 46 .scope = GNUNET_NT_LAN
47 } 47 }
48
49
48 } 50 }
51
52
49 }, 53 },
50 /* 1: adding same address again should fail */ 54 /* 1: adding same address again should fail */
51 { 55 {
@@ -61,6 +65,8 @@ static struct Command test_commands[] = {
61 }, 65 },
62 .expect_fail = 1 66 .expect_fail = 1
63 } 67 }
68
69
64 }, 70 },
65 /* 2: some solver still require explicit start */ 71 /* 2: some solver still require explicit start */
66 { 72 {
@@ -69,6 +75,8 @@ static struct Command test_commands[] = {
69 .details.request_connection_start = { 75 .details.request_connection_start = {
70 .pid = 0 76 .pid = 0
71 } 77 }
78
79
72 }, 80 },
73 /* 3: check we got an address */ 81 /* 3: check we got an address */
74 { 82 {
@@ -76,6 +84,8 @@ static struct Command test_commands[] = {
76 .details.await_address_suggestion = { 84 .details.await_address_suggestion = {
77 .add_label = "add-address-0-0" 85 .add_label = "add-address-0-0"
78 } 86 }
87
88
79 }, 89 },
80 /* 4: check monitor also got the address */ 90 /* 4: check monitor also got the address */
81 { 91 {
@@ -83,6 +93,8 @@ static struct Command test_commands[] = {
83 .details.await_address_information = { 93 .details.await_address_information = {
84 .add_label = "add-address-0-0" 94 .add_label = "add-address-0-0"
85 } 95 }
96
97
86 }, 98 },
87 /* 5: test session API */ 99 /* 5: test session API */
88 { 100 {
@@ -92,12 +104,16 @@ static struct Command test_commands[] = {
92 .add_label = "add-address-0-0", 104 .add_label = "add-address-0-0",
93 .session = 1 105 .session = 1
94 } 106 }
107
108
95 }, 109 },
96 { 110 {
97 .code = CMD_DEL_SESSION, 111 .code = CMD_DEL_SESSION,
98 .details.del_session = { 112 .details.del_session = {
99 .add_session_label = "add-session-0-0-1", 113 .add_session_label = "add-session-0-0-1",
100 } 114 }
115
116
101 }, 117 },
102 /* 7: test preference API */ 118 /* 7: test preference API */
103 { 119 {
@@ -106,6 +122,8 @@ static struct Command test_commands[] = {
106 .pid = 0 122 .pid = 0
107 /* FIXME: preference details */ 123 /* FIXME: preference details */
108 } 124 }
125
126
109 }, 127 },
110 { 128 {
111 .code = CMD_PROVIDE_FEEDBACK, 129 .code = CMD_PROVIDE_FEEDBACK,
@@ -114,6 +132,8 @@ static struct Command test_commands[] = {
114 .scope = { 50LL } 132 .scope = { 50LL }
115 /* FIXME: preference details */ 133 /* FIXME: preference details */
116 } 134 }
135
136
117 }, 137 },
118 /* 9: test sanity check address listing */ 138 /* 9: test sanity check address listing */
119 { 139 {
@@ -126,6 +146,8 @@ static struct Command test_commands[] = {
126 .min_active_calls = 1, 146 .min_active_calls = 1,
127 .max_active_calls = 1 147 .max_active_calls = 1
128 } 148 }
149
150
129 }, 151 },
130 /* 10: remove address testing */ 152 /* 10: remove address testing */
131 { 153 {
@@ -133,6 +155,8 @@ static struct Command test_commands[] = {
133 .details.del_address = { 155 .details.del_address = {
134 .add_label = "add-address-0-0" 156 .add_label = "add-address-0-0"
135 } 157 }
158
159
136 }, 160 },
137 /* 11: check we got disconnected */ 161 /* 11: check we got disconnected */
138 { 162 {
@@ -140,6 +164,8 @@ static struct Command test_commands[] = {
140 .details.await_disconnect_suggestion = { 164 .details.await_disconnect_suggestion = {
141 .pid = 0 165 .pid = 0
142 } 166 }
167
168
143 }, 169 },
144 /* 12: just for symmetry, also stop asking for the connection */ 170 /* 12: just for symmetry, also stop asking for the connection */
145 { 171 {
@@ -147,6 +173,8 @@ static struct Command test_commands[] = {
147 .details.request_connection_stop = { 173 .details.request_connection_stop = {
148 .connect_label = "request-0", 174 .connect_label = "request-0",
149 } 175 }
176
177
150 }, 178 },
151 /* 13: add address again */ 179 /* 13: add address again */
152 { 180 {
@@ -159,7 +187,11 @@ static struct Command test_commands[] = {
159 .properties = { 187 .properties = {
160 .scope = GNUNET_NT_LAN 188 .scope = GNUNET_NT_LAN
161 } 189 }
190
191
162 } 192 }
193
194
163 }, 195 },
164 /* 14: some solver still require explicit start */ 196 /* 14: some solver still require explicit start */
165 { 197 {
@@ -168,6 +200,8 @@ static struct Command test_commands[] = {
168 .details.request_connection_start = { 200 .details.request_connection_start = {
169 .pid = 0 201 .pid = 0
170 } 202 }
203
204
171 }, 205 },
172 /* 15: check we got an address */ 206 /* 15: check we got an address */
173 { 207 {
@@ -175,6 +209,8 @@ static struct Command test_commands[] = {
175 .details.await_address_suggestion = { 209 .details.await_address_suggestion = {
176 .add_label = "add-address-0-0:1" 210 .add_label = "add-address-0-0:1"
177 } 211 }
212
213
178 }, 214 },
179 /* 16: add alternative address */ 215 /* 16: add alternative address */
180 { 216 {
@@ -188,7 +224,11 @@ static struct Command test_commands[] = {
188 .properties = { 224 .properties = {
189 .scope = GNUNET_NT_LAN 225 .scope = GNUNET_NT_LAN
190 } 226 }
227
228
191 } 229 }
230
231
192 }, 232 },
193 /* 17: remove original address */ 233 /* 17: remove original address */
194 { 234 {
@@ -196,6 +236,8 @@ static struct Command test_commands[] = {
196 .details.del_address = { 236 .details.del_address = {
197 .add_label = "add-address-0-0:1" 237 .add_label = "add-address-0-0:1"
198 } 238 }
239
240
199 }, 241 },
200 /* 18: check we switched to alternative address */ 242 /* 18: check we switched to alternative address */
201 { 243 {
@@ -203,6 +245,8 @@ static struct Command test_commands[] = {
203 .details.await_address_suggestion = { 245 .details.await_address_suggestion = {
204 .add_label = "add-address-0-1" 246 .add_label = "add-address-0-1"
205 } 247 }
248
249
206 }, 250 },
207 /* 19: remove alternative address */ 251 /* 19: remove alternative address */
208 { 252 {
@@ -210,6 +254,8 @@ static struct Command test_commands[] = {
210 .details.del_address = { 254 .details.del_address = {
211 .add_label = "add-address-0-1" 255 .add_label = "add-address-0-1"
212 } 256 }
257
258
213 }, 259 },
214 /* 20: check we got disconnected */ 260 /* 20: check we got disconnected */
215 { 261 {
@@ -217,6 +263,8 @@ static struct Command test_commands[] = {
217 .details.await_disconnect_suggestion = { 263 .details.await_disconnect_suggestion = {
218 .pid = 0 264 .pid = 0
219 } 265 }
266
267
220 }, 268 },
221 /* 21: just for symmetry, also stop asking for the connection */ 269 /* 21: just for symmetry, also stop asking for the connection */
222 { 270 {
@@ -224,6 +272,8 @@ static struct Command test_commands[] = {
224 .details.request_connection_stop = { 272 .details.request_connection_stop = {
225 .connect_label = "request-0", 273 .connect_label = "request-0",
226 } 274 }
275
276
227 }, 277 },
228 /* Test ends successfully */ 278 /* Test ends successfully */
229 { 279 {
diff --git a/src/ats/test_ats_lib.c b/src/ats/test_ats_lib.c
index cd512634d..2c4d3f5ad 100644
--- a/src/ats/test_ats_lib.c
+++ b/src/ats/test_ats_lib.c
@@ -146,7 +146,6 @@ static unsigned int off;
146static struct Command *test_commands; 146static struct Command *test_commands;
147 147
148 148
149
150/** 149/**
151 * Free `struct AddressSuggestData` entry. 150 * Free `struct AddressSuggestData` entry.
152 * 151 *
@@ -1104,4 +1103,5 @@ TEST_ATS_run (int argc,
1104 return ret; 1103 return ret;
1105} 1104}
1106 1105
1106
1107/* end of test_ats_lib.c */ 1107/* end of test_ats_lib.c */
diff --git a/src/ats/test_ats_reservation_api.c b/src/ats/test_ats_reservation_api.c
index ff924b3b4..46658007b 100644
--- a/src/ats/test_ats_reservation_api.c
+++ b/src/ats/test_ats_reservation_api.c
@@ -46,7 +46,11 @@ static struct Command test_commands[] = {
46 /* use network with 65k quota! */ 46 /* use network with 65k quota! */
47 .scope = GNUNET_NT_WAN 47 .scope = GNUNET_NT_WAN
48 } 48 }
49
50
49 } 51 }
52
53
50 }, 54 },
51 /* 1: some solver still require explicit start */ 55 /* 1: some solver still require explicit start */
52 { 56 {
@@ -55,6 +59,8 @@ static struct Command test_commands[] = {
55 .details.request_connection_start = { 59 .details.request_connection_start = {
56 .pid = 0 60 .pid = 0
57 } 61 }
62
63
58 }, 64 },
59 /* 2: check we got an address */ 65 /* 2: check we got an address */
60 { 66 {
@@ -62,6 +68,8 @@ static struct Command test_commands[] = {
62 .details.await_address_suggestion = { 68 .details.await_address_suggestion = {
63 .add_label = "add-address-0-0" 69 .add_label = "add-address-0-0"
64 } 70 }
71
72
65 }, 73 },
66 /* 3: sleep 7s, should give us 5s * 64k/s = 320k buffer; 74 /* 3: sleep 7s, should give us 5s * 64k/s = 320k buffer;
67 Note that this depends on MAX_BANDWIDTH_CARRY_S. We 75 Note that this depends on MAX_BANDWIDTH_CARRY_S. We
@@ -79,6 +87,8 @@ static struct Command test_commands[] = {
79 .amount = 128 * 1024, 87 .amount = 128 * 1024,
80 .expected_result = GNUNET_YES 88 .expected_result = GNUNET_YES
81 } 89 }
90
91
82 }, 92 },
83 /* 5: reserve another 192k -- should just work (now exactly pushing the limit) */ 93 /* 5: reserve another 192k -- should just work (now exactly pushing the limit) */
84 { 94 {
@@ -89,6 +99,8 @@ static struct Command test_commands[] = {
89 .amount = 192 * 1024, 99 .amount = 192 * 1024,
90 .expected_result = GNUNET_YES 100 .expected_result = GNUNET_YES
91 } 101 }
102
103
92 }, 104 },
93 /* 6: reserve another 32k -- should now fail (if MAX_BANDWIDTH_CARRY_S 105 /* 6: reserve another 32k -- should now fail (if MAX_BANDWIDTH_CARRY_S
94 is precisely observed) */ 106 is precisely observed) */
@@ -100,6 +112,8 @@ static struct Command test_commands[] = {
100 .amount = 32 * 1024, 112 .amount = 32 * 1024,
101 .expected_result = GNUNET_SYSERR 113 .expected_result = GNUNET_SYSERR
102 } 114 }
115
116
103 }, 117 },
104 /* 7: sleep 3s, should give us 3s * 64k/s - 32k = 160k buffer */ 118 /* 7: sleep 3s, should give us 3s * 64k/s - 32k = 160k buffer */
105 { 119 {
@@ -116,6 +130,8 @@ static struct Command test_commands[] = {
116 .amount = 160 * 1024, 130 .amount = 160 * 1024,
117 .expected_result = GNUNET_YES 131 .expected_result = GNUNET_YES
118 } 132 }
133
134
119 }, 135 },
120 /* 9: remove address */ 136 /* 9: remove address */
121 { 137 {
@@ -123,6 +139,8 @@ static struct Command test_commands[] = {
123 .details.del_address = { 139 .details.del_address = {
124 .add_label = "add-address-0-0" 140 .add_label = "add-address-0-0"
125 } 141 }
142
143
126 }, 144 },
127 /* 10: check we got disconnected */ 145 /* 10: check we got disconnected */
128 { 146 {
@@ -130,6 +148,8 @@ static struct Command test_commands[] = {
130 .details.await_disconnect_suggestion = { 148 .details.await_disconnect_suggestion = {
131 .pid = 0 149 .pid = 0
132 } 150 }
151
152
133 }, 153 },
134 /* 11: just for symmetry, also stop asking for the connection */ 154 /* 11: just for symmetry, also stop asking for the connection */
135 { 155 {
@@ -137,6 +157,8 @@ static struct Command test_commands[] = {
137 .details.request_connection_stop = { 157 .details.request_connection_stop = {
138 .connect_label = "request-0", 158 .connect_label = "request-0",
139 } 159 }
160
161
140 }, 162 },
141 /* Test ends successfully */ 163 /* Test ends successfully */
142 { 164 {