diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-02-03 14:08:48 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-02-03 14:08:48 +0000 |
commit | da30ec65a28e5ec08dc9b1b7e35927a0571a4164 (patch) | |
tree | a7ce083cb7ae8fccc5a6928eaf041c9ea29ac076 /src/ats-tests/ats-testing-experiment.c | |
parent | 54e443c4dddcd4ff8aff4fd764e4c7c010ec917e (diff) | |
download | gnunet-da30ec65a28e5ec08dc9b1b7e35927a0571a4164.tar.gz gnunet-da30ec65a28e5ec08dc9b1b7e35927a0571a4164.zip |
removing set_rate, using start_send instead
Diffstat (limited to 'src/ats-tests/ats-testing-experiment.c')
-rw-r--r-- | src/ats-tests/ats-testing-experiment.c | 61 |
1 files changed, 22 insertions, 39 deletions
diff --git a/src/ats-tests/ats-testing-experiment.c b/src/ats-tests/ats-testing-experiment.c index 3d19c739f..8471733d6 100644 --- a/src/ats-tests/ats-testing-experiment.c +++ b/src/ats-tests/ats-testing-experiment.c | |||
@@ -35,8 +35,6 @@ print_op (enum OperationType op) | |||
35 | return "START_SEND"; | 35 | return "START_SEND"; |
36 | case STOP_SEND: | 36 | case STOP_SEND: |
37 | return "STOP_SEND"; | 37 | return "STOP_SEND"; |
38 | case SET_RATE: | ||
39 | return "SET_RATE"; | ||
40 | case SET_PREFERENCE: | 38 | case SET_PREFERENCE: |
41 | return "SET_PREFERENCE"; | 39 | return "SET_PREFERENCE"; |
42 | default: | 40 | default: |
@@ -119,10 +117,6 @@ load_episode (struct Experiment *e, struct Episode *cur, | |||
119 | { | 117 | { |
120 | o->type = STOP_SEND; | 118 | o->type = STOP_SEND; |
121 | } | 119 | } |
122 | else if (0 == strcmp (op, "set_rate")) | ||
123 | { | ||
124 | o->type = SET_RATE; | ||
125 | } | ||
126 | else if (0 == strcmp (op, "set_preference")) | 120 | else if (0 == strcmp (op, "set_preference")) |
127 | { | 121 | { |
128 | o->type = SET_PREFERENCE; | 122 | o->type = SET_PREFERENCE; |
@@ -253,7 +247,6 @@ load_episode (struct Experiment *e, struct Episode *cur, | |||
253 | o->period = cur->duration; | 247 | o->period = cur->duration; |
254 | } | 248 | } |
255 | GNUNET_free (op_name); | 249 | GNUNET_free (op_name); |
256 | |||
257 | } | 250 | } |
258 | 251 | ||
259 | /* Safety checks */ | 252 | /* Safety checks */ |
@@ -357,35 +350,6 @@ timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) | |||
357 | static void | 350 | static void |
358 | enforce_start_send (struct GNUNET_ATS_TEST_Operation *op) | 351 | enforce_start_send (struct GNUNET_ATS_TEST_Operation *op) |
359 | { | 352 | { |
360 | GNUNET_break (0); | ||
361 | } | ||
362 | |||
363 | static void | ||
364 | enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op) | ||
365 | { | ||
366 | struct BenchmarkPartner *p; | ||
367 | p = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id); | ||
368 | if (NULL == p) | ||
369 | { | ||
370 | GNUNET_break (0); | ||
371 | return; | ||
372 | } | ||
373 | |||
374 | fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id); | ||
375 | |||
376 | if (NULL != p->tg) | ||
377 | { | ||
378 | fprintf (stderr, "Stopping traffic between master %llu slave %llu\n",op->src_id, op->dest_id); | ||
379 | GNUNET_ATS_TEST_generate_traffic_stop(p->tg); | ||
380 | p->tg = NULL; | ||
381 | } | ||
382 | |||
383 | |||
384 | } | ||
385 | |||
386 | static void | ||
387 | enforce_set_rate (struct GNUNET_ATS_TEST_Operation *op) | ||
388 | { | ||
389 | struct BenchmarkPeer *peer; | 353 | struct BenchmarkPeer *peer; |
390 | struct BenchmarkPartner *partner; | 354 | struct BenchmarkPartner *partner; |
391 | 355 | ||
@@ -418,6 +382,28 @@ enforce_set_rate (struct GNUNET_ATS_TEST_Operation *op) | |||
418 | } | 382 | } |
419 | 383 | ||
420 | static void | 384 | static void |
385 | enforce_stop_send (struct GNUNET_ATS_TEST_Operation *op) | ||
386 | { | ||
387 | struct BenchmarkPartner *p; | ||
388 | p = GNUNET_ATS_TEST_get_partner (op->src_id, op->dest_id); | ||
389 | if (NULL == p) | ||
390 | { | ||
391 | GNUNET_break (0); | ||
392 | return; | ||
393 | } | ||
394 | |||
395 | fprintf (stderr, "Found master %llu slave %llu\n",op->src_id, op->dest_id); | ||
396 | |||
397 | if (NULL != p->tg) | ||
398 | { | ||
399 | fprintf (stderr, "Stopping traffic between master %llu slave %llu\n",op->src_id, op->dest_id); | ||
400 | GNUNET_ATS_TEST_generate_traffic_stop(p->tg); | ||
401 | p->tg = NULL; | ||
402 | } | ||
403 | } | ||
404 | |||
405 | |||
406 | static void | ||
421 | enforce_set_preference (struct GNUNET_ATS_TEST_Operation *op) | 407 | enforce_set_preference (struct GNUNET_ATS_TEST_Operation *op) |
422 | { | 408 | { |
423 | GNUNET_break (0); | 409 | GNUNET_break (0); |
@@ -438,9 +424,6 @@ static void enforce_episode (struct Episode *ep) | |||
438 | case STOP_SEND: | 424 | case STOP_SEND: |
439 | enforce_stop_send (cur); | 425 | enforce_stop_send (cur); |
440 | break; | 426 | break; |
441 | case SET_RATE: | ||
442 | enforce_set_rate (cur); | ||
443 | break; | ||
444 | case SET_PREFERENCE: | 427 | case SET_PREFERENCE: |
445 | enforce_set_preference (cur); | 428 | enforce_set_preference (cur); |
446 | break; | 429 | break; |