gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24721 - gnunet/src/exit


From: gnunet
Subject: [GNUnet-SVN] r24721 - gnunet/src/exit
Date: Mon, 5 Nov 2012 13:49:05 +0100

Author: grothoff
Date: 2012-11-05 13:49:05 +0100 (Mon, 05 Nov 2012)
New Revision: 24721

Modified:
   gnunet/src/exit/exit.conf
   gnunet/src/exit/gnunet-daemon-exit.c
Log:
-actually enable free regex specification, in binary for now

Modified: gnunet/src/exit/exit.conf
===================================================================
--- gnunet/src/exit/exit.conf   2012-11-05 12:26:23 UTC (rev 24720)
+++ gnunet/src/exit/exit.conf   2012-11-05 12:49:05 UTC (rev 24721)
@@ -16,7 +16,15 @@
 # Netmask for the IPv4 subnet on the TUN interface.
 IPV4MASK = 255.255.255.0
 
+# Regular expression matching IPv4 addresses in binary (32 values of 0 or 1) 
+# format for which this system is willing to serve as an exit.
+EXIT_RANGE_IPV4_REGEX = (0|1)*
 
+# Regular expression matching IPv4 addresses in binary (128 values of 0 or 1) 
+# format for which this system is willing to serve as an exit.
+EXIT_RANGE_IPV6_REGEX = (0|1)*
+
+
 # Name of the (virtual) tunnel interface the exit daemon will manage
 TUN_IFNAME = exit-gnunet
 

Modified: gnunet/src/exit/gnunet-daemon-exit.c
===================================================================
--- gnunet/src/exit/gnunet-daemon-exit.c        2012-11-05 12:26:23 UTC (rev 
24720)
+++ gnunet/src/exit/gnunet-daemon-exit.c        2012-11-05 12:49:05 UTC (rev 
24721)
@@ -3015,8 +3015,6 @@
   char *ipv4mask;
   char *binary;
   char *regex;
-  char ipv4regex[GNUNET_REGEX_IPV4_REGEXLEN];
-  char ipv6regex[GNUNET_REGEX_IPV6_REGEXLEN];
 
   binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit");
   if (GNUNET_YES !=
@@ -3208,29 +3206,21 @@
   }
 
   /* Mesh handle acquired, now announce regular expressions matching our exit 
*/
-  if (GNUNET_YES == ipv4_enabled && GNUNET_YES == ipv4_exit)
+  if ( (GNUNET_YES == ipv4_enabled) && (GNUNET_YES == ipv4_exit) )
   {
-    GNUNET_REGEX_ipv4toregex (&exit_ipv4addr, ipv4mask, ipv4regex);
-    GNUNET_asprintf (&regex, "%s%s%s",
-                     GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX,
-                     "4",
-                     ipv4regex);
-
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Announcing exit regex: %s\n", regex);
+    if (GNUNET_OK !=
+       GNUNET_CONFIGURATION_get_value_string (cfg, "exit", 
"EXIT_RANGE_IPV4_REGEX", &regex))
+      regex = GNUNET_strdup ("(0|1)*");
     GNUNET_MESH_announce_regex (mesh_handle, regex, REGEX_MAX_PATH_LEN_IPV4);
     GNUNET_free (regex);
   }
 
   if (GNUNET_YES == ipv6_enabled && GNUNET_YES == ipv6_exit)
   {
-    GNUNET_REGEX_ipv6toregex (&exit_ipv6addr, ipv6prefix, ipv6regex);
-    GNUNET_asprintf (&regex, "%s%s%s",
-                     GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX,
-                     "6",
-                     ipv6regex);
-
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Announcing exit regex: %s\n", regex);
-    GNUNET_MESH_announce_regex (mesh_handle, regex, REGEX_MAX_PATH_LEN_IPV4);
+    if (GNUNET_OK !=
+       GNUNET_CONFIGURATION_get_value_string (cfg, "exit", 
"EXIT_RANGE_IPV6_REGEX", &regex))
+      regex = GNUNET_strdup ("(0|1)*");
+    GNUNET_MESH_announce_regex (mesh_handle, regex, REGEX_MAX_PATH_LEN_IPV6);
     GNUNET_free (regex);
   }
 




reply via email to

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