papi: fix VPP_API_DIR
[vpp.git] / src / plugins / lb / api.c
index 176da24..bf4a50d 100644 (file)
 #include <lb/lb.api_enum.h>
 #include <lb/lb.api_types.h>
 
-#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
 
 #define REPLY_MSG_ID_BASE lbm->msg_id_base
 #include <vlibapi/api_helper_macros.h>
 
-/* Macro to finish up custom dump fns */
-#define FINISH                                  \
-    vec_add1 (s, 0);                            \
-    vl_print (handle, (char *)s);               \
-    vec_free (s);                               \
-    return handle;
+#define FINISH                                                                \
+  vec_add1 (s, 0);                                                            \
+  vlib_cli_output (handle, (char *) s);                                       \
+  vec_free (s);                                                               \
+  return handle;
 
 static void
 vl_api_lb_conf_t_handler
@@ -177,7 +175,7 @@ vl_api_lb_vip_dump_t_handler
   lb_vip_t *vip = 0;
 
   /* construct vip list */
-  pool_foreach(vip, lbm->vips, {
+  pool_foreach (vip, lbm->vips) {
       /* Hide placeholder VIP */
       if (vip != lbm->vips) {
         msg_size = sizeof (*rmp);
@@ -199,7 +197,7 @@ vl_api_lb_vip_dump_t_handler
 
         vl_api_send_msg (reg, (u8 *) rmp);
       }
-  });
+  }
 
 
 }
@@ -211,12 +209,11 @@ static void send_lb_as_details
   lb_main_t *lbm = &lb_main;
   int msg_size = 0;
   u32 *as_index;
-  u32 asindex = 0;
 
   /* construct as list under this vip */
   lb_as_t *as;
 
-  pool_foreach(as_index, vip->as_indexes, {
+  pool_foreach (as_index, vip->as_indexes) {
       /* Hide placeholder As for specific VIP */
       if (*as_index != 0) {
         as = &lbm->ass[*as_index];
@@ -235,9 +232,8 @@ static void send_lb_as_details
         rmp->in_use_since = htonl(as->last_used);
 
         vl_api_send_msg (reg, (u8 *) rmp);
-        asindex++;
       }
-  });
+  }
 
 
 }
@@ -261,8 +257,8 @@ vl_api_lb_as_dump_t_handler
   dump_all = (prefix.ip6.as_u64[0] == 0) && (prefix.ip6.as_u64[1] == 0);
 
   /* *INDENT-OFF* */
-  pool_foreach(vip, lbm->vips,
-  ({
+  pool_foreach (vip, lbm->vips)
+   {
     if ( dump_all
         || ((prefix.as_u64[0] == vip->prefix.as_u64[0])
         && (prefix.as_u64[1] == vip->prefix.as_u64[1])
@@ -271,7 +267,7 @@ vl_api_lb_as_dump_t_handler
       {
         send_lb_as_details(reg, mp->context, vip);
       }
-  }));
+  }
   /* *INDENT-ON* */
 }