nat: use SVR
[vpp.git] / src / plugins / nat / nat_format.c
index 5ce00dc..17f64b9 100644 (file)
@@ -124,12 +124,10 @@ format_snat_session (u8 * s, va_list * args)
     {
       s = format (s, "  i2o %U proto %u fib %u\n",
                  format_ip4_address, &sess->in2out.addr,
-                 clib_net_to_host_u16 (sess->in2out.port),
-                 sess->in2out.fib_index);
+                 sess->in2out.port, sess->in2out.fib_index);
       s = format (s, "    o2i %U proto %u fib %u\n",
                  format_ip4_address, &sess->out2in.addr,
-                 clib_net_to_host_u16 (sess->out2in.port),
-                 sess->out2in.fib_index);
+                 sess->out2in.port, sess->out2in.fib_index);
     }
   else
     {
@@ -226,12 +224,15 @@ format_snat_static_mapping (u8 * s, va_list * args)
        s = format (s, "identity mapping %U",
                    format_ip4_address, &m->local_addr);
       else
-       s = format (s, "identity mapping %U:%d",
+       s = format (s, "identity mapping %U %U:%d",
+                   format_snat_protocol, m->proto,
                    format_ip4_address, &m->local_addr, m->local_port);
 
       /* *INDENT-OFF* */
-      vec_foreach (local, m->locals)
+      pool_foreach (local, m->locals,
+      ({
         s = format (s, " vrf %d", local->vrf_id);
+      }));
       /* *INDENT-ON* */
 
       return s;
@@ -255,10 +256,16 @@ format_snat_static_mapping (u8 * s, va_list * args)
                      m->twice_nat == TWICE_NAT ? "twice-nat" :
                      m->twice_nat == TWICE_NAT_SELF ? "self-twice-nat" : "",
                      is_out2in_only_static_mapping (m) ? "out2in-only" : "");
-         vec_foreach (local, m->locals)
+
+          /* *INDENT-OFF* */
+          pool_foreach (local, m->locals,
+          ({
            s = format (s, "\n  local %U:%d vrf %d probability %d\%",
                        format_ip4_address, &local->addr, local->port,
                        local->vrf_id, local->probability);
+          }));
+          /* *INDENT-ON* */
+
        }
       else
        s = format (s, "%U local %U:%d external %U:%d vrf %d %s %s",
@@ -326,20 +333,6 @@ format_det_map_ses (u8 * s, va_list * args)
   return s;
 }
 
-u8 *
-format_nat44_reass_trace (u8 * s, va_list * args)
-{
-  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
-  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
-  nat44_reass_trace_t *t = va_arg (*args, nat44_reass_trace_t *);
-
-  s = format (s, "NAT44_REASS: sw_if_index %d, next index %d, status %s",
-             t->sw_if_index, t->next_index,
-             t->cached ? "cached" : "translated");
-
-  return s;
-}
-
 /*
  * fd.io coding-style-patch-verification: ON
  *