diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-10 23:24:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-10 23:24:01 +0000 |
commit | 1c323bd4cbb388a9e7515a1f733a3062bf093aee (patch) | |
tree | 7cc525d79149d44840b9f7a0040aaf3e69ecd665 /src/testbed/gnunet-daemon-testbed-underlay.c | |
parent | aedaaed687db1ff20b447378f01ad7306921450c (diff) | |
download | gnunet-1c323bd4cbb388a9e7515a1f733a3062bf093aee.tar.gz gnunet-1c323bd4cbb388a9e7515a1f733a3062bf093aee.zip |
fixing #3657 (replace ATS_Information with struct), but WIHTOUT fixing ATS testcases yet
Diffstat (limited to 'src/testbed/gnunet-daemon-testbed-underlay.c')
-rw-r--r-- | src/testbed/gnunet-daemon-testbed-underlay.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/testbed/gnunet-daemon-testbed-underlay.c b/src/testbed/gnunet-daemon-testbed-underlay.c index 49bfc64bf..e41cf4a4d 100644 --- a/src/testbed/gnunet-daemon-testbed-underlay.c +++ b/src/testbed/gnunet-daemon-testbed-underlay.c | |||
@@ -365,13 +365,15 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
365 | struct WhiteListRow *wl_head; | 365 | struct WhiteListRow *wl_head; |
366 | struct WhiteListRow *wl_entry; | 366 | struct WhiteListRow *wl_entry; |
367 | struct GNUNET_PeerIdentity identity; | 367 | struct GNUNET_PeerIdentity identity; |
368 | struct GNUNET_ATS_Information params[1]; | 368 | struct GNUNET_ATS_Properties prop; |
369 | struct GNUNET_TIME_Relative delay; | ||
369 | unsigned long long pid; | 370 | unsigned long long pid; |
370 | unsigned int nrows; | 371 | unsigned int nrows; |
371 | int ret; | 372 | int ret; |
372 | 373 | ||
373 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (c, "TESTBED", | 374 | if (GNUNET_OK != |
374 | "PEERID", &pid)) | 375 | GNUNET_CONFIGURATION_get_value_number (c, "TESTBED", |
376 | "PEERID", &pid)) | ||
375 | { | 377 | { |
376 | GNUNET_break (0); | 378 | GNUNET_break (0); |
377 | return; | 379 | return; |
@@ -418,11 +420,11 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
418 | goto close_db; | 420 | goto close_db; |
419 | } | 421 | } |
420 | map = GNUNET_CONTAINER_multipeermap_create (nrows, GNUNET_NO); | 422 | map = GNUNET_CONTAINER_multipeermap_create (nrows, GNUNET_NO); |
421 | params[0].type = GNUNET_ATS_QUALITY_NET_DELAY; | ||
422 | while (NULL != (wl_entry = wl_head)) | 423 | while (NULL != (wl_entry = wl_head)) |
423 | { | 424 | { |
424 | wl_head = wl_entry->next; | 425 | wl_head = wl_entry->next; |
425 | params[0].value = wl_entry->latency; | 426 | delay.rel_value_us = wl_entry->latency; |
427 | memset (&prop, 0, sizeof (prop)); | ||
426 | GNUNET_assert (GNUNET_OK == get_identity (wl_entry->id, &identity)); | 428 | GNUNET_assert (GNUNET_OK == get_identity (wl_entry->id, &identity)); |
427 | GNUNET_break (GNUNET_OK == | 429 | GNUNET_break (GNUNET_OK == |
428 | GNUNET_CONTAINER_multipeermap_put (map, &identity, &identity, | 430 | GNUNET_CONTAINER_multipeermap_put (map, &identity, &identity, |
@@ -432,9 +434,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
432 | GNUNET_i2s (&identity)); | 434 | GNUNET_i2s (&identity)); |
433 | GNUNET_TRANSPORT_set_traffic_metric (transport, | 435 | GNUNET_TRANSPORT_set_traffic_metric (transport, |
434 | &identity, | 436 | &identity, |
435 | GNUNET_YES, | 437 | &prop, |
436 | GNUNET_YES, /* FIXME: Separate inbound, outboud metrics */ | 438 | delay, |
437 | params, 1); | 439 | delay); |
438 | GNUNET_free (wl_entry); | 440 | GNUNET_free (wl_entry); |
439 | } | 441 | } |
440 | bh = GNUNET_TRANSPORT_blacklist (c, &check_access, NULL); | 442 | bh = GNUNET_TRANSPORT_blacklist (c, &check_access, NULL); |