Call a plugin init function by name 80/9480/2
authorDave Barach <dave@barachs.net>
Sat, 18 Nov 2017 13:43:06 +0000 (08:43 -0500)
committerFlorin Coras <florin.coras@gmail.com>
Sat, 18 Nov 2017 17:04:34 +0000 (17:04 +0000)
commitcabbee7d8caeafa3959f4559177ae335567aefb4
treea2692a381007e78ffb87586cbd6c19521435ed36
parent1d6d085d352c8a009cca3bf62fa8975b3b44d90a
Call a plugin init function by name

Use this macro to arrange init function ordering between friend
plugins.  Fails in the usual manner if the plugin doesn't exist, or if
the init function symbol is AWOL.

clib_error_t *
thisplug_init (vlib_main_t *vm)
{
  clib_error_t *error = 0;

  if ((error = vlib_plugin_init_function ("otherplug.so", otherplug_init)))
     return error;

  <etc>
  return error;
}
VLIB_INIT_FUNCTION(thisplug_init);

Change-Id: Ideecaf46bc0b1546e85096e54be8ddef87946565
Signed-off-by: Dave Barach <dave@barachs.net>
src/vlib/unix/plugin.h
src/vppinfra/clib.h