Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
nat: sessions get expired when fib table removed
[vpp.git]
/
src
/
plugins
/
nat
/
nat.h
diff --git
a/src/plugins/nat/nat.h
b/src/plugins/nat/nat.h
index
ddcf4c9
..
8bec46a
100644
(file)
--- a/
src/plugins/nat/nat.h
+++ b/
src/plugins/nat/nat.h
@@
-198,6
+198,20
@@
typedef enum
#define NAT_STATIC_MAPPING_FLAG_IDENTITY_NAT 4
#define NAT_STATIC_MAPPING_FLAG_LB 8
#define NAT_STATIC_MAPPING_FLAG_IDENTITY_NAT 4
#define NAT_STATIC_MAPPING_FLAG_LB 8
+/* *INDENT-OFF* */
+typedef CLIB_PACKED(struct
+{
+ // number of sessions in this vrf
+ u32 ses_count;
+
+ u32 rx_fib_index;
+ u32 tx_fib_index;
+
+ // is this vrf expired
+ u8 expired;
+}) per_vrf_sessions_t;
+/* *INDENT-ON* */
+
/* *INDENT-OFF* */
typedef CLIB_PACKED(struct
{
/* *INDENT-OFF* */
typedef CLIB_PACKED(struct
{
@@
-258,10
+272,13
@@
typedef CLIB_PACKED(struct
/* user index */
u32 user_index;
/* user index */
u32 user_index;
+
+ /* per vrf sessions index */
+ u32 per_vrf_sessions_index;
+
}) snat_session_t;
/* *INDENT-ON* */
}) snat_session_t;
/* *INDENT-ON* */
-
typedef struct
{
ip4_address_t addr;
typedef struct
{
ip4_address_t addr;
@@
-285,6
+302,12
@@
typedef struct
/* *INDENT-ON* */
} snat_address_t;
/* *INDENT-ON* */
} snat_address_t;
+typedef struct
+{
+ u32 fib_index;
+ u32 ref_count;
+} nat_fib_t;
+
typedef struct
{
u32 fib_index;
typedef struct
{
u32 fib_index;
@@
-414,6
+437,8
@@
typedef struct
/* real thread index */
u32 thread_index;
/* real thread index */
u32 thread_index;
+ per_vrf_sessions_t *per_vrf_sessions_vec;
+
} snat_main_per_thread_data_t;
struct snat_main_s;
} snat_main_per_thread_data_t;
struct snat_main_s;
@@
-501,6
+526,9
@@
typedef struct snat_main_s
u16 start_port;
u16 end_port;
u16 start_port;
u16 end_port;
+ /* vector of fibs */
+ nat_fib_t *fibs;
+
/* vector of outside fibs */
nat_outside_fib_t *outside_fibs;
/* vector of outside fibs */
nat_outside_fib_t *outside_fibs;
@@
-1350,6
+1378,8
@@
int snat_alloc_outside_address_and_port (snat_address_t * addresses,
u16 port_per_thread,
u32 snat_thread_index);
u16 port_per_thread,
u32 snat_thread_index);
+void expire_per_vrf_sessions (u32 fib_index);
+
/**
* @brief Match NAT44 static mapping.
*
/**
* @brief Match NAT44 static mapping.
*