vat: unload unused vat plugins
[vpp.git] / src / plugins / lb / lb_test.c
index 00ad673..4ac306b 100644 (file)
@@ -349,8 +349,8 @@ _(lb_add_del_vip, "<prefix> "  \
 _(lb_add_del_as, "<vip-prefix> [protocol (tcp|udp) port <n>] "  \
                  "[<address>] [del] [flush]")
 
-static void 
-lb_vat_api_hookup (vat_main_t *vam)
+static void
+lb_api_hookup (vat_main_t *vam)
 {
   lb_test_main_t * lbtm = &lb_test_main;
   /* Hook up handlers for replies from the data plane plug-in */
@@ -376,22 +376,4 @@ lb_vat_api_hookup (vat_main_t *vam)
 #undef _
 }
 
-clib_error_t * vat_plugin_register (vat_main_t *vam)
-{
-  lb_test_main_t * lbtm = &lb_test_main;
-
-  u8 * name;
-
-  lbtm->vat_main = vam;
-
-  /* Ask the vpp engine for the first assigned message-id */
-  name = format (0, "lb_%08x%c", api_version, 0);
-  lbtm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name);
-
-  if (lbtm->msg_id_base != (u16) ~0)
-    lb_vat_api_hookup (vam);
-
-  vec_free(name);
-
-  return 0;
-}
+VAT_PLUGIN_REGISTER(lb);