summaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/nat64_db.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-07-11 03:55:02 -0700
committerOle Trøan <otroan@employees.org>2017-08-16 08:36:43 +0000
commitf8cd5817442f3a191befb3242a2c0c9bdd927ce0 (patch)
tree5836120f7430572c122cfe15e98a948d2424202f /src/plugins/snat/nat64_db.h
parent6d5c4cdbcc4799a9f43df68df434d5786db44b45 (diff)
NAT64: Fallback to 3-tuple key for non TCP/UDP sessions (VPP-884)
Change-Id: I4cafc8291725feb499355092bd429433e649b5b2 Signed-off-by: Matus Fabian <matfabia@cisco.com>
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__ */
/*