diff options
-rw-r--r-- | src/include/gnunet_tun_lib.h | 12 | ||||
-rw-r--r-- | src/tun/regex.c | 8 | ||||
-rw-r--r-- | src/tun/test_regex.c | 4 | ||||
-rw-r--r-- | src/vpn/gnunet-service-vpn.c | 4 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h index 90487265b..1b0bb716d 100644 --- a/src/include/gnunet_tun_lib.h +++ b/src/include/gnunet_tun_lib.h | |||
@@ -47,13 +47,13 @@ | |||
47 | 47 | ||
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Maximum regex string length for use with GNUNET_TUN_ipv4toregex | 50 | * Maximum regex string length for use with GNUNET_TUN_ipv4toregexsearch |
51 | */ | 51 | */ |
52 | #define GNUNET_TUN_IPV4_REGEXLEN 32 + 6 | 52 | #define GNUNET_TUN_IPV4_REGEXLEN 32 + 6 |
53 | 53 | ||
54 | 54 | ||
55 | /** | 55 | /** |
56 | * Maximum regex string length for use with GNUNET_TUN_ipv6toregex | 56 | * Maximum regex string length for use with GNUNET_TUN_ipv6toregexsearch |
57 | */ | 57 | */ |
58 | #define GNUNET_TUN_IPV6_REGEXLEN 128 + 6 | 58 | #define GNUNET_TUN_IPV6_REGEXLEN 128 + 6 |
59 | 59 | ||
@@ -438,7 +438,7 @@ GNUNET_TUN_calculate_icmp_checksum (struct GNUNET_TUN_IcmpHeader *icmp, | |||
438 | * bytes long. | 438 | * bytes long. |
439 | */ | 439 | */ |
440 | void | 440 | void |
441 | GNUNET_TUN_ipv4toregex (const struct in_addr *ip, const char *netmask, | 441 | GNUNET_TUN_ipv4toregexsearch (const struct in_addr *ip, const char *netmask, |
442 | char *rxstr); | 442 | char *rxstr); |
443 | 443 | ||
444 | 444 | ||
@@ -451,7 +451,7 @@ GNUNET_TUN_ipv4toregex (const struct in_addr *ip, const char *netmask, | |||
451 | * bytes long. | 451 | * bytes long. |
452 | */ | 452 | */ |
453 | void | 453 | void |
454 | GNUNET_TUN_ipv6toregex (const struct in6_addr *ipv6, | 454 | GNUNET_TUN_ipv6toregexsearch (const struct in6_addr *ipv6, |
455 | unsigned int prefixlen, char *rxstr); | 455 | unsigned int prefixlen, char *rxstr); |
456 | 456 | ||
457 | 457 | ||
@@ -459,7 +459,7 @@ GNUNET_TUN_ipv6toregex (const struct in6_addr *ipv6, | |||
459 | * Convert an exit policy to a regular expression. The exit policy | 459 | * Convert an exit policy to a regular expression. The exit policy |
460 | * specifies a set of subnets this peer is willing to serve as an | 460 | * specifies a set of subnets this peer is willing to serve as an |
461 | * exit for; the resulting regular expression will match the | 461 | * exit for; the resulting regular expression will match the |
462 | * IPv6 address strings as returned by 'GNUNET_TUN_ipv6toregex'. | 462 | * IPv6 address strings as returned by 'GNUNET_TUN_ipv6toregexsearch'. |
463 | * | 463 | * |
464 | * @param policy exit policy specification | 464 | * @param policy exit policy specification |
465 | * @return regular expression, NULL on error | 465 | * @return regular expression, NULL on error |
@@ -472,7 +472,7 @@ GNUNET_TUN_ipv6policy2regex (const char *policy); | |||
472 | * Convert an exit policy to a regular expression. The exit policy | 472 | * Convert an exit policy to a regular expression. The exit policy |
473 | * specifies a set of subnets this peer is willing to serve as an | 473 | * specifies a set of subnets this peer is willing to serve as an |
474 | * exit for; the resulting regular expression will match the | 474 | * exit for; the resulting regular expression will match the |
475 | * IPv4 address strings as returned by 'GNUNET_TUN_ipv4toregex'. | 475 | * IPv4 address strings as returned by 'GNUNET_TUN_ipv4toregexsearch'. |
476 | * | 476 | * |
477 | * @param policy exit policy specification | 477 | * @param policy exit policy specification |
478 | * @return regular expression, NULL on error | 478 | * @return regular expression, NULL on error |
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 | */ |
109 | void | 109 | void |
110 | GNUNET_TUN_ipv4toregex (const struct in_addr *ip, const char *netmask, | 110 | GNUNET_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 | */ |
131 | void | 131 | void |
132 | GNUNET_TUN_ipv6toregex (const struct in6_addr *ipv6, unsigned int prefixlen, | 132 | GNUNET_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 | { |
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 5230dc631..b4a4bbff5 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c | |||
@@ -855,7 +855,7 @@ create_tunnel_to_destination (struct DestinationEntry *de, | |||
855 | { | 855 | { |
856 | char address[GNUNET_TUN_IPV4_REGEXLEN]; | 856 | char address[GNUNET_TUN_IPV4_REGEXLEN]; |
857 | 857 | ||
858 | GNUNET_TUN_ipv4toregex (&de->details.exit_destination.ip.v4, | 858 | GNUNET_TUN_ipv4toregexsearch (&de->details.exit_destination.ip.v4, |
859 | "255.255.255.255", address); | 859 | "255.255.255.255", address); |
860 | GNUNET_asprintf (&policy, "%s%s%s", | 860 | GNUNET_asprintf (&policy, "%s%s%s", |
861 | GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX, | 861 | GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX, |
@@ -867,7 +867,7 @@ create_tunnel_to_destination (struct DestinationEntry *de, | |||
867 | { | 867 | { |
868 | char address[GNUNET_TUN_IPV6_REGEXLEN]; | 868 | char address[GNUNET_TUN_IPV6_REGEXLEN]; |
869 | 869 | ||
870 | GNUNET_TUN_ipv6toregex (&de->details.exit_destination.ip.v6, | 870 | GNUNET_TUN_ipv6toregexsearch (&de->details.exit_destination.ip.v6, |
871 | 128, address); | 871 | 128, address); |
872 | GNUNET_asprintf (&policy, "%s%s%s", | 872 | GNUNET_asprintf (&policy, "%s%s%s", |
873 | GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX, | 873 | GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX, |