diff options
author | Filip Varga <fivarga@cisco.com> | 2021-08-09 14:45:12 +0200 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-09-02 14:06:42 +0000 |
commit | 4d41f954abc2965d187bcaf165dee81c8b3fd14a (patch) | |
tree | 04b9e9d2b541a5761daab98ba205f2452bd1c945 /src/plugins/nat/nat44-ed/nat44_ed_format.c | |
parent | 0242fd81ca6d13cad960870df09bf5732b892991 (diff) |
nat: NAT44 ED improvements and fixes
Fixed FIB entry per interface, pool and
static mapping registrations in NAT control plane.
Improved FIB configuration handling in NAT -
added functions to generalize handling of FIB & NAT,
cleaned up interface callback functions. Changed "is_"
macros to inline functions for easier debugging.
Type: improvement
Change-Id: I68a17761a975dd819139ae94e52a8a85d3f27ffc
Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat44-ed/nat44_ed_format.c')
-rw-r--r-- | src/plugins/nat/nat44-ed/nat44_ed_format.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_format.c b/src/plugins/nat/nat44-ed/nat44_ed_format.c index 597bc2b4d0b..442f6ad3d7a 100644 --- a/src/plugins/nat/nat44-ed/nat44_ed_format.c +++ b/src/plugins/nat/nat44-ed/nat44_ed_format.c @@ -137,16 +137,14 @@ format_snat_session (u8 * s, va_list * args) sess->nat_proto, clib_net_to_host_u16 (sess->out2in.port), sess->out2in.fib_index); } - if (is_ed_session (sess) || is_fwd_bypass_session (sess)) + if (nat44_ed_is_twice_nat_session (sess)) { - if (is_twice_nat_session (sess)) - { - s = format (s, " external host o2i %U:%d i2o %U:%d\n", - format_ip4_address, &sess->ext_host_addr, - clib_net_to_host_u16 (sess->ext_host_port), - format_ip4_address, &sess->ext_host_nat_addr, - clib_net_to_host_u16 (sess->ext_host_nat_port)); - } + s = format (s, " external host o2i %U:%d i2o %U:%d\n", + format_ip4_address, &sess->ext_host_addr, + clib_net_to_host_u16 (sess->ext_host_port), + format_ip4_address, &sess->ext_host_nat_addr, + clib_net_to_host_u16 (sess->ext_host_nat_port)); + } else { if (sess->ext_host_addr.as_u32) @@ -156,20 +154,19 @@ format_snat_session (u8 * s, va_list * args) } s = format (s, " i2o flow: %U\n", format_nat_6t_flow, &sess->i2o); s = format (s, " o2i flow: %U\n", format_nat_6t_flow, &sess->o2i); - } s = format (s, " index %llu\n", sess - tsm->sessions); s = format (s, " last heard %.2f\n", sess->last_heard); s = format (s, " total pkts %d, total bytes %lld\n", sess->total_pkts, sess->total_bytes); - if (snat_is_session_static (sess)) + if (nat44_ed_is_session_static (sess)) s = format (s, " static translation\n"); else s = format (s, " dynamic translation\n"); - if (is_fwd_bypass_session (sess)) + if (na44_ed_is_fwd_bypass_session (sess)) s = format (s, " forwarding-bypass\n"); - if (is_lb_session (sess)) + if (nat44_ed_is_lb_session (sess)) s = format (s, " load-balancing\n"); - if (is_twice_nat_session (sess)) + if (nat44_ed_is_twice_nat_session (sess)) s = format (s, " twice-nat\n"); return s; } |