aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-11-16 04:41:31 -0800
committerDamjan Marion <dmarion@me.com>2018-11-19 09:15:48 +0000
commit6c01dceea5c612373453db7f1ccda589a2cd782e (patch)
tree9e105928cf0ede85eef9c87920a1bc8e65e83502 /src/plugins/nat/nat.h
parentd30bf015ad3f7fbf206f143ed5d47a9af25148e8 (diff)
NAT44: fix bug in TCP close with output-feature interface (VPP-1493)
Change-Id: If8c883d6b1ee58de9a03012d3567ec82211a0225 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat.h')
-rw-r--r--src/plugins/nat/nat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h
index 13467203917..02d4aaef9f6 100644
--- a/src/plugins/nat/nat.h
+++ b/src/plugins/nat/nat.h
@@ -174,6 +174,7 @@ typedef enum
#define SNAT_SESSION_FLAG_ENDPOINT_DEPENDENT 16
#define SNAT_SESSION_FLAG_FWD_BYPASS 32
#define SNAT_SESSION_FLAG_AFFINITY 64
+#define SNAT_SESSION_FLAG_OUTPUT_FEATURE 128
/* NAT interface flags */
#define NAT_INTERFACE_FLAG_IS_INSIDE 1
@@ -673,6 +674,12 @@ unformat_function_t unformat_snat_protocol;
*/
#define is_lb_static_mapping(sm) (sm->flags & NAT_STATIC_MAPPING_FLAG_LB)
+/** \brief Check if client initiating TCP connection (received SYN from client)
+ @param t TCP header
+ @return 1 if client initiating TCP connection
+*/
+#define tcp_is_init(t) ((t->flags & TCP_FLAG_SYN) && !(t->flags & TCP_FLAG_ACK))
+
/* logging */
#define nat_log_err(...) \
vlib_log(VLIB_LOG_LEVEL_ERR, snat_main.log_class, __VA_ARGS__)