diff options
author | Maximilian Szengel <gnunet@maxsz.de> | 2012-09-27 13:18:09 +0000 |
---|---|---|
committer | Maximilian Szengel <gnunet@maxsz.de> | 2012-09-27 13:18:09 +0000 |
commit | 8323699ba0ce8915d9251d687c825955144161f5 (patch) | |
tree | 9f7ec68f2799f14e2ea4cb49fc0f54eecf4b3122 /src/include | |
parent | 5fb7998799e47ea2ff281b237024cde9a6fc1453 (diff) | |
download | gnunet-8323699ba0ce8915d9251d687c825955144161f5.tar.gz gnunet-8323699ba0ce8915d9251d687c825955144161f5.zip |
iptoregex test
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_regex_lib.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/include/gnunet_regex_lib.h b/src/include/gnunet_regex_lib.h index f4109fd85..599e92765 100644 --- a/src/include/gnunet_regex_lib.h +++ b/src/include/gnunet_regex_lib.h | |||
@@ -37,6 +37,19 @@ extern "C" | |||
37 | #endif | 37 | #endif |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | |||
41 | /** | ||
42 | * Maximum regex string length for use with GNUNET_REGEX_ipv4toregex | ||
43 | */ | ||
44 | #define GNUNET_REGEX_IPV4_REGEXLEN 32 + 6 | ||
45 | |||
46 | |||
47 | /** | ||
48 | * Maximum regex string length for use with GNUNET_REGEX_ipv6toregex | ||
49 | */ | ||
50 | #define GNUNET_REGEX_IPV6_REGEXLEN 128 + 6 | ||
51 | |||
52 | |||
40 | /** | 53 | /** |
41 | * Automaton (NFA/DFA) representation. | 54 | * Automaton (NFA/DFA) representation. |
42 | */ | 55 | */ |
@@ -206,6 +219,32 @@ GNUNET_REGEX_iterate_all_edges (struct GNUNET_REGEX_Automaton *a, | |||
206 | void *iterator_cls); | 219 | void *iterator_cls); |
207 | 220 | ||
208 | 221 | ||
222 | /** | ||
223 | * Create a regex in 'rxstr' from the given 'ip' and 'netmask'. | ||
224 | * | ||
225 | * @param ip IPv4 representation. | ||
226 | * @param netmask netmask for the ip. | ||
227 | * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV4_REGEXLEN | ||
228 | * bytes long. | ||
229 | */ | ||
230 | void | ||
231 | GNUNET_REGEX_ipv4toregex (const struct in_addr *ip, const char *netmask, | ||
232 | char *rxstr); | ||
233 | |||
234 | |||
235 | /** | ||
236 | * Create a regex in 'rxstr' from the given 'ipv6' and 'prefixlen'. | ||
237 | * | ||
238 | * @param ipv6 IPv6 representation. | ||
239 | * @param prefixlen length of the ipv6 prefix. | ||
240 | * @param rxstr generated regex, must be at least GNUNET_REGEX_IPV6_REGEXLEN | ||
241 | * bytes long. | ||
242 | */ | ||
243 | void | ||
244 | GNUNET_REGEX_ipv6toregex (const struct in6_addr *ipv6, | ||
245 | unsigned int prefixlen, char *rxstr); | ||
246 | |||
247 | |||
209 | #if 0 /* keep Emacsens' auto-indent happy */ | 248 | #if 0 /* keep Emacsens' auto-indent happy */ |
210 | { | 249 | { |
211 | #endif | 250 | #endif |