diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-01-14 20:09:37 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-01-14 20:09:37 +0100 |
commit | 4556b3fb39dd80e958ff70f3496d06ec04f3839d (patch) | |
tree | ccb5cd1b23747c5c8afafe2abe2d7e9d0eb802cf | |
parent | e351346da584402647a147514610a744ee064d8e (diff) | |
download | conntrack-tools-4556b3fb39dd80e958ff70f3496d06ec04f3839d.tar.gz conntrack-tools-4556b3fb39dd80e958ff70f3496d06ec04f3839d.zip |
filter: add prefix ct_filter_ to hash and compare functions
This patch adds the prefix ct_filter_ to the hash and compare
functions. This is useful to disambiguate when interpreting the
oprofile reports. Note that without this patch there are two
functions called hash and compare in the source tree.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/filter.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/filter.c b/src/filter.c index a3432a2..c6e24a9 100644 --- a/src/filter.c +++ b/src/filter.c @@ -44,19 +44,19 @@ struct ct_filter { #define FILTER_POOL_SIZE 128 #define FILTER_POOL_LIMIT INT_MAX -static uint32_t hash(const void *data, const struct hashtable *table) +static uint32_t ct_filter_hash(const void *data, const struct hashtable *table) { const uint32_t *f = data; return jhash_1word(*f, 0) % table->hashsize; } -static uint32_t hash6(const void *data, const struct hashtable *table) +static uint32_t ct_filter_hash6(const void *data, const struct hashtable *table) { return jhash2(data, 4, 0) % table->hashsize; } -static int compare(const void *data1, const void *data2) +static int ct_filter_compare(const void *data1, const void *data2) { const uint32_t *f1 = data1; const uint32_t *f2 = data2; @@ -64,7 +64,7 @@ static int compare(const void *data1, const void *data2) return *f1 == *f2; } -static int compare6(const void *data1, const void *data2) +static int ct_filter_compare6(const void *data1, const void *data2) { return memcmp(data1, data2, sizeof(uint32_t)*4) == 0; } @@ -81,8 +81,8 @@ struct ct_filter *ct_filter_create(void) filter->h = hashtable_create(FILTER_POOL_SIZE, FILTER_POOL_LIMIT, sizeof(uint32_t), - hash, - compare); + ct_filter_hash, + ct_filter_compare); if (!filter->h) { free(filter); return NULL; @@ -91,8 +91,8 @@ struct ct_filter *ct_filter_create(void) filter->h6 = hashtable_create(FILTER_POOL_SIZE, FILTER_POOL_LIMIT, sizeof(uint32_t)*4, - hash6, - compare6); + ct_filter_hash6, + ct_filter_compare6); if (!filter->h6) { free(filter->h); free(filter); |