From 240b5ef57cc79cf32934ba8f218de29b6685406b Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Thu, 11 Jan 2018 04:09:17 -0800 Subject: 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 --- src/plugins/nat/nat_api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins/nat/nat_api.c') 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) -- cgit 1.2.3-korg