diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2015-04-09 11:01:28 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2015-04-09 11:01:28 +0000 |
commit | 5ffbe65c5c78e09b83d3eaae95c2c363535a332f (patch) | |
tree | 58ea8c81da45112b0439ba67393378731a64392d /src/ats-tests/perf_ats.c | |
parent | a541dc562dcd9508acdd0102d3aee3c857463bed (diff) | |
download | gnunet-5ffbe65c5c78e09b83d3eaae95c2c363535a332f.tar.gz gnunet-5ffbe65c5c78e09b83d3eaae95c2c363535a332f.zip |
adding new ATS struct, updating config files to use lower case solver names
Diffstat (limited to 'src/ats-tests/perf_ats.c')
-rw-r--r-- | src/ats-tests/perf_ats.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c index f278bfbb5..5db2f3b24 100644 --- a/src/ats-tests/perf_ats.c +++ b/src/ats-tests/perf_ats.c | |||
@@ -320,11 +320,10 @@ static void | |||
320 | log_request_cb (void *cls, const struct GNUNET_HELLO_Address *address, | 320 | log_request_cb (void *cls, const struct GNUNET_HELLO_Address *address, |
321 | int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 321 | int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
322 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 322 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
323 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) | 323 | const struct GNUNET_ATS_Properties *ats) |
324 | { | 324 | { |
325 | struct BenchmarkPeer *me = cls; | 325 | struct BenchmarkPeer *me = cls; |
326 | struct BenchmarkPartner *p; | 326 | struct BenchmarkPartner *p; |
327 | int c_a; | ||
328 | char *peer_id; | 327 | char *peer_id; |
329 | 328 | ||
330 | p = find_partner (me, &address->peer); | 329 | p = find_partner (me, &address->peer); |
@@ -342,15 +341,11 @@ log_request_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
342 | p->bandwidth_in = ntohl (bandwidth_in.value__); | 341 | p->bandwidth_in = ntohl (bandwidth_in.value__); |
343 | p->bandwidth_out = ntohl (bandwidth_out.value__); | 342 | p->bandwidth_out = ntohl (bandwidth_out.value__); |
344 | 343 | ||
345 | for (c_a = 0; c_a < ats_count; c_a++) | 344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s [%u] received ATS information for peers `%s'\n", |
346 | { | 345 | (GNUNET_YES == p->me->master) ? "Master" : "Slave", |
347 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s [%u] received ATS information: %s %s %u\n", | 346 | p->me->no, |
348 | (GNUNET_YES == p->me->master) ? "Master" : "Slave", | 347 | GNUNET_i2s (&p->dest->id)); |
349 | p->me->no, | 348 | |
350 | GNUNET_i2s (&p->dest->id), | ||
351 | GNUNET_ATS_print_property_type(ntohl(ats[c_a].type)), | ||
352 | ntohl(ats[c_a].value)); | ||
353 | } | ||
354 | GNUNET_free(peer_id); | 349 | GNUNET_free(peer_id); |
355 | if (NULL != l) | 350 | if (NULL != l) |
356 | GNUNET_ATS_TEST_logging_now (l); | 351 | GNUNET_ATS_TEST_logging_now (l); |
@@ -374,17 +369,27 @@ main (int argc, char *argv[]) | |||
374 | 369 | ||
375 | result = 0; | 370 | result = 0; |
376 | 371 | ||
377 | /* figure out testname */ | 372 | /* Determine testname |
373 | * perf_ats_<solver>_<transport>_<preference>[.exe]*/ | ||
374 | |||
375 | /* Find test prefix, store in temp */ | ||
378 | tmp = strstr (argv[0], TESTNAME_PREFIX); | 376 | tmp = strstr (argv[0], TESTNAME_PREFIX); |
379 | if (NULL == tmp) | 377 | if (NULL == tmp) |
380 | { | 378 | { |
381 | fprintf (stderr, "Unable to parse test name `%s'\n", argv[0]); | 379 | fprintf (stderr, "Unable to parse test name `%s'\n", argv[0]); |
382 | return GNUNET_SYSERR; | 380 | return GNUNET_SYSERR; |
383 | } | 381 | } |
382 | |||
383 | /* Set tmp to end of test name prefix */ | ||
384 | tmp += strlen (TESTNAME_PREFIX); | 384 | tmp += strlen (TESTNAME_PREFIX); |
385 | |||
386 | /* Determine solver name */ | ||
385 | solver = GNUNET_strdup (tmp); | 387 | solver = GNUNET_strdup (tmp); |
388 | /* Remove .exe prefix */ | ||
386 | if (NULL != (dotexe = strstr (solver, ".exe")) && dotexe[4] == '\0') | 389 | if (NULL != (dotexe = strstr (solver, ".exe")) && dotexe[4] == '\0') |
387 | dotexe[0] = '\0'; | 390 | dotexe[0] = '\0'; |
391 | |||
392 | /* Determine first '_' after solver */ | ||
388 | tmp_sep = strchr (solver, '_'); | 393 | tmp_sep = strchr (solver, '_'); |
389 | if (NULL == tmp_sep) | 394 | if (NULL == tmp_sep) |
390 | { | 395 | { |