diff options
Diffstat (limited to 'src/ats-tests/ats-testing.h')
-rw-r--r-- | src/ats-tests/ats-testing.h | 100 |
1 files changed, 51 insertions, 49 deletions
diff --git a/src/ats-tests/ats-testing.h b/src/ats-tests/ats-testing.h index 9c4353b52..f6df5a9bd 100644 --- a/src/ats-tests/ats-testing.h +++ b/src/ats-tests/ats-testing.h | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "gnunet_testbed_service.h" | 28 | #include "gnunet_testbed_service.h" |
29 | #include "gnunet_ats_service.h" | 29 | #include "gnunet_ats_service.h" |
30 | #include "gnunet_core_service.h" | 30 | #include "gnunet_core_service.h" |
31 | #include "gnunet_transport_core_service.h" | 31 | #include "gnunet_transport_service.h" |
32 | 32 | ||
33 | #define TEST_ATS_PREFERENCE_DEFAULT 1.0 | 33 | #define TEST_ATS_PREFERENCE_DEFAULT 1.0 |
34 | 34 | ||
@@ -82,10 +82,10 @@ enum GeneratorType | |||
82 | * @param masters array of master peers | 82 | * @param masters array of master peers |
83 | * @param slaves array of master peers | 83 | * @param slaves array of master peers |
84 | */ | 84 | */ |
85 | typedef void | 85 | typedef void (*GNUNET_ATS_TEST_TopologySetupDoneCallback) ( |
86 | (*GNUNET_ATS_TEST_TopologySetupDoneCallback) (void *cls, | 86 | void *cls, |
87 | struct BenchmarkPeer *masters, | 87 | struct BenchmarkPeer *masters, |
88 | struct BenchmarkPeer *slaves); | 88 | struct BenchmarkPeer *slaves); |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * Callback called when logging is required for the data contained | 91 | * Callback called when logging is required for the data contained |
@@ -97,13 +97,13 @@ typedef void | |||
97 | * @param bandwidth_in bandwidth inbound | 97 | * @param bandwidth_in bandwidth inbound |
98 | * @param prop performance information | 98 | * @param prop performance information |
99 | */ | 99 | */ |
100 | typedef void | 100 | typedef void (*GNUNET_ATS_TEST_LogRequest) ( |
101 | (*GNUNET_ATS_TEST_LogRequest) (void *cls, | 101 | void *cls, |
102 | const struct GNUNET_HELLO_Address *address, | 102 | const struct GNUNET_HELLO_Address *address, |
103 | int address_active, | 103 | int address_active, |
104 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 104 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
105 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 105 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
106 | const struct GNUNET_ATS_Properties *prop); | 106 | const struct GNUNET_ATS_Properties *prop); |
107 | 107 | ||
108 | /** | 108 | /** |
109 | * Information we track for a peer in the testbed. | 109 | * Information we track for a peer in the testbed. |
@@ -176,7 +176,7 @@ struct BenchmarkPeer | |||
176 | * Masters only | 176 | * Masters only |
177 | * Progress task | 177 | * Progress task |
178 | */ | 178 | */ |
179 | struct GNUNET_SCHEDULER_Task * ats_task; | 179 | struct GNUNET_SCHEDULER_Task *ats_task; |
180 | 180 | ||
181 | /** | 181 | /** |
182 | * Masters only | 182 | * Masters only |
@@ -241,7 +241,7 @@ struct TrafficGenerator | |||
241 | long int max_rate; | 241 | long int max_rate; |
242 | struct GNUNET_TIME_Relative duration_period; | 242 | struct GNUNET_TIME_Relative duration_period; |
243 | 243 | ||
244 | struct GNUNET_SCHEDULER_Task * send_task; | 244 | struct GNUNET_SCHEDULER_Task *send_task; |
245 | struct GNUNET_TIME_Absolute next_ping_transmission; | 245 | struct GNUNET_TIME_Absolute next_ping_transmission; |
246 | struct GNUNET_TIME_Absolute time_start; | 246 | struct GNUNET_TIME_Absolute time_start; |
247 | }; | 247 | }; |
@@ -264,7 +264,7 @@ struct PreferenceGenerator | |||
264 | struct GNUNET_TIME_Relative duration_period; | 264 | struct GNUNET_TIME_Relative duration_period; |
265 | struct GNUNET_TIME_Relative frequency; | 265 | struct GNUNET_TIME_Relative frequency; |
266 | 266 | ||
267 | struct GNUNET_SCHEDULER_Task * set_task; | 267 | struct GNUNET_SCHEDULER_Task *set_task; |
268 | struct GNUNET_TIME_Absolute next_ping_transmission; | 268 | struct GNUNET_TIME_Absolute next_ping_transmission; |
269 | struct GNUNET_TIME_Absolute time_start; | 269 | struct GNUNET_TIME_Absolute time_start; |
270 | }; | 270 | }; |
@@ -353,7 +353,6 @@ struct BenchmarkPartner | |||
353 | * Current preference values for delay | 353 | * Current preference values for delay |
354 | */ | 354 | */ |
355 | double pref_delay; | 355 | double pref_delay; |
356 | |||
357 | }; | 356 | }; |
358 | 357 | ||
359 | 358 | ||
@@ -480,13 +479,12 @@ struct Episode; | |||
480 | 479 | ||
481 | struct Experiment; | 480 | struct Experiment; |
482 | 481 | ||
483 | typedef void | 482 | typedef void (*GNUNET_ATS_TESTING_EpisodeDoneCallback) (struct Episode *e); |
484 | (*GNUNET_ATS_TESTING_EpisodeDoneCallback) (struct Episode *e); | ||
485 | 483 | ||
486 | typedef void | 484 | typedef void (*GNUNET_ATS_TESTING_ExperimentDoneCallback) ( |
487 | (*GNUNET_ATS_TESTING_ExperimentDoneCallback) (struct Experiment *e, | 485 | struct Experiment *e, |
488 | struct GNUNET_TIME_Relative duration, | 486 | struct GNUNET_TIME_Relative duration, |
489 | int success); | 487 | int success); |
490 | 488 | ||
491 | /** | 489 | /** |
492 | * An operation in an experiment | 490 | * An operation in an experiment |
@@ -533,8 +531,8 @@ struct Experiment | |||
533 | unsigned int num_episodes; | 531 | unsigned int num_episodes; |
534 | struct Episode *start; | 532 | struct Episode *start; |
535 | 533 | ||
536 | struct GNUNET_SCHEDULER_Task * experiment_timeout_task; | 534 | struct GNUNET_SCHEDULER_Task *experiment_timeout_task; |
537 | struct GNUNET_SCHEDULER_Task * episode_timeout_task; | 535 | struct GNUNET_SCHEDULER_Task *episode_timeout_task; |
538 | struct Episode *cur; | 536 | struct Episode *cur; |
539 | 537 | ||
540 | GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb; | 538 | GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb; |
@@ -552,9 +550,10 @@ extern struct GNUNET_CONFIGURATION_Handle *cfg; | |||
552 | * @param e_done_cb the experiment is completed | 550 | * @param e_done_cb the experiment is completed |
553 | */ | 551 | */ |
554 | void | 552 | void |
555 | GNUNET_ATS_TEST_experimentation_run (struct Experiment *e, | 553 | GNUNET_ATS_TEST_experimentation_run ( |
556 | GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb, | 554 | struct Experiment *e, |
557 | GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb); | 555 | GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb, |
556 | GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb); | ||
558 | 557 | ||
559 | 558 | ||
560 | /** | 559 | /** |
@@ -633,14 +632,15 @@ GNUNET_ATS_TEST_generate_traffic_stop_all (void); | |||
633 | * @return the traffic generator | 632 | * @return the traffic generator |
634 | */ | 633 | */ |
635 | struct PreferenceGenerator * | 634 | struct PreferenceGenerator * |
636 | GNUNET_ATS_TEST_generate_preferences_start (struct BenchmarkPeer *src, | 635 | GNUNET_ATS_TEST_generate_preferences_start ( |
637 | struct BenchmarkPartner *dest, | 636 | struct BenchmarkPeer *src, |
638 | enum GeneratorType type, | 637 | struct BenchmarkPartner *dest, |
639 | unsigned int base_value, | 638 | enum GeneratorType type, |
640 | unsigned int value_rate, | 639 | unsigned int base_value, |
641 | struct GNUNET_TIME_Relative period, | 640 | unsigned int value_rate, |
642 | struct GNUNET_TIME_Relative frequency, | 641 | struct GNUNET_TIME_Relative period, |
643 | enum GNUNET_ATS_PreferenceKind kind); | 642 | struct GNUNET_TIME_Relative frequency, |
643 | enum GNUNET_ATS_PreferenceKind kind); | ||
644 | 644 | ||
645 | 645 | ||
646 | void | 646 | void |
@@ -664,11 +664,11 @@ GNUNET_ATS_TEST_generate_preferences_stop_all (void); | |||
664 | */ | 664 | */ |
665 | struct LoggingHandle * | 665 | struct LoggingHandle * |
666 | GNUNET_ATS_TEST_logging_start (struct GNUNET_TIME_Relative log_frequency, | 666 | GNUNET_ATS_TEST_logging_start (struct GNUNET_TIME_Relative log_frequency, |
667 | const char *testname, | 667 | const char *testname, |
668 | struct BenchmarkPeer *masters, | 668 | struct BenchmarkPeer *masters, |
669 | int num_masters, | 669 | int num_masters, |
670 | int num_slaves, | 670 | int num_slaves, |
671 | int verbose); | 671 | int verbose); |
672 | 672 | ||
673 | 673 | ||
674 | /** | 674 | /** |
@@ -729,20 +729,22 @@ GNUNET_ATS_TEST_get_partner (int src, int dest); | |||
729 | * @param cfg_file configuration file to use for the peers | 729 | * @param cfg_file configuration file to use for the peers |
730 | * @param num_slaves number of slaves | 730 | * @param num_slaves number of slaves |
731 | * @param num_masters number of masters | 731 | * @param num_masters number of masters |
732 | * @param test_core connect to CORE service (#GNUNET_YES) or transport (#GNUNET_NO) | 732 | * @param test_core connect to CORE service (#GNUNET_YES) or transport |
733 | * (#GNUNET_NO) | ||
733 | * @param done_cb function to call when topology is setup | 734 | * @param done_cb function to call when topology is setup |
734 | * @param done_cb_cls cls for callback | 735 | * @param done_cb_cls cls for callback |
735 | * @param log_request_cb callback to call when logging is required | 736 | * @param log_request_cb callback to call when logging is required |
736 | */ | 737 | */ |
737 | void | 738 | void |
738 | GNUNET_ATS_TEST_create_topology (char *name, | 739 | GNUNET_ATS_TEST_create_topology ( |
739 | char *cfg_file, | 740 | char *name, |
740 | unsigned int num_slaves, | 741 | char *cfg_file, |
741 | unsigned int num_masters, | 742 | unsigned int num_slaves, |
742 | int test_core, | 743 | unsigned int num_masters, |
743 | GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb, | 744 | int test_core, |
744 | void *done_cb_cls, | 745 | GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb, |
745 | GNUNET_ATS_TEST_LogRequest ats_perf_cb); | 746 | void *done_cb_cls, |
747 | GNUNET_ATS_TEST_LogRequest ats_perf_cb); | ||
746 | 748 | ||
747 | 749 | ||
748 | /** | 750 | /** |