aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-10-24 04:13:49 -0700
committerOle Trøan <otroan@employees.org>2017-10-25 16:18:54 +0000
commit36ea2d6d3a67a60534a7c2b58551688858a1ce7f (patch)
tree1cb424c70e1f1557e2354eb50559a346adb3314b /src/plugins/nat/nat.h
parentac1f96d7cdfb845c08400d27ec566b991e32e24b (diff)
One armed NAT (VPP-1035)
Use a single physical interface in order to accomplish NAT44/NAT64. Change-Id: I0c8138953a7a4075df306172e125abad771315e4 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat.h')
-rw-r--r--src/plugins/nat/nat.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h
index e53e924ff03..d4ad72520da 100644
--- a/src/plugins/nat/nat.h
+++ b/src/plugins/nat/nat.h
@@ -129,6 +129,9 @@ typedef enum {
#define SNAT_SESSION_FLAG_UNKNOWN_PROTO 2
#define SNAT_SESSION_FLAG_LOAD_BALANCING 4
+#define NAT_INTERFACE_FLAG_IS_INSIDE 1
+#define NAT_INTERFACE_FLAG_IS_OUTSIDE 2
+
typedef CLIB_PACKED(struct {
snat_session_key_t out2in; /* 0-15 */
@@ -217,7 +220,7 @@ typedef struct {
typedef struct {
u32 sw_if_index;
- u8 is_inside;
+ u8 flags;
} snat_interface_t;
typedef struct {
@@ -414,6 +417,9 @@ typedef struct {
*/
#define snat_is_unk_proto_session(s) s->flags & SNAT_SESSION_FLAG_UNKNOWN_PROTO
+#define nat_interface_is_inside(i) i->flags & NAT_INTERFACE_FLAG_IS_INSIDE
+#define nat_interface_is_outside(i) i->flags & NAT_INTERFACE_FLAG_IS_OUTSIDE
+
/*
* Why is this here? Because we don't need to touch this layer to
* simply reply to an icmp. We need to change id to a unique