diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-11-25 23:34:48 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-11-25 23:34:48 +0100 |
commit | b2edf895af82914ab09a842641a45b7a806e9b1e (patch) | |
tree | 2b2890418f2f39bd12587288411420e9a0b9b369 /include/cidr.h | |
parent | 6262a4a7b7139fb5636228cb0f5a1e72f848d871 (diff) | |
download | conntrack-tools-b2edf895af82914ab09a842641a45b7a806e9b1e.tar.gz conntrack-tools-b2edf895af82914ab09a842641a45b7a806e9b1e.zip |
filter: CIDR-based filtering support
This patch adds CIDR-based filtering support. The current
implementation is O(n).
This patch also introduces the vector data type which is
used to store the IP address and the network mask.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/cidr.h')
-rw-r--r-- | include/cidr.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/cidr.h b/include/cidr.h new file mode 100644 index 0000000..f8a4e2a --- /dev/null +++ b/include/cidr.h @@ -0,0 +1,8 @@ +#ifndef _CIDR_H_ + +uint32_t ipv4_cidr2mask_host(uint8_t cidr); +uint32_t ipv4_cidr2mask_net(uint8_t cidr); +void ipv6_cidr2mask_host(uint8_t cidr, uint32_t *res); +void ipv6_cidr2mask_net(uint8_t cidr, uint32_t *res); + +#endif |