feature: API/CLI to enable/disable feature per interface
[vpp.git] / vpp / vpp-api / custom_dump.c
index 2eafac9..6c181ee 100644 (file)
@@ -146,6 +146,21 @@ static void *vl_api_sw_interface_set_table_t_print
   FINISH;
 }
 
+static void *vl_api_sw_interface_set_mpls_enable_t_print
+  (vl_api_sw_interface_set_mpls_enable_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: sw_interface_set_mpls_enable ");
+
+  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
+
+  if (mp->enable == 0)
+    s = format (s, "disable");
+
+  FINISH;
+}
+
 static void *vl_api_sw_interface_set_vpath_t_print
   (vl_api_sw_interface_set_vpath_t * mp, void *handle)
 {
@@ -1207,6 +1222,10 @@ static void *vl_api_classify_add_del_table_t_print
       s = format (s, "match %d ", ntohl (mp->match_n_vectors));
       s = format (s, "next-table %d ", ntohl (mp->next_table_index));
       s = format (s, "miss-next %d ", ntohl (mp->miss_next_index));
+      s = format (s, "current-data-flag %d ", ntohl (mp->current_data_flag));
+      if (mp->current_data_flag)
+       s = format (s, "current-data-offset %d ",
+                   ntohl (mp->current_data_offset));
       s = format (s, "mask hex ");
       for (i = 0; i < ntohl (mp->match_n_vectors) * sizeof (u32x4); i++)
        s = format (s, "%02x", mp->mask[i]);
@@ -1228,6 +1247,9 @@ static void *vl_api_classify_add_del_session_t_print
   s = format (s, "hit_next_index %d ", ntohl (mp->hit_next_index));
   s = format (s, "opaque_index %d ", ntohl (mp->opaque_index));
   s = format (s, "advance %d ", ntohl (mp->advance));
+  s = format (s, "action %d ", mp->action);
+  if (mp->action)
+    s = format (s, "metadata %d ", ntohl (mp->metadata));
   if (mp->is_add == 0)
     s = format (s, "del ");
 
@@ -2041,6 +2063,26 @@ static void *vl_api_mpls_fib_dump_t_print
   FINISH;
 }
 
+static void *vl_api_ip_fib_dump_t_print
+  (vl_api_ip_fib_dump_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: ip_fib_dump ");
+
+  FINISH;
+}
+
+static void *vl_api_ip6_fib_dump_t_print
+  (vl_api_ip6_fib_dump_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: ip6_fib_dump ");
+
+  FINISH;
+}
+
 static void *vl_api_classify_table_ids_t_print
   (vl_api_classify_table_ids_t * mp, void *handle)
 {
@@ -2164,6 +2206,31 @@ static void *vl_api_ipfix_classify_table_dump_t_print
   FINISH;
 }
 
+static void *vl_api_sw_interface_span_enable_disable_t_print
+  (vl_api_sw_interface_span_enable_disable_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: sw_interface_span_enable_disable ");
+  s = format (s, "src_sw_if_index %u ", ntohl (mp->sw_if_index_from));
+  s = format (s, "dst_sw_if_index %u ", ntohl (mp->sw_if_index_to));
+  if (!mp->enable)
+    s = format (s, "disable ");
+
+  FINISH;
+}
+
+static void *
+vl_api_sw_interface_span_dump_t_print (vl_api_sw_interface_span_dump_t * mp,
+                                      void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: sw_interface_span_dump ");
+
+  FINISH;
+}
+
 static void *vl_api_get_next_index_t_print
   (vl_api_get_next_index_t * mp, void *handle)
 {
@@ -2789,6 +2856,57 @@ static void *vl_api_get_first_msg_id_t_print
   FINISH;
 }
 
+static void *vl_api_ioam_enable_t_print
+  (vl_api_ioam_enable_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: ioam_enable ");
+
+  if (mp->trace_enable)
+    s = format (s, "trace enabled");
+
+  if (mp->pot_enable)
+    s = format (s, "POT enabled");
+
+  if (mp->seqno)
+    s = format (s, "Seqno enabled");
+
+  if (mp->analyse)
+    s = format (s, "Analyse enabled");
+
+  FINISH;
+}
+
+static void *vl_api_ioam_disable_t_print
+  (vl_api_ioam_disable_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: ioam_disable ");
+  s = format (s, "trace disabled");
+  s = format (s, "POT disabled");
+  s = format (s, "Seqno disabled");
+  s = format (s, "Analyse disabled");
+
+  FINISH;
+}
+
+static void *vl_api_feature_enable_disable_t_print
+  (vl_api_feature_enable_disable_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: feature_enable_disable ");
+  s = format (s, "arc_name %s ", mp->arc_name);
+  s = format (s, "feature_name %s ", mp->feature_name);
+  s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
+  if (!mp->enable)
+    s = format (s, "disable");
+
+  FINISH;
+}
+
 #define foreach_custom_print_no_arg_function                            \
 _(lisp_eid_table_vni_dump)                                              \
 _(lisp_map_resolver_dump)                                               \
@@ -2810,6 +2928,7 @@ _(CREATE_LOOPBACK, create_loopback)                                     \
 _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags)                       \
 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address)           \
 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table)                       \
+_(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable)           \
 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath)                       \
 _(TAP_CONNECT, tap_connect)                                             \
 _(TAP_MODIFY, tap_modify)                                               \
@@ -2909,6 +3028,8 @@ _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream)                 \
 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump)               \
 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del)           \
 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump)                 \
+_(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable)   \
+_(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump)                       \
 _(GET_NEXT_INDEX, get_next_index)                                       \
 _(PG_CREATE_INTERFACE,pg_create_interface)                              \
 _(PG_CAPTURE, pg_capture)                                               \
@@ -2952,7 +3073,12 @@ _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite)           \
 _(PUNT, punt)                                                           \
 _(FLOW_CLASSIFY_SET_INTERFACE, flow_classify_set_interface)             \
 _(FLOW_CLASSIFY_DUMP, flow_classify_dump)                              \
-_(GET_FIRST_MSG_ID, get_first_msg_id)
+_(GET_FIRST_MSG_ID, get_first_msg_id)                                   \
+_(IOAM_ENABLE, ioam_enable)                                             \
+_(IOAM_DISABLE, ioam_disable)                                           \
+_(IP_FIB_DUMP, ip_fib_dump)                                             \
+_(IP6_FIB_DUMP, ip6_fib_dump)                                           \
+_(FEATURE_ENABLE_DISABLE, feature_enable_disable)
   void
 vl_msg_api_custom_dump_configure (api_main_t * am)
 {