aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat64_db.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-12-19 03:43:07 -0800
committerOle Trøan <otroan@employees.org>2018-01-03 11:44:40 +0000
commita3a6ec63d34c98e19b18530c165d09ac61389225 (patch)
treeb8153ff25070020ec8c6fcef37f8a15b82d7b59a /src/plugins/nat/nat64_db.h
parent041fa507c085010d55d18088321faa64d345bb88 (diff)
NAT64: free port when dynamic BIB deleted (VPP-1107)v18.04-rc0
Change-Id: Id897ed61a26a4069678ed4ddac1ba28bf32809c3 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat64_db.h')
-rw-r--r--src/plugins/nat/nat64_db.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/nat/nat64_db.h b/src/plugins/nat/nat64_db.h
index 7cda8b09a72..4345fd30974 100644
--- a/src/plugins/nat/nat64_db.h
+++ b/src/plugins/nat/nat64_db.h
@@ -117,10 +117,21 @@ typedef struct
clib_bihash_48_8_t out2in;
} nat64_db_st_t;
-typedef struct
+struct nat64_db_s;
+
+/**
+ * @brief Call back function to free NAT64 pool address and port when BIB
+ * entry is deleted.
+ */
+typedef void (*nat64_db_free_addr_port_function_t) (struct nat64_db_s * db,
+ ip4_address_t * addr,
+ u16 port, u8 proto);
+
+typedef struct nat64_db_s
{
nat64_db_bib_t bib;
nat64_db_st_t st;
+ nat64_db_free_addr_port_function_t free_addr_port_cb;
} nat64_db_t;
/**
@@ -131,11 +142,13 @@ typedef struct
* @param bib_memory_size Memory size of BIB hash.
* @param st_buckets Number of session table hash buckets.
* @param st_memory_size Memory size of session table hash.
+ * @param free_addr_port_cb Call back function to free address and port.
*
* @returns 0 on success, non-zero value otherwise.
*/
int nat64_db_init (nat64_db_t * db, u32 bib_buckets, u32 bib_memory_size,
- u32 st_buckets, u32 st_memory_size);
+ u32 st_buckets, u32 st_memory_size,
+ nat64_db_free_addr_port_function_t free_addr_port_cb);
/**
* @brief Create new NAT64 BIB entry.