X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fnat44_cli.c;h=2f1e9a019ac30541863b99dd6f529d34b2437d8e;hb=1e5c07d379a092f4829e7081aa962d013b31fdfc;hp=da97a801b7f5a7e1ba89cf8a81444ea91178f048;hpb=b14826e459302556febb391456ea90644278645a;p=vpp.git diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c index da97a801b7f..2f1e9a019ac 100644 --- a/src/plugins/nat/nat44_cli.c +++ b/src/plugins/nat/nat44_cli.c @@ -501,7 +501,7 @@ add_static_mapping_command_fn (vlib_main_t * vm, int rv; snat_protocol_t proto = ~0; u8 proto_set = 0; - u8 twice_nat = 0; + twice_nat_type_t twice_nat = TWICE_NAT_DISABLED; u8 out2in_only = 0; if (sm->deterministic) @@ -538,7 +538,9 @@ add_static_mapping_command_fn (vlib_main_t * vm, else if (unformat (line_input, "%U", unformat_snat_protocol, &proto)) proto_set = 1; else if (unformat (line_input, "twice-nat")) - twice_nat = 1; + twice_nat = TWICE_NAT; + else if (unformat (line_input, "self-twice-nat")) + twice_nat = TWICE_NAT_SELF; else if (unformat (line_input, "out2in-only")) out2in_only = 1; else if (unformat (line_input, "del")) @@ -688,7 +690,7 @@ add_lb_static_mapping_command_fn (vlib_main_t * vm, snat_protocol_t proto; u8 proto_set = 0; nat44_lb_addr_port_t *locals = 0, local; - u8 twice_nat = 0; + twice_nat_type_t twice_nat = TWICE_NAT_DISABLED; u8 out2in_only = 0; if (sm->deterministic) @@ -718,7 +720,9 @@ add_lb_static_mapping_command_fn (vlib_main_t * vm, &proto)) proto_set = 1; else if (unformat (line_input, "twice-nat")) - twice_nat = 1; + twice_nat = TWICE_NAT; + else if (unformat (line_input, "self-twice-nat")) + twice_nat = TWICE_NAT_SELF; else if (unformat (line_input, "out2in-only")) out2in_only = 1; else if (unformat (line_input, "del")) @@ -1584,7 +1588,8 @@ VLIB_CLI_COMMAND (add_static_mapping_command, static) = { .function = add_static_mapping_command_fn, .short_help = "nat44 add static mapping tcp|udp|icmp local [] " - "external [] [vrf ] [twice-nat] [out2in-only] [del]", + "external [] [vrf ] [twice-nat|self-twice-nat] " + "[out2in-only] [del]", }; /*? @@ -1622,8 +1627,8 @@ VLIB_CLI_COMMAND (add_lb_static_mapping_command, static) = { .function = add_lb_static_mapping_command_fn, .short_help = "nat44 add load-balancing static mapping protocol tcp|udp " - "external : local : probability [twice-nat] " - "[vrf ] [out2in-only] [del]", + "external : local : probability " + "[twice-nat|self-twice-nat] [vrf ] [out2in-only] [del]", }; /*?