diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-01-07 05:14:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-01-07 05:14:12 +0000 |
commit | 9e0744da3a82cc7b68a9043272044584be98db44 (patch) | |
tree | 0d66dcff21faddda56c57f6768f7fee49649366a /src/nat/test_nat_mini.c | |
parent | 1ab001d527da02fbf9a7212497c162a979aa8f6b (diff) | |
download | gnunet-9e0744da3a82cc7b68a9043272044584be98db44.tar.gz gnunet-9e0744da3a82cc7b68a9043272044584be98db44.zip |
-modify NAT API to return error messages about problems detected
Diffstat (limited to 'src/nat/test_nat_mini.c')
-rw-r--r-- | src/nat/test_nat_mini.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/nat/test_nat_mini.c b/src/nat/test_nat_mini.c index c503a837a..6fe4fd5b9 100644 --- a/src/nat/test_nat_mini.c +++ b/src/nat/test_nat_mini.c | |||
@@ -42,12 +42,17 @@ | |||
42 | * believes to be valid for the transport. | 42 | * believes to be valid for the transport. |
43 | */ | 43 | */ |
44 | static void | 44 | static void |
45 | addr_callback (void *cls, int add_remove, const struct sockaddr *addr, | 45 | addr_callback (void *cls, int add_remove, |
46 | socklen_t addrlen) | 46 | const struct sockaddr *addr, |
47 | socklen_t addrlen, | ||
48 | const char *emsg) | ||
47 | { | 49 | { |
48 | fprintf (stderr, "Address changed: %s `%s' (%u bytes)\n", | 50 | fprintf (stderr, |
49 | add_remove == GNUNET_YES ? "added" : "removed", GNUNET_a2s (addr, | 51 | "Address changed: %s `%s' (%u bytes)\n", |
50 | addrlen), | 52 | add_remove == GNUNET_YES |
53 | ? "added" : "removed", | ||
54 | GNUNET_a2s (addr, | ||
55 | addrlen), | ||
51 | (unsigned int) addrlen); | 56 | (unsigned int) addrlen); |
52 | } | 57 | } |
53 | 58 | ||
@@ -76,7 +81,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
76 | struct GNUNET_NAT_MiniHandle *mini; | 81 | struct GNUNET_NAT_MiniHandle *mini; |
77 | 82 | ||
78 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 83 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
79 | "Requesting NAT redirection for port %u...\n", PORT); | 84 | "Requesting NAT redirection for port %u...\n", |
85 | PORT); | ||
80 | mini = GNUNET_NAT_mini_map_start (PORT, GNUNET_YES /* tcp */ , | 86 | mini = GNUNET_NAT_mini_map_start (PORT, GNUNET_YES /* tcp */ , |
81 | &addr_callback, NULL); | 87 | &addr_callback, NULL); |
82 | if (NULL == mini) | 88 | if (NULL == mini) |