fib: fib api updates
[vpp.git] / src / vpp / api / api.c
index 8e2e4cd..9c23811 100644 (file)
@@ -59,6 +59,8 @@
 #include <vnet/ip/format.h>
 
 #include <vpp/api/vpe_msg_enum.h>
+#include <vpp/api/types.h>
+#include <vlibapi/api_types_inlines.h>
 
 #define vl_typedefs            /* define message structures */
 #include <vpp/api/vpe_all_api_h.h>
@@ -102,9 +104,6 @@ memclnt_delete_callback (u32 client_index)
   vpe_api_main_t *vam = &vpe_api_main;
   vpe_client_registration_t *rp;
   uword *p;
-  int stats_memclnt_delete_callback (u32 client_index);
-
-  stats_memclnt_delete_callback (client_index);
 
 #define _(a)                                                    \
     p = hash_get (vam->a##_registration_hash, client_index);    \
@@ -228,7 +227,7 @@ vl_api_cli_inband_t_handler (vl_api_cli_inband_t * mp)
 
   unformat_init_string (&input, (char *) vl_api_from_api_string (&mp->cmd),
                        vl_api_string_len (&mp->cmd));
-  vlib_cli_input (vm, &input, inband_cli_output, (uword) & out_vec);
+  rv = vlib_cli_input (vm, &input, inband_cli_output, (uword) & out_vec);
 
   len = vec_len (out_vec);
 
@@ -251,11 +250,10 @@ 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);
 
-  u32 program_len = strnlen_s ("vpe", 32) + 1;
-  u32 version_len = strnlen_s (vpe_api_get_version (), 32) + 1;
-  u32 build_date_len = strnlen_s (vpe_api_get_build_date (), 32) + 1;
-  u32 build_directory_len =
-    strnlen_s (vpe_api_get_build_directory (), 256) + 1;
+  u32 program_len = strnlen_s ("vpe", 32);
+  u32 version_len = strnlen_s (vpe_api_get_version (), 32);
+  u32 build_date_len = strnlen_s (vpe_api_get_build_date (), 32);
+  u32 build_directory_len = strnlen_s (vpe_api_get_build_directory (), 256);
 
   u32 n = program_len + version_len + build_date_len + build_directory_len;
 
@@ -290,8 +288,7 @@ get_thread_data (vl_api_thread_data_t * td, int index)
 static void
 vl_api_show_threads_t_handler (vl_api_show_threads_t * mp)
 {
-  vlib_main_t *vm = vlib_get_main ();
-  int rv = 0, count = 0;
+  int count = 0;
 
 #if !defined(__powerpc64__)
   vl_api_registration_t *reg;
@@ -541,7 +538,9 @@ vpe_api_hookup (vlib_main_t * vm)
   /*
    * Thread-safe API messages
    */
-  am->is_mp_safe[VL_API_IP_ADD_DEL_ROUTE] = 1;
+  am->is_mp_safe[VL_API_CONTROL_PING] = 1;
+  am->is_mp_safe[VL_API_CONTROL_PING_REPLY] = 1;
+  am->is_mp_safe[VL_API_IP_ROUTE_ADD_DEL] = 1;
   am->is_mp_safe[VL_API_GET_NODE_GRAPH] = 1;
 
   /*
@@ -702,7 +701,7 @@ format_arp_event (u8 * s, va_list * args)
   vl_api_ip4_arp_event_t *event = va_arg (*args, vl_api_ip4_arp_event_t *);
 
   s = format (s, "pid %d: ", ntohl (event->pid));
-  s = format (s, "resolution for %U", format_ip4_address, &event->address);
+  s = format (s, "resolution for %U", format_vl_api_ip4_address, event->ip);
   return s;
 }
 
@@ -712,7 +711,7 @@ format_nd_event (u8 * s, va_list * args)
   vl_api_ip6_nd_event_t *event = va_arg (*args, vl_api_ip6_nd_event_t *);
 
   s = format (s, "pid %d: ", ntohl (event->pid));
-  s = format (s, "resolution for %U", format_ip6_address, event->address);
+  s = format (s, "resolution for %U", format_vl_api_ip6_address, event->ip);
   return s;
 }