BIER
[vpp.git] / src / vpp / api / api.c
index d020314..c0c6f61 100644 (file)
@@ -87,6 +87,7 @@
 #include <vnet/dpo/lookup_dpo.h>
 #include <vnet/dpo/classify_dpo.h>
 #include <vnet/dpo/ip_null_dpo.h>
+
 #define vl_typedefs            /* define message structures */
 #include <vpp/api/vpe_all_api_h.h>
 #undef vl_typedefs
@@ -1031,15 +1032,10 @@ vl_api_cli_inband_t_handler (vl_api_cli_inband_t * mp)
 {
   vl_api_cli_inband_reply_t *rmp;
   int rv = 0;
-  unix_shared_memory_queue_t *q;
   vlib_main_t *vm = vlib_get_main ();
   unformat_input_t input;
   u8 *out_vec = 0;
 
-  q = vl_api_client_index_to_input_queue (mp->client_index);
-  if (!q)
-    return;
-
   unformat_init_string (&input, (char *) mp->cmd, ntohl (mp->length));
   vlib_cli_input (vm, &input, inband_cli_output, (uword) & out_vec);
 
@@ -1174,12 +1170,6 @@ vl_api_show_version_t_handler (vl_api_show_version_t * mp)
   char *vpe_api_get_version (void);
   char *vpe_api_get_build_date (void);
 
-  unix_shared_memory_queue_t *q =
-    vl_api_client_index_to_input_queue (mp->client_index);
-
-  if (!q)
-    return;
-
   /* *INDENT-OFF* */
   REPLY_MACRO2(VL_API_SHOW_VERSION_REPLY,
   ({
@@ -1816,6 +1806,7 @@ vl_api_pg_capture_t_handler (vl_api_pg_capture_t * mp)
   vnet_hw_interface_t *hi = 0;
 
   u8 *intf_name = format (0, "pg%d", ntohl (mp->interface_id), 0);
+  vec_terminate_c_string (intf_name);
   u32 hw_if_index = ~0;
   uword *p = hash_get_mem (im->hw_interface_by_name, intf_name);
   if (p)
@@ -2120,6 +2111,9 @@ vl_api_feature_enable_disable_t_handler (vl_api_feature_enable_disable_t * mp)
   u8 *arc_name = format (0, "%s%c", mp->arc_name, 0);
   u8 *feature_name = format (0, "%s%c", mp->feature_name, 0);
 
+  vec_terminate_c_string (arc_name);
+  vec_terminate_c_string (feature_name);
+
   vnet_feature_registration_t *reg =
     vnet_get_feature_reg ((const char *) arc_name,
                          (const char *) feature_name);
@@ -2456,6 +2450,11 @@ setup_message_id_table (api_main_t * am)
   foreach_vl_msg_name_crc_memclnt;
   foreach_vl_msg_name_crc_vpe;
 #undef _
+
+#define vl_api_version_tuple(n,mj, mi, p) \
+  vl_msg_api_add_version (am, #n, mj, mi, p);
+#include <vpp/api/vpe_all_api_h.h>
+#undef vl_api_version_tuple
 }