From fa92364741e801a83fe7bd00a90efa462b3ab076 Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Wed, 26 Oct 2016 19:27:09 +0000 Subject: [PATCH] Use GNUNET_NAT_StatusCode and GNUNET_NAT_status2string --- src/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 index aceaceb87..e928cf660 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -214,38 +214,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 */ @@ -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); -- 2.25.1