aboutsummaryrefslogtreecommitdiff
path: root/src/nat/test_nat.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-06 15:01:44 +0000
committerChristian Grothoff <christian@grothoff.org>2016-05-06 15:01:44 +0000
commit221996eb735384bb5478819e4358d2c648a16d7b (patch)
treefa8049781525b35c0689ddaf89792e60416bcff7 /src/nat/test_nat.c
parent34aad61f423d2f6078ecfe51cb7a650fe528ab96 (diff)
downloadgnunet-221996eb735384bb5478819e4358d2c648a16d7b.tar.gz
gnunet-221996eb735384bb5478819e4358d2c648a16d7b.zip
fix compiler warnings
Diffstat (limited to 'src/nat/test_nat.c')
-rw-r--r--src/nat/test_nat.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/nat/test_nat.c b/src/nat/test_nat.c
index fd67473ee..3205e1f05 100644
--- a/src/nat/test_nat.c
+++ b/src/nat/test_nat.c
@@ -54,9 +54,11 @@ static void
54addr_callback (void *cls, int add_remove, const struct sockaddr *addr, 54addr_callback (void *cls, int add_remove, const struct sockaddr *addr,
55 socklen_t addrlen) 55 socklen_t addrlen)
56{ 56{
57 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Address changed: %s `%s' (%u bytes)\n", 57 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
58 add_remove == GNUNET_YES ? "added" : "removed", GNUNET_a2s (addr, 58 "Address changed: %s `%s' (%u bytes)\n",
59 addrlen), 59 add_remove == GNUNET_YES ? "added" : "removed",
60 GNUNET_a2s (addr,
61 addrlen),
60 (unsigned int) addrlen); 62 (unsigned int) addrlen);
61} 63}
62 64
@@ -90,13 +92,17 @@ struct addr_cls
90 * @param name name of the interface 92 * @param name name of the interface
91 * @param isDefault do we think this may be our default interface 93 * @param isDefault do we think this may be our default interface
92 * @param addr address of the interface 94 * @param addr address of the interface
93 * @param addrlen number of bytes in addr 95 * @param addrlen number of bytes in @a addr
94 * @return GNUNET_OK to continue iterating 96 * @return #GNUNET_OK to continue iterating
95 */ 97 */
96static int 98static int
97process_if (void *cls, const char *name, int isDefault, 99process_if (void *cls,
98 const struct sockaddr *addr, const struct sockaddr *broadcast_addr, 100 const char *name,
99 const struct sockaddr *netmask, socklen_t addrlen) 101 int isDefault,
102 const struct sockaddr *addr,
103 const struct sockaddr *broadcast_addr,
104 const struct sockaddr *netmask,
105 socklen_t addrlen)
100{ 106{
101 struct addr_cls *data = cls; 107 struct addr_cls *data = cls;
102 108
@@ -116,7 +122,9 @@ process_if (void *cls, const char *name, int isDefault,
116 * Main function run with scheduler. 122 * Main function run with scheduler.
117 */ 123 */
118static void 124static void
119run (void *cls, char *const *args, const char *cfgfile, 125run (void *cls,
126 char *const *args,
127 const char *cfgfile,
120 const struct GNUNET_CONFIGURATION_Handle *cfg) 128 const struct GNUNET_CONFIGURATION_Handle *cfg)
121{ 129{
122 struct GNUNET_NAT_Handle *nat; 130 struct GNUNET_NAT_Handle *nat;
@@ -167,8 +175,15 @@ main (int argc, char *const argv[])
167 "WARNING", 175 "WARNING",
168 NULL); 176 NULL);
169 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 177 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
170 "Testing NAT library, timeout set to %d seconds\n", TIMEOUT); 178 "Testing NAT library, timeout set to %s\n",
171 GNUNET_PROGRAM_run (3, argv_prog, "test-nat", "nohelp", options, &run, NULL); 179 GNUNET_STRINGS_relative_time_to_string (TIMEOUT,
180 GNUNET_YES));
181 GNUNET_PROGRAM_run (3,
182 argv_prog,
183 "test-nat",
184 "nohelp",
185 options,
186 &run, NULL);
172 return 0; 187 return 0;
173} 188}
174 189