Fix unlinking of /dev/shm files.
[vpp.git] / src / vpp / api / custom_dump.c
index b3fd781..7f3a58d 100644 (file)
@@ -24,7 +24,7 @@
 #include <vnet/dhcp/dhcp_proxy.h>
 #include <vnet/l2tp/l2tp.h>
 #include <vnet/l2/l2_input.h>
-#include <vnet/sr/sr.h>
+#include <vnet/srv6/sr.h>
 #include <vnet/vxlan-gpe/vxlan_gpe.h>
 #include <vnet/classify/policer_classify.h>
 #include <vnet/policer/xlate.h>
@@ -298,6 +298,41 @@ static void *vl_api_bridge_domain_dump_t_print
   FINISH;
 }
 
+static void *vl_api_l2fib_flush_all_t_print
+  (vl_api_l2fib_flush_all_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: l2fib_flush_all ");
+
+  FINISH;
+}
+
+
+static void *vl_api_l2fib_flush_bd_t_print
+  (vl_api_l2fib_flush_bd_t * mp, void *handle)
+{
+  u8 *s;
+  u32 bd_id = ntohl (mp->bd_id);
+
+  s = format (0, "SCRIPT: l2fib_flush_bd ");
+  s = format (s, "bd_id %d ", bd_id);
+
+  FINISH;
+}
+
+static void *vl_api_l2fib_flush_int_t_print
+  (vl_api_l2fib_flush_int_t * mp, void *handle)
+{
+  u8 *s;
+  u32 sw_if_index = ntohl (mp->sw_if_index);
+
+  s = format (0, "SCRIPT: l2fib_flush_int ");
+  s = format (s, "sw_if_index %d ", sw_if_index);
+
+  FINISH;
+}
+
 static void *vl_api_l2fib_add_del_t_print
   (vl_api_l2fib_add_del_t * mp, void *handle)
 {
@@ -1139,7 +1174,6 @@ static void *vl_api_sr_policy_mod_t_print
   (vl_api_sr_policy_mod_t * mp, void *handle)
 {
   u8 *s;
-  u32 weight;
 
   ip6_address_t *segments = 0, *seg;
   ip6_address_t *this_address = (ip6_address_t *) mp->segments;
@@ -1181,8 +1215,6 @@ static void *vl_api_sr_policy_del_t_print
   u8 *s;
 
   s = format (0, "SCRIPT: sr_policy_del ");
-  u8 bsid_addr[16];
-  u32 sr_policy_index;
   s = format (s, "To be delivered. Good luck.");
   FINISH;
 }
@@ -1621,12 +1653,12 @@ static void *vl_api_want_interface_events_t_print
   FINISH;
 }
 
-static void *vl_api_cli_request_t_print
-  (vl_api_cli_request_t * mp, void *handle)
+static void *
+vl_api_cli_t_print (vl_api_cli_t * mp, void *handle)
 {
   u8 *s;
 
-  s = format (0, "SCRIPT: cli_request ");
+  s = format (0, "SCRIPT: cli ");
 
   FINISH;
 }
@@ -1668,10 +1700,18 @@ static void *vl_api_vxlan_gpe_add_del_tunnel_t_print
 
   s = format (0, "SCRIPT: vxlan_gpe_add_del_tunnel ");
 
-  s = format (s, "local %U ", format_ip46_address, &mp->local, mp->is_ipv6);
+  ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local);
+  ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote);
 
-  s = format (s, "remote %U ", format_ip46_address, &mp->remote, mp->is_ipv6);
+  u8 is_grp = ip46_address_is_multicast (&remote);
+  char *remote_name = is_grp ? "group" : "remote";
 
+  s = format (s, "local %U ", format_ip46_address, &local, IP46_TYPE_ANY);
+  s = format (s, "%s %U ", remote_name, format_ip46_address,
+             &remote, IP46_TYPE_ANY);
+
+  if (is_grp)
+    s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
   s = format (s, "protocol %d ", ntohl (mp->protocol));
 
   s = format (s, "vni %d ", ntohl (mp->vni));
@@ -2389,7 +2429,7 @@ static void *vl_api_lisp_add_del_remote_mapping_t_print
   (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
 {
   u8 *s;
-  u32 i, rloc_num = 0;
+  u32 rloc_num = 0;
 
   s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
 
@@ -2531,7 +2571,6 @@ static void *vl_api_lisp_add_del_locator_set_t_print
   (vl_api_lisp_add_del_locator_set_t * mp, void *handle)
 {
   u8 *s;
-  u32 loc_num = 0, i;
 
   s = format (0, "SCRIPT: lisp_add_del_locator_set ");
 
@@ -2540,8 +2579,6 @@ static void *vl_api_lisp_add_del_locator_set_t_print
 
   s = format (s, "locator-set %s ", mp->locator_set_name);
 
-  loc_num = clib_net_to_host_u32 (mp->locator_num);
-
   FINISH;
 }
 
@@ -2897,6 +2934,30 @@ static void *vl_api_sw_interface_set_mtu_t_print
   FINISH;
 }
 
+static void *vl_api_p2p_ethernet_add_t_print
+  (vl_api_p2p_ethernet_add_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: p2p_ethernet_add ");
+  s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
+  s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
+
+  FINISH;
+}
+
+static void *vl_api_p2p_ethernet_del_t_print
+  (vl_api_p2p_ethernet_del_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: p2p_ethernet_del ");
+  s = format (s, "sw_if_index %d ", ntohl (mp->parent_if_index));
+  s = format (s, "remote_mac %U ", format_ethernet_address, mp->remote_mac);
+
+  FINISH;
+}
+
 #define foreach_custom_print_no_arg_function                            \
 _(lisp_eid_table_vni_dump)                                              \
 _(lisp_map_resolver_dump)                                               \
@@ -2955,6 +3016,9 @@ _(SR_POLICY_MOD, sr_policy_mod)                                         \
 _(SR_POLICY_DEL, sr_policy_del)                                         \
 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect)           \
 _(L2FIB_ADD_DEL, l2fib_add_del)                                         \
+_(L2FIB_FLUSH_ALL, l2fib_flush_all)                                     \
+_(L2FIB_FLUSH_BD, l2fib_flush_bd)                                       \
+_(L2FIB_FLUSH_INT, l2fib_flush_int)                                     \
 _(L2_FLAGS, l2_flags)                                                   \
 _(BRIDGE_FLAGS, bridge_flags)                                           \
 _(CLASSIFY_ADD_DEL_TABLE, classify_add_del_table)                      \
@@ -2985,7 +3049,7 @@ _(DELETE_VHOST_USER_IF, delete_vhost_user_if)                             \
 _(SW_INTERFACE_DUMP, sw_interface_dump)                                        \
 _(CONTROL_PING, control_ping)                                          \
 _(WANT_INTERFACE_EVENTS, want_interface_events)                                \
-_(CLI_REQUEST, cli_request)                                            \
+_(CLI, cli)                                                            \
 _(CLI_INBAND, cli_inband)                                              \
 _(MEMCLNT_CREATE, memclnt_create)                                      \
 _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump)           \
@@ -3074,7 +3138,9 @@ _(IP_FIB_DUMP, ip_fib_dump)                                             \
 _(IP6_FIB_DUMP, ip6_fib_dump)                                           \
 _(FEATURE_ENABLE_DISABLE, feature_enable_disable)                      \
 _(SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del)                  \
-_(SW_INTERFACE_SET_MTU, sw_interface_set_mtu)
+_(SW_INTERFACE_SET_MTU, sw_interface_set_mtu)                           \
+_(P2P_ETHERNET_ADD, p2p_ethernet_add)                                   \
+_(P2P_ETHERNET_DEL, p2p_ethernet_del)
   void
 vl_msg_api_custom_dump_configure (api_main_t * am)
 {