diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-01-15 23:19:57 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-01-15 23:19:57 +0100 |
commit | 50339f96638eed35dac2b673b64cc6f1eb96406c (patch) | |
tree | 20dbb60fd3c41994da7cd7ad8888185c681fadb1 /include/us-conntrack.h | |
parent | b28224b0326636ff5832b38817b7720f48070ee7 (diff) |
src: rework of the hash-cache infrastructure
Currently, the caching system is implemented in a two layer
architecture: hashtable (inner layer) and cache (upper layer).
This patch reworks the hash-cache infrastructure to solve some
initial design problems to make it more flexible, the main strong
points of this patch are:
* Memory handling is done in the cache layer, not in the inner
hashtable layer. This removes one of the main dependencies between
the hashtable and the cache classes.
* Remove excessive encapsulation: the former cache used to hide a
lot of details of the inner hashtable implementation.
* Fix over-hashing of some operations: lookup-delete-add required
three hash calculations. Similarly, the update-or-add operation
required two hash calculations. Now, we calculate the hash once
and re-use the value how many times as we need.
This patch simplifies the caching system. As a result, we save ~130
lines of code. Small code means and less complexity means less
chance to have bugs.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/us-conntrack.h')
-rw-r--r-- | include/us-conntrack.h | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/include/us-conntrack.h b/include/us-conntrack.h deleted file mode 100644 index 9eafa3b..0000000 --- a/include/us-conntrack.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _US_CONNTRACK_H_ -#define _US_CONNTRACK_H_ - -#include "alarm.h" -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> - -struct us_conntrack { - struct nf_conntrack *ct; - struct cache *cache; - struct alarm_block alarm; - char data[0]; -}; - -#endif |