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/vector.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/vector.h')
-rw-r--r-- | include/vector.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/vector.h b/include/vector.h new file mode 100644 index 0000000..5b05cba --- /dev/null +++ b/include/vector.h @@ -0,0 +1,13 @@ +#ifndef _VECTOR_H_ +#define _VECTOR_H_ + +#include <stdlib.h> + +struct vector; + +struct vector *vector_create(size_t size); +void vector_destroy(struct vector *v); +int vector_add(struct vector *v, void *data); +int vector_iterate(struct vector *v, const void *data, int (*fcn)(const void *a, const void *b)); + +#endif |