summaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/nat64_db.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/snat/nat64_db.h')
-rw-r--r--src/plugins/snat/nat64_db.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/plugins/snat/nat64_db.h b/src/plugins/snat/nat64_db.h
index caea3bf03a0..4511fb26a75 100644
--- a/src/plugins/snat/nat64_db.h
+++ b/src/plugins/snat/nat64_db.h
@@ -63,6 +63,7 @@ typedef struct
foreach_snat_protocol
#undef _
/* *INDENT-ON* */
+ nat64_db_bib_entry_t *_unk_proto_bib;
/* BIB lookup */
clib_bihash_24_8_t in2out;
@@ -109,6 +110,7 @@ typedef struct
foreach_snat_protocol
#undef _
/* *INDENT-ON* */
+ nat64_db_st_entry_t *_unk_proto_st;
/* session lookup */
clib_bihash_48_8_t in2out;
@@ -149,8 +151,7 @@ nat64_db_bib_entry_t *nat64_db_bib_entry_create (nat64_db_t * db,
ip4_address_t * out_addr,
u16 in_port, u16 out_port,
u32 fib_index,
- snat_protocol_t proto,
- u8 is_static);
+ u8 proto, u8 is_static);
/**
* @brief Free NAT64 BIB entry.
@@ -170,11 +171,11 @@ typedef int (*nat64_db_bib_walk_fn_t) (nat64_db_bib_entry_t * bibe,
* @brief Walk NAT64 BIB.
*
* @param db NAT64 DB.
- * @param proto BIB protocol (TCP/UDP/ICMP).
+ * @param proto L4 protocol.
* @param fn The function to invoke on each entry visited.
* @param ctx A context passed in the visit function.
*/
-void nat64_db_bib_walk (nat64_db_t * db, snat_protocol_t proto,
+void nat64_db_bib_walk (nat64_db_t * db, u8 proto,
nat64_db_bib_walk_fn_t fn, void *ctx);
/**
@@ -192,7 +193,7 @@ void nat64_db_bib_walk (nat64_db_t * db, snat_protocol_t proto,
nat64_db_bib_entry_t *nat64_db_bib_entry_find (nat64_db_t * db,
ip46_address_t * addr,
u16 port,
- snat_protocol_t proto,
+ u8 proto,
u32 fib_index, u8 is_ip6);
/**
@@ -205,8 +206,7 @@ nat64_db_bib_entry_t *nat64_db_bib_entry_find (nat64_db_t * db,
* @return BIB entry if found.
*/
nat64_db_bib_entry_t *nat64_db_bib_entry_by_index (nat64_db_t * db,
- snat_protocol_t proto,
- u32 bibe_index);
+ u8 proto, u32 bibe_index);
/**
* @brief Create new NAT64 session table entry.
*
@@ -250,7 +250,7 @@ nat64_db_st_entry_t *nat64_db_st_entry_find (nat64_db_t * db,
ip46_address_t * l_addr,
ip46_address_t * r_addr,
u16 l_port, u16 r_port,
- snat_protocol_t proto,
+ u8 proto,
u32 fib_index, u8 is_ip6);
/**
@@ -263,11 +263,11 @@ typedef int (*nat64_db_st_walk_fn_t) (nat64_db_st_entry_t * ste, void *ctx);
* @brief Walk NAT64 session table.
*
* @param db NAT64 DB.
- * @param proto Session table protocol (TCP/UDP/ICMP).
+ * @param proto L4 protocol.
* @param fn The function to invoke on each entry visited.
* @param ctx A context passed in the visit function.
*/
-void nat64_db_st_walk (nat64_db_t * db, snat_protocol_t proto,
+void nat64_db_st_walk (nat64_db_t * db, u8 proto,
nat64_db_st_walk_fn_t fn, void *ctx);
/**
@@ -278,6 +278,14 @@ void nat64_db_st_walk (nat64_db_t * db, snat_protocol_t proto,
*/
void nad64_db_st_free_expired (nat64_db_t * db, u32 now);
+/**
+ * @brief Free sessions using specific outside address.
+ *
+ * @param db NAT64 DB.
+ * @param out_addr Outside address to match.
+ */
+void nat64_db_free_out_addr (nat64_db_t * db, ip4_address_t * out_addr);
+
#endif /* __included_nat64_db_h__ */
/*