gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: notes for next steps with N


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: notes for next steps with NAT
Date: Sun, 25 Dec 2016 19:20:23 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 9ba4c1d  notes for next steps with NAT
9ba4c1d is described below

commit 9ba4c1d15e6bcb20c47dff1067ab76e86d7c0f8a
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Dec 25 19:20:16 2016 +0100

    notes for next steps with NAT
---
 src/nat/gnunet-nat-server.c  | 44 +++++++++++++++++++++++++++-----------------
 src/nat/gnunet-nat.c         |  8 ++++----
 src/nat/gnunet-service-nat.c |  3 ++-
 3 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/src/nat/gnunet-nat-server.c b/src/nat/gnunet-nat-server.c
index 6722dee..1692a8e 100644
--- a/src/nat/gnunet-nat-server.c
+++ b/src/nat/gnunet-nat-server.c
@@ -42,8 +42,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 
 /**
- * Try contacting the peer using autonomous
- * NAT traveral method.
+ * Try contacting the peer using autonomous NAT traveral method.
  *
  * @param dst_ipv4 IPv4 address to send the fake ICMP message
  * @param dport destination port to include in ICMP message
@@ -78,7 +77,7 @@ try_anat (uint32_t dst_ipv4,
 
 
 /**
- * Closure for 'tcp_send'.
+ * Closure for #tcp_send.
  */
 struct TcpContext
 {
@@ -98,7 +97,7 @@ struct TcpContext
  * Task called by the scheduler once we can do the TCP send
  * (or once we failed to connect...).
  *
- * @param cls the 'struct TcpContext'
+ * @param cls the `struct TcpContext`
  */
 static void
 tcp_send (void *cls)
@@ -182,7 +181,7 @@ try_send_tcp (uint32_t dst_ipv4,
 
 /**
  * Try to send @a data to the
- * IP @a dst_ipv4' at port @a dport via UDP.
+ * IP @a dst_ipv4 at port @a dport via UDP.
  *
  * @param dst_ipv4 target IP
  * @param dport target port
@@ -313,12 +312,13 @@ run (void *cls,
   };
 
   cfg = c;
-  if ((args[0] == NULL) || (1 != SSCANF (args[0], "%u", &port)) || (0 == port)
-      || (65536 <= port))
+  if ( (NULL == args[0]) ||
+       (1 != SSCANF (args[0], "%u", &port)) ||
+       (0 == port) ||
+       (65536 <= port) )
   {
     FPRINTF (stderr,
-             _
-             ("Please pass valid port number as the first argument! (got 
`%s')\n"),
+             _("Please pass valid port number as the first argument! (got 
`%s')\n"),
              args[0]);
     return;
   }
@@ -332,10 +332,14 @@ run (void *cls,
   in4.sin_len = sizeof (in4);
   in6.sin6_len = sizeof (in6);
 #endif
-  server =
-      GNUNET_SERVER_create (NULL, NULL, (struct sockaddr * const *) sa, slen,
-                            GNUNET_TIME_UNIT_SECONDS, GNUNET_YES);
-  GNUNET_SERVER_add_handlers (server, handlers);
+  server = GNUNET_SERVER_create (NULL,
+                                NULL,
+                                (struct sockaddr * const *) sa,
+                                slen,
+                                GNUNET_TIME_UNIT_SECONDS,
+                                GNUNET_YES);
+  GNUNET_SERVER_add_handlers (server,
+                             handlers);
   GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
                                 NULL);
 }
@@ -355,13 +359,19 @@ main (int argc, char *const argv[])
     GNUNET_GETOPT_OPTION_END
   };
 
-  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
+  if (GNUNET_OK !=
+      GNUNET_STRINGS_get_utf8_args (argc, argv,
+                                   &argc, &argv))
     return 2;
 
   if (GNUNET_OK !=
-      GNUNET_PROGRAM_run (argc, argv, "gnunet-nat-server [options] PORT",
-                          _("GNUnet NAT traversal test helper daemon"), 
options,
-                          &run, NULL))
+      GNUNET_PROGRAM_run (argc,
+                         argv,
+                         "gnunet-nat-server [options] PORT",
+                          _("GNUnet NAT traversal test helper daemon"),
+                         options,
+                          &run,
+                         NULL))
   {
     GNUNET_free ((void*) argv);
     return 1;
diff --git a/src/nat/gnunet-nat.c b/src/nat/gnunet-nat.c
index d04a933..4d0ed57 100644
--- a/src/nat/gnunet-nat.c
+++ b/src/nat/gnunet-nat.c
@@ -459,7 +459,7 @@ run (void *cls,
   struct sockaddr_in extern_sa;
   struct sockaddr *local_sa;
   struct sockaddr *remote_sa;
-  size_t local_len;
+  socklen_t local_len;
   size_t remote_len;
 
   cfg_file = cfgfile;
@@ -527,9 +527,9 @@ run (void *cls,
   }
   if (NULL != local_addr)
   {
-    local_len = GNUNET_STRINGS_parse_socket_addr (local_addr,
-                                                 &af,
-                                                 &local_sa);
+    local_len = (socklen_t) GNUNET_STRINGS_parse_socket_addr (local_addr,
+                                                             &af,
+                                                             &local_sa);
     if (0 == local_len)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c
index 5b5a108..7621754 100644
--- a/src/nat/gnunet-service-nat.c
+++ b/src/nat/gnunet-service-nat.c
@@ -29,9 +29,10 @@
  *
  * TODO:
  * - test ICMP based NAT traversal
+ * - implement "more" autoconfig:
+ *   re-work gnunet-nat-server & integrate!
  * - implement & test STUN processing to classify NAT;
  *   basically, open port & try different methods.
- * - implement "more" autoconfig
  * - implement NEW logic for external IP detection
  */
 #include "platform.h"

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]