From f82cdb61caf9955ea56c6df9448b95ec4e3aacd3 Mon Sep 17 00:00:00 2001 From: Christian Fuchs Date: Tue, 17 Jun 2014 10:35:26 +0000 Subject: - renamed NAT's failure code to status code across gnunet (not GTK yet) - added proper error reporting to NAT-test-start/stop - timed-out nat tests not automatically stop the test itself - fixed a design flaw in nat-test - fixed a potential crash in the tests of the nat functionality (NOT NAT_TEST_xy...) --- src/nat/nat.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/nat/nat.c') diff --git a/src/nat/nat.c b/src/nat/nat.c index 670ae6a27..61ca5eab7 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c @@ -1018,7 +1018,7 @@ upnp_add (void *cls, int add_remove, const struct sockaddr *addr, socklen_t addrlen, - enum GNUNET_NAT_FailureCode ret) + enum GNUNET_NAT_StatusCode ret) { struct GNUNET_NAT_Handle *h = cls; struct LocalAddressList *pos; @@ -1561,4 +1561,21 @@ GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, } +/** + * Converts enum GNUNET_NAT_StatusCode to a string + * + * @param err error code to resolve to a string + * @return point to a static string containing the error code + */ +const char * +GNUNET_NAT_status2string (enum GNUNET_NAT_StatusCode err){ + switch (err){ + case GNUNET_NAT_ERROR_SUCCESS: + return _("Operation Successful"); + + default: + return "unknown status code"; + } +} + /* end of nat.c */ -- cgit v1.2.3