aboutsummaryrefslogtreecommitdiff
path: root/src/nat-auto
diff options
context:
space:
mode:
Diffstat (limited to 'src/nat-auto')
-rw-r--r--src/nat-auto/gnunet-nat-auto.c30
-rw-r--r--src/nat-auto/gnunet-nat-server.c6
-rw-r--r--src/nat-auto/gnunet-service-nat-auto.c8
-rw-r--r--src/nat-auto/nat-auto.h6
-rw-r--r--src/nat-auto/nat_auto_api.c43
-rw-r--r--src/nat-auto/nat_auto_api_test.c38
6 files changed, 65 insertions, 66 deletions
diff --git a/src/nat-auto/gnunet-nat-auto.c b/src/nat-auto/gnunet-nat-auto.c
index 3b9a5fa94..d411c6d75 100644
--- a/src/nat-auto/gnunet-nat-auto.c
+++ b/src/nat-auto/gnunet-nat-auto.c
@@ -37,7 +37,7 @@ static int global_ret;
37/** 37/**
38 * Handle to ongoing autoconfiguration. 38 * Handle to ongoing autoconfiguration.
39 */ 39 */
40static struct GNUNET_NAT_AutoHandle *ah; 40static struct GNUNET_NAT_AUTO_AutoHandle *ah;
41 41
42/** 42/**
43 * If we do auto-configuration, should we write the result 43 * If we do auto-configuration, should we write the result
@@ -75,7 +75,7 @@ static unsigned int do_auto;
75/** 75/**
76 * Handle to a NAT test operation. 76 * Handle to a NAT test operation.
77 */ 77 */
78static struct GNUNET_NAT_Test *nt; 78static struct GNUNET_NAT_AUTO_Test *nt;
79 79
80/** 80/**
81 * Flag set to 1 if we use IPPROTO_UDP. 81 * Flag set to 1 if we use IPPROTO_UDP.
@@ -178,7 +178,7 @@ auto_config_cb (void *cls,
178 178
179 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 179 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
180 "NAT status: %s/%s\n", 180 "NAT status: %s/%s\n",
181 GNUNET_NAT_status2string (result), 181 GNUNET_NAT_AUTO_status2string (result),
182 nat_type); 182 nat_type);
183 183
184 /* Shortcut: if there are no changes suggested, bail out early. */ 184 /* Shortcut: if there are no changes suggested, bail out early. */
@@ -256,7 +256,7 @@ test_report_cb (void *cls,
256{ 256{
257 nt = NULL; 257 nt = NULL;
258 PRINTF ("NAT test result: %s\n", 258 PRINTF ("NAT test result: %s\n",
259 GNUNET_NAT_status2string (result)); 259 GNUNET_NAT_AUTO_status2string (result));
260 test_finished (); 260 test_finished ();
261} 261}
262 262
@@ -271,12 +271,12 @@ do_shutdown (void *cls)
271{ 271{
272 if (NULL != ah) 272 if (NULL != ah)
273 { 273 {
274 GNUNET_NAT_autoconfig_cancel (ah); 274 GNUNET_NAT_AUTO_autoconfig_cancel (ah);
275 ah = NULL; 275 ah = NULL;
276 } 276 }
277 if (NULL != nt) 277 if (NULL != nt)
278 { 278 {
279 GNUNET_NAT_test_stop (nt); 279 GNUNET_NAT_AUTO_test_stop (nt);
280 nt = NULL; 280 nt = NULL;
281 } 281 }
282} 282}
@@ -307,7 +307,7 @@ run (void *cls,
307 307
308 if (do_auto) 308 if (do_auto)
309 { 309 {
310 ah = GNUNET_NAT_autoconfig_start (c, 310 ah = GNUNET_NAT_AUTO_autoconfig_start (c,
311 &auto_config_cb, 311 &auto_config_cb,
312 NULL); 312 NULL);
313 } 313 }
@@ -360,14 +360,14 @@ run (void *cls,
360 { 360 {
361 if (NULL == extern_addr) 361 if (NULL == extern_addr)
362 extern_sa = bind_sa; 362 extern_sa = bind_sa;
363 nt = GNUNET_NAT_test_start (c, 363 nt = GNUNET_NAT_AUTO_test_start (c,
364 proto, 364 proto,
365 bind_sa.sin_addr, 365 bind_sa.sin_addr,
366 ntohs (bind_sa.sin_port), 366 ntohs (bind_sa.sin_port),
367 extern_sa.sin_addr, 367 extern_sa.sin_addr,
368 ntohs (extern_sa.sin_port), 368 ntohs (extern_sa.sin_port),
369 &test_report_cb, 369 &test_report_cb,
370 NULL); 370 NULL);
371 } 371 }
372 test_finished (); 372 test_finished ();
373} 373}
diff --git a/src/nat-auto/gnunet-nat-server.c b/src/nat-auto/gnunet-nat-server.c
index 93352f5f0..d98a7a55e 100644
--- a/src/nat-auto/gnunet-nat-server.c
+++ b/src/nat-auto/gnunet-nat-server.c
@@ -240,12 +240,12 @@ test (void *cls,
240 struct GNUNET_SERVER_Client *client, 240 struct GNUNET_SERVER_Client *client,
241 const struct GNUNET_MessageHeader *msg) 241 const struct GNUNET_MessageHeader *msg)
242{ 242{
243 const struct GNUNET_NAT_TestMessage *tm; 243 const struct GNUNET_NAT_AUTO_TestMessage *tm;
244 uint16_t dport; 244 uint16_t dport;
245 245
246 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 246 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
247 "Received test request\n"); 247 "Received test request\n");
248 tm = (const struct GNUNET_NAT_TestMessage *) msg; 248 tm = (const struct GNUNET_NAT_AUTO_TestMessage *) msg;
249 dport = ntohs (tm->dport); 249 dport = ntohs (tm->dport);
250 if (0 == dport) 250 if (0 == dport)
251 try_anat (tm->dst_ipv4, 251 try_anat (tm->dst_ipv4,
@@ -293,7 +293,7 @@ run (void *cls,
293{ 293{
294 static const struct GNUNET_SERVER_MessageHandler handlers[] = { 294 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
295 {&test, NULL, GNUNET_MESSAGE_TYPE_NAT_TEST, 295 {&test, NULL, GNUNET_MESSAGE_TYPE_NAT_TEST,
296 sizeof (struct GNUNET_NAT_TestMessage)}, 296 sizeof (struct GNUNET_NAT_AUTO_TestMessage)},
297 {NULL, NULL, 0, 0} 297 {NULL, NULL, 0, 0}
298 }; 298 };
299 unsigned int port; 299 unsigned int port;
diff --git a/src/nat-auto/gnunet-service-nat-auto.c b/src/nat-auto/gnunet-service-nat-auto.c
index 897d6feb2..f4e1b09e4 100644
--- a/src/nat-auto/gnunet-service-nat-auto.c
+++ b/src/nat-auto/gnunet-service-nat-auto.c
@@ -170,7 +170,7 @@ static struct GNUNET_STATISTICS_Handle *stats;
170 */ 170 */
171static int 171static int
172check_autoconfig_request (void *cls, 172check_autoconfig_request (void *cls,
173 const struct GNUNET_NAT_AutoconfigRequestMessage *message) 173 const struct GNUNET_NAT_AUTO_AutoconfigRequestMessage *message)
174{ 174{
175 return GNUNET_OK; /* checked later */ 175 return GNUNET_OK; /* checked later */
176} 176}
@@ -203,7 +203,7 @@ conclude_autoconfig_request (void *cls)
203{ 203{
204 struct AutoconfigContext *ac = cls; 204 struct AutoconfigContext *ac = cls;
205 struct ClientHandle *ch = ac->ch; 205 struct ClientHandle *ch = ac->ch;
206 struct GNUNET_NAT_AutoconfigResultMessage *arm; 206 struct GNUNET_NAT_AUTO_AutoconfigResultMessage *arm;
207 struct GNUNET_MQ_Envelope *env; 207 struct GNUNET_MQ_Envelope *env;
208 size_t c_size; 208 size_t c_size;
209 char *buf; 209 char *buf;
@@ -295,7 +295,7 @@ update_enable_upnpc_option (struct AutoconfigContext *ac)
295 */ 295 */
296static void 296static void
297handle_autoconfig_request (void *cls, 297handle_autoconfig_request (void *cls,
298 const struct GNUNET_NAT_AutoconfigRequestMessage *message) 298 const struct GNUNET_NAT_AUTO_AutoconfigRequestMessage *message)
299{ 299{
300 struct ClientHandle *ch = cls; 300 struct ClientHandle *ch = cls;
301 size_t left = ntohs (message->header.size) - sizeof (*message); 301 size_t left = ntohs (message->header.size) - sizeof (*message);
@@ -458,7 +458,7 @@ GNUNET_SERVICE_MAIN
458 NULL, 458 NULL,
459 GNUNET_MQ_hd_var_size (autoconfig_request, 459 GNUNET_MQ_hd_var_size (autoconfig_request,
460 GNUNET_MESSAGE_TYPE_NAT_AUTO_REQUEST_CFG, 460 GNUNET_MESSAGE_TYPE_NAT_AUTO_REQUEST_CFG,
461 struct GNUNET_NAT_AutoconfigRequestMessage, 461 struct GNUNET_NAT_AUTO_AutoconfigRequestMessage,
462 NULL), 462 NULL),
463 GNUNET_MQ_handler_end ()); 463 GNUNET_MQ_handler_end ());
464 464
diff --git a/src/nat-auto/nat-auto.h b/src/nat-auto/nat-auto.h
index 150dc32c2..07b5a5b91 100644
--- a/src/nat-auto/nat-auto.h
+++ b/src/nat-auto/nat-auto.h
@@ -36,7 +36,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
36 * Request to test NAT traversal, sent to the gnunet-nat-server 36 * Request to test NAT traversal, sent to the gnunet-nat-server
37 * (not the service!). 37 * (not the service!).
38 */ 38 */
39struct GNUNET_NAT_TestMessage 39struct GNUNET_NAT_AUTO_TestMessage
40{ 40{
41 /** 41 /**
42 * Header with type #GNUNET_MESSAGE_TYPE_NAT_TEST 42 * Header with type #GNUNET_MESSAGE_TYPE_NAT_TEST
@@ -69,7 +69,7 @@ struct GNUNET_NAT_TestMessage
69/** 69/**
70 * Client requesting automatic configuration. 70 * Client requesting automatic configuration.
71 */ 71 */
72struct GNUNET_NAT_AutoconfigRequestMessage 72struct GNUNET_NAT_AUTO_AutoconfigRequestMessage
73{ 73{
74 /** 74 /**
75 * Header with type #GNUNET_MESSAGE_TYPE_NAT_REQUEST_AUTO_CFG 75 * Header with type #GNUNET_MESSAGE_TYPE_NAT_REQUEST_AUTO_CFG
@@ -84,7 +84,7 @@ struct GNUNET_NAT_AutoconfigRequestMessage
84/** 84/**
85 * Service responding with proposed configuration. 85 * Service responding with proposed configuration.
86 */ 86 */
87struct GNUNET_NAT_AutoconfigResultMessage 87struct GNUNET_NAT_AUTO_AutoconfigResultMessage
88{ 88{
89 /** 89 /**
90 * Header with type #GNUNET_MESSAGE_TYPE_NAT_AUTO_CFG_RESULT 90 * Header with type #GNUNET_MESSAGE_TYPE_NAT_AUTO_CFG_RESULT
diff --git a/src/nat-auto/nat_auto_api.c b/src/nat-auto/nat_auto_api.c
index e6b0512c6..632561097 100644
--- a/src/nat-auto/nat_auto_api.c
+++ b/src/nat-auto/nat_auto_api.c
@@ -1,7 +1,6 @@
1
2/* 1/*
3 This file is part of GNUnet. 2 This file is part of GNUnet.
4 Copyright (C) 2007-2016 GNUnet e.V. 3 Copyright (C) 2007-2017 GNUnet e.V.
5 4
6 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -23,7 +22,7 @@
23 * @author Christian Grothoff 22 * @author Christian Grothoff
24 * @author Milan Bouchet-Valat 23 * @author Milan Bouchet-Valat
25 * 24 *
26 * @file nat/nat_auto_api.c 25 * @file nat-auto/nat_auto_api.c
27 * Routines for NAT auto configuration. 26 * Routines for NAT auto configuration.
28 */ 27 */
29#include "platform.h" 28#include "platform.h"
@@ -36,7 +35,7 @@
36/** 35/**
37 * Handle to auto-configuration in progress. 36 * Handle to auto-configuration in progress.
38 */ 37 */
39struct GNUNET_NAT_AutoHandle 38struct GNUNET_NAT_AUTO_AutoHandle
40{ 39{
41 40
42 /** 41 /**
@@ -52,7 +51,7 @@ struct GNUNET_NAT_AutoHandle
52 /** 51 /**
53 * Function called with the result from the autoconfiguration. 52 * Function called with the result from the autoconfiguration.
54 */ 53 */
55 GNUNET_NAT_AutoResultCallback arc; 54 GNUNET_NAT_AUTO_AutoResultCallback arc;
56 55
57 /** 56 /**
58 * Closure for @e arc. 57 * Closure for @e arc.
@@ -69,7 +68,7 @@ struct GNUNET_NAT_AutoHandle
69 * @return point to a static string containing the error code 68 * @return point to a static string containing the error code
70 */ 69 */
71const char * 70const char *
72GNUNET_NAT_status2string (enum GNUNET_NAT_StatusCode err) 71GNUNET_NAT_AUTO_status2string (enum GNUNET_NAT_StatusCode err)
73{ 72{
74 switch (err) 73 switch (err)
75 { 74 {
@@ -120,13 +119,13 @@ GNUNET_NAT_status2string (enum GNUNET_NAT_StatusCode err)
120/** 119/**
121 * Check result from autoconfiguration attempt. 120 * Check result from autoconfiguration attempt.
122 * 121 *
123 * @param cls the `struct GNUNET_NAT_AutoHandle` 122 * @param cls the `struct GNUNET_NAT_AUTO_AutoHandle`
124 * @param res the result 123 * @param res the result
125 * @return #GNUNET_OK if @a res is well-formed (always for now) 124 * @return #GNUNET_OK if @a res is well-formed (always for now)
126 */ 125 */
127static int 126static int
128check_auto_result (void *cls, 127check_auto_result (void *cls,
129 const struct GNUNET_NAT_AutoconfigResultMessage *res) 128 const struct GNUNET_NAT_AUTO_AutoconfigResultMessage *res)
130{ 129{
131 return GNUNET_OK; 130 return GNUNET_OK;
132} 131}
@@ -135,14 +134,14 @@ check_auto_result (void *cls,
135/** 134/**
136 * Handle result from autoconfiguration attempt. 135 * Handle result from autoconfiguration attempt.
137 * 136 *
138 * @param cls the `struct GNUNET_NAT_AutoHandle` 137 * @param cls the `struct GNUNET_NAT_AUTO_AutoHandle`
139 * @param res the result 138 * @param res the result
140 */ 139 */
141static void 140static void
142handle_auto_result (void *cls, 141handle_auto_result (void *cls,
143 const struct GNUNET_NAT_AutoconfigResultMessage *res) 142 const struct GNUNET_NAT_AUTO_AutoconfigResultMessage *res)
144{ 143{
145 struct GNUNET_NAT_AutoHandle *ah = cls; 144 struct GNUNET_NAT_AUTO_AutoHandle *ah = cls;
146 size_t left; 145 size_t left;
147 struct GNUNET_CONFIGURATION_Handle *cfg; 146 struct GNUNET_CONFIGURATION_Handle *cfg;
148 enum GNUNET_NAT_Type type 147 enum GNUNET_NAT_Type type
@@ -172,27 +171,27 @@ handle_auto_result (void *cls,
172 type); 171 type);
173 } 172 }
174 GNUNET_CONFIGURATION_destroy (cfg); 173 GNUNET_CONFIGURATION_destroy (cfg);
175 GNUNET_NAT_autoconfig_cancel (ah); 174 GNUNET_NAT_AUTO_autoconfig_cancel (ah);
176} 175}
177 176
178 177
179/** 178/**
180 * Handle queue errors by reporting autoconfiguration failure. 179 * Handle queue errors by reporting autoconfiguration failure.
181 * 180 *
182 * @param cls the `struct GNUNET_NAT_AutoHandle *` 181 * @param cls the `struct GNUNET_NAT_AUTO_AutoHandle *`
183 * @param error details about the error 182 * @param error details about the error
184 */ 183 */
185static void 184static void
186ah_error_handler (void *cls, 185ah_error_handler (void *cls,
187 enum GNUNET_MQ_Error error) 186 enum GNUNET_MQ_Error error)
188{ 187{
189 struct GNUNET_NAT_AutoHandle *ah = cls; 188 struct GNUNET_NAT_AUTO_AutoHandle *ah = cls;
190 189
191 ah->arc (ah->arc_cls, 190 ah->arc (ah->arc_cls,
192 NULL, 191 NULL,
193 GNUNET_NAT_ERROR_IPC_FAILURE, 192 GNUNET_NAT_ERROR_IPC_FAILURE,
194 GNUNET_NAT_TYPE_UNKNOWN); 193 GNUNET_NAT_TYPE_UNKNOWN);
195 GNUNET_NAT_autoconfig_cancel (ah); 194 GNUNET_NAT_AUTO_autoconfig_cancel (ah);
196} 195}
197 196
198 197
@@ -205,21 +204,21 @@ ah_error_handler (void *cls,
205 * @param cb_cls closure for @a cb 204 * @param cb_cls closure for @a cb
206 * @return handle to cancel operation 205 * @return handle to cancel operation
207 */ 206 */
208struct GNUNET_NAT_AutoHandle * 207struct GNUNET_NAT_AUTO_AutoHandle *
209GNUNET_NAT_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, 208GNUNET_NAT_AUTO_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
210 GNUNET_NAT_AutoResultCallback cb, 209 GNUNET_NAT_AUTO_AutoResultCallback cb,
211 void *cb_cls) 210 void *cb_cls)
212{ 211{
213 struct GNUNET_NAT_AutoHandle *ah = GNUNET_new (struct GNUNET_NAT_AutoHandle); 212 struct GNUNET_NAT_AUTO_AutoHandle *ah = GNUNET_new (struct GNUNET_NAT_AUTO_AutoHandle);
214 struct GNUNET_MQ_MessageHandler handlers[] = { 213 struct GNUNET_MQ_MessageHandler handlers[] = {
215 GNUNET_MQ_hd_var_size (auto_result, 214 GNUNET_MQ_hd_var_size (auto_result,
216 GNUNET_MESSAGE_TYPE_NAT_AUTO_CFG_RESULT, 215 GNUNET_MESSAGE_TYPE_NAT_AUTO_CFG_RESULT,
217 struct GNUNET_NAT_AutoconfigResultMessage, 216 struct GNUNET_NAT_AUTO_AutoconfigResultMessage,
218 ah), 217 ah),
219 GNUNET_MQ_handler_end () 218 GNUNET_MQ_handler_end ()
220 }; 219 };
221 struct GNUNET_MQ_Envelope *env; 220 struct GNUNET_MQ_Envelope *env;
222 struct GNUNET_NAT_AutoconfigRequestMessage *req; 221 struct GNUNET_NAT_AUTO_AutoconfigRequestMessage *req;
223 char *buf; 222 char *buf;
224 size_t size; 223 size_t size;
225 224
@@ -265,7 +264,7 @@ GNUNET_NAT_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
265 * @param ah handle for operation to abort 264 * @param ah handle for operation to abort
266 */ 265 */
267void 266void
268GNUNET_NAT_autoconfig_cancel (struct GNUNET_NAT_AutoHandle *ah) 267GNUNET_NAT_AUTO_autoconfig_cancel (struct GNUNET_NAT_AUTO_AutoHandle *ah)
269{ 268{
270 GNUNET_MQ_destroy (ah->mq); 269 GNUNET_MQ_destroy (ah->mq);
271 GNUNET_free (ah); 270 GNUNET_free (ah);
diff --git a/src/nat-auto/nat_auto_api_test.c b/src/nat-auto/nat_auto_api_test.c
index 056d2a2bf..df2d9fed3 100644
--- a/src/nat-auto/nat_auto_api_test.c
+++ b/src/nat-auto/nat_auto_api_test.c
@@ -54,7 +54,7 @@ struct NatActivity
54 /** 54 /**
55 * Handle of the master context. 55 * Handle of the master context.
56 */ 56 */
57 struct GNUNET_NAT_Test *h; 57 struct GNUNET_NAT_AUTO_Test *h;
58 58
59 /** 59 /**
60 * Task reading from the incoming connection. 60 * Task reading from the incoming connection.
@@ -86,7 +86,7 @@ struct ClientActivity
86 /** 86 /**
87 * Handle to overall NAT test. 87 * Handle to overall NAT test.
88 */ 88 */
89 struct GNUNET_NAT_Test *h; 89 struct GNUNET_NAT_AUTO_Test *h;
90 90
91}; 91};
92 92
@@ -94,7 +94,7 @@ struct ClientActivity
94/** 94/**
95 * Handle to a NAT test. 95 * Handle to a NAT test.
96 */ 96 */
97struct GNUNET_NAT_Test 97struct GNUNET_NAT_AUTO_Test
98{ 98{
99 99
100 /** 100 /**
@@ -187,7 +187,7 @@ reversal_cb (void *cls,
187 const struct sockaddr *addr, 187 const struct sockaddr *addr,
188 socklen_t addrlen) 188 socklen_t addrlen)
189{ 189{
190 struct GNUNET_NAT_Test *h = cls; 190 struct GNUNET_NAT_AUTO_Test *h = cls;
191 const struct sockaddr_in *sa; 191 const struct sockaddr_in *sa;
192 192
193 if (sizeof (struct sockaddr_in) != addrlen) 193 if (sizeof (struct sockaddr_in) != addrlen)
@@ -209,12 +209,12 @@ reversal_cb (void *cls,
209 * Activity on our incoming socket. Read data from the 209 * Activity on our incoming socket. Read data from the
210 * incoming connection. 210 * incoming connection.
211 * 211 *
212 * @param cls the `struct GNUNET_NAT_Test` 212 * @param cls the `struct GNUNET_NAT_AUTO_Test`
213 */ 213 */
214static void 214static void
215do_udp_read (void *cls) 215do_udp_read (void *cls)
216{ 216{
217 struct GNUNET_NAT_Test *tst = cls; 217 struct GNUNET_NAT_AUTO_Test *tst = cls;
218 uint16_t data; 218 uint16_t data;
219 const struct GNUNET_SCHEDULER_TaskContext *tc; 219 const struct GNUNET_SCHEDULER_TaskContext *tc;
220 220
@@ -255,7 +255,7 @@ static void
255do_read (void *cls) 255do_read (void *cls)
256{ 256{
257 struct NatActivity *na = cls; 257 struct NatActivity *na = cls;
258 struct GNUNET_NAT_Test *tst; 258 struct GNUNET_NAT_AUTO_Test *tst;
259 uint16_t data; 259 uint16_t data;
260 const struct GNUNET_SCHEDULER_TaskContext *tc; 260 const struct GNUNET_SCHEDULER_TaskContext *tc;
261 261
@@ -292,12 +292,12 @@ do_read (void *cls)
292 * Activity on our listen socket. Accept the 292 * Activity on our listen socket. Accept the
293 * incoming connection. 293 * incoming connection.
294 * 294 *
295 * @param cls the `struct GNUNET_NAT_Test` 295 * @param cls the `struct GNUNET_NAT_AUTO_Test`
296 */ 296 */
297static void 297static void
298do_accept (void *cls) 298do_accept (void *cls)
299{ 299{
300 struct GNUNET_NAT_Test *tst = cls; 300 struct GNUNET_NAT_AUTO_Test *tst = cls;
301 struct GNUNET_NETWORK_Handle *s; 301 struct GNUNET_NETWORK_Handle *s;
302 struct NatActivity *wl; 302 struct NatActivity *wl;
303 303
@@ -342,7 +342,7 @@ mq_error_handler (void *cls,
342 enum GNUNET_MQ_Error error) 342 enum GNUNET_MQ_Error error)
343{ 343{
344 struct ClientActivity *ca = cls; 344 struct ClientActivity *ca = cls;
345 struct GNUNET_NAT_Test *tst = ca->h; 345 struct GNUNET_NAT_AUTO_Test *tst = ca->h;
346 346
347 GNUNET_CONTAINER_DLL_remove (tst->ca_head, 347 GNUNET_CONTAINER_DLL_remove (tst->ca_head,
348 tst->ca_tail, 348 tst->ca_tail,
@@ -367,10 +367,10 @@ addr_cb (void *cls,
367 const struct sockaddr *addr, 367 const struct sockaddr *addr,
368 socklen_t addrlen) 368 socklen_t addrlen)
369{ 369{
370 struct GNUNET_NAT_Test *h = cls; 370 struct GNUNET_NAT_AUTO_Test *h = cls;
371 struct ClientActivity *ca; 371 struct ClientActivity *ca;
372 struct GNUNET_MQ_Envelope *env; 372 struct GNUNET_MQ_Envelope *env;
373 struct GNUNET_NAT_TestMessage *msg; 373 struct GNUNET_NAT_AUTO_TestMessage *msg;
374 const struct sockaddr_in *sa; 374 const struct sockaddr_in *sa;
375 375
376 if (GNUNET_YES != add_remove) 376 if (GNUNET_YES != add_remove)
@@ -428,7 +428,7 @@ addr_cb (void *cls,
428static void 428static void
429do_timeout (void *cls) 429do_timeout (void *cls)
430{ 430{
431 struct GNUNET_NAT_Test *nh = cls; 431 struct GNUNET_NAT_AUTO_Test *nh = cls;
432 432
433 nh->ttask = NULL; 433 nh->ttask = NULL;
434 nh->report (nh->report_cls, 434 nh->report (nh->report_cls,
@@ -453,8 +453,8 @@ do_timeout (void *cls)
453 * @param report_cls closure for @a report 453 * @param report_cls closure for @a report
454 * @return handle to cancel NAT test or NULL. The error is always indicated via the report callback 454 * @return handle to cancel NAT test or NULL. The error is always indicated via the report callback
455 */ 455 */
456struct GNUNET_NAT_Test * 456struct GNUNET_NAT_AUTO_Test *
457GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, 457GNUNET_NAT_AUTO_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
458 int is_tcp, 458 int is_tcp,
459 uint16_t bnd_port, 459 uint16_t bnd_port,
460 uint16_t adv_port, 460 uint16_t adv_port,
@@ -462,7 +462,7 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
462 GNUNET_NAT_TestCallback report, 462 GNUNET_NAT_TestCallback report,
463 void *report_cls) 463 void *report_cls)
464{ 464{
465 struct GNUNET_NAT_Test *nh; 465 struct GNUNET_NAT_AUTO_Test *nh;
466 struct sockaddr_in sa; 466 struct sockaddr_in sa;
467 const struct sockaddr *addrs[] = { 467 const struct sockaddr *addrs[] = {
468 (const struct sockaddr *) &sa 468 (const struct sockaddr *) &sa
@@ -478,7 +478,7 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
478 sa.sin_len = sizeof (sa); 478 sa.sin_len = sizeof (sa);
479#endif 479#endif
480 480
481 nh = GNUNET_new (struct GNUNET_NAT_Test); 481 nh = GNUNET_new (struct GNUNET_NAT_AUTO_Test);
482 nh->cfg = cfg; 482 nh->cfg = cfg;
483 nh->is_tcp = is_tcp; 483 nh->is_tcp = is_tcp;
484 nh->data = bnd_port; 484 nh->data = bnd_port;
@@ -594,7 +594,7 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
594 * @param tst test to stop. 594 * @param tst test to stop.
595 */ 595 */
596void 596void
597GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst) 597GNUNET_NAT_AUTO_test_stop (struct GNUNET_NAT_AUTO_Test *tst)
598{ 598{
599 struct NatActivity *pos; 599 struct NatActivity *pos;
600 struct ClientActivity *cpos; 600 struct ClientActivity *cpos;
@@ -641,4 +641,4 @@ GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst)
641 GNUNET_free (tst); 641 GNUNET_free (tst);
642} 642}
643 643
644/* end of nat_test.c */ 644/* end of nat_auto_api_test.c */