[conntrack-tools] cache: cleanup, rename __del2() by __del()

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Wed Dec 17 17:19:23 CET 2008


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=7a7742b5dfe89caefa62a79f12dc0be971057d45
commit 7a7742b5dfe89caefa62a79f12dc0be971057d45
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Wed Dec 17 12:49:48 2008 +0100
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Wed Dec 17 12:49:48 2008 +0100

    cache: cleanup, rename __del2() by __del()
    
    This patch renames __del2() by __del(). The name of this function
    is a reminiscent of a removed __del() function time ago.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

commit 4e9cccfa0071ff51b489629bf2d69eefe6196ded
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Wed Dec 17 12:42:00 2008 +0100
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Wed Dec 17 12:42:00 2008 +0100

    src: cleanup, rename hashtable_test() by hashtable_find()
    
    This patch renames the function hashtable_test() by
    hashtable_find() which is a better name IMO to describe this
    function.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  7a7742b5dfe89caefa62a79f12dc0be971057d45 (commit)
       via  4e9cccfa0071ff51b489629bf2d69eefe6196ded (commit)
      from  aa36f86194a51c776810ced5c3a6dcead30243fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7a7742b5dfe89caefa62a79f12dc0be971057d45
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Wed Dec 17 12:49:48 2008 +0100

    cache: cleanup, rename __del2() by __del()
    
    This patch renames __del2() by __del(). The name of this function
    is a reminiscent of a removed __del() function time ago.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

commit 4e9cccfa0071ff51b489629bf2d69eefe6196ded
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Wed Dec 17 12:42:00 2008 +0100

    src: cleanup, rename hashtable_test() by hashtable_find()
    
    This patch renames the function hashtable_test() by
    hashtable_find() which is a better name IMO to describe this
    function.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

-----------------------------------------------------------------------

 include/hash.h |    2 +-
 src/cache.c    |   14 +++++++-------
 src/filter.c   |    8 ++++----
 src/hash.c     |    2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)
This patch renames the function hashtable_test() by
hashtable_find() which is a better name IMO to describe this
function.

Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

diff --git a/include/hash.h b/include/hash.h
index caad412..d260f65 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -38,7 +38,7 @@ hashtable_create(int hashsize, int limit, int datasize,
 void hashtable_destroy(struct hashtable *h);
 
 void *hashtable_add(struct hashtable *table, void *data);
-void *hashtable_test(struct hashtable *table, const void *data);
+void *hashtable_find(struct hashtable *table, const void *data);
 int hashtable_del(struct hashtable *table, void *data);
 int hashtable_flush(struct hashtable *table);
 int hashtable_iterate(struct hashtable *table, void *data,
diff --git a/src/cache.c b/src/cache.c
index 1d39fd5..c87aafa 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -254,7 +254,7 @@ static struct us_conntrack *__update(struct cache *c, struct nf_conntrack *ct)
 
 	u->ct = ct;
 
-	u = (struct us_conntrack *) hashtable_test(c->h, u);
+	u = (struct us_conntrack *) hashtable_find(c->h, u);
 	if (u) {
 		__cache_update(c, u, ct);
 		return u;
@@ -341,7 +341,7 @@ int cache_test(struct cache *c, struct nf_conntrack *ct)
 
 	u->ct = ct;
 
-	ret = hashtable_test(c->h, u);
+	ret = hashtable_find(c->h, u);
 
 	return ret != NULL;
 }
@@ -354,7 +354,7 @@ int cache_del(struct cache *c, struct nf_conntrack *ct)
 
 	u->ct = ct;
 
-	u = (struct us_conntrack *) hashtable_test(c->h, u);
+	u = (struct us_conntrack *) hashtable_find(c->h, u);
 	if (u) {
 		__cache_del(c, u);
 		return 1;
@@ -401,7 +401,7 @@ struct us_conntrack *cache_find(struct cache *c, struct nf_conntrack *ct)
 
 	u->ct = ct;
 
-	return ((struct us_conntrack *) hashtable_test(c->h, u));
+	return ((struct us_conntrack *) hashtable_find(c->h, u));
 }
 
 struct us_conntrack *cache_get_conntrack(struct cache *c, void *data)
diff --git a/src/filter.c b/src/filter.c
index 5a8b5d8..4e24fb5 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -221,15 +221,15 @@ static inline int
 __ct_filter_test_ipv4(struct ct_filter *f, struct nf_conntrack *ct)
 {
 	/* we only use the real source and destination address */
-	return (hashtable_test(f->h, nfct_get_attr(ct, ATTR_ORIG_IPV4_SRC)) ||
-		hashtable_test(f->h, nfct_get_attr(ct, ATTR_REPL_IPV4_SRC)));
+	return (hashtable_find(f->h, nfct_get_attr(ct, ATTR_ORIG_IPV4_SRC)) ||
+		hashtable_find(f->h, nfct_get_attr(ct, ATTR_REPL_IPV4_SRC)));
 }
 
 static inline int
 __ct_filter_test_ipv6(struct ct_filter *f, struct nf_conntrack *ct)
 {
-	return (hashtable_test(f->h6, nfct_get_attr(ct, ATTR_ORIG_IPV6_SRC)) ||
-	        hashtable_test(f->h6, nfct_get_attr(ct, ATTR_REPL_IPV6_SRC)));
+	return (hashtable_find(f->h6, nfct_get_attr(ct, ATTR_ORIG_IPV6_SRC)) ||
+	        hashtable_find(f->h6, nfct_get_attr(ct, ATTR_REPL_IPV6_SRC)));
 }
 
 static int
diff --git a/src/hash.c b/src/hash.c
index cf64df4..eb099dc 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -113,7 +113,7 @@ void *hashtable_add(struct hashtable *table, void *data)
 	return n->data;
 }
 
-void *hashtable_test(struct hashtable *table, const void *data)
+void *hashtable_find(struct hashtable *table, const void *data)
 {
 	struct slist_head *e;
 	uint32_t id;



More information about the netfilter-cvslog mailing list