aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_table.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-08-05 10:22:52 +0200
committerFlorin Coras <florin.coras@gmail.com>2021-09-21 05:13:26 +0000
commitb3ea73e766013bed70340688ce361d9096045b44 (patch)
treed4e7b3a2c9a45b412b605b210181b9545cfbc16f /src/vnet/session/session_table.c
parenta9f5f85c95dbb0d05a5fa6a31847b50b511e5156 (diff)
session: implement app_ns deletion
Type: feature Change-Id: If0edbb21a0283d66c648a9e190d238c8cfa56353 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet/session/session_table.c')
-rw-r--r--src/vnet/session/session_table.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vnet/session/session_table.c b/src/vnet/session/session_table.c
index d0b576fda7b..9af8ae6a584 100644
--- a/src/vnet/session/session_table.c
+++ b/src/vnet/session/session_table.c
@@ -60,6 +60,31 @@ session_table_get (u32 table_index)
_(v6,halfopen,buckets,20000) \
_(v6,halfopen,memory,(64<<20))
+void
+session_table_free (session_table_t *slt, u8 fib_proto)
+{
+ u8 all = fib_proto > FIB_PROTOCOL_IP6 ? 1 : 0;
+ int i;
+
+ for (i = 0; i < TRANSPORT_N_PROTOS; i++)
+ session_rules_table_free (&slt->session_rules[i]);
+
+ vec_free (slt->session_rules);
+
+ if (fib_proto == FIB_PROTOCOL_IP4 || all)
+ {
+ clib_bihash_free_16_8 (&slt->v4_session_hash);
+ clib_bihash_free_16_8 (&slt->v4_half_open_hash);
+ }
+ if (fib_proto == FIB_PROTOCOL_IP6 || all)
+ {
+ clib_bihash_free_48_8 (&slt->v6_session_hash);
+ clib_bihash_free_48_8 (&slt->v6_half_open_hash);
+ }
+
+ pool_put (lookup_tables, slt);
+}
+
/**
* Initialize session table hash tables
*