aboutsummaryrefslogtreecommitdiff
path: root/src/nat/nat.c
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2014-06-24 10:18:59 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2014-06-24 10:18:59 +0000
commitf24861f1b06362d683841e07bde180f34f738a10 (patch)
tree61e134e99a44ec623a0c71576b892a1d01def2b6 /src/nat/nat.c
parent76c3b55cd2589f3376635c9a8f3b0a6f2421ca7a (diff)
downloadgnunet-f24861f1b06362d683841e07bde180f34f738a10.tar.gz
gnunet-f24861f1b06362d683841e07bde180f34f738a10.zip
- added more debug messages to status2string
- added remaining functionality to GNUNET_NAT_test_stop
Diffstat (limited to 'src/nat/nat.c')
-rw-r--r--src/nat/nat.c52
1 files changed, 45 insertions, 7 deletions
diff --git a/src/nat/nat.c b/src/nat/nat.c
index 61ca5eab7..85d069e07 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -1560,22 +1560,60 @@ GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h,
1560 return GNUNET_NO; 1560 return GNUNET_NO;
1561} 1561}
1562 1562
1563
1564/** 1563/**
1565 * Converts enum GNUNET_NAT_StatusCode to a string 1564 * Converts enum GNUNET_NAT_StatusCode to a string
1566 * 1565 *
1567 * @param err error code to resolve to a string 1566 * @param err error code to resolve to a string
1568 * @return point to a static string containing the error code 1567 * @return pointer to a static string containing the error code
1569 */ 1568 */
1570const char * 1569const char *
1571GNUNET_NAT_status2string (enum GNUNET_NAT_StatusCode err){ 1570GNUNET_NAT_status2string (enum GNUNET_NAT_StatusCode err)
1572 switch (err){ 1571{
1572 switch (err)
1573 {
1573 case GNUNET_NAT_ERROR_SUCCESS: 1574 case GNUNET_NAT_ERROR_SUCCESS:
1574 return _("Operation Successful"); 1575 return _ ("Operation Successful");
1575 1576 case GNUNET_NAT_ERROR_IPC_FAILURE:
1577 return _ ("Internal Failure (IPC, ...)");
1578 case GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR:
1579 return _ ("Failure in network subsystem, check permissions.");
1580 case GNUNET_NAT_ERROR_TIMEOUT:
1581 return _ ("Encountered timeout while performing operation");
1582 case GNUNET_NAT_ERROR_NOT_ONLINE:
1583 return _ ("detected that we are offline");
1584 case GNUNET_NAT_ERROR_UPNPC_NOT_FOUND:
1585 return _ ("`upnpc` command not found");
1586 case GNUNET_NAT_ERROR_UPNPC_FAILED:
1587 return _ ("Failed to run `upnpc` command");
1588 case GNUNET_NAT_ERROR_UPNPC_TIMEOUT:
1589 return _ ("`upnpc' command took too long, process killed");
1590 case GNUNET_NAT_ERROR_UPNPC_PORTMAP_FAILED:
1591 return _ ("`upnpc' command failed to establish port mapping");
1592 case GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_NOT_FOUND:
1593 return _ ("`external-ip' command not found");
1594 case GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_FAILED:
1595 return _ ("Failed to run `external-ip` command");
1596 case GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_OUTPUT_INVALID:
1597 return _ ("`external-ip' command output invalid");
1598 case GNUNET_NAT_ERROR_EXTERNAL_IP_ADDRESS_INVALID:
1599 return _ ("no valid address was returned by `external-ip'");
1600 case GNUNET_NAT_ERROR_NO_VALID_IF_IP_COMBO:
1601 return _ ("Could not determine interface with internal/local network address");
1602 case GNUNET_NAT_ERROR_HELPER_NAT_SERVER_NOT_FOUND:
1603 return _ ("No functioning gnunet-helper-nat-server installation found");
1604 case GNUNET_NAT_ERROR_NAT_TEST_START_FAILED:
1605 return _ ("NAT test could not be initialized");
1606 case GNUNET_NAT_ERROR_NAT_TEST_TIMEOUT:
1607 return _ ("NAT test timeout reached");
1608 case GNUNET_NAT_ERROR_NAT_REGISTER_FAILED:
1609 return _ ("could not register NAT");
1610 case GNUNET_NAT_ERROR_HELPER_NAT_CLIENT_NOT_FOUND:
1611 return _ ("No working gnunet-helper-nat-client installation found");
1612/* case:
1613 return _ ("");*/
1576 default: 1614 default:
1577 return "unknown status code"; 1615 return "unknown status code";
1578 } 1616 }
1579} 1617}
1580 1618
1581/* end of nat.c */ 1619/* end of nat.c */