diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-07-17 13:36:05 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-07-17 13:36:05 +0200 |
commit | a1d03b775376aa8545ec9a0e89381b659e4d28ed (patch) | |
tree | dbce19e61288f5a4d31154e55a1e53553416bc72 /include | |
parent | 9406f29b89f6727c3db5485d109466701393b4d4 (diff) | |
download | conntrack-tools-a1d03b775376aa8545ec9a0e89381b659e4d28ed.tar.gz conntrack-tools-a1d03b775376aa8545ec9a0e89381b659e4d28ed.zip |
conntrackd: add iterators with limited steps in hash and cache types
This patch adds cache_iterate_limit() and hashtable_iterate_limit()
that allows to limit the iteration to given a number of states.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/cache.h | 1 | ||||
-rw-r--r-- | include/hash.h | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/cache.h b/include/cache.h index 0b2b18d..109e6aa 100644 --- a/include/cache.h +++ b/include/cache.h @@ -114,6 +114,7 @@ void cache_stats_extended(const struct cache *c, int fd); struct cache_object *cache_data_get_object(struct cache *c, void *data); void *cache_get_extra(struct cache *, void *); void cache_iterate(struct cache *c, void *data, int (*iterate)(void *data1, void *data2)); +void cache_iterate_limit(struct cache *c, void *data, uint32_t from, uint32_t steps, int (*iterate)(void *data1, void *data2)); /* iterators */ struct nfct_handle; diff --git a/include/hash.h b/include/hash.h index 68d618b..eaa9e96 100644 --- a/include/hash.h +++ b/include/hash.h @@ -37,7 +37,8 @@ int hashtable_add(struct hashtable *table, struct hashtable_node *n, int id); void hashtable_del(struct hashtable *table, struct hashtable_node *node); int hashtable_flush(struct hashtable *table); int hashtable_iterate(struct hashtable *table, void *data, - int (*iterate)(void *data, struct hashtable_node *n)); + int (*iterate)(void *data, void *n)); +int hashtable_iterate_limit(struct hashtable *table, void *data, uint32_t from, uint32_t steps, int (*iterate)(void *data1, void *n)); unsigned int hashtable_counter(const struct hashtable *table); #endif |