gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r27498 - in gnunet/src: . include mesh regex tun vpn


From: gnunet
Subject: [GNUnet-SVN] r27498 - in gnunet/src: . include mesh regex tun vpn
Date: Thu, 20 Jun 2013 10:32:50 +0200

Author: grothoff
Date: 2013-06-20 10:32:50 +0200 (Thu, 20 Jun 2013)
New Revision: 27498

Added:
   gnunet/src/regex/regex_internal_lib.h
   gnunet/src/tun/test_regex.c
Removed:
   gnunet/src/include/gnunet_regex_lib.h
   gnunet/src/regex/test_regex_iptoregex.c
Modified:
   gnunet/src/Makefile.am
   gnunet/src/include/Makefile.am
   gnunet/src/include/gnunet_tun_lib.h
   gnunet/src/mesh/Makefile.am
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/regex/Makefile.am
   gnunet/src/regex/gnunet-daemon-regexprofiler.c
   gnunet/src/regex/gnunet-regex-profiler.c
   gnunet/src/regex/gnunet-regex-simulation-profiler.c
   gnunet/src/regex/gnunet-service-regex.c
   gnunet/src/regex/perf-regex.c
   gnunet/src/regex/plugin_block_regex.c
   gnunet/src/regex/regex.c
   gnunet/src/regex/regex_block_lib.c
   gnunet/src/regex/regex_block_lib.h
   gnunet/src/regex/regex_dht.c
   gnunet/src/regex/regex_graph.c
   gnunet/src/regex/regex_internal.h
   gnunet/src/regex/regex_random.c
   gnunet/src/regex/regex_test_lib.c
   gnunet/src/regex/regex_test_lib.h
   gnunet/src/regex/test_regex_eval_api.c
   gnunet/src/regex/test_regex_graph_api.c
   gnunet/src/regex/test_regex_iterate_api.c
   gnunet/src/regex/test_regex_proofs.c
   gnunet/src/tun/Makefile.am
   gnunet/src/vpn/gnunet-service-vpn.c
Log:
continuing refactoring of regex library structure, disambiguating symbol names 
between old regex library which is now internal and the public API; moving 
IP-to-regex conversion functions to tun library, as only vpn is using those to 
begin with

Modified: gnunet/src/Makefile.am
===================================================================
--- gnunet/src/Makefile.am      2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/Makefile.am      2013-06-20 08:32:50 UTC (rev 27498)
@@ -64,7 +64,7 @@
   regex \
   mesh \
   lockmanager \
-  stream \ 
+  stream \
   fs \
   $(LINUX_DIR) \
   $(MINGW_DIR) \

Modified: gnunet/src/include/Makefile.am
===================================================================
--- gnunet/src/include/Makefile.am      2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/include/Makefile.am      2013-06-20 08:32:50 UTC (rev 27498)
@@ -69,7 +69,6 @@
   gnunet_program_lib.h \
   gnunet_protocols.h \
   gnunet_resolver_service.h \
-  gnunet_regex_lib.h \
   gnunet_regex_service.h \
   gnunet_scheduler_lib.h \
   gnunet_server_lib.h \

Deleted: gnunet/src/include/gnunet_regex_lib.h
===================================================================
--- gnunet/src/include/gnunet_regex_lib.h       2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/include/gnunet_regex_lib.h       2013-06-20 08:32:50 UTC (rev 
27498)
@@ -1,362 +0,0 @@
-/*
-     This file is part of GNUnet
-     (C) 2012 Christian Grothoff (and other contributing authors)
-
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 3, or (at your
-     option) any later version.
-
-     GNUnet is distributed in the hope that it will be useful, but
-     WITHOUT ANY WARRANTY; without even the implied warranty of
-     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     General Public License for more details.
-
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
-*/
-/**
- * @file include/gnunet_regex_lib.h
- * @brief library to parse regular expressions into dfa
- * @author Maximilian Szengel
- *
- */
-
-#ifndef GNUNET_REGEX_LIB_H
-#define GNUNET_REGEX_LIB_H
-
-#include "gnunet_util_lib.h"
-#include "gnunet_dht_service.h"
-#include "gnunet_statistics_service.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#if 0                           /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
-
-/**
- * Constant for how many bytes the initial string regex should have.
- */
-#define GNUNET_REGEX_INITIAL_BYTES 24
-
-
-/**
- * Maximum regex string length for use with GNUNET_REGEX_ipv4toregex
- */
-#define GNUNET_REGEX_IPV4_REGEXLEN 32 + 6
-
-
-/**
- * Maximum regex string length for use with GNUNET_REGEX_ipv6toregex
- */
-#define GNUNET_REGEX_IPV6_REGEXLEN 128 + 6
-
-
-/**
- * Automaton (NFA/DFA) representation.
- */
-struct GNUNET_REGEX_Automaton;
-
-
-/**
- * Edge representation.
- */
-struct GNUNET_REGEX_Edge
-{
-  /**
-   * Label of the edge.  FIXME: might want to not consume exactly multiples of 
8 bits, need length?
-   */
-  const char *label;
-
-  /**
-   * Destionation of the edge.
-   */
-  struct GNUNET_HashCode destination;
-};
-
-
-/**
- * Construct DFA for the given 'regex' of length 'len'.
- *
- * Path compression means, that for example a DFA o -> a -> b -> c -> o will be
- * compressed to o -> abc -> o. Note that this parameter influences the
- * non-determinism of states of the resulting NFA in the DHT (number of 
outgoing
- * edges with the same label). For example for an application that stores IPv4
- * addresses as bitstrings it could make sense to limit the path compression to
- * 4 or 8.
- *
- * @param regex regular expression string.
- * @param len length of the regular expression.
- * @param max_path_len limit the path compression length to the
- *        given value. If set to 1, no path compression is applied. Set to 0 
for
- *        maximal possible path compression (generally not desireable).
- * @return DFA, needs to be freed using GNUNET_REGEX_automaton_destroy.
- */
-struct GNUNET_REGEX_Automaton *
-GNUNET_REGEX_construct_dfa (const char *regex, const size_t len,
-                            unsigned int max_path_len);
-
-
-/**
- * Free the memory allocated by constructing the GNUNET_REGEX_Automaton.
- * data structure.
- *
- * @param a automaton to be destroyed.
- */
-void
-GNUNET_REGEX_automaton_destroy (struct GNUNET_REGEX_Automaton *a);
-
-
-/**
- * Options for graph creation function
- * GNUNET_REGEX_automaton_save_graph.
- */
-enum GNUNET_REGEX_GraphSavingOptions
-{
-  /**
-   * Default. Do nothing special.
-   */
-  GNUNET_REGEX_GRAPH_DEFAULT = 0,
-
-  /**
-   * The generated graph will include extra information such as the NFA states
-   * that were used to generate the DFA state.
-   */
-  GNUNET_REGEX_GRAPH_VERBOSE = 1,
-
-  /**
-   * Enable graph coloring. Will color each SCC in a different color.
-   */
-  GNUNET_REGEX_GRAPH_COLORING = 2
-};
-
-
-/**
- * Save the given automaton as a GraphViz dot file.
- *
- * @param a the automaton to be saved.
- * @param filename where to save the file.
- * @param options options for graph generation that include coloring or verbose
- *                mode
- */
-void
-GNUNET_REGEX_automaton_save_graph (struct GNUNET_REGEX_Automaton *a,
-                                   const char *filename,
-                                   enum GNUNET_REGEX_GraphSavingOptions 
options);
-
-
-/**
- * Evaluates the given 'string' against the given compiled regex.
- *
- * @param a automaton.
- * @param string string to check.
- *
- * @return 0 if string matches, non 0 otherwise.
- */
-int
-GNUNET_REGEX_eval (struct GNUNET_REGEX_Automaton *a,
-                   const char *string);
-
-
-/**
- * Get the first key for the given 'input_string'. This hashes
- * the first x bits of the 'input_string'.
- *
- * @param input_string string.
- * @param string_len length of the 'input_string'.
- * @param key pointer to where to write the hash code.
- *
- * @return number of bits of 'input_string' that have been consumed
- *         to construct the key
- */
-size_t
-GNUNET_REGEX_get_first_key (const char *input_string, size_t string_len,
-                            struct GNUNET_HashCode * key);
-
-
-/**
- * Check if the given 'proof' matches the given 'key'.
- *
- * @param proof partial regex of a state.
- * @param key hash of a state.
- *
- * @return GNUNET_OK if the proof is valid for the given key.
- */
-int
-GNUNET_REGEX_check_proof (const char *proof,
-                          const struct GNUNET_HashCode *key);
-
-
-/**
- * Iterator callback function.
- *
- * @param cls closure.
- * @param key hash for current state.
- * @param proof proof for current state.
- * @param accepting GNUNET_YES if this is an accepting state, GNUNET_NO if not.
- * @param num_edges number of edges leaving current state.
- * @param edges edges leaving current state.
- */
-typedef void (*GNUNET_REGEX_KeyIterator)(void *cls,
-                                         const struct GNUNET_HashCode *key,
-                                         const char *proof,
-                                         int accepting,
-                                         unsigned int num_edges,
-                                         const struct GNUNET_REGEX_Edge 
*edges);
-
-
-/**
- * Iterate over all edges starting from start state of automaton 'a'. Calling
- * iterator for each edge.
- *
- * @param a automaton.
- * @param iterator iterator called for each edge.
- * @param iterator_cls closure.
- */
-void
-GNUNET_REGEX_iterate_all_edges (struct GNUNET_REGEX_Automaton *a,
-                                GNUNET_REGEX_KeyIterator iterator,
-                                void *iterator_cls);
-
-
-/**
- * Create a regex in 'rxstr' from the given 'ip' and 'netmask'.
- *
- * @param ip IPv4 representation.
- * @param netmask netmask for the ip.
- * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV4_REGEXLEN
- *              bytes long.
- */
-void
-GNUNET_REGEX_ipv4toregex (const struct in_addr *ip, const char *netmask,
-                          char *rxstr);
-
-
-/**
- * Create a regex in 'rxstr' from the given 'ipv6' and 'prefixlen'.
- *
- * @param ipv6 IPv6 representation.
- * @param prefixlen length of the ipv6 prefix.
- * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV6_REGEXLEN
- *              bytes long.
- */
-void
-GNUNET_REGEX_ipv6toregex (const struct in6_addr *ipv6,
-                          unsigned int prefixlen, char *rxstr);
-
-
-
-/**
- * Handle to store cached data about a regex announce.
- */
-struct GNUNET_REGEX_announce_handle;
-
-/**
- * Handle to store data about a regex search.
- */
-struct GNUNET_REGEX_search_handle;
-
-/**
- * Announce a regular expression: put all states of the automaton in the DHT.
- * Does not free resources, must call GNUNET_REGEX_announce_cancel for that.
- * 
- * @param dht An existing and valid DHT service handle. CANNOT be NULL.
- * @param id ID to announce as provider of regex. Own ID in most cases.
- * @param regex Regular expression to announce.
- * @param compression How many characters per edge can we squeeze?
- * @param stats Optional statistics handle to report usage. Can be NULL.
- * 
- * @return Handle to reuse o free cached resources.
- *         Must be freed by calling GNUNET_REGEX_announce_cancel.
- */
-struct GNUNET_REGEX_announce_handle *
-GNUNET_REGEX_announce (struct GNUNET_DHT_Handle *dht,
-                       const struct GNUNET_PeerIdentity *id,
-                       const char *regex,
-                       uint16_t compression,
-                       struct GNUNET_STATISTICS_Handle *stats);
-
-/**
- * Announce again a regular expression previously announced.
- * Does use caching to speed up process.
- * 
- * @param h Handle returned by a previous GNUNET_REGEX_announce call.
- */
-void
-GNUNET_REGEX_reannounce (struct GNUNET_REGEX_announce_handle *h);
-
-
-/**
- * Clear all cached data used by a regex announce.
- * Does not close DHT connection.
- * 
- * @param h Handle returned by a previous GNUNET_REGEX_announce call.
- */
-void
-GNUNET_REGEX_announce_cancel (struct GNUNET_REGEX_announce_handle *h);
-
-
-/**
- * Search callback function.
- *
- * @param cls Closure provided in GNUNET_REGEX_search.
- * @param id Peer providing a regex that matches the string.
- * @param get_path Path of the get request.
- * @param get_path_length Lenght of get_path.
- * @param put_path Path of the put request.
- * @param put_path_length Length of the put_path.
- */
-typedef void (*GNUNET_REGEX_Found)(void *cls,
-                                   const struct GNUNET_PeerIdentity *id,
-                                   const struct GNUNET_PeerIdentity *get_path,
-                                   unsigned int get_path_length,
-                                   const struct GNUNET_PeerIdentity *put_path,
-                                   unsigned int put_path_length);
-
-
-/**
- * Search for a peer offering a regex matching certain string in the DHT.
- * The search runs until GNUNET_REGEX_search_cancel is called, even if results
- * are returned.
- *
- * @param dht An existing and valid DHT service handle.
- * @param string String to match against the regexes in the DHT.
- * @param callback Callback for found peers.
- * @param callback_cls Closure for @c callback.
- * @param stats Optional statistics handle to report usage. Can be NULL.
- * 
- * @return Handle to stop search and free resources.
- *         Must be freed by calling GNUNET_REGEX_search_cancel.
- */
-struct GNUNET_REGEX_search_handle *
-GNUNET_REGEX_search (struct GNUNET_DHT_Handle *dht,
-                     const char *string,
-                     GNUNET_REGEX_Found callback,
-                     void *callback_cls,
-                     struct GNUNET_STATISTICS_Handle *stats);
-
-/**
- * Stop search and free all data used by a GNUNET_REGEX_search call.
- * Does not close DHT connection.
- * 
- * @param h Handle returned by a previous GNUNET_REGEX_search call.
- */
-void
-GNUNET_REGEX_search_cancel (struct GNUNET_REGEX_search_handle *h);
-
-
-#if 0                           /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-/* end of gnunet_regex_lib.h */
-#endif

Modified: gnunet/src/include/gnunet_tun_lib.h
===================================================================
--- gnunet/src/include/gnunet_tun_lib.h 2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/include/gnunet_tun_lib.h 2013-06-20 08:32:50 UTC (rev 27498)
@@ -46,6 +46,18 @@
 #endif
 
 
+/**
+ * Maximum regex string length for use with GNUNET_TUN_ipv4toregex
+ */
+#define GNUNET_TUN_IPV4_REGEXLEN 32 + 6
+
+
+/**
+ * Maximum regex string length for use with GNUNET_TUN_ipv6toregex
+ */
+#define GNUNET_TUN_IPV6_REGEXLEN 128 + 6
+
+
 GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
@@ -417,4 +429,31 @@
                                    uint16_t payload_length);
 
 
+/**
+ * Create a regex in 'rxstr' from the given 'ip' and 'netmask'.
+ *
+ * @param ip IPv4 representation.
+ * @param netmask netmask for the ip.
+ * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV4_REGEXLEN
+ *              bytes long.
+ */
+void
+GNUNET_TUN_ipv4toregex (const struct in_addr *ip, const char *netmask,
+                       char *rxstr);
+
+
+/**
+ * Create a regex in 'rxstr' from the given 'ipv6' and 'prefixlen'.
+ *
+ * @param ipv6 IPv6 representation.
+ * @param prefixlen length of the ipv6 prefix.
+ * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV6_REGEXLEN
+ *              bytes long.
+ */
+void
+GNUNET_TUN_ipv6toregex (const struct in6_addr *ipv6,
+                       unsigned int prefixlen, char *rxstr);
+
+
+
 #endif

Modified: gnunet/src/mesh/Makefile.am
===================================================================
--- gnunet/src/mesh/Makefile.am 2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/mesh/Makefile.am 2013-06-20 08:32:50 UTC (rev 27498)
@@ -79,19 +79,19 @@
  mesh_common.c
 gnunet_service_mesh_CFLAGS = $(AM_CFLAGS)
 gnunet_service_mesh_LDADD = \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/regex/libgnunetregexnew.la \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/core/libgnunetcore.la \
   $(top_builddir)/src/dht/libgnunetdht.la \
-  $(top_builddir)/src/statistics/libgnunetstatistics.la \
-  $(top_builddir)/src/block/libgnunetblock.la \
-  $(top_builddir)/src/regex/libgnunetregex.la
+  $(top_builddir)/src/block/libgnunetblock.la 
 gnunet_service_mesh_DEPENDENCIES = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/core/libgnunetcore.la \
   $(top_builddir)/src/dht/libgnunetdht.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/block/libgnunetblock.la \
-  $(top_builddir)/src/regex/libgnunetregex.la
+  $(top_builddir)/src/regex/libgnunetregexnew.la
 if LINUX
 gnunet_service_mesh_LDFLAGS = -lrt
 endif

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2013-06-20 08:32:50 UTC (rev 
27498)
@@ -52,7 +52,7 @@
 #include "block_mesh.h"
 #include "gnunet_dht_service.h"
 #include "gnunet_statistics_service.h"
-#include "gnunet_regex_lib.h"
+#include "gnunet_regex_service.h"
 
 #define MESH_BLOOM_SIZE         128
 
@@ -65,6 +65,7 @@
                                   GNUNET_TIME_UNIT_MINUTES,\
                                   10)
 
+
 #if MESH_DEBUG_CONNECTION
 #define DEBUG_CONN(...) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
 #else
@@ -198,7 +199,7 @@
     /**
      * Handle to announce the regex.
      */
-  struct GNUNET_REGEX_announce_handle *h;
+  struct GNUNET_REGEX_Announcement *h;
 };
 
 
@@ -221,7 +222,7 @@
     /**
      * Regex search handle.
      */
-  struct GNUNET_REGEX_search_handle *search_handle;
+  struct GNUNET_REGEX_Search *search_handle;
 
     /**
      * Peer that is connecting via connect_by_string. When connected, free ctx.
@@ -931,10 +932,10 @@
  */
 static struct GNUNET_CONTAINER_MultiHashMap *peers;
 
-/*
- * Handle to communicate with transport
+/**
+ * Configuration handle
  */
-// static struct GNUNET_TRANSPORT_Handle *transport_handle;
+static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 /**
  * Handle to communicate with core.
@@ -1388,17 +1389,12 @@
   if (NULL == regex->h)
   {
     DEBUG_REGEX ("  first put, creating DFA\n");
-    regex->h = GNUNET_REGEX_announce (dht_handle,
+    regex->h = GNUNET_REGEX_announce (cfg,
                                       &my_full_id,
                                       regex->regex,
-                                      regex->compression,
-                                      stats);
+                                     app_announce_time,
+                                      regex->compression);
   }
-  else
-  {
-    DEBUG_REGEX ("  not first put, using cached data\n");
-    GNUNET_REGEX_reannounce (regex->h);
-  }
   DEBUG_REGEX ("  regex_put (%s) end\n", regex->regex);
 }
 
@@ -6317,7 +6313,6 @@
     c = next;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "   done!\n");
-  return;
 }
 
 
@@ -7219,10 +7214,9 @@
 
   t->regex_search = info;
 
-  info->search_handle = GNUNET_REGEX_search (dht_handle,
+  info->search_handle = GNUNET_REGEX_search (cfg,
                                              info->description,
-                                             &regex_found_handler, info,
-                                             stats);
+                                             &regex_found_handler, info);
 
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connect by string processed\n");
@@ -8249,6 +8243,7 @@
 {
   char *keyfile;
 
+  cfg = c;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "starting to run\n");
   server_handle = server;
 

Modified: gnunet/src/regex/Makefile.am
===================================================================
--- gnunet/src/regex/Makefile.am        2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/Makefile.am        2013-06-20 08:32:50 UTC (rev 27498)
@@ -22,21 +22,24 @@
 
 gnunet_service_regex_SOURCES =  \
  gnunet-service-regex.c
-gnunet_service_regex_LDADD =  \
- $(top_builddir)/src/regex/libgnunetregex.la \
+gnunet_service_regex_LDADD =  -lm \
+ $(top_builddir)/src/regex/libgnunetregex_internal.a \
+ $(top_builddir)/src/regex/libgnunetregexblock.la \
  $(top_builddir)/src/dht/libgnunetdht.la \
  $(top_builddir)/src/statistics/libgnunetstatistics.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(GN_LIBINTL) 
 gnunet_service_regex_DEPENDENCIES = \
-  libgnunetregex.la
+  libgnunetregex_internal.a
 # todo: link files from libgnunetregex statically into gnunet_service_regex,
 # rename API prefix to avoid collision with 'libgnunetregexnew'...
 
+noinst_LIBRARIES = \
+  libgnunetregex_internal.a \
+  libgnunetregextest.a
 
 lib_LTLIBRARIES = \
   libgnunetregexblock.la \
-  libgnunetregex.la \
   libgnunetregexnew.la
 
 
@@ -50,20 +53,13 @@
   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
   -version-info 1:0:0
 
-libgnunetregex_la_SOURCES = \
+
+libgnunetregex_internal_a_SOURCES = \
   regex_internal.h regex.c \
   regex_graph.c regex_random.c \
   regex_dht.c
-libgnunetregex_la_LIBADD = -lm \
-  $(top_builddir)/src/util/libgnunetutil.la \
-  $(top_builddir)/src/dht/libgnunetdht.la \
-  $(top_builddir)/src/statistics/libgnunetstatistics.la \
-  $(top_builddir)/src/regex/libgnunetregexblock.la
-libgnunetregex_la_DEPENDENCIES = \
+libgnunetregex_internal_a_DEPENDENCIES = \
   libgnunetregexblock.la
-libgnunetregex_la_LDFLAGS = \
-  $(GN_LIB_LDFLAGS) \
-   -version-info 2:0:1
 
 
 libgnunetregexnew_la_SOURCES = \
@@ -75,8 +71,6 @@
    -version-info 3:0:0
 
 
-plugindir = $(libdir)/gnunet
-
 plugin_LTLIBRARIES = \
  libgnunet_plugin_block_regex.la
 
@@ -99,21 +93,19 @@
   gnunet-regex-simulation-profiler.c
 gnunet_regex_simulation_profiler_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
-  $(top_builddir)/src/regex/libgnunetregex.la \
+  $(top_builddir)/src/regex/libgnunetregex_internal.a \
   $(top_builddir)/src/mysql/libgnunetmysql.la
 gnunet_regex_simulation_profiler_DEPENDENCIES = \
-  libgnunetregex.la
+  libgnunetregex_internal.a
 endif
 
-noinst_LTLIBRARIES = libgnunetregextest.la
-
-libgnunetregextest_la_SOURCES = \
+libgnunetregextest_a_SOURCES = \
   regex_test_lib.c regex_test_lib.h
-libgnunetregextest_la_LIBADD = \
+libgnunetregextest_a_LIBADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/regex/libgnunetregex.la
-libgnunetregextest_la_DEPENDENCIES = \
-  libgnunetregex.la
+ $(top_builddir)/src/regex/libgnunetregex_internal.a
+libgnunetregextest_a_DEPENDENCIES = \
+  libgnunetregex_internal.a
 
 
 noinst_PROGRAMS = $(noinst_mysql_progs) \
@@ -123,43 +115,46 @@
 
 perf_regex_SOURCES = \
   perf-regex.c
-perf_regex_LDADD = \
+perf_regex_LDADD = -lm \
   $(top_builddir)/src/util/libgnunetutil.la \
-  $(top_builddir)/src/regex/libgnunetregex.la \
-  $(top_builddir)/src/regex/libgnunetregextest.la
+  $(top_builddir)/src/regex/libgnunetregex_internal.a \
+  $(top_builddir)/src/regex/libgnunetregexblock.la \
+  $(top_builddir)/src/regex/libgnunetregextest.a
 perf_regex_DEPENDENCIES = \
-  libgnunetregex.la \
-  libgnunetregextest.la
+  libgnunetregex_internal.a \
+  libgnunetregextest.a
 
 gnunet_regex_profiler_SOURCES = \
   gnunet-regex-profiler.c
-gnunet_regex_profiler_LDADD = \
+gnunet_regex_profiler_LDADD = -lm \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/arm/libgnunetarm.la \
   $(top_builddir)/src/dht/libgnunetdht.la \
   $(top_builddir)/src/testbed/libgnunettestbed.la \
-  $(top_builddir)/src/regex/libgnunetregex.la \
-  $(top_builddir)/src/regex/libgnunetregextest.la \
+  $(top_builddir)/src/regex/libgnunetregex_internal.a \
+  $(top_builddir)/src/regex/libgnunetregexblock.la \
+  $(top_builddir)/src/regex/libgnunetregextest.a \
   $(top_builddir)/src/statistics/libgnunetstatistics.la
 gnunet_regex_profiler_DEPENDENCIES = \
   $(top_builddir)/src/arm/libgnunetarm.la \
   $(top_builddir)/src/dht/libgnunetdht.la \
-  libgnunetregex.la \
-  libgnunetregextest.la
+  libgnunetregex_internal.a \
+  libgnunetregextest.a
 
 
 gnunet_daemon_regexprofiler_SOURCES = \
   gnunet-daemon-regexprofiler.c
-gnunet_daemon_regexprofiler_LDADD = \
+gnunet_daemon_regexprofiler_LDADD = -lm \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/dht/libgnunetdht.la \
-  $(top_builddir)/src/regex/libgnunetregex.la \
-  $(top_builddir)/src/regex/libgnunetregextest.la \
+  $(top_builddir)/src/regex/libgnunetregex_internal.a \
+  $(top_builddir)/src/regex/libgnunetregexblock.la \
+  $(top_builddir)/src/regex/libgnunetregextest.a \
   $(top_builddir)/src/statistics/libgnunetstatistics.la
 gnunet_daemon_regexprofiler_DEPENDENCIES = \
   $(top_builddir)/src/dht/libgnunetdht.la \
-  libgnunetregextest.la \
-  libgnunetregex.la
+  libgnunetregextest.a \
+  libgnunetregex_internal.a
 
 
 
@@ -167,8 +162,7 @@
   test_regex_eval_api \
   test_regex_iterate_api \
   test_regex_proofs \
-  test_regex_graph_api \
-  test_regex_iptoregex
+  test_regex_graph_api
 
 if ENABLE_TEST_RUN
  TESTS = $(check_PROGRAMS)
@@ -176,34 +170,32 @@
 
 test_regex_eval_api_SOURCES = \
   test_regex_eval_api.c
-test_regex_eval_api_LDADD = \
-  $(top_builddir)/src/regex/libgnunetregex.la \
+test_regex_eval_api_LDADD = -lm \
+  $(top_builddir)/src/regex/libgnunetregex_internal.a \
+  $(top_builddir)/src/regex/libgnunetregexblock.la \
   $(top_builddir)/src/util/libgnunetutil.la
 
 test_regex_iterate_api_SOURCES = \
   test_regex_iterate_api.c
-test_regex_iterate_api_LDADD = \
-  $(top_builddir)/src/regex/libgnunetregex.la \
+test_regex_iterate_api_LDADD = -lm \
+  $(top_builddir)/src/regex/libgnunetregex_internal.a \
+  $(top_builddir)/src/regex/libgnunetregexblock.la \
   $(top_builddir)/src/util/libgnunetutil.la
 
 test_regex_proofs_SOURCES = \
   test_regex_proofs.c
-test_regex_proofs_LDADD = \
-  $(top_builddir)/src/regex/libgnunetregex.la \
+test_regex_proofs_LDADD = -lm \
+  $(top_builddir)/src/regex/libgnunetregex_internal.a \
+  $(top_builddir)/src/regex/libgnunetregexblock.la \
   $(top_builddir)/src/util/libgnunetutil.la
 
 test_regex_graph_api_SOURCES = \
   test_regex_graph_api.c
-test_regex_graph_api_LDADD = \
-  $(top_builddir)/src/regex/libgnunetregex.la \
+test_regex_graph_api_LDADD = -lm \
+  $(top_builddir)/src/regex/libgnunetregex_internal.a \
+  $(top_builddir)/src/regex/libgnunetregexblock.la \
   $(top_builddir)/src/util/libgnunetutil.la
 
-test_regex_iptoregex_SOURCES = \
-  test_regex_iptoregex.c
-test_regex_iptoregex_LDADD = \
-  $(top_builddir)/src/util/libgnunetutil.la \
-  $(top_builddir)/src/regex/libgnunetregex.la
 
-
 EXTRA_DIST = \
   regex_simulation_profiler_test.conf

Modified: gnunet/src/regex/gnunet-daemon-regexprofiler.c
===================================================================
--- gnunet/src/regex/gnunet-daemon-regexprofiler.c      2013-06-19 17:49:39 UTC 
(rev 27497)
+++ gnunet/src/regex/gnunet-daemon-regexprofiler.c      2013-06-20 08:32:50 UTC 
(rev 27498)
@@ -29,7 +29,7 @@
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_test_lib.h"
 #include "gnunet_dht_service.h"
 #include "gnunet_statistics_service.h"
@@ -57,7 +57,7 @@
 /**
  * Peer's regex announce handle.
  */
-static struct GNUNET_REGEX_announce_handle *announce_handle;
+static struct REGEX_ITERNAL_Announcement *announce_handle;
 
 /**
  * Periodically reannounce regex.
@@ -109,7 +109,7 @@
 
   if (NULL != announce_handle)
   {
-    GNUNET_REGEX_announce_cancel (announce_handle);
+    REGEX_ITERNAL_announce_cancel (announce_handle);
     announce_handle = NULL;
   }
 
@@ -160,7 +160,7 @@
                 "First time, creating regex: %s\n",
                 regex);
     memset (&id, 0, sizeof (struct GNUNET_PeerIdentity));
-    announce_handle = GNUNET_REGEX_announce (dht_handle,
+    announce_handle = REGEX_ITERNAL_announce (dht_handle,
                                             &id,
                                             regex,
                                             (unsigned int) 
max_path_compression,
@@ -169,7 +169,7 @@
   else
   {
     GNUNET_assert (NULL != announce_handle);
-    GNUNET_REGEX_reannounce (announce_handle);
+    REGEX_ITERNAL_reannounce (announce_handle);
   }
 
   random_delay =
@@ -330,7 +330,7 @@
   /* Read regexes from policy files */
   GNUNET_assert (-1 != GNUNET_DISK_directory_scan (policy_dir, &scan,
                                                    (void *) (long) peer_id));
-  if (NULL == (components = GNUNET_REGEX_read_from_file (policy_filename)))
+  if (NULL == (components = REGEX_ITERNAL_read_from_file (policy_filename)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Policy file %s contains no policies. Exiting.\n",
@@ -339,8 +339,8 @@
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  regex = GNUNET_REGEX_combine (components);
-  GNUNET_REGEX_free_from_file (components);
+  regex = REGEX_ITERNAL_combine (components);
+  REGEX_ITERNAL_free_from_file (components);
 
   /* Announcing regexes from policy_filename */
   GNUNET_asprintf (&rx_with_pfx, "%s(%s)(0|1)*", regex_prefix, regex);

Modified: gnunet/src/regex/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-profiler.c    2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/regex/gnunet-regex-profiler.c    2013-06-20 08:32:50 UTC (rev 
27498)
@@ -31,7 +31,7 @@
 #include "platform.h"
 #include "gnunet_applications.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "gnunet_arm_service.h"
 #include "gnunet_dht_service.h"
 #include "gnunet_testbed_service.h"
@@ -150,7 +150,7 @@
   /**
    * Handle to a running regex search.
    */
-   struct GNUNET_REGEX_search_handle *search_handle;
+   struct REGEX_ITERNAL_Search *search_handle;
 
   /**
    * Testbed operation handle for DHT.
@@ -702,7 +702,7 @@
  * Method called when we've found a peer that announced a regex
  * that matches our search string. Now get the statistics.
  *
- * @param cls Closure provided in GNUNET_REGEX_search.
+ * @param cls Closure provided in REGEX_ITERNAL_search.
  * @param id Peer providing a regex that matches the string.
  * @param get_path Path of the get request.
  * @param get_path_length Lenght of get_path.
@@ -1039,7 +1039,7 @@
   GNUNET_assert (peer->dht_handle == ca_result);
 
   peer->search_str_matched = GNUNET_NO;
-  peer->search_handle = GNUNET_REGEX_search (peer->dht_handle,
+  peer->search_handle = REGEX_ITERNAL_search (peer->dht_handle,
                                              peer->search_str,
                                              &regex_found_handler, peer,
                                              NULL);
@@ -1081,7 +1081,7 @@
 
   if (NULL != peer->search_handle)
   {
-    GNUNET_REGEX_search_cancel (peer->search_handle);
+    REGEX_ITERNAL_search_cancel (peer->search_handle);
     peer->search_handle = NULL;
   }
 

Modified: gnunet/src/regex/gnunet-regex-simulation-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-simulation-profiler.c 2013-06-19 17:49:39 UTC 
(rev 27497)
+++ gnunet/src/regex/gnunet-regex-simulation-profiler.c 2013-06-20 08:32:50 UTC 
(rev 27498)
@@ -28,7 +28,7 @@
 
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "gnunet_mysql_lib.h"
 #include <mysql/mysql.h>
 
@@ -335,7 +335,7 @@
 static void
 regex_iterator (void *cls, const struct GNUNET_HashCode *key, const char 
*proof,
                 int accepting, unsigned int num_edges,
-                const struct GNUNET_REGEX_Edge *edges)
+                const struct REGEX_ITERNAL_Edge *edges)
 {
   unsigned int i;
   int result;
@@ -460,10 +460,10 @@
 static int
 announce_regex (const char *regex)
 {
-  struct GNUNET_REGEX_Automaton *dfa;
+  struct REGEX_ITERNAL_Automaton *dfa;
 
   dfa =
-      GNUNET_REGEX_construct_dfa (regex, strlen (regex), max_path_compression);
+      REGEX_ITERNAL_construct_dfa (regex, strlen (regex), 
max_path_compression);
 
   if (NULL == dfa)
   {
@@ -473,9 +473,9 @@
     return GNUNET_SYSERR;
   }
 
-  GNUNET_REGEX_iterate_all_edges (dfa, &regex_iterator, NULL);
+  REGEX_ITERNAL_iterate_all_edges (dfa, &regex_iterator, NULL);
 
-  GNUNET_REGEX_automaton_destroy (dfa);
+  REGEX_ITERNAL_automaton_destroy (dfa);
 
   return GNUNET_OK;
 }

Modified: gnunet/src/regex/gnunet-service-regex.c
===================================================================
--- gnunet/src/regex/gnunet-service-regex.c     2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/regex/gnunet-service-regex.c     2013-06-20 08:32:50 UTC (rev 
27498)
@@ -26,7 +26,7 @@
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_ipc.h"
 
 
@@ -54,12 +54,12 @@
   /**
    * Search handle (if this client is searching).
    */
-  struct GNUNET_REGEX_search_handle *sh;
+  struct REGEX_ITERNAL_Search *sh;
 
   /**
    * Announcement handle (if this client is announcing).
    */
-  struct GNUNET_REGEX_announce_handle *ah;
+  struct REGEX_ITERNAL_Announcement *ah;
 
   /**
    * Refresh frequency for announcements.
@@ -143,12 +143,12 @@
       }
       if (NULL != ce->ah)
       {
-       GNUNET_REGEX_announce_cancel (ce->ah);
+       REGEX_ITERNAL_announce_cancel (ce->ah);
        ce->ah = NULL;
       }
       if (NULL != ce->sh)
       {
-       GNUNET_REGEX_search_cancel (ce->sh);
+       REGEX_ITERNAL_search_cancel (ce->sh);
        ce->sh = NULL;
       }
       GNUNET_CONTAINER_DLL_remove (client_head, client_tail, ce);
@@ -171,7 +171,7 @@
 {
   struct ClientEntry *ce = cls;
 
-  GNUNET_REGEX_reannounce (ce->ah);
+  REGEX_ITERNAL_reannounce (ce->ah);
   ce->refresh_task = GNUNET_SCHEDULER_add_delayed (ce->frequency,
                                                   &reannounce,
                                                   ce);
@@ -207,7 +207,7 @@
   }
   ce = GNUNET_new (struct ClientEntry);
   ce->client = client;
-  ce->ah = GNUNET_REGEX_announce (dht,
+  ce->ah = REGEX_ITERNAL_announce (dht,
                                  &am->pid,
                                  regex,
                                  ntohs (am->compression),
@@ -311,7 +311,7 @@
   }
   ce = GNUNET_new (struct ClientEntry);
   ce->client = client;
-  ce->sh = GNUNET_REGEX_search (dht,
+  ce->sh = REGEX_ITERNAL_search (dht,
                                string,
                                &handle_search_result,
                                ce,

Modified: gnunet/src/regex/perf-regex.c
===================================================================
--- gnunet/src/regex/perf-regex.c       2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/perf-regex.c       2013-06-20 08:32:50 UTC (rev 27498)
@@ -26,7 +26,7 @@
 #include <regex.h>
 #include <time.h>
 #include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_test_lib.h"
 
 static const char *exe;
@@ -53,7 +53,7 @@
       const char *proof,
       int accepting,
       unsigned int num_edges,
-      const struct GNUNET_REGEX_Edge *edges)
+      const struct REGEX_ITERNAL_Edge *edges)
 {
   unsigned int i;
 
@@ -66,9 +66,9 @@
 }
 
 static void
-print_dfa (struct GNUNET_REGEX_Automaton* dfa)
+print_dfa (struct REGEX_ITERNAL_Automaton* dfa)
 {
-  GNUNET_REGEX_iterate_all_edges (dfa, iter, NULL);
+  REGEX_ITERNAL_iterate_all_edges (dfa, iter, NULL);
 }
 
 /**
@@ -84,7 +84,7 @@
 int
 main (int argc, char *const *argv)
 {
-  struct GNUNET_REGEX_Automaton* dfa;
+  struct REGEX_ITERNAL_Automaton* dfa;
   char **regexes;
   char *buffer;
   char *regex;
@@ -98,14 +98,14 @@
     usage();
     return 1;
   }
-  regexes = GNUNET_REGEX_read_from_file (argv[1]);
+  regexes = REGEX_ITERNAL_read_from_file (argv[1]);
 
   if (NULL == regexes)
   {
     usage();
     return 2;
   }
-  buffer = GNUNET_REGEX_combine (regexes);
+  buffer = REGEX_ITERNAL_combine (regexes);
 
   GNUNET_asprintf (&regex, "GNVPN-0001-PAD(%s)(0|1)*", buffer);
   size = strlen (regex);
@@ -114,11 +114,11 @@
   //   return 0;
 
   compression = atoi (argv[2]);
-  dfa = GNUNET_REGEX_construct_dfa (regex, size, compression);
+  dfa = REGEX_ITERNAL_construct_dfa (regex, size, compression);
   print_dfa (dfa);
-  GNUNET_REGEX_automaton_destroy (dfa);
+  REGEX_ITERNAL_automaton_destroy (dfa);
   GNUNET_free (buffer);
-  GNUNET_REGEX_free_from_file (regexes);
+  REGEX_ITERNAL_free_from_file (regexes);
   GNUNET_free (regex);
   return 0;
 }

Modified: gnunet/src/regex/plugin_block_regex.c
===================================================================
--- gnunet/src/regex/plugin_block_regex.c       2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/regex/plugin_block_regex.c       2013-06-20 08:32:50 UTC (rev 
27498)
@@ -107,10 +107,10 @@
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Block with no xquery\n");
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  key: %s, %u edges\n",
                 GNUNET_h2s (&rblock->key), ntohl (rblock->n_edges));
-    GNUNET_REGEX_block_iterate (rblock, reply_block_size, &rdebug, NULL);
+    REGEX_ITERNAL_block_iterate (rblock, reply_block_size, &rdebug, NULL);
     return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
   }
-  switch (GNUNET_REGEX_block_check (reply_block,
+  switch (REGEX_ITERNAL_block_check (reply_block,
                                     reply_block_size,
                                     xquery))
   {

Modified: gnunet/src/regex/regex.c
===================================================================
--- gnunet/src/regex/regex.c    2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex.c    2013-06-20 08:32:50 UTC (rev 27498)
@@ -24,11 +24,12 @@
  * @author Maximilian Szengel
  */
 #include "platform.h"
-#include "gnunet_container_lib.h"
-#include "gnunet_crypto_lib.h"
-#include "gnunet_regex_lib.h"
+#include "gnunet_util_lib.h"
+#include "gnunet_regex_service.h"
+#include "regex_internal_lib.h"
 #include "regex_internal.h"
 
+
 /**
  * Set this to GNUNET_YES to enable state naming. Used to debug NFA->DFA
  * creation. Disabled by default for better performance.
@@ -38,17 +39,17 @@
 /**
  * Set of states using MDLL API.
  */
-struct GNUNET_REGEX_StateSet_MDLL
+struct REGEX_ITERNAL_StateSet_MDLL
 {
   /**
    * MDLL of states.
    */
-  struct GNUNET_REGEX_State *head;
+  struct REGEX_ITERNAL_State *head;
 
   /**
    * MDLL of states.
    */
-  struct GNUNET_REGEX_State *tail;
+  struct REGEX_ITERNAL_State *tail;
 
   /**
    * Length of the MDLL.
@@ -64,8 +65,8 @@
  * @param state state to be appended
  */
 static void
-state_set_append (struct GNUNET_REGEX_StateSet *set,
-                 struct GNUNET_REGEX_State *state)
+state_set_append (struct REGEX_ITERNAL_StateSet *set,
+                 struct REGEX_ITERNAL_State *state)
 {
   if (set->off == set->size)
     GNUNET_array_grow (set->states, set->size, set->size * 2 + 4);
@@ -103,12 +104,12 @@
  * @param to_state state to where the transition should point to
  */
 static void
-state_add_transition (struct GNUNET_REGEX_Context *ctx,
-                      struct GNUNET_REGEX_State *from_state, const char *label,
-                      struct GNUNET_REGEX_State *to_state)
+state_add_transition (struct REGEX_ITERNAL_Context *ctx,
+                      struct REGEX_ITERNAL_State *from_state, const char 
*label,
+                      struct REGEX_ITERNAL_State *to_state)
 {
-  struct GNUNET_REGEX_Transition *t;
-  struct GNUNET_REGEX_Transition *oth;
+  struct REGEX_ITERNAL_Transition *t;
+  struct REGEX_ITERNAL_Transition *oth;
 
   if (NULL == from_state)
   {
@@ -131,7 +132,7 @@
       break;
   }
 
-  t = GNUNET_malloc (sizeof (struct GNUNET_REGEX_Transition));
+  t = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_Transition));
   if (NULL != ctx)
     t->id = ctx->transition_id++;
   if (NULL != label)
@@ -155,8 +156,8 @@
  * @param transition transition that should be removed from state 'state'.
  */
 static void
-state_remove_transition (struct GNUNET_REGEX_State *state,
-                         struct GNUNET_REGEX_Transition *transition)
+state_remove_transition (struct REGEX_ITERNAL_State *state,
+                         struct REGEX_ITERNAL_Transition *transition)
 {
   if (NULL == state || NULL == transition)
     return;
@@ -187,8 +188,8 @@
 static int
 state_compare (const void *a, const void *b)
 {
-  struct GNUNET_REGEX_State **s1 = (struct GNUNET_REGEX_State **) a;
-  struct GNUNET_REGEX_State **s2 = (struct GNUNET_REGEX_State **) b;
+  struct REGEX_ITERNAL_State **s1 = (struct REGEX_ITERNAL_State **) a;
+  struct REGEX_ITERNAL_State **s2 = (struct REGEX_ITERNAL_State **) b;
 
   return (*s1)->id - (*s2)->id;
 }
@@ -204,9 +205,9 @@
  * @return number of edges.
  */
 static unsigned int
-state_get_edges (struct GNUNET_REGEX_State *s, struct GNUNET_REGEX_Edge *edges)
+state_get_edges (struct REGEX_ITERNAL_State *s, struct REGEX_ITERNAL_Edge 
*edges)
 {
-  struct GNUNET_REGEX_Transition *t;
+  struct REGEX_ITERNAL_Transition *t;
   unsigned int count;
 
   if (NULL == s)
@@ -236,8 +237,8 @@
  * @return 0 if the sets are equal, otherwise non-zero
  */
 static int
-state_set_compare (struct GNUNET_REGEX_StateSet *sset1,
-                   struct GNUNET_REGEX_StateSet *sset2)
+state_set_compare (struct REGEX_ITERNAL_StateSet *sset1,
+                   struct REGEX_ITERNAL_StateSet *sset2)
 {
   int result;
   unsigned int i;
@@ -263,7 +264,7 @@
  * @param set set to be cleared
  */
 static void
-state_set_clear (struct GNUNET_REGEX_StateSet *set)
+state_set_clear (struct REGEX_ITERNAL_StateSet *set)
 {
   GNUNET_array_grow (set->states, set->size, 0);
   set->off = 0;
@@ -277,7 +278,7 @@
  * @param a automaton to be cleared
  */
 static void
-automaton_fragment_clear (struct GNUNET_REGEX_Automaton *a)
+automaton_fragment_clear (struct REGEX_ITERNAL_Automaton *a)
 {
   if (NULL == a)
     return;
@@ -297,10 +298,10 @@
  * @param s state that should be destroyed
  */
 static void
-automaton_destroy_state (struct GNUNET_REGEX_State *s)
+automaton_destroy_state (struct REGEX_ITERNAL_State *s)
 {
-  struct GNUNET_REGEX_Transition *t;
-  struct GNUNET_REGEX_Transition *next_t;
+  struct REGEX_ITERNAL_Transition *t;
+  struct REGEX_ITERNAL_Transition *next_t;
 
   if (NULL == s)
     return;
@@ -327,12 +328,12 @@
  * @param s state to remove
  */
 static void
-automaton_remove_state (struct GNUNET_REGEX_Automaton *a,
-                        struct GNUNET_REGEX_State *s)
+automaton_remove_state (struct REGEX_ITERNAL_Automaton *a,
+                        struct REGEX_ITERNAL_State *s)
 {
-  struct GNUNET_REGEX_State *s_check;
-  struct GNUNET_REGEX_Transition *t_check;
-  struct GNUNET_REGEX_Transition *t_check_next;
+  struct REGEX_ITERNAL_State *s_check;
+  struct REGEX_ITERNAL_Transition *t_check;
+  struct REGEX_ITERNAL_Transition *t_check_next;
 
   if (NULL == a || NULL == s)
     return;
@@ -367,15 +368,15 @@
  * @param s2 second state, will be destroyed
  */
 static void
-automaton_merge_states (struct GNUNET_REGEX_Context *ctx,
-                        struct GNUNET_REGEX_Automaton *a,
-                        struct GNUNET_REGEX_State *s1,
-                        struct GNUNET_REGEX_State *s2)
+automaton_merge_states (struct REGEX_ITERNAL_Context *ctx,
+                        struct REGEX_ITERNAL_Automaton *a,
+                        struct REGEX_ITERNAL_State *s1,
+                        struct REGEX_ITERNAL_State *s2)
 {
-  struct GNUNET_REGEX_State *s_check;
-  struct GNUNET_REGEX_Transition *t_check;
-  struct GNUNET_REGEX_Transition *t;
-  struct GNUNET_REGEX_Transition *t_next;
+  struct REGEX_ITERNAL_State *s_check;
+  struct REGEX_ITERNAL_Transition *t_check;
+  struct REGEX_ITERNAL_Transition *t;
+  struct REGEX_ITERNAL_Transition *t_next;
   int is_dup;
 
   if (s1 == s2)
@@ -436,8 +437,8 @@
  * @param s state that should be added
  */
 static void
-automaton_add_state (struct GNUNET_REGEX_Automaton *a,
-                     struct GNUNET_REGEX_State *s)
+automaton_add_state (struct REGEX_ITERNAL_Automaton *a,
+                     struct REGEX_ITERNAL_State *s)
 {
   GNUNET_CONTAINER_DLL_insert (a->states_head, a->states_tail, s);
   a->state_count++;
@@ -459,12 +460,12 @@
  * @param action_cls closure for action.
  */
 static void
-automaton_state_traverse (struct GNUNET_REGEX_State *s, int *marks,
+automaton_state_traverse (struct REGEX_ITERNAL_State *s, int *marks,
                           unsigned int *count,
-                          GNUNET_REGEX_traverse_check check, void *check_cls,
-                          GNUNET_REGEX_traverse_action action, void 
*action_cls)
+                          REGEX_ITERNAL_traverse_check check, void *check_cls,
+                          REGEX_ITERNAL_traverse_action action, void 
*action_cls)
 {
-  struct GNUNET_REGEX_Transition *t;
+  struct REGEX_ITERNAL_Transition *t;
 
   if (GNUNET_YES == marks[s->traversal_id])
     return;
@@ -502,15 +503,15 @@
  * @param action_cls closure for action
  */
 void
-GNUNET_REGEX_automaton_traverse (const struct GNUNET_REGEX_Automaton *a,
-                                 struct GNUNET_REGEX_State *start,
-                                 GNUNET_REGEX_traverse_check check,
+REGEX_ITERNAL_automaton_traverse (const struct REGEX_ITERNAL_Automaton *a,
+                                 struct REGEX_ITERNAL_State *start,
+                                 REGEX_ITERNAL_traverse_check check,
                                  void *check_cls,
-                                 GNUNET_REGEX_traverse_action action,
+                                 REGEX_ITERNAL_traverse_action action,
                                  void *action_cls)
 {
   unsigned int count;
-  struct GNUNET_REGEX_State *s;
+  struct REGEX_ITERNAL_State *s;
 
   if (NULL == a || 0 == a->state_count)
     return;
@@ -1155,7 +1156,7 @@
 
 
 /**
- * Helper function used as 'action' in 'GNUNET_REGEX_automaton_traverse'
+ * Helper function used as 'action' in 'REGEX_ITERNAL_automaton_traverse'
  * function to create the depth-first numbering of the states.
  *
  * @param cls states array.
@@ -1164,9 +1165,9 @@
  */
 static void
 number_states (void *cls, const unsigned int count,
-               struct GNUNET_REGEX_State *s)
+               struct REGEX_ITERNAL_State *s)
 {
-  struct GNUNET_REGEX_State **states = cls;
+  struct REGEX_ITERNAL_State **states = cls;
 
   s->dfs_id = count;
   if (NULL != states)
@@ -1603,16 +1604,16 @@
  * @param a automaton for which to assign proofs and hashes, must not be NULL
  */
 static int
-automaton_create_proofs (struct GNUNET_REGEX_Automaton *a)
+automaton_create_proofs (struct REGEX_ITERNAL_Automaton *a)
 {
   unsigned int n = a->state_count;
-  struct GNUNET_REGEX_State *states[n];
+  struct REGEX_ITERNAL_State *states[n];
   struct StringBuffer *R_last;
   struct StringBuffer *R_cur;
   struct StringBuffer R_cur_r;
   struct StringBuffer R_cur_l;
   struct StringBuffer *R_swap;
-  struct GNUNET_REGEX_Transition *t;
+  struct REGEX_ITERNAL_Transition *t;
   struct StringBuffer complete_regex;
   unsigned int i;
   unsigned int j;
@@ -1630,7 +1631,7 @@
   }
 
   /* create depth-first numbering of the states, initializes 'state' */
-  GNUNET_REGEX_automaton_traverse (a, a->start, NULL, NULL, &number_states,
+  REGEX_ITERNAL_automaton_traverse (a, a->start, NULL, NULL, &number_states,
                                    states);
 
   for (i = 0; i < n; i++)
@@ -1762,18 +1763,18 @@
  *
  * @return new DFA state
  */
-static struct GNUNET_REGEX_State *
-dfa_state_create (struct GNUNET_REGEX_Context *ctx,
-                  struct GNUNET_REGEX_StateSet *nfa_states)
+static struct REGEX_ITERNAL_State *
+dfa_state_create (struct REGEX_ITERNAL_Context *ctx,
+                  struct REGEX_ITERNAL_StateSet *nfa_states)
 {
-  struct GNUNET_REGEX_State *s;
+  struct REGEX_ITERNAL_State *s;
   char *pos;
   size_t len;
-  struct GNUNET_REGEX_State *cstate;
-  struct GNUNET_REGEX_Transition *ctran;
+  struct REGEX_ITERNAL_State *cstate;
+  struct REGEX_ITERNAL_Transition *ctran;
   unsigned int i;
 
-  s = GNUNET_malloc (sizeof (struct GNUNET_REGEX_State));
+  s = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_State));
   s->id = ctx->state_id++;
   s->index = -1;
   s->lowlink = -1;
@@ -1815,7 +1816,7 @@
   pos[-1] = '}';
   s->name = GNUNET_realloc (s->name, strlen (s->name) + 1);
 
-  memset (nfa_states, 0, sizeof (struct GNUNET_REGEX_StateSet));
+  memset (nfa_states, 0, sizeof (struct REGEX_ITERNAL_StateSet));
   return s;
 }
 
@@ -1834,10 +1835,10 @@
  * @return length of the substring comsumed from 'str'
  */
 static unsigned int
-dfa_move (struct GNUNET_REGEX_State **s, const char *str)
+dfa_move (struct REGEX_ITERNAL_State **s, const char *str)
 {
-  struct GNUNET_REGEX_Transition *t;
-  struct GNUNET_REGEX_State *new_s;
+  struct REGEX_ITERNAL_Transition *t;
+  struct REGEX_ITERNAL_State *new_s;
   unsigned int len;
   unsigned int max_len;
 
@@ -1875,7 +1876,7 @@
  * @param s state where the marked attribute will be set to GNUNET_YES.
  */
 static void
-mark_states (void *cls, const unsigned int count, struct GNUNET_REGEX_State *s)
+mark_states (void *cls, const unsigned int count, struct REGEX_ITERNAL_State 
*s)
 {
   s->marked = GNUNET_YES;
 }
@@ -1888,17 +1889,17 @@
  * @param a DFA automaton
  */
 static void
-dfa_remove_unreachable_states (struct GNUNET_REGEX_Automaton *a)
+dfa_remove_unreachable_states (struct REGEX_ITERNAL_Automaton *a)
 {
-  struct GNUNET_REGEX_State *s;
-  struct GNUNET_REGEX_State *s_next;
+  struct REGEX_ITERNAL_State *s;
+  struct REGEX_ITERNAL_State *s_next;
 
   /* 1. unmark all states */
   for (s = a->states_head; NULL != s; s = s->next)
     s->marked = GNUNET_NO;
 
   /* 2. traverse dfa from start state and mark all visited states */
-  GNUNET_REGEX_automaton_traverse (a, a->start, NULL, NULL, &mark_states, 
NULL);
+  REGEX_ITERNAL_automaton_traverse (a, a->start, NULL, NULL, &mark_states, 
NULL);
 
   /* 3. delete all states that were not visited */
   for (s = a->states_head; NULL != s; s = s_next)
@@ -1917,11 +1918,11 @@
  * @param a DFA automaton
  */
 static void
-dfa_remove_dead_states (struct GNUNET_REGEX_Automaton *a)
+dfa_remove_dead_states (struct REGEX_ITERNAL_Automaton *a)
 {
-  struct GNUNET_REGEX_State *s;
-  struct GNUNET_REGEX_State *s_next;
-  struct GNUNET_REGEX_Transition *t;
+  struct REGEX_ITERNAL_State *s;
+  struct REGEX_ITERNAL_State *s_next;
+  struct REGEX_ITERNAL_Transition *t;
   int dead;
 
   GNUNET_assert (DFA == a->type);
@@ -1960,16 +1961,16 @@
  * @return GNUNET_OK on success
  */
 static int
-dfa_merge_nondistinguishable_states (struct GNUNET_REGEX_Context *ctx,
-                                     struct GNUNET_REGEX_Automaton *a)
+dfa_merge_nondistinguishable_states (struct REGEX_ITERNAL_Context *ctx,
+                                     struct REGEX_ITERNAL_Automaton *a)
 {
   uint32_t *table;
-  struct GNUNET_REGEX_State *s1;
-  struct GNUNET_REGEX_State *s2;
-  struct GNUNET_REGEX_Transition *t1;
-  struct GNUNET_REGEX_Transition *t2;
-  struct GNUNET_REGEX_State *s1_next;
-  struct GNUNET_REGEX_State *s2_next;
+  struct REGEX_ITERNAL_State *s1;
+  struct REGEX_ITERNAL_State *s2;
+  struct REGEX_ITERNAL_Transition *t1;
+  struct REGEX_ITERNAL_Transition *t2;
+  struct REGEX_ITERNAL_State *s1_next;
+  struct REGEX_ITERNAL_State *s2_next;
   int change;
   unsigned int num_equal_edges;
   unsigned int i;
@@ -2077,8 +2078,8 @@
  * @return GNUNET_OK on success
  */
 static int
-dfa_minimize (struct GNUNET_REGEX_Context *ctx,
-              struct GNUNET_REGEX_Automaton *a)
+dfa_minimize (struct REGEX_ITERNAL_Context *ctx,
+              struct REGEX_ITERNAL_Automaton *a)
 {
   if (NULL == a)
     return GNUNET_SYSERR;
@@ -2101,7 +2102,7 @@
 /**
  * Context for adding strided transitions to a DFA.
  */
-struct GNUNET_REGEX_Strided_Context
+struct REGEX_ITERNAL_Strided_Context
 {
   /**
    * Length of the strides.
@@ -2112,12 +2113,12 @@
    * Strided transitions DLL. New strided transitions will be stored in this 
DLL
    * and afterwards added to the DFA.
    */
-  struct GNUNET_REGEX_Transition *transitions_head;
+  struct REGEX_ITERNAL_Transition *transitions_head;
 
   /**
    * Strided transitions DLL.
    */
-  struct GNUNET_REGEX_Transition *transitions_tail;
+  struct REGEX_ITERNAL_Transition *transitions_tail;
 };
 
 
@@ -2133,16 +2134,16 @@
  */
 void
 dfa_add_multi_strides_helper (void *cls, const unsigned int depth, char *label,
-                              struct GNUNET_REGEX_State *start,
-                              struct GNUNET_REGEX_State *s)
+                              struct REGEX_ITERNAL_State *start,
+                              struct REGEX_ITERNAL_State *s)
 {
-  struct GNUNET_REGEX_Strided_Context *ctx = cls;
-  struct GNUNET_REGEX_Transition *t;
+  struct REGEX_ITERNAL_Strided_Context *ctx = cls;
+  struct REGEX_ITERNAL_Transition *t;
   char *new_label;
 
   if (depth == ctx->stride)
   {
-    t = GNUNET_malloc (sizeof (struct GNUNET_REGEX_Transition));
+    t = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_Transition));
     t->label = GNUNET_strdup (label);
     t->to_state = s;
     t->from_state = start;
@@ -2183,7 +2184,7 @@
  */
 void
 dfa_add_multi_strides (void *cls, const unsigned int count,
-                       struct GNUNET_REGEX_State *s)
+                       struct REGEX_ITERNAL_State *s)
 {
   dfa_add_multi_strides_helper (cls, 0, NULL, s, s);
 }
@@ -2197,19 +2198,19 @@
  * @param stride_len length of the strides.
  */
 void
-GNUNET_REGEX_dfa_add_multi_strides (struct GNUNET_REGEX_Context *regex_ctx,
-                                    struct GNUNET_REGEX_Automaton *dfa,
+REGEX_ITERNAL_dfa_add_multi_strides (struct REGEX_ITERNAL_Context *regex_ctx,
+                                    struct REGEX_ITERNAL_Automaton *dfa,
                                     const unsigned int stride_len)
 {
-  struct GNUNET_REGEX_Strided_Context ctx = { stride_len, NULL, NULL };
-  struct GNUNET_REGEX_Transition *t;
-  struct GNUNET_REGEX_Transition *t_next;
+  struct REGEX_ITERNAL_Strided_Context ctx = { stride_len, NULL, NULL };
+  struct REGEX_ITERNAL_Transition *t;
+  struct REGEX_ITERNAL_Transition *t_next;
 
   if (1 > stride_len || GNUNET_YES == dfa->is_multistrided)
     return;
 
   /* Compute the new transitions of given stride_len */
-  GNUNET_REGEX_automaton_traverse (dfa, dfa->start, NULL, NULL,
+  REGEX_ITERNAL_automaton_traverse (dfa, dfa->start, NULL, NULL,
                                    &dfa_add_multi_strides, &ctx);
 
   /* Add all the new transitions to the automaton. */
@@ -2240,14 +2241,14 @@
  * @param transitions_tail transitions DLL.
  */
 void
-dfa_compress_paths_helper (struct GNUNET_REGEX_Automaton *dfa,
-                           struct GNUNET_REGEX_State *start,
-                           struct GNUNET_REGEX_State *cur, char *label,
+dfa_compress_paths_helper (struct REGEX_ITERNAL_Automaton *dfa,
+                           struct REGEX_ITERNAL_State *start,
+                           struct REGEX_ITERNAL_State *cur, char *label,
                            unsigned int max_len,
-                           struct GNUNET_REGEX_Transition **transitions_head,
-                           struct GNUNET_REGEX_Transition **transitions_tail)
+                           struct REGEX_ITERNAL_Transition **transitions_head,
+                           struct REGEX_ITERNAL_Transition **transitions_tail)
 {
-  struct GNUNET_REGEX_Transition *t;
+  struct REGEX_ITERNAL_Transition *t;
   char *new_label;
 
 
@@ -2257,7 +2258,7 @@
                                        max_len == strlen (label)) ||
        (start == dfa->start && GNUNET_REGEX_INITIAL_BYTES == strlen (label))))
   {
-    t = GNUNET_malloc (sizeof (struct GNUNET_REGEX_Transition));
+    t = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_Transition));
     t->label = GNUNET_strdup (label);
     t->to_state = cur;
     t->from_state = start;
@@ -2305,15 +2306,15 @@
  * @param max_len maximal length of the compressed paths.
  */
 static void
-dfa_compress_paths (struct GNUNET_REGEX_Context *regex_ctx,
-                    struct GNUNET_REGEX_Automaton *dfa, unsigned int max_len)
+dfa_compress_paths (struct REGEX_ITERNAL_Context *regex_ctx,
+                    struct REGEX_ITERNAL_Automaton *dfa, unsigned int max_len)
 {
-  struct GNUNET_REGEX_State *s;
-  struct GNUNET_REGEX_State *s_next;
-  struct GNUNET_REGEX_Transition *t;
-  struct GNUNET_REGEX_Transition *t_next;
-  struct GNUNET_REGEX_Transition *transitions_head = NULL;
-  struct GNUNET_REGEX_Transition *transitions_tail = NULL;
+  struct REGEX_ITERNAL_State *s;
+  struct REGEX_ITERNAL_State *s_next;
+  struct REGEX_ITERNAL_Transition *t;
+  struct REGEX_ITERNAL_Transition *t_next;
+  struct REGEX_ITERNAL_Transition *transitions_head = NULL;
+  struct REGEX_ITERNAL_Transition *transitions_tail = NULL;
 
   if (NULL == dfa)
     return;
@@ -2368,13 +2369,13 @@
  *
  * @return new NFA fragment
  */
-static struct GNUNET_REGEX_Automaton *
-nfa_fragment_create (struct GNUNET_REGEX_State *start,
-                     struct GNUNET_REGEX_State *end)
+static struct REGEX_ITERNAL_Automaton *
+nfa_fragment_create (struct REGEX_ITERNAL_State *start,
+                     struct REGEX_ITERNAL_State *end)
 {
-  struct GNUNET_REGEX_Automaton *n;
+  struct REGEX_ITERNAL_Automaton *n;
 
-  n = GNUNET_malloc (sizeof (struct GNUNET_REGEX_Automaton));
+  n = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_Automaton));
 
   n->type = NFA;
   n->start = NULL;
@@ -2404,11 +2405,11 @@
  * @param states_tail tail of the DLL of states
  */
 static void
-nfa_add_states (struct GNUNET_REGEX_Automaton *n,
-                struct GNUNET_REGEX_State *states_head,
-                struct GNUNET_REGEX_State *states_tail)
+nfa_add_states (struct REGEX_ITERNAL_Automaton *n,
+                struct REGEX_ITERNAL_State *states_head,
+                struct REGEX_ITERNAL_State *states_tail)
 {
-  struct GNUNET_REGEX_State *s;
+  struct REGEX_ITERNAL_State *s;
 
   if (NULL == n || NULL == states_head)
   {
@@ -2442,12 +2443,12 @@
  *
  * @return new NFA state
  */
-static struct GNUNET_REGEX_State *
-nfa_state_create (struct GNUNET_REGEX_Context *ctx, int accepting)
+static struct REGEX_ITERNAL_State *
+nfa_state_create (struct REGEX_ITERNAL_Context *ctx, int accepting)
 {
-  struct GNUNET_REGEX_State *s;
+  struct REGEX_ITERNAL_State *s;
 
-  s = GNUNET_malloc (sizeof (struct GNUNET_REGEX_State));
+  s = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_State));
   s->id = ctx->state_id++;
   s->accepting = accepting;
   s->marked = GNUNET_NO;
@@ -2472,18 +2473,18 @@
  *                pass NULL for epsilon transition
  */
 static void
-nfa_closure_set_create (struct GNUNET_REGEX_StateSet *ret,
-                       struct GNUNET_REGEX_Automaton *nfa,
-                        struct GNUNET_REGEX_StateSet *states, const char 
*label)
+nfa_closure_set_create (struct REGEX_ITERNAL_StateSet *ret,
+                       struct REGEX_ITERNAL_Automaton *nfa,
+                        struct REGEX_ITERNAL_StateSet *states, const char 
*label)
 {
-  struct GNUNET_REGEX_State *s;
+  struct REGEX_ITERNAL_State *s;
   unsigned int i;
-  struct GNUNET_REGEX_StateSet_MDLL cls_stack;
-  struct GNUNET_REGEX_State *clsstate;
-  struct GNUNET_REGEX_State *currentstate;
-  struct GNUNET_REGEX_Transition *ctran;
+  struct REGEX_ITERNAL_StateSet_MDLL cls_stack;
+  struct REGEX_ITERNAL_State *clsstate;
+  struct REGEX_ITERNAL_State *currentstate;
+  struct REGEX_ITERNAL_Transition *ctran;
 
-  memset (ret, 0, sizeof (struct GNUNET_REGEX_StateSet));
+  memset (ret, 0, sizeof (struct REGEX_ITERNAL_StateSet));
   if (NULL == states)
     return;
 
@@ -2527,7 +2528,7 @@
     ret->states[i]->contained = 0;
 
   if (ret->off > 1)
-    qsort (ret->states, ret->off, sizeof (struct GNUNET_REGEX_State *),
+    qsort (ret->states, ret->off, sizeof (struct REGEX_ITERNAL_State *),
            &state_compare);
 }
 
@@ -2538,11 +2539,11 @@
  * @param ctx context
  */
 static void
-nfa_add_concatenation (struct GNUNET_REGEX_Context *ctx)
+nfa_add_concatenation (struct REGEX_ITERNAL_Context *ctx)
 {
-  struct GNUNET_REGEX_Automaton *a;
-  struct GNUNET_REGEX_Automaton *b;
-  struct GNUNET_REGEX_Automaton *new_nfa;
+  struct REGEX_ITERNAL_Automaton *a;
+  struct REGEX_ITERNAL_Automaton *b;
+  struct REGEX_ITERNAL_Automaton *new_nfa;
 
   b = ctx->stack_tail;
   GNUNET_assert (NULL != b);
@@ -2574,12 +2575,12 @@
  * @param ctx context
  */
 static void
-nfa_add_star_op (struct GNUNET_REGEX_Context *ctx)
+nfa_add_star_op (struct REGEX_ITERNAL_Context *ctx)
 {
-  struct GNUNET_REGEX_Automaton *a;
-  struct GNUNET_REGEX_Automaton *new_nfa;
-  struct GNUNET_REGEX_State *start;
-  struct GNUNET_REGEX_State *end;
+  struct REGEX_ITERNAL_Automaton *a;
+  struct REGEX_ITERNAL_Automaton *new_nfa;
+  struct REGEX_ITERNAL_State *start;
+  struct REGEX_ITERNAL_State *end;
 
   a = ctx->stack_tail;
 
@@ -2617,9 +2618,9 @@
  * @param ctx context
  */
 static void
-nfa_add_plus_op (struct GNUNET_REGEX_Context *ctx)
+nfa_add_plus_op (struct REGEX_ITERNAL_Context *ctx)
 {
-  struct GNUNET_REGEX_Automaton *a;
+  struct REGEX_ITERNAL_Automaton *a;
 
   a = ctx->stack_tail;
 
@@ -2644,12 +2645,12 @@
  * @param ctx context
  */
 static void
-nfa_add_question_op (struct GNUNET_REGEX_Context *ctx)
+nfa_add_question_op (struct REGEX_ITERNAL_Context *ctx)
 {
-  struct GNUNET_REGEX_Automaton *a;
-  struct GNUNET_REGEX_Automaton *new_nfa;
-  struct GNUNET_REGEX_State *start;
-  struct GNUNET_REGEX_State *end;
+  struct REGEX_ITERNAL_Automaton *a;
+  struct REGEX_ITERNAL_Automaton *new_nfa;
+  struct REGEX_ITERNAL_State *start;
+  struct REGEX_ITERNAL_State *end;
 
   a = ctx->stack_tail;
 
@@ -2685,13 +2686,13 @@
  * @param ctx context
  */
 static void
-nfa_add_alternation (struct GNUNET_REGEX_Context *ctx)
+nfa_add_alternation (struct REGEX_ITERNAL_Context *ctx)
 {
-  struct GNUNET_REGEX_Automaton *a;
-  struct GNUNET_REGEX_Automaton *b;
-  struct GNUNET_REGEX_Automaton *new_nfa;
-  struct GNUNET_REGEX_State *start;
-  struct GNUNET_REGEX_State *end;
+  struct REGEX_ITERNAL_Automaton *a;
+  struct REGEX_ITERNAL_Automaton *b;
+  struct REGEX_ITERNAL_Automaton *new_nfa;
+  struct REGEX_ITERNAL_State *start;
+  struct REGEX_ITERNAL_State *end;
 
   b = ctx->stack_tail;
   GNUNET_assert (NULL != b);
@@ -2729,11 +2730,11 @@
  * @param label label for nfa transition
  */
 static void
-nfa_add_label (struct GNUNET_REGEX_Context *ctx, const char *label)
+nfa_add_label (struct REGEX_ITERNAL_Context *ctx, const char *label)
 {
-  struct GNUNET_REGEX_Automaton *n;
-  struct GNUNET_REGEX_State *start;
-  struct GNUNET_REGEX_State *end;
+  struct REGEX_ITERNAL_Automaton *n;
+  struct REGEX_ITERNAL_State *start;
+  struct REGEX_ITERNAL_State *end;
 
   GNUNET_assert (NULL != ctx);
 
@@ -2752,7 +2753,7 @@
  * @param ctx context
  */
 static void
-GNUNET_REGEX_context_init (struct GNUNET_REGEX_Context *ctx)
+REGEX_ITERNAL_context_init (struct REGEX_ITERNAL_Context *ctx)
 {
   if (NULL == ctx)
   {
@@ -2772,13 +2773,13 @@
  * @param regex regular expression string
  * @param len length of the string
  *
- * @return NFA, needs to be freed using GNUNET_REGEX_destroy_automaton
+ * @return NFA, needs to be freed using REGEX_ITERNAL_destroy_automaton
  */
-struct GNUNET_REGEX_Automaton *
-GNUNET_REGEX_construct_nfa (const char *regex, const size_t len)
+struct REGEX_ITERNAL_Automaton *
+REGEX_ITERNAL_construct_nfa (const char *regex, const size_t len)
 {
-  struct GNUNET_REGEX_Context ctx;
-  struct GNUNET_REGEX_Automaton *nfa;
+  struct REGEX_ITERNAL_Context ctx;
+  struct REGEX_ITERNAL_Automaton *nfa;
   const char *regexp;
   char curlabel[2];
   char *error_msg;
@@ -2800,7 +2801,7 @@
 
     return NULL;
   }
-  GNUNET_REGEX_context_init (&ctx);
+  REGEX_ITERNAL_context_init (&ctx);
 
   regexp = regex;
   curlabel[1] = '\0';
@@ -2923,7 +2924,7 @@
   nfa->regex = GNUNET_strdup (regex);
 
   /* create depth-first numbering of the states for pretty printing */
-  GNUNET_REGEX_automaton_traverse (nfa, NULL, NULL, NULL, &number_states, 
NULL);
+  REGEX_ITERNAL_automaton_traverse (nfa, NULL, NULL, NULL, &number_states, 
NULL);
 
   /* No multistriding added so far */
   nfa->is_multistrided = GNUNET_NO;
@@ -2940,7 +2941,7 @@
   while (NULL != (nfa = ctx.stack_head))
   {
     GNUNET_CONTAINER_DLL_remove (ctx.stack_head, ctx.stack_tail, nfa);
-    GNUNET_REGEX_automaton_destroy (nfa);
+    REGEX_ITERNAL_automaton_destroy (nfa);
   }
 
   return NULL;
@@ -2957,17 +2958,17 @@
  *                  for starting.
  */
 static void
-construct_dfa_states (struct GNUNET_REGEX_Context *ctx,
-                      struct GNUNET_REGEX_Automaton *nfa,
-                      struct GNUNET_REGEX_Automaton *dfa,
-                      struct GNUNET_REGEX_State *dfa_state)
+construct_dfa_states (struct REGEX_ITERNAL_Context *ctx,
+                      struct REGEX_ITERNAL_Automaton *nfa,
+                      struct REGEX_ITERNAL_Automaton *dfa,
+                      struct REGEX_ITERNAL_State *dfa_state)
 {
-  struct GNUNET_REGEX_Transition *ctran;
-  struct GNUNET_REGEX_State *new_dfa_state;
-  struct GNUNET_REGEX_State *state_contains;
-  struct GNUNET_REGEX_State *state_iter;
-  struct GNUNET_REGEX_StateSet tmp;
-  struct GNUNET_REGEX_StateSet nfa_set;
+  struct REGEX_ITERNAL_Transition *ctran;
+  struct REGEX_ITERNAL_State *new_dfa_state;
+  struct REGEX_ITERNAL_State *state_contains;
+  struct REGEX_ITERNAL_State *state_iter;
+  struct REGEX_ITERNAL_StateSet tmp;
+  struct REGEX_ITERNAL_StateSet nfa_set;
 
   for (ctran = dfa_state->transitions_head; NULL != ctran; ctran = ctran->next)
   {
@@ -3019,23 +3020,23 @@
  * @param max_path_len limit the path compression length to the
  *        given value. If set to 1, no path compression is applied. Set to 0 
for
  *        maximal possible path compression (generally not desireable).
- * @return DFA, needs to be freed using GNUNET_REGEX_automaton_destroy.
+ * @return DFA, needs to be freed using REGEX_ITERNAL_automaton_destroy.
  */
-struct GNUNET_REGEX_Automaton *
-GNUNET_REGEX_construct_dfa (const char *regex, const size_t len,
+struct REGEX_ITERNAL_Automaton *
+REGEX_ITERNAL_construct_dfa (const char *regex, const size_t len,
                             unsigned int max_path_len)
 {
-  struct GNUNET_REGEX_Context ctx;
-  struct GNUNET_REGEX_Automaton *dfa;
-  struct GNUNET_REGEX_Automaton *nfa;
-  struct GNUNET_REGEX_StateSet nfa_start_eps_cls;
-  struct GNUNET_REGEX_StateSet singleton_set;
+  struct REGEX_ITERNAL_Context ctx;
+  struct REGEX_ITERNAL_Automaton *dfa;
+  struct REGEX_ITERNAL_Automaton *nfa;
+  struct REGEX_ITERNAL_StateSet nfa_start_eps_cls;
+  struct REGEX_ITERNAL_StateSet singleton_set;
 
-  GNUNET_REGEX_context_init (&ctx);
+  REGEX_ITERNAL_context_init (&ctx);
 
   /* Create NFA */
   // fprintf (stderr, "N");
-  nfa = GNUNET_REGEX_construct_nfa (regex, len);
+  nfa = REGEX_ITERNAL_construct_nfa (regex, len);
 
   if (NULL == nfa)
   {
@@ -3044,12 +3045,12 @@
     return NULL;
   }
 
-  dfa = GNUNET_malloc (sizeof (struct GNUNET_REGEX_Automaton));
+  dfa = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_Automaton));
   dfa->type = DFA;
   dfa->regex = GNUNET_strdup (regex);
 
   /* Create DFA start state from epsilon closure */
-  memset (&singleton_set, 0, sizeof (struct GNUNET_REGEX_StateSet));
+  memset (&singleton_set, 0, sizeof (struct REGEX_ITERNAL_StateSet));
   state_set_append (&singleton_set, nfa->start);
   nfa_closure_set_create (&nfa_start_eps_cls, nfa, &singleton_set, NULL);
   state_set_clear (&singleton_set);
@@ -3058,20 +3059,20 @@
 
   // fprintf (stderr, "D");
   construct_dfa_states (&ctx, nfa, dfa, dfa->start);
-  GNUNET_REGEX_automaton_destroy (nfa);
+  REGEX_ITERNAL_automaton_destroy (nfa);
 
   /* Minimize DFA */
   // fprintf (stderr, "M");
   if (GNUNET_OK != dfa_minimize (&ctx, dfa))
   {
-    GNUNET_REGEX_automaton_destroy (dfa);
+    REGEX_ITERNAL_automaton_destroy (dfa);
     return NULL;
   }
 
   /* Create proofs and hashes for all states */
   if (GNUNET_OK != automaton_create_proofs (dfa))
   {
-    GNUNET_REGEX_automaton_destroy (dfa);
+    REGEX_ITERNAL_automaton_destroy (dfa);
     return NULL;
   }
 
@@ -3084,16 +3085,16 @@
 
 
 /**
- * Free the memory allocated by constructing the GNUNET_REGEX_Automaton data
+ * Free the memory allocated by constructing the REGEX_ITERNAL_Automaton data
  * structure.
  *
  * @param a automaton to be destroyed
  */
 void
-GNUNET_REGEX_automaton_destroy (struct GNUNET_REGEX_Automaton *a)
+REGEX_ITERNAL_automaton_destroy (struct REGEX_ITERNAL_Automaton *a)
 {
-  struct GNUNET_REGEX_State *s;
-  struct GNUNET_REGEX_State *next_state;
+  struct REGEX_ITERNAL_State *s;
+  struct REGEX_ITERNAL_State *next_state;
 
   if (NULL == a)
     return;
@@ -3121,10 +3122,10 @@
  * @return 0 if string matches, non 0 otherwise
  */
 static int
-evaluate_dfa (struct GNUNET_REGEX_Automaton *a, const char *string)
+evaluate_dfa (struct REGEX_ITERNAL_Automaton *a, const char *string)
 {
   const char *strp;
-  struct GNUNET_REGEX_State *s;
+  struct REGEX_ITERNAL_State *s;
   unsigned int step_len;
 
   if (DFA != a->type)
@@ -3164,14 +3165,14 @@
  * @return 0 if string matches, non 0 otherwise
  */
 static int
-evaluate_nfa (struct GNUNET_REGEX_Automaton *a, const char *string)
+evaluate_nfa (struct REGEX_ITERNAL_Automaton *a, const char *string)
 {
   const char *strp;
   char str[2];
-  struct GNUNET_REGEX_State *s;
-  struct GNUNET_REGEX_StateSet sset;
-  struct GNUNET_REGEX_StateSet new_sset;
-  struct GNUNET_REGEX_StateSet singleton_set;
+  struct REGEX_ITERNAL_State *s;
+  struct REGEX_ITERNAL_StateSet sset;
+  struct REGEX_ITERNAL_StateSet new_sset;
+  struct REGEX_ITERNAL_StateSet singleton_set;
   unsigned int i;
   int result;
 
@@ -3187,7 +3188,7 @@
     return 0;
 
   result = 1;
-  memset (&singleton_set, 0, sizeof (struct GNUNET_REGEX_StateSet));
+  memset (&singleton_set, 0, sizeof (struct REGEX_ITERNAL_StateSet));
   state_set_append (&singleton_set, a->start);
   nfa_closure_set_create (&sset, a, &singleton_set, NULL);
   state_set_clear (&singleton_set);
@@ -3226,7 +3227,7 @@
  * @return 0 if string matches, non 0 otherwise
  */
 int
-GNUNET_REGEX_eval (struct GNUNET_REGEX_Automaton *a, const char *string)
+REGEX_ITERNAL_eval (struct REGEX_ITERNAL_Automaton *a, const char *string)
 {
   int result;
 
@@ -3261,7 +3262,7 @@
  * @return
  */
 const char *
-GNUNET_REGEX_get_canonical_regex (struct GNUNET_REGEX_Automaton *a)
+REGEX_ITERNAL_get_canonical_regex (struct REGEX_ITERNAL_Automaton *a)
 {
   if (NULL == a)
     return NULL;
@@ -3278,10 +3279,10 @@
  * @return number of transitions in the given automaton.
  */
 unsigned int
-GNUNET_REGEX_get_transition_count (struct GNUNET_REGEX_Automaton *a)
+REGEX_ITERNAL_get_transition_count (struct REGEX_ITERNAL_Automaton *a)
 {
   unsigned int t_count;
-  struct GNUNET_REGEX_State *s;
+  struct REGEX_ITERNAL_State *s;
 
   if (NULL == a)
     return 0;
@@ -3306,7 +3307,7 @@
  *         to construct the key
  */
 size_t
-GNUNET_REGEX_get_first_key (const char *input_string, size_t string_len,
+REGEX_ITERNAL_get_first_key (const char *input_string, size_t string_len,
                             struct GNUNET_HashCode * key)
 {
   unsigned int size;
@@ -3336,7 +3337,7 @@
  * @return GNUNET_OK if the proof is valid for the given key.
  */
 int
-GNUNET_REGEX_check_proof (const char *proof, const struct GNUNET_HashCode *key)
+REGEX_ITERNAL_check_proof (const char *proof, const struct GNUNET_HashCode 
*key)
 {
   struct GNUNET_HashCode key_check;
 
@@ -3364,15 +3365,15 @@
  */
 static void
 iterate_initial_edge (const unsigned int min_len, const unsigned int max_len,
-                      char *consumed_string, struct GNUNET_REGEX_State *state,
-                      GNUNET_REGEX_KeyIterator iterator, void *iterator_cls)
+                      char *consumed_string, struct REGEX_ITERNAL_State *state,
+                      REGEX_ITERNAL_KeyIterator iterator, void *iterator_cls)
 {
   unsigned int i;
   char *temp;
-  struct GNUNET_REGEX_Transition *t;
+  struct REGEX_ITERNAL_Transition *t;
   unsigned int num_edges = state->transition_count;
-  struct GNUNET_REGEX_Edge edges[num_edges];
-  struct GNUNET_REGEX_Edge edge[1];
+  struct REGEX_ITERNAL_Edge edges[num_edges];
+  struct REGEX_ITERNAL_Edge edge[1];
   struct GNUNET_HashCode hash;
   struct GNUNET_HashCode hash_new;
 
@@ -3454,15 +3455,15 @@
  * @param iterator_cls closure.
  */
 void
-GNUNET_REGEX_iterate_all_edges (struct GNUNET_REGEX_Automaton *a,
-                                GNUNET_REGEX_KeyIterator iterator,
+REGEX_ITERNAL_iterate_all_edges (struct REGEX_ITERNAL_Automaton *a,
+                                REGEX_ITERNAL_KeyIterator iterator,
                                 void *iterator_cls)
 {
-  struct GNUNET_REGEX_State *s;
+  struct REGEX_ITERNAL_State *s;
 
   for (s = a->states_head; NULL != s; s = s->next)
   {
-    struct GNUNET_REGEX_Edge edges[s->transition_count];
+    struct REGEX_ITERNAL_Edge edges[s->transition_count];
     unsigned int num_edges;
 
     num_edges = state_get_edges (s, edges);
@@ -3479,116 +3480,6 @@
 }
 
 
-/**
- * Create a string with binary IP notation for the given 'addr' in 'str'.
- *
- * @param af address family of the given 'addr'.
- * @param addr address that should be converted to a string.
- *             struct in_addr * for IPv4 and struct in6_addr * for IPv6.
- * @param str string that will contain binary notation of 'addr'. Expected
- *            to be at least 33 bytes long for IPv4 and 129 bytes long for 
IPv6.
- */
-static void
-iptobinstr (const int af, const void *addr, char *str)
-{
-  int i;
-  
-  switch (af)
-  {
-    case AF_INET:
-    {
-      uint32_t b = htonl (((struct in_addr *) addr)->s_addr);
-      
-      str[32] = '\0';
-          str += 31;
-          for (i = 31; i >= 0; i--)
-          {
-            *str = (b & 1) + '0';
-            str--;
-            b >>= 1;
-          }
-              break;
-    }
-    case AF_INET6:
-    {
-      struct in6_addr b = *(const struct in6_addr *) addr;
-      
-      str[128] = '\0';
-            str += 127;
-            for (i = 127; i >= 0; i--)
-            {
-              *str = (b.s6_addr[i / 8] & 1) + '0';
-            str--;
-            b.s6_addr[i / 8] >>= 1;
-            }
-                break;
-    }
-  }
-}
 
 
-/**
- * Get the ipv4 network prefix from the given 'netmask'.
- *
- * @param netmask netmask for which to get the prefix len.
- *
- * @return length of ipv4 prefix for 'netmask'.
- */
-static unsigned int
-ipv4netmasktoprefixlen (const char *netmask)
-{
-  struct in_addr a;
-  unsigned int len;
-  uint32_t t;
-  
-  if (1 != inet_pton (AF_INET, netmask, &a))
-    return 0;
-  len = 32;
-  for (t = htonl (~a.s_addr); 0 != t; t >>= 1)
-    len--;
-  return len;
-}
-
-
-/**
- * Create a regex in 'rxstr' from the given 'ip' and 'netmask'.
- *
- * @param ip IPv4 representation.
- * @param netmask netmask for the ip.
- * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV4_REGEXLEN
- *              bytes long.
- */
-void
-GNUNET_REGEX_ipv4toregex (const struct in_addr *ip, const char *netmask,
-                          char *rxstr)
-{
-  unsigned int pfxlen;
-  
-  pfxlen = ipv4netmasktoprefixlen (netmask);
-  iptobinstr (AF_INET, ip, rxstr);
-  rxstr[pfxlen] = '\0';
-            if (pfxlen < 32)
-              strcat (rxstr, "(0|1)+");
-}
-
-
-/**
- * Create a regex in 'rxstr' from the given 'ipv6' and 'prefixlen'.
- *
- * @param ipv6 IPv6 representation.
- * @param prefixlen length of the ipv6 prefix.
- * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV6_REGEXLEN
- *              bytes long.
- */
-void
-GNUNET_REGEX_ipv6toregex (const struct in6_addr *ipv6, unsigned int prefixlen,
-                          char *rxstr)
-{
-  iptobinstr (AF_INET6, ipv6, rxstr);
-  rxstr[prefixlen] = '\0';
-    if (prefixlen < 128)
-      strcat (rxstr, "(0|1)+");
-}
-
-
 /* end of regex.c */

Modified: gnunet/src/regex/regex_block_lib.c
===================================================================
--- gnunet/src/regex/regex_block_lib.c  2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex_block_lib.c  2013-06-20 08:32:50 UTC (rev 27498)
@@ -92,7 +92,7 @@
 
 
 int
-GNUNET_REGEX_block_check (const struct RegexBlock *block,
+REGEX_ITERNAL_block_check (const struct RegexBlock *block,
                           size_t size,
                           const char *xquery)
 {
@@ -109,7 +109,7 @@
   ctx.xquery = xquery;
   ctx.found = GNUNET_NO;
   ctx.key = GNUNET_strdup (GNUNET_h2s (&block->key));
-  res = GNUNET_REGEX_block_iterate (block, size, &check_edge, &ctx);
+  res = REGEX_ITERNAL_block_iterate (block, size, &check_edge, &ctx);
   GNUNET_free (ctx.key);
   if (GNUNET_SYSERR == res)
     return GNUNET_SYSERR;
@@ -120,9 +120,9 @@
 
 
 int
-GNUNET_REGEX_block_iterate (const struct RegexBlock *block,
+REGEX_ITERNAL_block_iterate (const struct RegexBlock *block,
                             size_t size,
-                            GNUNET_REGEX_EgdeIterator iterator,
+                            REGEX_ITERNAL_EgdeIterator iterator,
                             void *iter_cls)
 {
   struct RegexEdge *edge;

Modified: gnunet/src/regex/regex_block_lib.h
===================================================================
--- gnunet/src/regex/regex_block_lib.h  2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex_block_lib.h  2013-06-20 08:32:50 UTC (rev 27498)
@@ -52,7 +52,7 @@
  *         GNUNET_SYSERR if the block is invalid.
  */
 int
-GNUNET_REGEX_block_check (const struct RegexBlock *block,
+REGEX_ITERNAL_block_check (const struct RegexBlock *block,
                           size_t size,
                           const char *xquery);
 
@@ -66,7 +66,7 @@
  *
  * @return GNUNET_YES if should keep iterating, GNUNET_NO otherwise.
  */
-typedef int (*GNUNET_REGEX_EgdeIterator)(void *cls,
+typedef int (*REGEX_ITERNAL_EgdeIterator)(void *cls,
                                          const char *token,
                                          size_t len,
                                          const struct GNUNET_HashCode *key);
@@ -89,9 +89,9 @@
  *         be errors in further edges.
  */
 int
-GNUNET_REGEX_block_iterate (const struct RegexBlock *block,
+REGEX_ITERNAL_block_iterate (const struct RegexBlock *block,
                             size_t size,
-                            GNUNET_REGEX_EgdeIterator iterator,
+                            REGEX_ITERNAL_EgdeIterator iterator,
                             void *iter_cls);
 
 #if 0                           /* keep Emacsens' auto-indent happy */

Modified: gnunet/src/regex/regex_dht.c
===================================================================
--- gnunet/src/regex/regex_dht.c        2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex_dht.c        2013-06-20 08:32:50 UTC (rev 27498)
@@ -24,7 +24,7 @@
  * @author Bartlomiej Polot
  */
 #include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_block_lib.h"
 #include "gnunet_dht_service.h"
 #include "gnunet_statistics_service.h"
@@ -42,7 +42,7 @@
 #define DHT_OPT         GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE
 #endif
 
-struct GNUNET_REGEX_announce_handle
+struct REGEX_ITERNAL_Announcement
 {
   /**
    * DHT handle to use, must be initialized externally.
@@ -57,7 +57,7 @@
   /**
    * Automaton representation of the regex (expensive to build).
    */
-  struct GNUNET_REGEX_Automaton* dfa;
+  struct REGEX_ITERNAL_Automaton* dfa;
 
   /**
    * Identity under which to announce the regex.
@@ -87,9 +87,9 @@
                 const char *proof,
                 int accepting,
                 unsigned int num_edges,
-                const struct GNUNET_REGEX_Edge *edges)
+                const struct REGEX_ITERNAL_Edge *edges)
 {
-  struct GNUNET_REGEX_announce_handle *h = cls;
+  struct REGEX_ITERNAL_Announcement *h = cls;
   struct RegexBlock *block;
   struct RegexEdge *block_edge;
   size_t size;
@@ -182,41 +182,41 @@
 }
 
 
-struct GNUNET_REGEX_announce_handle *
-GNUNET_REGEX_announce (struct GNUNET_DHT_Handle *dht,
+struct REGEX_ITERNAL_Announcement *
+REGEX_ITERNAL_announce (struct GNUNET_DHT_Handle *dht,
                        const struct GNUNET_PeerIdentity *id,
                        const char *regex,
                        uint16_t compression,
                        struct GNUNET_STATISTICS_Handle *stats)
 {
-  struct GNUNET_REGEX_announce_handle *h;
+  struct REGEX_ITERNAL_Announcement *h;
 
   GNUNET_assert (NULL != dht);
-  h = GNUNET_malloc (sizeof (struct GNUNET_REGEX_announce_handle));
+  h = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_Announcement));
   h->regex = regex;
   h->dht = dht;
   h->stats = stats;
   h->id = *id;
-  h->dfa = GNUNET_REGEX_construct_dfa (regex,
+  h->dfa = REGEX_ITERNAL_construct_dfa (regex,
                                        strlen (regex),
                                        compression);
-  GNUNET_REGEX_reannounce (h);
+  REGEX_ITERNAL_reannounce (h);
   return h;
 }
 
 void
-GNUNET_REGEX_reannounce (struct GNUNET_REGEX_announce_handle *h)
+REGEX_ITERNAL_reannounce (struct REGEX_ITERNAL_Announcement *h)
 {
   GNUNET_assert (NULL != h->dfa); /* make sure to call announce first */
-  LOG (GNUNET_ERROR_TYPE_INFO, "GNUNET_REGEX_reannounce: %.60s\n", h->regex);
+  LOG (GNUNET_ERROR_TYPE_INFO, "REGEX_ITERNAL_reannounce: %.60s\n", h->regex);
   LOG (GNUNET_ERROR_TYPE_DEBUG, "  full: %s\n", h->regex);
-  GNUNET_REGEX_iterate_all_edges (h->dfa, &regex_iterator, h);
+  REGEX_ITERNAL_iterate_all_edges (h->dfa, &regex_iterator, h);
 }
 
 void
-GNUNET_REGEX_announce_cancel (struct GNUNET_REGEX_announce_handle *h)
+REGEX_ITERNAL_announce_cancel (struct REGEX_ITERNAL_Announcement *h)
 {
-  GNUNET_REGEX_automaton_destroy (h->dfa);
+  REGEX_ITERNAL_automaton_destroy (h->dfa);
   GNUNET_free (h);
 }
 
@@ -239,7 +239,7 @@
     /**
      * Information about the search.
      */
-  struct GNUNET_REGEX_search_handle *info;
+  struct REGEX_ITERNAL_Search *info;
 
     /**
      * We just want to look for one edge, the longer the better.
@@ -258,7 +258,7 @@
  * Struct to keep information of searches of services described by a regex
  * using a user-provided string service description.
  */
-struct GNUNET_REGEX_search_handle
+struct REGEX_ITERNAL_Search
 {
     /**
      * DHT handle to use, must be initialized externally.
@@ -298,7 +298,7 @@
   /**
    * @param callback Callback for found peers.
    */
-  GNUNET_REGEX_Found callback;
+  REGEX_ITERNAL_Found callback;
 
   /**
    * @param callback_cls Closure for @c callback.
@@ -350,7 +350,7 @@
 {
   const struct RegexAccept *block = data;
   struct RegexSearchContext *ctx = cls;
-  struct GNUNET_REGEX_search_handle *info = ctx->info;
+  struct REGEX_ITERNAL_Search *info = ctx->info;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Got regex results from DHT!\n");
   LOG (GNUNET_ERROR_TYPE_INFO, "   accept for %s (key %s)\n",
@@ -429,7 +429,7 @@
 {
   const struct RegexBlock *block = data;
   struct RegexSearchContext *ctx = cls;
-  struct GNUNET_REGEX_search_handle *info = ctx->info;
+  struct REGEX_ITERNAL_Search *info = ctx->info;
   void *copy;
   size_t len;
   char *datastore;
@@ -465,7 +465,7 @@
 
     memcpy (proof, &block[1], len);
     proof[len] = '\0';
-    if (GNUNET_OK != GNUNET_REGEX_check_proof (proof, key))
+    if (GNUNET_OK != REGEX_ITERNAL_check_proof (proof, key))
     {
       GNUNET_break_op (0);
       return;
@@ -545,7 +545,7 @@
                      const struct GNUNET_HashCode *key)
 {
   struct RegexSearchContext *ctx = cls;
-  struct GNUNET_REGEX_search_handle *info = ctx->info;
+  struct REGEX_ITERNAL_Search *info = ctx->info;
   const char *current;
   size_t current_len;
 
@@ -604,7 +604,7 @@
                  struct RegexSearchContext *ctx)
 {
   struct RegexSearchContext *new_ctx;
-  struct GNUNET_REGEX_search_handle *info = ctx->info;
+  struct REGEX_ITERNAL_Search *info = ctx->info;
   struct GNUNET_DHT_GetHandle *get_h;
   struct GNUNET_HashCode *hash;
   const char *rest;
@@ -613,7 +613,7 @@
   /* Find the longest match for the current string position, 
    * among tokens in the given block */
   ctx->longest_match = 0;
-  result = GNUNET_REGEX_block_iterate (block, size,
+  result = REGEX_ITERNAL_block_iterate (block, size,
                                        &regex_edge_iterator, ctx);
   GNUNET_break (GNUNET_OK == result);
 
@@ -672,14 +672,14 @@
 }
 
 
-struct GNUNET_REGEX_search_handle *
-GNUNET_REGEX_search (struct GNUNET_DHT_Handle *dht,
+struct REGEX_ITERNAL_Search *
+REGEX_ITERNAL_search (struct GNUNET_DHT_Handle *dht,
                      const char *string,
-                     GNUNET_REGEX_Found callback,
+                     REGEX_ITERNAL_Found callback,
                      void *callback_cls,
                      struct GNUNET_STATISTICS_Handle *stats)
 {
-  struct GNUNET_REGEX_search_handle *h;
+  struct REGEX_ITERNAL_Search *h;
   struct GNUNET_DHT_GetHandle *get_h;
   struct RegexSearchContext *ctx;
   struct GNUNET_HashCode key;
@@ -687,10 +687,10 @@
   size_t len;
 
   /* Initialize handle */
-  LOG (GNUNET_ERROR_TYPE_INFO, "GNUNET_REGEX_search: %s\n", string);
+  LOG (GNUNET_ERROR_TYPE_INFO, "REGEX_ITERNAL_search: %s\n", string);
   GNUNET_assert (NULL != dht);
   GNUNET_assert (NULL != callback);
-  h = GNUNET_malloc (sizeof (struct GNUNET_REGEX_search_handle));
+  h = GNUNET_malloc (sizeof (struct REGEX_ITERNAL_Search));
   h->dht = dht;
   h->description = GNUNET_strdup (string);
   h->callback = callback;
@@ -701,7 +701,7 @@
 
   /* Initialize context */
   len = strlen (string);
-  size = GNUNET_REGEX_get_first_key (string, len, &key);
+  size = REGEX_ITERNAL_get_first_key (string, len, &key);
   ctx = GNUNET_malloc (sizeof (struct RegexSearchContext));
   ctx->position = size;
   ctx->info = h;
@@ -781,7 +781,7 @@
  * @param ctx The search context.
  */
 static void
-regex_cancel_search (struct GNUNET_REGEX_search_handle *ctx)
+regex_cancel_search (struct REGEX_ITERNAL_Search *ctx)
 {
   GNUNET_free (ctx->description);
   GNUNET_CONTAINER_multihashmap_iterate (ctx->dht_get_handles,
@@ -803,7 +803,7 @@
 }
 
 void
-GNUNET_REGEX_search_cancel (struct GNUNET_REGEX_search_handle *h)
+REGEX_ITERNAL_search_cancel (struct REGEX_ITERNAL_Search *h)
 {
   regex_cancel_search (h);
   GNUNET_free (h);

Modified: gnunet/src/regex/regex_graph.c
===================================================================
--- gnunet/src/regex/regex_graph.c      2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex_graph.c      2013-06-20 08:32:50 UTC (rev 27498)
@@ -23,14 +23,14 @@
  * @author Maximilian Szengel
  */
 #include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_internal.h"
 
 /**
  * Context for graph creation. Passed as the cls to
- * GNUNET_REGEX_automaton_save_graph_step.
+ * REGEX_ITERNAL_automaton_save_graph_step.
  */
-struct GNUNET_REGEX_Graph_Context
+struct REGEX_ITERNAL_Graph_Context
 {
   /**
    * File pointer to the dot file used for output.
@@ -63,12 +63,12 @@
  */
 static void
 scc_tarjan_strongconnect (unsigned int *scc_counter,
-                          struct GNUNET_REGEX_State *v, unsigned int *index,
-                          struct GNUNET_REGEX_State **stack,
+                          struct REGEX_ITERNAL_State *v, unsigned int *index,
+                          struct REGEX_ITERNAL_State **stack,
                           unsigned int *stack_size)
 {
-  struct GNUNET_REGEX_State *w;
-  struct GNUNET_REGEX_Transition *t;
+  struct REGEX_ITERNAL_State *w;
+  struct REGEX_ITERNAL_Transition *t;
 
   v->index = *index;
   v->lowlink = *index;
@@ -113,12 +113,12 @@
  * @param a the automaton for which SCCs should be computed and assigned.
  */
 static void
-scc_tarjan (struct GNUNET_REGEX_Automaton *a)
+scc_tarjan (struct REGEX_ITERNAL_Automaton *a)
 {
   unsigned int index;
   unsigned int scc_counter;
-  struct GNUNET_REGEX_State *v;
-  struct GNUNET_REGEX_State *stack[a->state_count];
+  struct REGEX_ITERNAL_State *v;
+  struct REGEX_ITERNAL_State *stack[a->state_count];
   unsigned int stack_size;
 
   for (v = a->states_head; NULL != v; v = v->next)
@@ -143,18 +143,18 @@
 /**
  * Save a state to an open file pointer. cls is expected to be a file pointer 
to
  * an open file. Used only in conjunction with
- * GNUNET_REGEX_automaton_save_graph.
+ * REGEX_ITERNAL_automaton_save_graph.
  *
  * @param cls file pointer.
  * @param count current count of the state, not used.
  * @param s state.
  */
 void
-GNUNET_REGEX_automaton_save_graph_step (void *cls, unsigned int count,
-                                        struct GNUNET_REGEX_State *s)
+REGEX_ITERNAL_automaton_save_graph_step (void *cls, unsigned int count,
+                                        struct REGEX_ITERNAL_State *s)
 {
-  struct GNUNET_REGEX_Graph_Context *ctx = cls;
-  struct GNUNET_REGEX_Transition *ctran;
+  struct REGEX_ITERNAL_Graph_Context *ctx = cls;
+  struct REGEX_ITERNAL_Transition *ctran;
   char *s_acc = NULL;
   char *s_tran = NULL;
   char *name;
@@ -267,13 +267,13 @@
  *                mode
  */
 void
-GNUNET_REGEX_automaton_save_graph (struct GNUNET_REGEX_Automaton *a,
+REGEX_ITERNAL_automaton_save_graph (struct REGEX_ITERNAL_Automaton *a,
                                    const char *filename,
-                                   enum GNUNET_REGEX_GraphSavingOptions 
options)
+                                   enum REGEX_ITERNAL_GraphSavingOptions 
options)
 {
   char *start;
   char *end;
-  struct GNUNET_REGEX_Graph_Context ctx;
+  struct REGEX_ITERNAL_Graph_Context ctx;
 
   if (NULL == a)
   {
@@ -289,9 +289,9 @@
 
   ctx.filep = fopen (filename, "w");
   ctx.verbose =
-      (0 == (options & GNUNET_REGEX_GRAPH_VERBOSE)) ? GNUNET_NO : GNUNET_YES;
+      (0 == (options & REGEX_ITERNAL_GRAPH_VERBOSE)) ? GNUNET_NO : GNUNET_YES;
   ctx.coloring =
-      (0 == (options & GNUNET_REGEX_GRAPH_COLORING)) ? GNUNET_NO : GNUNET_YES;
+      (0 == (options & REGEX_ITERNAL_GRAPH_COLORING)) ? GNUNET_NO : GNUNET_YES;
 
   if (NULL == ctx.filep)
   {
@@ -307,8 +307,8 @@
   start = "digraph G {\nrankdir=LR\n";
   fwrite (start, strlen (start), 1, ctx.filep);
 
-  GNUNET_REGEX_automaton_traverse (a, a->start, NULL, NULL,
-                                   &GNUNET_REGEX_automaton_save_graph_step,
+  REGEX_ITERNAL_automaton_traverse (a, a->start, NULL, NULL,
+                                   &REGEX_ITERNAL_automaton_save_graph_step,
                                    &ctx);
 
   end = "\n}\n";

Modified: gnunet/src/regex/regex_internal.h
===================================================================
--- gnunet/src/regex/regex_internal.h   2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex_internal.h   2013-06-20 08:32:50 UTC (rev 27498)
@@ -25,7 +25,7 @@
 #ifndef REGEX_INTERNAL_H
 #define REGEX_INTERNAL_H
 
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -47,17 +47,17 @@
  * which they origin ('from_state'). Each state can have 0-n transitions.
  * If label is NULL, this is considered to be an epsilon transition.
  */
-struct GNUNET_REGEX_Transition
+struct REGEX_ITERNAL_Transition
 {
   /**
    * This is a linked list.
    */
-  struct GNUNET_REGEX_Transition *prev;
+  struct REGEX_ITERNAL_Transition *prev;
 
   /**
    * This is a linked list.
    */
-  struct GNUNET_REGEX_Transition *next;
+  struct REGEX_ITERNAL_Transition *next;
 
   /**
    * Unique id of this transition.
@@ -72,30 +72,30 @@
   /**
    * State to which this transition leads.
    */
-  struct GNUNET_REGEX_State *to_state;
+  struct REGEX_ITERNAL_State *to_state;
 
   /**
    * State from which this transition origins.
    */
-  struct GNUNET_REGEX_State *from_state;
+  struct REGEX_ITERNAL_State *from_state;
 };
 
 
 /**
  * A state. Can be used in DFA and NFA automatons.
  */
-struct GNUNET_REGEX_State;
+struct REGEX_ITERNAL_State;
 
 
 /**
  * Set of states.
  */
-struct GNUNET_REGEX_StateSet
+struct REGEX_ITERNAL_StateSet
 {
   /**
    * Array of states.
    */
-  struct GNUNET_REGEX_State **states;
+  struct REGEX_ITERNAL_State **states;
 
   /**
    * Number of entries in *use* in the 'states' array.
@@ -112,37 +112,37 @@
 /**
  * A state. Can be used in DFA and NFA automatons.
  */
-struct GNUNET_REGEX_State
+struct REGEX_ITERNAL_State
 {
   /**
    * This is a linked list to keep states in an automaton.
    */
-  struct GNUNET_REGEX_State *prev;
+  struct REGEX_ITERNAL_State *prev;
 
   /**
    * This is a linked list to keep states in an automaton.
    */
-  struct GNUNET_REGEX_State *next;
+  struct REGEX_ITERNAL_State *next;
 
   /**
    * This is a multi DLL for StateSet_MDLL.
    */
-  struct GNUNET_REGEX_State *prev_SS;
+  struct REGEX_ITERNAL_State *prev_SS;
 
   /**
    * This is a multi DLL for StateSet_MDLL.
    */
-  struct GNUNET_REGEX_State *next_SS;
+  struct REGEX_ITERNAL_State *next_SS;
 
   /**
    * This is a multi DLL for StateSet_MDLL Stack.
    */
-  struct GNUNET_REGEX_State *prev_ST;
+  struct REGEX_ITERNAL_State *prev_ST;
 
   /**
    * This is a multi DLL for StateSet_MDLL Stack.
    */
-  struct GNUNET_REGEX_State *next_ST;
+  struct REGEX_ITERNAL_State *next_ST;
 
   /**
    * Unique state id.
@@ -222,12 +222,12 @@
   /**
    * DLL of transitions.
    */
-  struct GNUNET_REGEX_Transition *transitions_head;
+  struct REGEX_ITERNAL_Transition *transitions_head;
 
   /**
    * DLL of transitions.
    */
-  struct GNUNET_REGEX_Transition *transitions_tail;
+  struct REGEX_ITERNAL_Transition *transitions_tail;
 
   /**
    * Number of incoming transitions. Used for compressing DFA paths.
@@ -238,14 +238,14 @@
    * Set of states on which this state is based on. Used when creating a DFA 
out
    * of several NFA states.
    */
-  struct GNUNET_REGEX_StateSet nfa_set;
+  struct REGEX_ITERNAL_StateSet nfa_set;
 };
 
 
 /**
  * Type of an automaton.
  */
-enum GNUNET_REGEX_AutomatonType
+enum REGEX_ITERNAL_AutomatonType
 {
   NFA,
   DFA
@@ -255,28 +255,28 @@
 /**
  * Automaton representation.
  */
-struct GNUNET_REGEX_Automaton
+struct REGEX_ITERNAL_Automaton
 {
   /**
    * Linked list of NFAs used for partial NFA creation.
    */
-  struct GNUNET_REGEX_Automaton *prev;
+  struct REGEX_ITERNAL_Automaton *prev;
 
   /**
    * Linked list of NFAs used for partial NFA creation.
    */
-  struct GNUNET_REGEX_Automaton *next;
+  struct REGEX_ITERNAL_Automaton *next;
 
   /**
    * First state of the automaton. This is mainly used for constructing an NFA,
    * where each NFA itself consists of one or more NFAs linked together.
    */
-  struct GNUNET_REGEX_State *start;
+  struct REGEX_ITERNAL_State *start;
 
   /**
    * End state of the partial NFA. This is undefined for DFAs
    */
-  struct GNUNET_REGEX_State *end;
+  struct REGEX_ITERNAL_State *end;
 
   /**
    * Number of states in the automaton.
@@ -286,17 +286,17 @@
   /**
    * DLL of states.
    */
-  struct GNUNET_REGEX_State *states_head;
+  struct REGEX_ITERNAL_State *states_head;
 
   /**
    * DLL of states
    */
-  struct GNUNET_REGEX_State *states_tail;
+  struct REGEX_ITERNAL_State *states_tail;
 
   /**
    * Type of the automaton.
    */
-  enum GNUNET_REGEX_AutomatonType type;
+  enum REGEX_ITERNAL_AutomatonType type;
 
   /**
    * Regex
@@ -321,10 +321,10 @@
  * @param regex regular expression string.
  * @param len length of the string.
  *
- * @return NFA, needs to be freed using GNUNET_REGEX_automaton_destroy.
+ * @return NFA, needs to be freed using REGEX_ITERNAL_automaton_destroy.
  */
-struct GNUNET_REGEX_Automaton *
-GNUNET_REGEX_construct_nfa (const char *regex, const size_t len);
+struct REGEX_ITERNAL_Automaton *
+REGEX_ITERNAL_construct_nfa (const char *regex, const size_t len);
 
 
 /**
@@ -339,9 +339,9 @@
  *
  * @return GNUNET_YES to proceed traversal, GNUNET_NO to stop.
  */
-typedef int (*GNUNET_REGEX_traverse_check) (void *cls,
-                                            struct GNUNET_REGEX_State * s,
-                                            struct GNUNET_REGEX_Transition * 
t);
+typedef int (*REGEX_ITERNAL_traverse_check) (void *cls,
+                                            struct REGEX_ITERNAL_State * s,
+                                            struct REGEX_ITERNAL_Transition * 
t);
 
 
 /**
@@ -351,9 +351,9 @@
  * @param count current count of the state, from 0 to a->state_count -1.
  * @param s state.
  */
-typedef void (*GNUNET_REGEX_traverse_action) (void *cls,
+typedef void (*REGEX_ITERNAL_traverse_action) (void *cls,
                                               const unsigned int count,
-                                              struct GNUNET_REGEX_State * s);
+                                              struct REGEX_ITERNAL_State * s);
 
 
 /**
@@ -370,11 +370,11 @@
  * @param action_cls closure for action
  */
 void
-GNUNET_REGEX_automaton_traverse (const struct GNUNET_REGEX_Automaton *a,
-                                 struct GNUNET_REGEX_State *start,
-                                 GNUNET_REGEX_traverse_check check,
+REGEX_ITERNAL_automaton_traverse (const struct REGEX_ITERNAL_Automaton *a,
+                                 struct REGEX_ITERNAL_State *start,
+                                 REGEX_ITERNAL_traverse_check check,
                                  void *check_cls,
-                                 GNUNET_REGEX_traverse_action action,
+                                 REGEX_ITERNAL_traverse_action action,
                                  void *action_cls);
 
 /**
@@ -389,7 +389,7 @@
  * @return canonical regex string.
  */
 const char *
-GNUNET_REGEX_get_canonical_regex (struct GNUNET_REGEX_Automaton *a);
+REGEX_ITERNAL_get_canonical_regex (struct REGEX_ITERNAL_Automaton *a);
 
 
 /**
@@ -400,14 +400,14 @@
  * @return number of transitions in the given automaton.
  */
 unsigned int
-GNUNET_REGEX_get_transition_count (struct GNUNET_REGEX_Automaton *a);
+REGEX_ITERNAL_get_transition_count (struct REGEX_ITERNAL_Automaton *a);
 
 
 /**
  * Context that contains an id counter for states and transitions as well as a
  * DLL of automatons used as a stack for NFA construction.
  */
-struct GNUNET_REGEX_Context
+struct REGEX_ITERNAL_Context
 {
   /**
    * Unique state id.
@@ -420,14 +420,14 @@
   unsigned int transition_id;
 
   /**
-   * DLL of GNUNET_REGEX_Automaton's used as a stack.
+   * DLL of REGEX_ITERNAL_Automaton's used as a stack.
    */
-  struct GNUNET_REGEX_Automaton *stack_head;
+  struct REGEX_ITERNAL_Automaton *stack_head;
 
   /**
-   * DLL of GNUNET_REGEX_Automaton's used as a stack.
+   * DLL of REGEX_ITERNAL_Automaton's used as a stack.
    */
-  struct GNUNET_REGEX_Automaton *stack_tail;
+  struct REGEX_ITERNAL_Automaton *stack_tail;
 };
 
 
@@ -439,8 +439,8 @@
  * @param stride_len length of the strides.
  */
 void
-GNUNET_REGEX_dfa_add_multi_strides (struct GNUNET_REGEX_Context *regex_ctx,
-                                    struct GNUNET_REGEX_Automaton *dfa,
+REGEX_ITERNAL_dfa_add_multi_strides (struct REGEX_ITERNAL_Context *regex_ctx,
+                                    struct REGEX_ITERNAL_Automaton *dfa,
                                     const unsigned int stride_len);
 
 
@@ -458,7 +458,7 @@
  *         needs to be freed, otherwise.
  */
 char *
-GNUNET_REGEX_generate_random_regex (size_t rx_length, char *matching_str);
+REGEX_ITERNAL_generate_random_regex (size_t rx_length, char *matching_str);
 
 
 /**
@@ -471,7 +471,7 @@
  * @return random string that needs to be freed.
  */
 char *
-GNUNET_REGEX_generate_random_string (size_t max_len);
+REGEX_ITERNAL_generate_random_string (size_t max_len);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */

Copied: gnunet/src/regex/regex_internal_lib.h (from rev 27497, 
gnunet/src/include/gnunet_regex_lib.h)
===================================================================
--- gnunet/src/regex/regex_internal_lib.h                               (rev 0)
+++ gnunet/src/regex/regex_internal_lib.h       2013-06-20 08:32:50 UTC (rev 
27498)
@@ -0,0 +1,320 @@
+/*
+     This file is part of GNUnet
+     (C) 2012, 2013 Christian Grothoff (and other contributing authors)
+
+     GNUnet is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 3, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+/**
+ * @file regex/regex_internal_lib.h
+ * @brief library to parse regular expressions into dfa
+ * @author Maximilian Szengel
+ *
+ */
+
+#ifndef REGEX_INTERNAL_LIB_H
+#define REGEX_INTERNAL_LIB_H
+
+#include "gnunet_util_lib.h"
+#include "gnunet_dht_service.h"
+#include "gnunet_statistics_service.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#if 0                           /* keep Emacsens' auto-indent happy */
+}
+#endif
+#endif
+
+
+
+
+/**
+ * Automaton (NFA/DFA) representation.
+- */
+struct REGEX_ITERNAL_Automaton;
+
+
+/**
+ * Edge representation.
+ */
+struct REGEX_ITERNAL_Edge
+{
+  /**
+   * Label of the edge.  FIXME: might want to not consume exactly multiples of 
8 bits, need length?
+   */
+  const char *label;
+
+  /**
+   * Destionation of the edge.
+   */
+  struct GNUNET_HashCode destination;
+};
+
+
+/**
+ * Construct DFA for the given 'regex' of length 'len'.
+ *
+ * Path compression means, that for example a DFA o -> a -> b -> c -> o will be
+ * compressed to o -> abc -> o. Note that this parameter influences the
+ * non-determinism of states of the resulting NFA in the DHT (number of 
outgoing
+ * edges with the same label). For example for an application that stores IPv4
+ * addresses as bitstrings it could make sense to limit the path compression to
+ * 4 or 8.
+ *
+ * @param regex regular expression string.
+ * @param len length of the regular expression.
+ * @param max_path_len limit the path compression length to the
+ *        given value. If set to 1, no path compression is applied. Set to 0 
for
+ *        maximal possible path compression (generally not desireable).
+ * @return DFA, needs to be freed using REGEX_ITERNAL_automaton_destroy.
+ */
+struct REGEX_ITERNAL_Automaton *
+REGEX_ITERNAL_construct_dfa (const char *regex, const size_t len,
+                            unsigned int max_path_len);
+
+
+/**
+ * Free the memory allocated by constructing the REGEX_ITERNAL_Automaton.
+ * data structure.
+ *
+ * @param a automaton to be destroyed.
+ */
+void
+REGEX_ITERNAL_automaton_destroy (struct REGEX_ITERNAL_Automaton *a);
+
+
+/**
+ * Options for graph creation function
+ * REGEX_ITERNAL_automaton_save_graph.
+ */
+enum REGEX_ITERNAL_GraphSavingOptions
+{
+  /**
+   * Default. Do nothing special.
+   */
+  REGEX_ITERNAL_GRAPH_DEFAULT = 0,
+
+  /**
+   * The generated graph will include extra information such as the NFA states
+   * that were used to generate the DFA state.
+   */
+  REGEX_ITERNAL_GRAPH_VERBOSE = 1,
+
+  /**
+   * Enable graph coloring. Will color each SCC in a different color.
+   */
+  REGEX_ITERNAL_GRAPH_COLORING = 2
+};
+
+
+/**
+ * Save the given automaton as a GraphViz dot file.
+ *
+ * @param a the automaton to be saved.
+ * @param filename where to save the file.
+ * @param options options for graph generation that include coloring or verbose
+ *                mode
+ */
+void
+REGEX_ITERNAL_automaton_save_graph (struct REGEX_ITERNAL_Automaton *a,
+                                   const char *filename,
+                                   enum REGEX_ITERNAL_GraphSavingOptions 
options);
+
+
+/**
+ * Evaluates the given 'string' against the given compiled regex.
+ *
+ * @param a automaton.
+ * @param string string to check.
+ *
+ * @return 0 if string matches, non 0 otherwise.
+ */
+int
+REGEX_ITERNAL_eval (struct REGEX_ITERNAL_Automaton *a,
+                   const char *string);
+
+
+/**
+ * Get the first key for the given 'input_string'. This hashes
+ * the first x bits of the 'input_string'.
+ *
+ * @param input_string string.
+ * @param string_len length of the 'input_string'.
+ * @param key pointer to where to write the hash code.
+ *
+ * @return number of bits of 'input_string' that have been consumed
+ *         to construct the key
+ */
+size_t
+REGEX_ITERNAL_get_first_key (const char *input_string, size_t string_len,
+                            struct GNUNET_HashCode * key);
+
+
+/**
+ * Check if the given 'proof' matches the given 'key'.
+ *
+ * @param proof partial regex of a state.
+ * @param key hash of a state.
+ *
+ * @return GNUNET_OK if the proof is valid for the given key.
+ */
+int
+REGEX_ITERNAL_check_proof (const char *proof,
+                          const struct GNUNET_HashCode *key);
+
+
+/**
+ * Iterator callback function.
+ *
+ * @param cls closure.
+ * @param key hash for current state.
+ * @param proof proof for current state.
+ * @param accepting GNUNET_YES if this is an accepting state, GNUNET_NO if not.
+ * @param num_edges number of edges leaving current state.
+ * @param edges edges leaving current state.
+ */
+typedef void (*REGEX_ITERNAL_KeyIterator)(void *cls,
+                                         const struct GNUNET_HashCode *key,
+                                         const char *proof,
+                                         int accepting,
+                                         unsigned int num_edges,
+                                         const struct REGEX_ITERNAL_Edge 
*edges);
+
+
+/**
+ * Iterate over all edges starting from start state of automaton 'a'. Calling
+ * iterator for each edge.
+ *
+ * @param a automaton.
+ * @param iterator iterator called for each edge.
+ * @param iterator_cls closure.
+ */
+void
+REGEX_ITERNAL_iterate_all_edges (struct REGEX_ITERNAL_Automaton *a,
+                                REGEX_ITERNAL_KeyIterator iterator,
+                                void *iterator_cls);
+
+
+
+/**
+ * Handle to store cached data about a regex announce.
+ */
+struct REGEX_ITERNAL_Announcement;
+
+/**
+ * Handle to store data about a regex search.
+ */
+struct REGEX_ITERNAL_Search;
+
+/**
+ * Announce a regular expression: put all states of the automaton in the DHT.
+ * Does not free resources, must call REGEX_ITERNAL_announce_cancel for that.
+ * 
+ * @param dht An existing and valid DHT service handle. CANNOT be NULL.
+ * @param id ID to announce as provider of regex. Own ID in most cases.
+ * @param regex Regular expression to announce.
+ * @param compression How many characters per edge can we squeeze?
+ * @param stats Optional statistics handle to report usage. Can be NULL.
+ * 
+ * @return Handle to reuse o free cached resources.
+ *         Must be freed by calling REGEX_ITERNAL_announce_cancel.
+ */
+struct REGEX_ITERNAL_Announcement *
+REGEX_ITERNAL_announce (struct GNUNET_DHT_Handle *dht,
+                       const struct GNUNET_PeerIdentity *id,
+                       const char *regex,
+                       uint16_t compression,
+                       struct GNUNET_STATISTICS_Handle *stats);
+
+/**
+ * Announce again a regular expression previously announced.
+ * Does use caching to speed up process.
+ * 
+ * @param h Handle returned by a previous REGEX_ITERNAL_announce call.
+ */
+void
+REGEX_ITERNAL_reannounce (struct REGEX_ITERNAL_Announcement *h);
+
+
+/**
+ * Clear all cached data used by a regex announce.
+ * Does not close DHT connection.
+ * 
+ * @param h Handle returned by a previous REGEX_ITERNAL_announce call.
+ */
+void
+REGEX_ITERNAL_announce_cancel (struct REGEX_ITERNAL_Announcement *h);
+
+
+/**
+ * Search callback function.
+ *
+ * @param cls Closure provided in REGEX_ITERNAL_search.
+ * @param id Peer providing a regex that matches the string.
+ * @param get_path Path of the get request.
+ * @param get_path_length Lenght of get_path.
+ * @param put_path Path of the put request.
+ * @param put_path_length Length of the put_path.
+ */
+typedef void (*REGEX_ITERNAL_Found)(void *cls,
+                                   const struct GNUNET_PeerIdentity *id,
+                                   const struct GNUNET_PeerIdentity *get_path,
+                                   unsigned int get_path_length,
+                                   const struct GNUNET_PeerIdentity *put_path,
+                                   unsigned int put_path_length);
+
+
+/**
+ * Search for a peer offering a regex matching certain string in the DHT.
+ * The search runs until REGEX_ITERNAL_search_cancel is called, even if results
+ * are returned.
+ *
+ * @param dht An existing and valid DHT service handle.
+ * @param string String to match against the regexes in the DHT.
+ * @param callback Callback for found peers.
+ * @param callback_cls Closure for @c callback.
+ * @param stats Optional statistics handle to report usage. Can be NULL.
+ * 
+ * @return Handle to stop search and free resources.
+ *         Must be freed by calling REGEX_ITERNAL_search_cancel.
+ */
+struct REGEX_ITERNAL_Search *
+REGEX_ITERNAL_search (struct GNUNET_DHT_Handle *dht,
+                     const char *string,
+                     REGEX_ITERNAL_Found callback,
+                     void *callback_cls,
+                     struct GNUNET_STATISTICS_Handle *stats);
+
+/**
+ * Stop search and free all data used by a REGEX_ITERNAL_search call.
+ * Does not close DHT connection.
+ * 
+ * @param h Handle returned by a previous REGEX_ITERNAL_search call.
+ */
+void
+REGEX_ITERNAL_search_cancel (struct REGEX_ITERNAL_Search *h);
+
+
+#if 0                           /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+/* end of regex_internal_lib.h */
+#endif

Modified: gnunet/src/regex/regex_random.c
===================================================================
--- gnunet/src/regex/regex_random.c     2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex_random.c     2013-06-20 08:32:50 UTC (rev 27498)
@@ -23,7 +23,7 @@
  * @author Maximilian Szengel
  */
 #include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "gnunet_crypto_lib.h"
 #include "regex_internal.h"
 
@@ -61,7 +61,7 @@
  *         needs to be freed, otherwise.
  */
 char *
-GNUNET_REGEX_generate_random_regex (size_t rx_length, char *matching_str)
+REGEX_ITERNAL_generate_random_regex (size_t rx_length, char *matching_str)
 {
   char *rx;
   char *rx_p;
@@ -147,7 +147,7 @@
  * @return random string that needs to be freed.
  */
 char *
-GNUNET_REGEX_generate_random_string (size_t max_len)
+REGEX_ITERNAL_generate_random_string (size_t max_len)
 {
   unsigned int i;
   char *str;

Modified: gnunet/src/regex/regex_test_lib.c
===================================================================
--- gnunet/src/regex/regex_test_lib.c   2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex_test_lib.c   2013-06-20 08:32:50 UTC (rev 27498)
@@ -305,7 +305,7 @@
  *          This function DOES NOT support arbitrary regex combining.
  */
 char *
-GNUNET_REGEX_combine (char * const regexes[])
+REGEX_ITERNAL_combine (char * const regexes[])
 {
   unsigned int i;
   char *combined;
@@ -333,15 +333,15 @@
 
 /**
  * Read a set of regexes from a file, one per line and return them in an array
- * suitable for GNUNET_REGEX_combine.
- * The array must be free'd using GNUNET_REGEX_free_from_file.
+ * suitable for REGEX_ITERNAL_combine.
+ * The array must be free'd using REGEX_ITERNAL_free_from_file.
  *
  * @param filename Name of the file containing the regexes.
  *
  * @return A newly allocated, NULL terminated array of regexes.
  */
 char **
-GNUNET_REGEX_read_from_file (const char *filename)
+REGEX_ITERNAL_read_from_file (const char *filename)
 {
   struct GNUNET_DISK_FileHandle *f;
   unsigned int nr;
@@ -421,7 +421,7 @@
  * @param regexes NULL-terminated array of regexes.
  */
 void
-GNUNET_REGEX_free_from_file (char **regexes)
+REGEX_ITERNAL_free_from_file (char **regexes)
 {
   unsigned int i;
 

Modified: gnunet/src/regex/regex_test_lib.h
===================================================================
--- gnunet/src/regex/regex_test_lib.h   2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/regex/regex_test_lib.h   2013-06-20 08:32:50 UTC (rev 27498)
@@ -26,8 +26,8 @@
  *
  */
 
-#ifndef GNUNET_REGEX_TEST_LIB_H
-#define GNUNET_REGEX_TEST_LIB_H
+#ifndef REGEX_ITERNAL_TEST_LIB_H
+#define REGEX_ITERNAL_TEST_LIB_H
 
 
 #ifdef __cplusplus
@@ -46,19 +46,19 @@
  * @return A string with a single regex that matches any of the original 
regexes
  */
 char *
-GNUNET_REGEX_combine(char * const regexes[]);
+REGEX_ITERNAL_combine(char * const regexes[]);
 
 /**
  * Read a set of regexes from a file, one per line and return them in an array
- * suitable for GNUNET_REGEX_combine.
- * The array must be free'd using GNUNET_REGEX_free_from_file.
+ * suitable for REGEX_ITERNAL_combine.
+ * The array must be free'd using REGEX_ITERNAL_free_from_file.
  *
  * @param filename Name of the file containing the regexes.
  *
  * @return A newly allocated, NULL terminated array of regexes.
  */
 char **
-GNUNET_REGEX_read_from_file (const char *filename);
+REGEX_ITERNAL_read_from_file (const char *filename);
 
 
 /**
@@ -67,7 +67,7 @@
  * @param regexes NULL-terminated array of regexes.
  */
 void
-GNUNET_REGEX_free_from_file (char **regexes);
+REGEX_ITERNAL_free_from_file (char **regexes);
 
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
@@ -76,5 +76,5 @@
 }
 #endif
 
-/* end of gnunet_regex_lib.h */
+/* end of regex_internal_lib.h */
 #endif
\ No newline at end of file

Modified: gnunet/src/regex/test_regex_eval_api.c
===================================================================
--- gnunet/src/regex/test_regex_eval_api.c      2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/regex/test_regex_eval_api.c      2013-06-20 08:32:50 UTC (rev 
27498)
@@ -25,7 +25,7 @@
 #include <regex.h>
 #include <time.h>
 #include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_internal.h"
 
 enum Match_Result
@@ -66,7 +66,7 @@
   int eval_check;
   int eval_canonical;
   int eval_canonical_check;
-  struct GNUNET_REGEX_Automaton *dfa;
+  struct REGEX_ITERNAL_Automaton *dfa;
   regex_t rx;
   regmatch_t matchptr[1];
   char error[200];
@@ -80,7 +80,7 @@
 
   /* Generate random regex and a string that matches the regex */
   matching_str = GNUNET_malloc (rx_length + 1);
-  rand_rx = GNUNET_REGEX_generate_random_regex (rx_length, matching_str);
+  rand_rx = REGEX_ITERNAL_generate_random_regex (rx_length, matching_str);
 
   /* Now match */
   result = 0;
@@ -88,21 +88,21 @@
   {
     if (0 < i)
     {
-      matching_str = GNUNET_REGEX_generate_random_string (max_str_len);
+      matching_str = REGEX_ITERNAL_generate_random_string (max_str_len);
     }
 
     /* Match string using DFA */
-    dfa = GNUNET_REGEX_construct_dfa (rand_rx, strlen (rand_rx), 0);
+    dfa = REGEX_ITERNAL_construct_dfa (rand_rx, strlen (rand_rx), 0);
     if (NULL == dfa)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Constructing DFA failed\n");
       goto error;
     }
 
-    eval = GNUNET_REGEX_eval (dfa, matching_str);
+    eval = REGEX_ITERNAL_eval (dfa, matching_str);
     /* save the canonical regex for later comparison */
-    canonical_regex = GNUNET_strdup (GNUNET_REGEX_get_canonical_regex (dfa));
-    GNUNET_REGEX_automaton_destroy (dfa);
+    canonical_regex = GNUNET_strdup (REGEX_ITERNAL_get_canonical_regex (dfa));
+    REGEX_ITERNAL_automaton_destroy (dfa);
 
     /* Match string using glibc regex */
     if (0 != regcomp (&rx, rand_rx, REG_EXTENDED))
@@ -123,7 +123,7 @@
 
     /* Match canonical regex */
     dfa =
-        GNUNET_REGEX_construct_dfa (canonical_regex, strlen (canonical_regex),
+        REGEX_ITERNAL_construct_dfa (canonical_regex, strlen (canonical_regex),
                                     0);
     if (NULL == dfa)
     {
@@ -131,8 +131,8 @@
       goto error;
     }
 
-    eval_canonical = GNUNET_REGEX_eval (dfa, matching_str);
-    GNUNET_REGEX_automaton_destroy (dfa);
+    eval_canonical = REGEX_ITERNAL_eval (dfa, matching_str);
+    REGEX_ITERNAL_automaton_destroy (dfa);
 
     if (0 != regcomp (&rx, canonical_regex, REG_EXTENDED))
     {
@@ -192,7 +192,7 @@
  * @return 0 on successfull, non 0 otherwise
  */
 int
-test_automaton (struct GNUNET_REGEX_Automaton *a, regex_t * rx,
+test_automaton (struct REGEX_ITERNAL_Automaton *a, regex_t * rx,
                 struct Regex_String_Pair *rxstr)
 {
   int result;
@@ -212,7 +212,7 @@
 
   for (i = 0; i < rxstr->string_count; i++)
   {
-    eval = GNUNET_REGEX_eval (a, rxstr->strings[i]);
+    eval = REGEX_ITERNAL_eval (a, rxstr->strings[i]);
     eval_check = regexec (rx, rxstr->strings[i], 1, matchptr, 0);
 
     /* We only want to match the whole string, because that's what our DFA 
does,
@@ -233,7 +233,7 @@
                   "string: %s\nexpected result: %i\n"
                   "gnunet regex: %i\nglibc regex: %i\nglibc error: %s\n"
                   "rm_so: %i\nrm_eo: %i\n\n", rxstr->regex,
-                  GNUNET_REGEX_get_canonical_regex (a), rxstr->strings[i],
+                  REGEX_ITERNAL_get_canonical_regex (a), rxstr->strings[i],
                   rxstr->expected_results[i], eval, eval_check, error,
                   matchptr[0].rm_so, matchptr[0].rm_eo);
     }
@@ -246,7 +246,7 @@
 {
   GNUNET_log_setup ("test-regex", "WARNING", NULL);
 
-  struct GNUNET_REGEX_Automaton *a;
+  struct REGEX_ITERNAL_Automaton *a;
   regex_t rx;
   int i;
   int check_nfa;
@@ -336,19 +336,19 @@
     }
 
     /* NFA test */
-    a = GNUNET_REGEX_construct_nfa (rxstr[i].regex, strlen (rxstr[i].regex));
+    a = REGEX_ITERNAL_construct_nfa (rxstr[i].regex, strlen (rxstr[i].regex));
     check_nfa += test_automaton (a, &rx, &rxstr[i]);
-    GNUNET_REGEX_automaton_destroy (a);
+    REGEX_ITERNAL_automaton_destroy (a);
 
     /* DFA test */
-    a = GNUNET_REGEX_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 
0);
+    a = REGEX_ITERNAL_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 
0);
     check_dfa += test_automaton (a, &rx, &rxstr[i]);
-    check_proof = GNUNET_strdup (GNUNET_REGEX_get_canonical_regex (a));
-    GNUNET_REGEX_automaton_destroy (a);
+    check_proof = GNUNET_strdup (REGEX_ITERNAL_get_canonical_regex (a));
+    REGEX_ITERNAL_automaton_destroy (a);
 
-    a = GNUNET_REGEX_construct_dfa (check_proof, strlen (check_proof), 0);
+    a = REGEX_ITERNAL_construct_dfa (check_proof, strlen (check_proof), 0);
     check_dfa += test_automaton (a, &rx, &rxstr[i]);
-    GNUNET_REGEX_automaton_destroy (a);
+    REGEX_ITERNAL_automaton_destroy (a);
     if (0 != check_dfa)
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "check_proof: %s\n", check_proof);
     GNUNET_free_non_null (check_proof);

Modified: gnunet/src/regex/test_regex_graph_api.c
===================================================================
--- gnunet/src/regex/test_regex_graph_api.c     2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/regex/test_regex_graph_api.c     2013-06-20 08:32:50 UTC (rev 
27498)
@@ -25,7 +25,7 @@
 #include <regex.h>
 #include <time.h>
 #include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_internal.h"
 
 #define KEEP_FILES 1
@@ -73,7 +73,7 @@
 main (int argc, char *argv[])
 {
   int error;
-  struct GNUNET_REGEX_Automaton *a;
+  struct REGEX_ITERNAL_Automaton *a;
   unsigned int i;
   const char *filename = "test_graph.dot";
 
@@ -97,58 +97,58 @@
   for (i = 0; i < 12; i++)
   {
     /* Check NFA graph creation */
-    a = GNUNET_REGEX_construct_nfa (regex[i], strlen (regex[i]));
-    GNUNET_REGEX_automaton_save_graph (a, filename, 
GNUNET_REGEX_GRAPH_DEFAULT);
-    GNUNET_REGEX_automaton_destroy (a);
+    a = REGEX_ITERNAL_construct_nfa (regex[i], strlen (regex[i]));
+    REGEX_ITERNAL_automaton_save_graph (a, filename, 
REGEX_ITERNAL_GRAPH_DEFAULT);
+    REGEX_ITERNAL_automaton_destroy (a);
     error += filecheck (filename);
 
-    a = GNUNET_REGEX_construct_nfa (regex[i], strlen (regex[i]));
-    GNUNET_REGEX_automaton_save_graph (a, filename,
-                                       GNUNET_REGEX_GRAPH_DEFAULT |
-                                       GNUNET_REGEX_GRAPH_VERBOSE);
-    GNUNET_REGEX_automaton_destroy (a);
+    a = REGEX_ITERNAL_construct_nfa (regex[i], strlen (regex[i]));
+    REGEX_ITERNAL_automaton_save_graph (a, filename,
+                                       REGEX_ITERNAL_GRAPH_DEFAULT |
+                                       REGEX_ITERNAL_GRAPH_VERBOSE);
+    REGEX_ITERNAL_automaton_destroy (a);
     error += filecheck (filename);
 
-    a = GNUNET_REGEX_construct_nfa (regex[i], strlen (regex[i]));
-    GNUNET_REGEX_automaton_save_graph (a, filename,
-                                       GNUNET_REGEX_GRAPH_DEFAULT |
-                                       GNUNET_REGEX_GRAPH_COLORING);
-    GNUNET_REGEX_automaton_destroy (a);
+    a = REGEX_ITERNAL_construct_nfa (regex[i], strlen (regex[i]));
+    REGEX_ITERNAL_automaton_save_graph (a, filename,
+                                       REGEX_ITERNAL_GRAPH_DEFAULT |
+                                       REGEX_ITERNAL_GRAPH_COLORING);
+    REGEX_ITERNAL_automaton_destroy (a);
     error += filecheck (filename);
 
-    a = GNUNET_REGEX_construct_nfa (regex[i], strlen (regex[i]));
-    GNUNET_REGEX_automaton_save_graph (a, filename,
-                                       GNUNET_REGEX_GRAPH_DEFAULT |
-                                       GNUNET_REGEX_GRAPH_VERBOSE |
-                                       GNUNET_REGEX_GRAPH_COLORING);
-    GNUNET_REGEX_automaton_destroy (a);
+    a = REGEX_ITERNAL_construct_nfa (regex[i], strlen (regex[i]));
+    REGEX_ITERNAL_automaton_save_graph (a, filename,
+                                       REGEX_ITERNAL_GRAPH_DEFAULT |
+                                       REGEX_ITERNAL_GRAPH_VERBOSE |
+                                       REGEX_ITERNAL_GRAPH_COLORING);
+    REGEX_ITERNAL_automaton_destroy (a);
     error += filecheck (filename);
 
 
     /* Check DFA graph creation */
-    a = GNUNET_REGEX_construct_dfa (regex[i], strlen (regex[i]), 0);
-    GNUNET_REGEX_automaton_save_graph (a, filename, 
GNUNET_REGEX_GRAPH_DEFAULT);
-    GNUNET_REGEX_automaton_destroy (a);
+    a = REGEX_ITERNAL_construct_dfa (regex[i], strlen (regex[i]), 0);
+    REGEX_ITERNAL_automaton_save_graph (a, filename, 
REGEX_ITERNAL_GRAPH_DEFAULT);
+    REGEX_ITERNAL_automaton_destroy (a);
     error += filecheck (filename);
 
-    a = GNUNET_REGEX_construct_dfa (regex[i], strlen (regex[i]), 0);
-    GNUNET_REGEX_automaton_save_graph (a, filename,
-                                       GNUNET_REGEX_GRAPH_DEFAULT |
-                                       GNUNET_REGEX_GRAPH_VERBOSE);
-    GNUNET_REGEX_automaton_destroy (a);
+    a = REGEX_ITERNAL_construct_dfa (regex[i], strlen (regex[i]), 0);
+    REGEX_ITERNAL_automaton_save_graph (a, filename,
+                                       REGEX_ITERNAL_GRAPH_DEFAULT |
+                                       REGEX_ITERNAL_GRAPH_VERBOSE);
+    REGEX_ITERNAL_automaton_destroy (a);
     error += filecheck (filename);
 
-    a = GNUNET_REGEX_construct_dfa (regex[i], strlen (regex[i]), 0);
-    GNUNET_REGEX_automaton_save_graph (a, filename,
-                                       GNUNET_REGEX_GRAPH_DEFAULT |
-                                       GNUNET_REGEX_GRAPH_COLORING);
-    GNUNET_REGEX_automaton_destroy (a);
+    a = REGEX_ITERNAL_construct_dfa (regex[i], strlen (regex[i]), 0);
+    REGEX_ITERNAL_automaton_save_graph (a, filename,
+                                       REGEX_ITERNAL_GRAPH_DEFAULT |
+                                       REGEX_ITERNAL_GRAPH_COLORING);
+    REGEX_ITERNAL_automaton_destroy (a);
     error += filecheck (filename);
 
 
-    a = GNUNET_REGEX_construct_dfa (regex[i], strlen (regex[i]), 4);
-    GNUNET_REGEX_automaton_save_graph (a, filename, 
GNUNET_REGEX_GRAPH_DEFAULT);
-    GNUNET_REGEX_automaton_destroy (a);
+    a = REGEX_ITERNAL_construct_dfa (regex[i], strlen (regex[i]), 4);
+    REGEX_ITERNAL_automaton_save_graph (a, filename, 
REGEX_ITERNAL_GRAPH_DEFAULT);
+    REGEX_ITERNAL_automaton_destroy (a);
     error += filecheck (filename);
 
   }

Deleted: gnunet/src/regex/test_regex_iptoregex.c
===================================================================
--- gnunet/src/regex/test_regex_iptoregex.c     2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/regex/test_regex_iptoregex.c     2013-06-20 08:32:50 UTC (rev 
27498)
@@ -1,103 +0,0 @@
-/*
-     This file is part of GNUnet
-     (C) 2012 Christian Grothoff (and other contributing authors)
-
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 3, or (at your
-     option) any later version.
-
-     GNUnet is distributed in the hope that it will be useful, but
-     WITHOUT ANY WARRANTY; without even the implied warranty of
-     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     General Public License for more details.
-
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
-*/
-/**
- * @file regex/test_regex_iptoregex.c
- * @brief simple test for regex.c iptoregex functions
- * @author Maximilian Szengel
- */
-#include "platform.h"
-#include "gnunet_regex_lib.h"
-
-
-static int
-test_iptoregex (const char *ipv4, const char *netmask, const char *expectedv4,
-                const char *ipv6, unsigned int prefixlen,
-                const char *expectedv6)
-{
-  int error = 0;
-
-  struct in_addr a;
-  struct in6_addr b;
-  char rxv4[GNUNET_REGEX_IPV4_REGEXLEN];
-  char rxv6[GNUNET_REGEX_IPV6_REGEXLEN];
-
-  GNUNET_assert (1 == inet_pton (AF_INET, ipv4, &a));
-  GNUNET_REGEX_ipv4toregex (&a, netmask, rxv4);
-
-
-  if (0 != strcmp (rxv4, expectedv4))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected: %s but got: %s\n",
-                expectedv4, rxv4);
-    error++;
-  }
-
-  GNUNET_assert (1 == inet_pton (AF_INET6, ipv6, &b));
-  GNUNET_REGEX_ipv6toregex (&b, prefixlen, rxv6);
-
-  if (0 != strcmp (rxv6, expectedv6))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected: %s but got: %s\n",
-                expectedv6, rxv6);
-    error++;
-  }
-
-  return error;
-}
-
-int
-main (int argc, char *argv[])
-{
-  GNUNET_log_setup ("test-regex", "WARNING", NULL);
-
-  int error;
-
-  error = 0;
-
-  error +=
-      test_iptoregex ("192.0.0.0", "255.255.255.0",
-                      "110000000000000000000000(0|1)+", "FFFF::0", 16,
-                      "1111111111111111(0|1)+");
-
-  error +=
-      test_iptoregex ("187.238.225.0", "255.255.255.128",
-                      "1011101111101110111000010(0|1)+", "E1E1:73F9:51BE::0",
-                      49,
-                      
"1110000111100001011100111111100101010001101111100(0|1)+");
-
-  error +=
-      test_iptoregex ("255.255.255.255", "255.255.255.255",
-                      "11111111111111111111111111111111",
-                      "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF", 128,
-                      "11111111111111111111111111111111"
-                      "11111111111111111111111111111111"
-                      "11111111111111111111111111111111"
-                      "11111111111111111111111111111111");
-
-  error +=
-      test_iptoregex ("0.0.0.0", "255.255.255.255",
-                      "00000000000000000000000000000000", "0::0", 128,
-                      "00000000000000000000000000000000"
-                      "00000000000000000000000000000000"
-                      "00000000000000000000000000000000"
-                      "00000000000000000000000000000000");
-
-  return error;
-}

Modified: gnunet/src/regex/test_regex_iterate_api.c
===================================================================
--- gnunet/src/regex/test_regex_iterate_api.c   2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/regex/test_regex_iterate_api.c   2013-06-20 08:32:50 UTC (rev 
27498)
@@ -25,7 +25,7 @@
 #include <regex.h>
 #include <time.h>
 #include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_internal.h"
 
 /**
@@ -36,7 +36,7 @@
 /**
  * Set to GNUNET_YES to save a debug graph.
  */
-#define GNUNET_REGEX_ITERATE_SAVE_DEBUG_GRAPH GNUNET_NO
+#define REGEX_ITERNAL_ITERATE_SAVE_DEBUG_GRAPH GNUNET_NO
 
 static unsigned int transition_counter;
 
@@ -61,7 +61,7 @@
 static void
 key_iterator (void *cls, const struct GNUNET_HashCode *key, const char *proof,
               int accepting, unsigned int num_edges,
-              const struct GNUNET_REGEX_Edge *edges)
+              const struct REGEX_ITERNAL_Edge *edges)
 {
   unsigned int i;
   struct IteratorContext *ctx = cls;
@@ -101,7 +101,7 @@
       ctx->match_count++;
   }
 
-  if (GNUNET_OK != GNUNET_REGEX_check_proof (proof, key))
+  if (GNUNET_OK != REGEX_ITERNAL_check_proof (proof, key))
   {
     ctx->error++;
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -117,7 +117,7 @@
   GNUNET_log_setup ("test-regex", "WARNING", NULL);
 
   int error;
-  struct GNUNET_REGEX_Automaton *dfa;
+  struct REGEX_ITERNAL_Automaton *dfa;
   unsigned int i;
   unsigned int num_transitions;
   char *filename = NULL;
@@ -161,7 +161,7 @@
 
 
     /* Create graph */
-    if (GNUNET_YES == GNUNET_REGEX_ITERATE_SAVE_DEBUG_GRAPH)
+    if (GNUNET_YES == REGEX_ITERNAL_ITERATE_SAVE_DEBUG_GRAPH)
     {
       GNUNET_asprintf (&filename, "iteration_graph_%u.dot", i);
       ctx.graph_filep = fopen (filename, "w");
@@ -191,10 +191,10 @@
     ctx.strings = rxstr[i].strings;
     ctx.match_count = 0;
     dfa =
-        GNUNET_REGEX_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 
0);
-    GNUNET_REGEX_iterate_all_edges (dfa, key_iterator, &ctx);
+        REGEX_ITERNAL_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 
0);
+    REGEX_ITERNAL_iterate_all_edges (dfa, key_iterator, &ctx);
     num_transitions =
-        GNUNET_REGEX_get_transition_count (dfa) - dfa->start->transition_count;
+        REGEX_ITERNAL_get_transition_count (dfa) - 
dfa->start->transition_count;
 
     if (transition_counter < num_transitions)
     {
@@ -218,7 +218,7 @@
       error += (ctx.string_count - ctx.match_count);
     }
 
-    GNUNET_REGEX_automaton_destroy (dfa);
+    REGEX_ITERNAL_automaton_destroy (dfa);
 
     /* Finish graph */
     if (GNUNET_YES == ctx.should_save_graph)
@@ -238,9 +238,9 @@
     ctx.match_count = 0;
 
     dfa =
-        GNUNET_REGEX_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 
0);
-    GNUNET_REGEX_dfa_add_multi_strides (NULL, dfa, 2);
-    GNUNET_REGEX_iterate_all_edges (dfa, key_iterator, &ctx);
+        REGEX_ITERNAL_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 
0);
+    REGEX_ITERNAL_dfa_add_multi_strides (NULL, dfa, 2);
+    REGEX_ITERNAL_iterate_all_edges (dfa, key_iterator, &ctx);
 
     if (ctx.match_count < ctx.string_count)
     {
@@ -249,7 +249,7 @@
       error += (ctx.string_count - ctx.match_count);
     }
 
-    GNUNET_REGEX_automaton_destroy (dfa);
+    REGEX_ITERNAL_automaton_destroy (dfa);
   }
 
   error += ctx.error;

Modified: gnunet/src/regex/test_regex_proofs.c
===================================================================
--- gnunet/src/regex/test_regex_proofs.c        2013-06-19 17:49:39 UTC (rev 
27497)
+++ gnunet/src/regex/test_regex_proofs.c        2013-06-20 08:32:50 UTC (rev 
27498)
@@ -23,7 +23,7 @@
  * @author Maximilian Szengel
  */
 #include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
 #include "regex_internal.h"
 
 
@@ -42,17 +42,17 @@
 test_proof (const char *regex)
 {
   unsigned int error;
-  struct GNUNET_REGEX_Automaton *dfa;
+  struct REGEX_ITERNAL_Automaton *dfa;
   char *c_rx1;
   const char *c_rx2;
 
-  dfa = GNUNET_REGEX_construct_dfa (regex, strlen (regex), 1);
+  dfa = REGEX_ITERNAL_construct_dfa (regex, strlen (regex), 1);
   GNUNET_assert (NULL != dfa);
-  c_rx1 = GNUNET_strdup (GNUNET_REGEX_get_canonical_regex (dfa));
-  GNUNET_REGEX_automaton_destroy (dfa);
-  dfa = GNUNET_REGEX_construct_dfa (c_rx1, strlen (c_rx1), 1);
+  c_rx1 = GNUNET_strdup (REGEX_ITERNAL_get_canonical_regex (dfa));
+  REGEX_ITERNAL_automaton_destroy (dfa);
+  dfa = REGEX_ITERNAL_construct_dfa (c_rx1, strlen (c_rx1), 1);
   GNUNET_assert (NULL != dfa);
-  c_rx2 = GNUNET_REGEX_get_canonical_regex (dfa);
+  c_rx2 = REGEX_ITERNAL_get_canonical_regex (dfa);
 
   error = (0 == strcmp (c_rx1, c_rx2)) ? 0 : 1;
 
@@ -64,7 +64,7 @@
   }
 
   GNUNET_free (c_rx1);
-  GNUNET_REGEX_automaton_destroy (dfa);
+  REGEX_ITERNAL_automaton_destroy (dfa);
 
   return error;
 }
@@ -90,7 +90,7 @@
 
   for (i = 0; i < count; i++)
   {
-    rand_rx = GNUNET_REGEX_generate_random_regex (rx_length, NULL);
+    rand_rx = REGEX_ITERNAL_generate_random_regex (rx_length, NULL);
     failures += test_proof (rand_rx);
     GNUNET_free (rand_rx);
   }
@@ -123,20 +123,20 @@
 
   const char *canon_rx1;
   const char *canon_rx2;
-  struct GNUNET_REGEX_Automaton *dfa1;
-  struct GNUNET_REGEX_Automaton *dfa2;
+  struct REGEX_ITERNAL_Automaton *dfa1;
+  struct REGEX_ITERNAL_Automaton *dfa2;
 
   error = 0;
 
   for (i = 0; i < 8; i += 2)
   {
-    dfa1 = GNUNET_REGEX_construct_dfa (regex[i], strlen (regex[i]), 1);
-    dfa2 = GNUNET_REGEX_construct_dfa (regex[i + 1], strlen (regex[i + 1]), 1);
+    dfa1 = REGEX_ITERNAL_construct_dfa (regex[i], strlen (regex[i]), 1);
+    dfa2 = REGEX_ITERNAL_construct_dfa (regex[i + 1], strlen (regex[i + 1]), 
1);
     GNUNET_assert (NULL != dfa1);
     GNUNET_assert (NULL != dfa2);
 
-    canon_rx1 = GNUNET_REGEX_get_canonical_regex (dfa1);
-    canon_rx2 = GNUNET_REGEX_get_canonical_regex (dfa2);
+    canon_rx1 = REGEX_ITERNAL_get_canonical_regex (dfa1);
+    canon_rx2 = REGEX_ITERNAL_get_canonical_regex (dfa2);
 
     error += (0 == strcmp (canon_rx1, canon_rx2)) ? 0 : 1;
 
@@ -147,8 +147,8 @@
                   regex[i], canon_rx1, regex[i + 1], canon_rx2);
     }
 
-    GNUNET_REGEX_automaton_destroy (dfa1);
-    GNUNET_REGEX_automaton_destroy (dfa2);
+    REGEX_ITERNAL_automaton_destroy (dfa1);
+    REGEX_ITERNAL_automaton_destroy (dfa2);
   }
 
   return error;

Modified: gnunet/src/tun/Makefile.am
===================================================================
--- gnunet/src/tun/Makefile.am  2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/tun/Makefile.am  2013-06-20 08:32:50 UTC (rev 27498)
@@ -12,19 +12,20 @@
 lib_LTLIBRARIES = libgnunettun.la
 
 libgnunettun_la_SOURCES = \
-  tun.c
+  tun.c \
+  regex.c
 libgnunettun_la_LIBADD = \
  $(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
  $(LTLIBINTL)
 libgnunettun_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) \
-  -version-info 0:0:0
+  -version-info 1:0:1
 
 
 check_PROGRAMS = \
- test_tun
+ test_tun \
+ test_regex
 
-
 if ENABLE_TEST_RUN
 TESTS = $(check_PROGRAMS)
 endif
@@ -34,3 +35,10 @@
 test_tun_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/tun/libgnunettun.la
+
+
+test_regex_SOURCES = \
+ test_regex.c
+test_regex_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/tun/libgnunettun.la

Copied: gnunet/src/tun/test_regex.c (from rev 27497, 
gnunet/src/regex/test_regex_iptoregex.c)
===================================================================
--- gnunet/src/tun/test_regex.c                         (rev 0)
+++ gnunet/src/tun/test_regex.c 2013-06-20 08:32:50 UTC (rev 27498)
@@ -0,0 +1,103 @@
+/*
+     This file is part of GNUnet
+     (C) 2012, 2013 Christian Grothoff (and other contributing authors)
+
+     GNUnet is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 3, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+/**
+ * @file tun/test_regex.c
+ * @brief simple test for regex.c iptoregex functions
+ * @author Maximilian Szengel
+ */
+#include "platform.h"
+#include "gnunet_tun_lib.h"
+
+
+static int
+test_iptoregex (const char *ipv4, const char *netmask, const char *expectedv4,
+                const char *ipv6, unsigned int prefixlen,
+                const char *expectedv6)
+{
+  int error = 0;
+
+  struct in_addr a;
+  struct in6_addr b;
+  char rxv4[GNUNET_REGEX_IPV4_REGEXLEN];
+  char rxv6[GNUNET_REGEX_IPV6_REGEXLEN];
+
+  GNUNET_assert (1 == inet_pton (AF_INET, ipv4, &a));
+  GNUNET_TUN_ipv4toregex (&a, netmask, rxv4);
+
+
+  if (0 != strcmp (rxv4, expectedv4))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected: %s but got: %s\n",
+                expectedv4, rxv4);
+    error++;
+  }
+
+  GNUNET_assert (1 == inet_pton (AF_INET6, ipv6, &b));
+  GNUNET_TUN_ipv6toregex (&b, prefixlen, rxv6);
+
+  if (0 != strcmp (rxv6, expectedv6))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected: %s but got: %s\n",
+                expectedv6, rxv6);
+    error++;
+  }
+
+  return error;
+}
+
+int
+main (int argc, char *argv[])
+{
+  GNUNET_log_setup ("test-regex", "WARNING", NULL);
+
+  int error;
+
+  error = 0;
+
+  error +=
+      test_iptoregex ("192.0.0.0", "255.255.255.0",
+                      "110000000000000000000000(0|1)+", "FFFF::0", 16,
+                      "1111111111111111(0|1)+");
+
+  error +=
+      test_iptoregex ("187.238.225.0", "255.255.255.128",
+                      "1011101111101110111000010(0|1)+", "E1E1:73F9:51BE::0",
+                      49,
+                      
"1110000111100001011100111111100101010001101111100(0|1)+");
+
+  error +=
+      test_iptoregex ("255.255.255.255", "255.255.255.255",
+                      "11111111111111111111111111111111",
+                      "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF", 128,
+                      "11111111111111111111111111111111"
+                      "11111111111111111111111111111111"
+                      "11111111111111111111111111111111"
+                      "11111111111111111111111111111111");
+
+  error +=
+      test_iptoregex ("0.0.0.0", "255.255.255.255",
+                      "00000000000000000000000000000000", "0::0", 128,
+                      "00000000000000000000000000000000"
+                      "00000000000000000000000000000000"
+                      "00000000000000000000000000000000"
+                      "00000000000000000000000000000000");
+
+  return error;
+}

Modified: gnunet/src/vpn/gnunet-service-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-service-vpn.c 2013-06-19 17:49:39 UTC (rev 27497)
+++ gnunet/src/vpn/gnunet-service-vpn.c 2013-06-20 08:32:50 UTC (rev 27498)
@@ -49,18 +49,8 @@
  */
 #define MAX_MESSAGE_QUEUE_SIZE 4
 
-/**
- * Maximum regex string length for use with GNUNET_REGEX_ipv4toregex
- */
-#define GNUNET_REGEX_IPV4_REGEXLEN 32 + 6
 
 /**
- * Maximum regex string length for use with GNUNET_REGEX_ipv6toregex
- */
-#define GNUNET_REGEX_IPV6_REGEXLEN 128 + 6
-
-
-/**
  * State we keep for each of our tunnels.
  */
 struct TunnelState;
@@ -769,118 +759,6 @@
 
 
 /**
- * Create a string with binary IP notation for the given 'addr' in 'str'.
- *
- * @param af address family of the given 'addr'.
- * @param addr address that should be converted to a string.
- *             struct in_addr * for IPv4 and struct in6_addr * for IPv6.
- * @param str string that will contain binary notation of 'addr'. Expected
- *            to be at least 33 bytes long for IPv4 and 129 bytes long for 
IPv6.
- */
-static void
-iptobinstr (const int af, const void *addr, char *str)
-{
-  int i;
-  
-  switch (af)
-  {
-    case AF_INET:
-    {
-      uint32_t b = htonl (((struct in_addr *) addr)->s_addr);
-      
-      str[32] = '\0';
-          str += 31;
-          for (i = 31; i >= 0; i--)
-          {
-            *str = (b & 1) + '0';
-            str--;
-            b >>= 1;
-          }
-              break;
-    }
-    case AF_INET6:
-    {
-      struct in6_addr b = *(const struct in6_addr *) addr;
-      
-      str[128] = '\0';
-            str += 127;
-            for (i = 127; i >= 0; i--)
-            {
-              *str = (b.s6_addr[i / 8] & 1) + '0';
-            str--;
-            b.s6_addr[i / 8] >>= 1;
-            }
-                break;
-    }
-  }
-}
-
-
-/**
- * Get the ipv4 network prefix from the given 'netmask'.
- *
- * @param netmask netmask for which to get the prefix len.
- *
- * @return length of ipv4 prefix for 'netmask'.
- */
-static unsigned int
-ipv4netmasktoprefixlen (const char *netmask)
-{
-  struct in_addr a;
-  unsigned int len;
-  uint32_t t;
-  
-  if (1 != inet_pton (AF_INET, netmask, &a))
-    return 0;
-  len = 32;
-  for (t = htonl (~a.s_addr); 0 != t; t >>= 1)
-    len--;
-  return len;
-}
-
-
-/**
- * Create a regex in 'rxstr' from the given 'ip' and 'netmask'.
- *
- * @param ip IPv4 representation.
- * @param netmask netmask for the ip.
- * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV4_REGEXLEN
- *              bytes long.
- */
-static void
-ipv4toregex (const struct in_addr *ip, const char *netmask,
-            char *rxstr)
-{
-  unsigned int pfxlen;
-  
-  pfxlen = ipv4netmasktoprefixlen (netmask);
-  iptobinstr (AF_INET, ip, rxstr);
-  rxstr[pfxlen] = '\0';
-            if (pfxlen < 32)
-              strcat (rxstr, "(0|1)+");
-}
-
-
-/**
- * Create a regex in 'rxstr' from the given 'ipv6' and 'prefixlen'.
- *
- * @param ipv6 IPv6 representation.
- * @param prefixlen length of the ipv6 prefix.
- * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV6_REGEXLEN
- *              bytes long.
- */
-static void
-ipv6toregex (const struct in6_addr *ipv6, unsigned int prefixlen,
-                          char *rxstr)
-{
-  iptobinstr (AF_INET6, ipv6, rxstr);
-  rxstr[prefixlen] = '\0';
-    if (prefixlen < 128)
-      strcat (rxstr, "(0|1)+");
-}
-
-
-/**
  * Regex has found a potential exit peer for us; consider using it.
  *
  * @param cls the 'struct TunnelState'
@@ -973,9 +851,9 @@
     {
     case AF_INET:
     {
-      char address[GNUNET_REGEX_IPV4_REGEXLEN];
+      char address[GNUNET_TUN_IPV4_REGEXLEN];
 
-      ipv4toregex (&de->details.exit_destination.ip.v4,
+      GNUNET_TUN_ipv4toregex (&de->details.exit_destination.ip.v4,
                   "255.255.255.255", address);
       GNUNET_asprintf (&policy, "%s%s%s",
                        GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX,
@@ -985,9 +863,9 @@
     }
     case AF_INET6:
     {
-      char address[GNUNET_REGEX_IPV6_REGEXLEN];
+      char address[GNUNET_TUN_IPV6_REGEXLEN];
       
-      ipv6toregex (&de->details.exit_destination.ip.v6,
+      GNUNET_TUN_ipv6toregex (&de->details.exit_destination.ip.v6,
                   128, address);
       GNUNET_asprintf (&policy, "%s%s%s",
                        GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX,




reply via email to

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