summaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/snat.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-06-06 04:53:28 -0700
committerOle Trøan <otroan@employees.org>2017-06-08 11:39:53 +0000
commit06596c54dc51e35222737b01c617cc675505a260 (patch)
tree0ee02baf650e9ab217ee4c3c64913dfac6ce68ff /src/plugins/snat/snat.h
parent2fcc49d9c6a66c49148d5790f6af38ab2f3b4be6 (diff)
NAT64: Add NAT64 support for snat plugin (VPP-699)
Basic NAT64 feature (no hairpinning, no multi-thread). Change-Id: I392fccbce93e70c117f4a9a7ec7cf08d6c537f2d Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/snat/snat.h')
-rw-r--r--src/plugins/snat/snat.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/snat/snat.h b/src/plugins/snat/snat.h
index d76026cdc86..016c2ff55df 100644
--- a/src/plugins/snat/snat.h
+++ b/src/plugins/snat/snat.h
@@ -30,8 +30,10 @@
#define SNAT_UDP_TIMEOUT 300
+#define SNAT_UDP_TIMEOUT_MIN 120
#define SNAT_TCP_TRANSITORY_TIMEOUT 240
#define SNAT_TCP_ESTABLISHED_TIMEOUT 7440
+#define SNAT_TCP_INCOMING_SYN 6
#define SNAT_ICMP_TIMEOUT 60
/* Key */
@@ -383,14 +385,15 @@ typedef struct {
u16 sequence;
} icmp_echo_header_t;
-always_inline snat_protocol_t
+always_inline u32
ip_proto_to_snat_proto (u8 ip_proto)
{
- snat_protocol_t snat_proto = ~0;
+ u32 snat_proto = ~0;
snat_proto = (ip_proto == IP_PROTOCOL_UDP) ? SNAT_PROTOCOL_UDP : snat_proto;
snat_proto = (ip_proto == IP_PROTOCOL_TCP) ? SNAT_PROTOCOL_TCP : snat_proto;
snat_proto = (ip_proto == IP_PROTOCOL_ICMP) ? SNAT_PROTOCOL_ICMP : snat_proto;
+ snat_proto = (ip_proto == IP_PROTOCOL_ICMP6) ? SNAT_PROTOCOL_ICMP : snat_proto;
return snat_proto;
}
@@ -445,6 +448,9 @@ clib_error_t * snat_api_init(vlib_main_t * vm, snat_main_t * sm);
int snat_set_workers (uword * bitmap);
int snat_interface_add_del(u32 sw_if_index, u8 is_inside, int is_del);
int snat_add_interface_address(snat_main_t *sm, u32 sw_if_index, int is_del);
+uword unformat_snat_protocol(unformat_input_t * input, va_list * args);
+u8 * format_snat_protocol(u8 * s, va_list * args);
+
static_always_inline u8
icmp_is_error_message (icmp46_header_t * icmp)
{