aboutsummaryrefslogtreecommitdiff
path: root/src/tun
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-07-22 07:18:25 +0000
committerChristian Grothoff <christian@grothoff.org>2013-07-22 07:18:25 +0000
commit4b0bf15f1e839c26be9312bac4b6e72e9c341b56 (patch)
treeffbf966a937a619255fdaa0e6e1e076f22e58453 /src/tun
parente284539fe4d076330ca7f09cc791bdfb4164c0ce (diff)
downloadgnunet-4b0bf15f1e839c26be9312bac4b6e72e9c341b56.tar.gz
gnunet-4b0bf15f1e839c26be9312bac4b6e72e9c341b56.zip
rename GNUNET_TUN_ipvXtoregex to GNUNET_TUN_ipvXtoregexsearch to clarify that this is for generating the search strings
Diffstat (limited to 'src/tun')
-rw-r--r--src/tun/regex.c8
-rw-r--r--src/tun/test_regex.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/tun/regex.c b/src/tun/regex.c
index 0d259a8d5..5b844c5bc 100644
--- a/src/tun/regex.c
+++ b/src/tun/regex.c
@@ -107,7 +107,7 @@ ipv4netmasktoprefixlen (const char *netmask)
107 * bytes long. 107 * bytes long.
108 */ 108 */
109void 109void
110GNUNET_TUN_ipv4toregex (const struct in_addr *ip, const char *netmask, 110GNUNET_TUN_ipv4toregexsearch (const struct in_addr *ip, const char *netmask,
111 char *rxstr) 111 char *rxstr)
112{ 112{
113 unsigned int pfxlen; 113 unsigned int pfxlen;
@@ -129,7 +129,7 @@ GNUNET_TUN_ipv4toregex (const struct in_addr *ip, const char *netmask,
129 * bytes long. 129 * bytes long.
130 */ 130 */
131void 131void
132GNUNET_TUN_ipv6toregex (const struct in6_addr *ipv6, unsigned int prefixlen, 132GNUNET_TUN_ipv6toregexsearch (const struct in6_addr *ipv6, unsigned int prefixlen,
133 char *rxstr) 133 char *rxstr)
134{ 134{
135 iptobinstr (AF_INET6, ipv6, rxstr); 135 iptobinstr (AF_INET6, ipv6, rxstr);
@@ -143,7 +143,7 @@ GNUNET_TUN_ipv6toregex (const struct in6_addr *ipv6, unsigned int prefixlen,
143 * Convert an exit policy to a regular expression. The exit policy 143 * Convert an exit policy to a regular expression. The exit policy
144 * specifies a set of subnets this peer is willing to serve as an 144 * specifies a set of subnets this peer is willing to serve as an
145 * exit for; the resulting regular expression will match the 145 * exit for; the resulting regular expression will match the
146 * IPv4 address strings as returned by 'GNUNET_TUN_ipv4toregex'. 146 * IPv4 address strings as returned by 'GNUNET_TUN_ipv4toregexsearch'.
147 * 147 *
148 * @param policy exit policy specification 148 * @param policy exit policy specification
149 * @return regular expression, NULL on error 149 * @return regular expression, NULL on error
@@ -159,7 +159,7 @@ GNUNET_TUN_ipv4policy2regex (const char *policy)
159 * Convert an exit policy to a regular expression. The exit policy 159 * Convert an exit policy to a regular expression. The exit policy
160 * specifies a set of subnets this peer is willing to serve as an 160 * specifies a set of subnets this peer is willing to serve as an
161 * exit for; the resulting regular expression will match the 161 * exit for; the resulting regular expression will match the
162 * IPv4 address strings as returned by 'GNUNET_TUN_ipv4toregex'. 162 * IPv4 address strings as returned by 'GNUNET_TUN_ipv4toregexsearch'.
163 * 163 *
164 * @param policy exit policy specification 164 * @param policy exit policy specification
165 * @return regular expression, NULL on error 165 * @return regular expression, NULL on error
diff --git a/src/tun/test_regex.c b/src/tun/test_regex.c
index 8af1abd02..a0c3e99fd 100644
--- a/src/tun/test_regex.c
+++ b/src/tun/test_regex.c
@@ -39,7 +39,7 @@ test_iptoregex (const char *ipv4, const char *netmask, const char *expectedv4,
39 char rxv6[GNUNET_TUN_IPV6_REGEXLEN]; 39 char rxv6[GNUNET_TUN_IPV6_REGEXLEN];
40 40
41 GNUNET_assert (1 == inet_pton (AF_INET, ipv4, &a)); 41 GNUNET_assert (1 == inet_pton (AF_INET, ipv4, &a));
42 GNUNET_TUN_ipv4toregex (&a, netmask, rxv4); 42 GNUNET_TUN_ipv4toregexsearch (&a, netmask, rxv4);
43 43
44 44
45 if (0 != strcmp (rxv4, expectedv4)) 45 if (0 != strcmp (rxv4, expectedv4))
@@ -50,7 +50,7 @@ test_iptoregex (const char *ipv4, const char *netmask, const char *expectedv4,
50 } 50 }
51 51
52 GNUNET_assert (1 == inet_pton (AF_INET6, ipv6, &b)); 52 GNUNET_assert (1 == inet_pton (AF_INET6, ipv6, &b));
53 GNUNET_TUN_ipv6toregex (&b, prefixlen, rxv6); 53 GNUNET_TUN_ipv6toregexsearch (&b, prefixlen, rxv6);
54 54
55 if (0 != strcmp (rxv6, expectedv6)) 55 if (0 != strcmp (rxv6, expectedv6))
56 { 56 {