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 /src/cache.c | |
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 'src/cache.c')
-rw-r--r-- | src/cache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cache.c b/src/cache.c index 1e544a2..f95bef6 100644 --- a/src/cache.c +++ b/src/cache.c @@ -423,3 +423,10 @@ void cache_iterate(struct cache *c, { hashtable_iterate(c->h, data, iterate); } + +void cache_iterate_limit(struct cache *c, void *data, + uint32_t from, uint32_t steps, + int (*iterate)(void *data1, void *data2)) +{ + hashtable_iterate_limit(c->h, data, from, steps, iterate); +} |