summaryrefslogtreecommitdiffstats
path: root/src/plugins/cnat/cnat_session.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2020-09-11 17:30:06 +0200
committerDave Barach <openvpp@barachs.net>2020-09-25 19:55:39 +0000
commitce25b60de5536e2f79bb72e929e70ccc1a75e0f8 (patch)
treedb5b9b18b321bb1dec2f0742afffd647695d12ce /src/plugins/cnat/cnat_session.c
parent613b2c3c78fbec12cc87a0095ee5488252449698 (diff)
cnat: Introduce parametric source policy
Type: feature Change-Id: I60ae9dd1c100b587d1902a20596b99a5c8a95df7 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_session.c')
-rw-r--r--src/plugins/cnat/cnat_session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/cnat/cnat_session.c b/src/plugins/cnat/cnat_session.c
index 4259f42f398..a80e367c2cc 100644
--- a/src/plugins/cnat/cnat_session.c
+++ b/src/plugins/cnat/cnat_session.c
@@ -15,13 +15,14 @@
#include <vnet/ip/ip.h>
#include <cnat/cnat_session.h>
+#include <cnat/cnat_inline.h>
#include <vppinfra/bihash_template.h>
#include <vppinfra/bihash_template.c>
clib_bihash_40_48_t cnat_session_db;
-
+void (*cnat_free_port_cb) (u16 port, ip_protocol_t iproto);
typedef struct cnat_session_walk_ctx_t_
{
@@ -128,7 +129,8 @@ cnat_session_free (cnat_session_t * session)
clib_bihash_kv_40_48_t *bkey = (clib_bihash_kv_40_48_t *) session;
/* age it */
if (session->value.flags & CNAT_SESSION_FLAG_ALLOC_PORT)
- cnat_free_port (session->value.cs_port[VLIB_RX], session->key.cs_proto);
+ cnat_free_port_cb (session->value.cs_port[VLIB_RX],
+ session->key.cs_proto);
if (!(session->value.flags & CNAT_SESSION_FLAG_NO_CLIENT))
cnat_client_free_by_ip (&session->key.cs_ip[VLIB_TX], session->key.cs_af);
cnat_timestamp_free (session->value.cs_ts_index);