tapv2: CLI and binary API fixes
[vpp.git] / src / vpp / api / custom_dump.c
index 5cd454e..28f16d2 100644 (file)
@@ -26,6 +26,7 @@
 #include <vnet/l2/l2_input.h>
 #include <vnet/srv6/sr.h>
 #include <vnet/srmpls/sr_mpls.h>
+#include <vnet/gre/gre.h>
 #include <vnet/vxlan-gpe/vxlan_gpe.h>
 #include <vnet/geneve/geneve.h>
 #include <vnet/classify/policer_classify.h>
@@ -557,7 +558,7 @@ static void *vl_api_tap_create_v2_t_print
   memset (null_mac, 0, sizeof (null_mac));
 
   s = format (0, "SCRIPT: tap_create_v2 ");
-  s = format (s, "id %s ", mp->id);
+  s = format (s, "id %u ", mp->id);
   if (memcmp (mp->mac_address, null_mac, 6))
     s = format (s, "mac-address %U ",
                format_ethernet_address, mp->mac_address);
@@ -1543,6 +1544,8 @@ static void *vl_api_vxlan_add_del_tunnel_t_print
 
   s = format (s, "vni %d ", ntohl (mp->vni));
 
+  s = format (s, "instance %d ", ntohl (mp->instance));
+
   if (mp->is_add == 0)
     s = format (s, "del ");
 
@@ -1620,9 +1623,14 @@ static void *vl_api_gre_add_del_tunnel_t_print
              (ip46_address_t *) & (mp->src_address),
              mp->is_ipv6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4);
 
-  if (mp->teb)
+  s = format (s, "instance %d ", ntohl (mp->instance));
+
+  if (mp->tunnel_type == GRE_TUNNEL_TYPE_TEB)
     s = format (s, "teb ");
 
+  if (mp->tunnel_type == GRE_TUNNEL_TYPE_ERSPAN)
+    s = format (s, "erspan %d ", ntohs (mp->session_id));
+
   if (mp->outer_fib_id)
     s = format (s, "outer-fib-id %d ", ntohl (mp->outer_fib_id));
 
@@ -1804,9 +1812,15 @@ static void *vl_api_cli_inband_t_print
   (vl_api_cli_inband_t * mp, void *handle)
 {
   u8 *s;
+  u8 *cmd = 0;
+  u32 length = ntohl (mp->length);
+
+  vec_validate (cmd, length);
+  clib_memcpy (cmd, mp->cmd, length);
 
-  s = format (0, "SCRIPT: cli_inband ");
+  s = format (0, "SCRIPT: exec %v ", cmd);
 
+  vec_free (cmd);
   FINISH;
 }