summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/in2out.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-11-06 05:04:53 -0800
committerOle Trøan <otroan@employees.org>2017-11-07 11:52:39 +0000
commit8ebe62536223e5a8d827b2b870cbd57aa34fd7ef (patch)
treef4ab30aa41a7a26bb6068e7f0f441930cc7774bb /src/plugins/nat/in2out.c
parent5917939256af392914d8a648de0c3287042ddbf6 (diff)
NAT: DS-Lite (VPP-1040)
Dual-Stack Lite enables a broadband service provider to share IPv4 addresses among customers by combining two well-known technologies: IPv4-in-IPv6 and NAT. Change-Id: I039740f8548c623cd1ac89b8ecda1a6cc4aafb9c Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/in2out.c')
-rwxr-xr-xsrc/plugins/nat/in2out.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/nat/in2out.c b/src/plugins/nat/in2out.c
index 9f668d89f97..b0593900a93 100755
--- a/src/plugins/nat/in2out.c
+++ b/src/plugins/nat/in2out.c
@@ -366,12 +366,15 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0,
s->in2out.fib_index);
snat_free_outside_address_and_port
- (sm, thread_index, &s->out2in, s->outside_address_index);
+ (sm->addresses, thread_index, &s->out2in, s->outside_address_index);
}
s->outside_address_index = ~0;
- if (snat_alloc_outside_address_and_port (sm, rx_fib_index0, thread_index,
- &key1, &address_index))
+ if (snat_alloc_outside_address_and_port (sm->addresses, rx_fib_index0,
+ thread_index, &key1,
+ &address_index, sm->vrf_mode,
+ sm->port_per_thread,
+ sm->per_thread_data[thread_index].snat_thread_index))
{
ASSERT(0);
@@ -389,9 +392,11 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0,
{
static_mapping = 0;
/* Try to create dynamic translation */
- if (snat_alloc_outside_address_and_port (sm, rx_fib_index0,
+ if (snat_alloc_outside_address_and_port (sm->addresses, rx_fib_index0,
thread_index, &key1,
- &address_index))
+ &address_index, sm->vrf_mode,
+ sm->port_per_thread,
+ sm->per_thread_data[thread_index].snat_thread_index))
{
b0->error = node->errors[SNAT_IN2OUT_ERROR_OUT_OF_PORTS];
return SNAT_IN2OUT_NEXT_DROP;
@@ -1265,7 +1270,8 @@ create_ses:
s->out2in.port,
s->in2out.fib_index);
- snat_free_outside_address_and_port (sm, thread_index, &s->out2in,
+ snat_free_outside_address_and_port (sm->addresses, thread_index,
+ &s->out2in,
s->outside_address_index);
/* Remove in2out, out2in keys */