diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-11-30 09:51:25 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-11-30 09:51:25 +0100 |
commit | 1466de299c038c5ef738271bd8040276f029e695 (patch) | |
tree | 50dfaa6cb9dadd31a1693aa3855686248161e6f4 /src/nat/gnunet-service-nat.c | |
parent | 738cbe38dec2f275994c822631bf3aba02a6e6d0 (diff) | |
download | gnunet-1466de299c038c5ef738271bd8040276f029e695.tar.gz gnunet-1466de299c038c5ef738271bd8040276f029e695.zip |
decided to keep NAT test logic in client library
Diffstat (limited to 'src/nat/gnunet-service-nat.c')
-rw-r--r-- | src/nat/gnunet-service-nat.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c index ffee6374e..1ae0ef2c0 100644 --- a/src/nat/gnunet-service-nat.c +++ b/src/nat/gnunet-service-nat.c | |||
@@ -26,6 +26,14 @@ | |||
26 | * The purpose of this service is to enable transports to | 26 | * The purpose of this service is to enable transports to |
27 | * traverse NAT routers, by providing traversal options and | 27 | * traverse NAT routers, by providing traversal options and |
28 | * knowledge about the local network topology. | 28 | * knowledge about the local network topology. |
29 | * | ||
30 | * TODO: | ||
31 | * - call GN_start_gnunet_nat_server_() if possible (i.e. | ||
32 | * when we find we have a non-global IPv4 address) | ||
33 | * - implement handle_test | ||
34 | * - implement autoconfig | ||
35 | * - implmeent UPnPC/PMP-based NAT traversal | ||
36 | * - implement NEW logic for external IP detection | ||
29 | */ | 37 | */ |
30 | #include "platform.h" | 38 | #include "platform.h" |
31 | #include <math.h> | 39 | #include <math.h> |
@@ -507,33 +515,14 @@ handle_request_connection_reversal (void *cls, | |||
507 | GNUNET_SERVICE_client_drop (ch->client); | 515 | GNUNET_SERVICE_client_drop (ch->client); |
508 | return; | 516 | return; |
509 | } | 517 | } |
510 | /* FIXME: actually run the logic! */ | 518 | /* FIXME: actually run the logic by |
519 | calling 'GN_request_connection_reversal()' */ | ||
511 | 520 | ||
512 | GNUNET_SERVICE_client_continue (ch->client); | 521 | GNUNET_SERVICE_client_continue (ch->client); |
513 | } | 522 | } |
514 | 523 | ||
515 | 524 | ||
516 | /** | 525 | /** |
517 | * Handler for #GNUNET_MESSAGE_TYPE_NAT_REQUEST_TEST message from | ||
518 | * client. | ||
519 | * | ||
520 | * @param cls client who sent the message | ||
521 | * @param message the message received | ||
522 | */ | ||
523 | static void | ||
524 | handle_test (void *cls, | ||
525 | const struct GNUNET_NAT_RequestTestMessage *message) | ||
526 | { | ||
527 | struct ClientHandle *ch = cls; | ||
528 | |||
529 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
530 | "Received REQUEST_TEST message from client\n"); | ||
531 | /* FIXME: actually process test request */ | ||
532 | GNUNET_SERVICE_client_continue (ch->client); | ||
533 | } | ||
534 | |||
535 | |||
536 | /** | ||
537 | * Check validity of #GNUNET_MESSAGE_TYPE_NAT_REQUEST_AUTO_CFG message | 526 | * Check validity of #GNUNET_MESSAGE_TYPE_NAT_REQUEST_AUTO_CFG message |
538 | * from client. | 527 | * from client. |
539 | * | 528 | * |
@@ -1071,10 +1060,6 @@ GNUNET_SERVICE_MAIN | |||
1071 | GNUNET_MESSAGE_TYPE_NAT_REQUEST_CONNECTION_REVERSAL, | 1060 | GNUNET_MESSAGE_TYPE_NAT_REQUEST_CONNECTION_REVERSAL, |
1072 | struct GNUNET_NAT_RequestConnectionReversalMessage, | 1061 | struct GNUNET_NAT_RequestConnectionReversalMessage, |
1073 | NULL), | 1062 | NULL), |
1074 | GNUNET_MQ_hd_fixed_size (test, | ||
1075 | GNUNET_MESSAGE_TYPE_NAT_REQUEST_TEST, | ||
1076 | struct GNUNET_NAT_RequestTestMessage, | ||
1077 | NULL), | ||
1078 | GNUNET_MQ_hd_var_size (autoconfig_request, | 1063 | GNUNET_MQ_hd_var_size (autoconfig_request, |
1079 | GNUNET_MESSAGE_TYPE_NAT_REQUEST_AUTO_CFG, | 1064 | GNUNET_MESSAGE_TYPE_NAT_REQUEST_AUTO_CFG, |
1080 | struct GNUNET_NAT_AutoconfigRequestMessage, | 1065 | struct GNUNET_NAT_AutoconfigRequestMessage, |