Use GNUNET_NAT_StatusCode and GNUNET_NAT_status2string
authorDavid Barksdale <amatus.amongus@gmail.com>
Wed, 26 Oct 2016 19:27:09 +0000 (19:27 +0000)
committerDavid Barksdale <amatus.amongus@gmail.com>
Wed, 26 Oct 2016 19:27:09 +0000 (19:27 +0000)
src/transport/gnunet-transport.c

index aceaceb87388cf338ef35845c68bed5bfe5c2c89..e928cf6603ad4ee842d34ce23b5e56e288f31e37 100644 (file)
@@ -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);