gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit fa92364741e801a83fe7bd00a90efa462b3ab076
parent 61f388ab07724920dd03c0dd06165b4d068edc18
Author: David Barksdale <amatus.amongus@gmail.com>
Date:   Wed, 26 Oct 2016 19:27:09 +0000

Use GNUNET_NAT_StatusCode and GNUNET_NAT_status2string


Diffstat:
Msrc/transport/gnunet-transport.c | 70+++++-----------------------------------------------------------------
1 file changed, 5 insertions(+), 65 deletions(-)

diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c @@ -215,38 +215,6 @@ struct TestContext /** - * - */ -enum TestResult -{ - /** - * NAT returned success - */ - NAT_TEST_SUCCESS = GNUNET_OK, - - /** - * NAT returned failure - */ - NAT_TEST_FAIL = GNUNET_NO, - - /** - * NAT returned failure while running test - */ - NAT_TEST_INTERNAL_FAIL = GNUNET_SYSERR, - - /** - * We could not start the test - */ - NAT_TEST_FAILED_TO_START = 2, - - /** - * We had a timeout while running the test - */ - NAT_TEST_TIMEOUT = 3 -}; - - -/** * Benchmarking block size in KB */ #define BLOCKSIZE 4 @@ -614,40 +582,12 @@ run_nat_test (void); */ static void display_test_result (struct TestContext *tc, - enum TestResult result) + enum GNUNET_NAT_StatusCode result) { - switch (result) { - case NAT_TEST_FAIL: - FPRINTF (stderr, - _("Configuration for plugin `%s' did not work!\n"), - tc->name); - break; - case NAT_TEST_SUCCESS: - FPRINTF (stderr, - _("Configuration for plugin `%s' did work!\n"), - tc->name); - break; - case NAT_TEST_INTERNAL_FAIL: - FPRINTF (stderr, - _("Internal NAT error while running test for plugin `%s'\n"), - tc->name); - break; - case NAT_TEST_FAILED_TO_START: - FPRINTF (stderr, - _("Failed to start NAT test for plugin `%s'\n"), - tc->name); - break; - case NAT_TEST_TIMEOUT: - FPRINTF (stderr, - _("Timeout while waiting for result of NAT test for plugin `%s'\n"), - tc->name); - break; - default: - FPRINTF (stderr, - _("Configuration for plugin `%s' did not work!\n"), - tc->name); - break; - } + FPRINTF (stderr, + _("NAT plugin `%s' reports: %s\n"), + tc->name, + GNUNET_NAT_status2string (result)); if (NULL != tc->tsk) { GNUNET_SCHEDULER_cancel (tc->tsk);