summaryrefslogtreecommitdiffstats
path: root/src/plugins/snat
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-02-28 15:15:56 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-01 20:25:48 +0000
commit68b0fb0c620c7451ef1a6380c43c39de6614db51 (patch)
treef4188fa09723152f3ebfcebbbe4cacad903e0cf1 /src/plugins/snat
parentf869028740aaebeb0375077d4d84fa07a17fff1a (diff)
VPP-598: tcp stack initial commit
Change-Id: I49e5ce0aae6e4ff634024387ceaf7dbc432a0351 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/plugins/snat')
-rw-r--r--src/plugins/snat/in2out.c26
-rw-r--r--src/plugins/snat/out2in.c24
2 files changed, 25 insertions, 25 deletions
diff --git a/src/plugins/snat/in2out.c b/src/plugins/snat/in2out.c
index e30c913c02d..b4b7793dae0 100644
--- a/src/plugins/snat/in2out.c
+++ b/src/plugins/snat/in2out.c
@@ -689,12 +689,12 @@ snat_hairpinning (snat_main_t *sm,
ip4_header_t, dst_address);
ip0->checksum = ip_csum_fold (sum0);
- old_dst_port0 = tcp0->ports.dst;
+ old_dst_port0 = tcp0->dst;
if (PREDICT_TRUE(new_dst_port0 != old_dst_port0))
{
if (PREDICT_TRUE(proto0 == SNAT_PROTOCOL_TCP))
{
- tcp0->ports.dst = new_dst_port0;
+ tcp0->dst = new_dst_port0;
sum0 = tcp0->checksum;
sum0 = ip_csum_update (sum0, old_dst_addr0, new_dst_addr0,
ip4_header_t, dst_address);
@@ -872,9 +872,9 @@ snat_in2out_node_fn_inline (vlib_main_t * vm,
if (PREDICT_TRUE(proto0 == SNAT_PROTOCOL_TCP))
{
- old_port0 = tcp0->ports.src;
- tcp0->ports.src = s0->out2in.port;
- new_port0 = tcp0->ports.src;
+ old_port0 = tcp0->src_port;
+ tcp0->src_port = s0->out2in.port;
+ new_port0 = tcp0->src_port;
sum0 = tcp0->checksum;
sum0 = ip_csum_update (sum0, old_addr0, new_addr0,
@@ -1012,9 +1012,9 @@ snat_in2out_node_fn_inline (vlib_main_t * vm,
if (PREDICT_TRUE(proto1 == SNAT_PROTOCOL_TCP))
{
- old_port1 = tcp1->ports.src;
- tcp1->ports.src = s1->out2in.port;
- new_port1 = tcp1->ports.src;
+ old_port1 = tcp1->src_port;
+ tcp1->src_port = s1->out2in.port;
+ new_port1 = tcp1->src_port;
sum1 = tcp1->checksum;
sum1 = ip_csum_update (sum1, old_addr1, new_addr1,
@@ -1188,9 +1188,9 @@ snat_in2out_node_fn_inline (vlib_main_t * vm,
if (PREDICT_TRUE(proto0 == SNAT_PROTOCOL_TCP))
{
- old_port0 = tcp0->ports.src;
- tcp0->ports.src = s0->out2in.port;
- new_port0 = tcp0->ports.src;
+ old_port0 = tcp0->src_port;
+ tcp0->src_port = s0->out2in.port;
+ new_port0 = tcp0->src_port;
sum0 = tcp0->checksum;
sum0 = ip_csum_update (sum0, old_addr0, new_addr0,
@@ -1667,8 +1667,8 @@ snat_in2out_fast_static_map_fn (vlib_main_t * vm,
{
if (PREDICT_TRUE(proto0 == SNAT_PROTOCOL_TCP))
{
- old_port0 = tcp0->ports.src;
- tcp0->ports.src = new_port0;
+ old_port0 = tcp0->src_port;
+ tcp0->src_port = new_port0;
sum0 = tcp0->checksum;
sum0 = ip_csum_update (sum0, old_addr0, new_addr0,
diff --git a/src/plugins/snat/out2in.c b/src/plugins/snat/out2in.c
index 328f5ba4c5e..3bfc0aa31e0 100644
--- a/src/plugins/snat/out2in.c
+++ b/src/plugins/snat/out2in.c
@@ -19,7 +19,7 @@
#include <vnet/handoff.h>
#include <vnet/ip/ip.h>
-#include <vnet/ip/udp.h>
+#include <vnet/udp/udp.h>
#include <vnet/ethernet/ethernet.h>
#include <vnet/fib/ip4_fib.h>
#include <snat/snat.h>
@@ -602,9 +602,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
if (PREDICT_TRUE(proto0 == SNAT_PROTOCOL_TCP))
{
- old_port0 = tcp0->ports.dst;
- tcp0->ports.dst = s0->in2out.port;
- new_port0 = tcp0->ports.dst;
+ old_port0 = tcp0->dst_port;
+ tcp0->dst_port = s0->in2out.port;
+ new_port0 = tcp0->dst_port;
sum0 = tcp0->checksum;
sum0 = ip_csum_update (sum0, old_addr0, new_addr0,
@@ -737,9 +737,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
if (PREDICT_TRUE(proto1 == SNAT_PROTOCOL_TCP))
{
- old_port1 = tcp1->ports.dst;
- tcp1->ports.dst = s1->in2out.port;
- new_port1 = tcp1->ports.dst;
+ old_port1 = tcp1->dst_port;
+ tcp1->dst_port = s1->in2out.port;
+ new_port1 = tcp1->dst_port;
sum1 = tcp1->checksum;
sum1 = ip_csum_update (sum1, old_addr1, new_addr1,
@@ -907,9 +907,9 @@ snat_out2in_node_fn (vlib_main_t * vm,
if (PREDICT_TRUE(proto0 == SNAT_PROTOCOL_TCP))
{
- old_port0 = tcp0->ports.dst;
- tcp0->ports.dst = s0->in2out.port;
- new_port0 = tcp0->ports.dst;
+ old_port0 = tcp0->dst_port;
+ tcp0->dst_port = s0->in2out.port;
+ new_port0 = tcp0->dst_port;
sum0 = tcp0->checksum;
sum0 = ip_csum_update (sum0, old_addr0, new_addr0,
@@ -1369,8 +1369,8 @@ snat_out2in_fast_node_fn (vlib_main_t * vm,
{
if (PREDICT_TRUE(proto0 == SNAT_PROTOCOL_TCP))
{
- old_port0 = tcp0->ports.dst;
- tcp0->ports.dst = new_port0;
+ old_port0 = tcp0->dst_port;
+ tcp0->dst_port = new_port0;
sum0 = tcp0->checksum;
sum0 = ip_csum_update (sum0, old_addr0, new_addr0,