summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-transport.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2016-10-26 19:27:09 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2016-10-26 19:27:09 +0000
commitfa92364741e801a83fe7bd00a90efa462b3ab076 (patch)
tree321624e92859cb12330e69662902025f8b81dcc7 /src/transport/gnunet-transport.c
parent61f388ab07724920dd03c0dd06165b4d068edc18 (diff)
Use GNUNET_NAT_StatusCode and GNUNET_NAT_status2string
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r--src/transport/gnunet-transport.c70
1 files 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
@@ -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);