summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat_api.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-01-11 04:09:17 -0800
committerMatus Fabian <matfabia@cisco.com>2018-01-11 04:10:26 -0800
commit240b5ef57cc79cf32934ba8f218de29b6685406b (patch)
treef7fb27adbc53bfa26b6fef986f11976e3345debb /src/plugins/nat/nat_api.c
parent0ae15ed43aaa600a75ca4c154bc62478820c00b4 (diff)
NAT44: asymmetrical load balancing static mapping rule (VPP-1132)
Add option to NAT44 load balancing static mapping API/CLI to make rule asymmetrical (rule match only in out2in direction). Change-Id: I325ecef5591e4bf44ce4469a24d44fe56c3bb2e9 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat_api.c')
-rw-r--r--src/plugins/nat/nat_api.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c
index d9f8bbd41be..dc9fc5d9a6d 100644
--- a/src/plugins/nat/nat_api.c
+++ b/src/plugins/nat/nat_api.c
@@ -1238,7 +1238,8 @@ static void
nat44_add_del_lb_static_mapping (e_addr,
clib_net_to_host_u16 (mp->external_port),
proto, clib_net_to_host_u32 (mp->vrf_id),
- locals, mp->is_add, mp->twice_nat);
+ locals, mp->is_add, mp->twice_nat,
+ mp->out2in_only);
vec_free (locals);
@@ -1251,7 +1252,8 @@ static void *vl_api_nat44_add_del_lb_static_mapping_t_print
u8 *s;
s = format (0, "SCRIPT: nat44_add_del_lb_static_mapping ");
- s = format (s, "is_add %d twice_nat %d", mp->is_add, mp->twice_nat);
+ s = format (s, "is_add %d twice_nat %d out2in_only ",
+ mp->is_add, mp->twice_nat, mp->out2in_only);
FINISH;
}
@@ -1278,6 +1280,7 @@ send_nat44_lb_static_mapping_details (snat_static_mapping_t * m,
rmp->vrf_id = ntohl (m->vrf_id);
rmp->context = context;
rmp->twice_nat = m->twice_nat;
+ rmp->out2in_only = m->out2in_only;
locals = (vl_api_nat44_lb_addr_port_t *) rmp->locals;
vec_foreach (ap, m->locals)