diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2020-09-23 17:50:52 +0200 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2021-03-19 14:15:14 +0100 |
commit | a070b0de9f9e9cbca150eea4eda74757ca588bed (patch) | |
tree | 9f2a11fa1afcd51b0b14f4b26bebf4deb8289a2f /hicn-light/src/hicn/core/content_store.c | |
parent | 32dccec98e4c7d7e4ce902e19ba8d1b29b823758 (diff) |
[HICN-645] Control plane (WIP)
Change-Id: I4be6a40b690b62f22f57de6d8c10b01a1be42a6d
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com>
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-light/src/hicn/core/content_store.c')
-rw-r--r-- | hicn-light/src/hicn/core/content_store.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/hicn-light/src/hicn/core/content_store.c b/hicn-light/src/hicn/core/content_store.c index 74b675224..cf1fe3af9 100644 --- a/hicn-light/src/hicn/core/content_store.c +++ b/hicn-light/src/hicn/core/content_store.c @@ -112,11 +112,10 @@ void cs_clear(cs_t * cs) } off_t -cs_match(cs_t * cs, off_t msgbuf_id, uint64_t now) +cs_match(cs_t * cs, msgbuf_pool_t * msgbuf_pool, off_t msgbuf_id, uint64_t now) { assert(cs); - const msgbuf_pool_t * msgbuf_pool = cs_get_msgbuf_pool(cs); const msgbuf_t * msgbuf = msgbuf_pool_at(msgbuf_pool, msgbuf_id); assert(msgbuf); @@ -133,7 +132,7 @@ cs_match(cs_t * cs, off_t msgbuf_id, uint64_t now) if (cs_entry_has_expiry_time(entry) && cs_entry_get_expiry_time(entry) < now) { // the entry is expired, we can remove it - cs_remove_entry(cs, entry); + cs_remove_entry(cs, msgbuf_pool, entry); goto NOT_FOUND; } @@ -160,7 +159,7 @@ NOT_FOUND: #define msgbuf_acquire(x) (x) cs_entry_t * -cs_add(cs_t * cs, off_t msgbuf_id, uint64_t now) +cs_add(cs_t * cs, msgbuf_pool_t * msgbuf_pool, off_t msgbuf_id, uint64_t now) { assert(cs); assert(msgbuf_id_is_valid(msgbuf_id)); @@ -235,7 +234,7 @@ ERR_ENTRY: } int -cs_remove_entry(cs_t * cs, cs_entry_t * entry) +cs_remove_entry(cs_t * cs, msgbuf_pool_t * msgbuf_pool, cs_entry_t * entry) { assert(cs); assert(entry); @@ -245,7 +244,6 @@ cs_remove_entry(cs_t * cs, cs_entry_t * entry) off_t msgbuf_id = cs_entry_get_msgbuf_id(entry); - const msgbuf_pool_t * msgbuf_pool = cs_get_msgbuf_pool(cs); const msgbuf_t * msgbuf = msgbuf_pool_at(msgbuf_pool, msgbuf_id); khiter_t k = kh_get_cs_name(cs->index_by_name, msgbuf_get_name(msgbuf)); @@ -263,7 +261,7 @@ cs_remove_entry(cs_t * cs, cs_entry_t * entry) // // XXX TODO what is the difference between purge and remove ? bool -cs_remove(cs_t * cs, msgbuf_t * msgbuf) +cs_remove(cs_t * cs, msgbuf_pool_t * msgbuf_pool, msgbuf_t * msgbuf) { assert(cs); assert(msgbuf); @@ -277,7 +275,7 @@ cs_remove(cs_t * cs, msgbuf_t * msgbuf) cs_entry_t * entry = cs->entries + kh_val(cs->index_by_name, k); assert(entry); - cs_remove_entry(cs, entry); + cs_remove_entry(cs, msgbuf_pool, entry); return true; } |