aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-03-22 11:08:39 +0100
committerOle Trøan <otroan@employees.org>2017-03-22 13:43:14 +0000
commit1bfb0ddace3ebb9010275e4bdd847c8c493ff4b3 (patch)
tree307ea8e61479211574c88e3915bc612a1aeb942c /src/vlib
parent864b25d0777d3226f475ef7d0232cacec7127770 (diff)
vlib: add description field in plugin registration
Change-Id: I88b322a5d602f3d6d3310e971479180a89430e0e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/unix/plugin.c14
-rw-r--r--src/vlib/unix/plugin.h1
2 files changed, 10 insertions, 5 deletions
diff --git a/src/vlib/unix/plugin.c b/src/vlib/unix/plugin.c
index e9846e3bbe2..9b341cc8113 100644
--- a/src/vlib/unix/plugin.c
+++ b/src/vlib/unix/plugin.c
@@ -105,13 +105,13 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init)
}
if (reg->default_disabled && pc->is_enabled == 0)
{
- clib_warning ("Plugin disabled: %s (default)", pi->name);
+ clib_warning ("Plugin disabled (default): %s", pi->name);
goto error;
}
}
else if (reg->default_disabled)
{
- clib_warning ("Plugin disabled: %s (default)", pi->name);
+ clib_warning ("Plugin disabled (default): %s", pi->name);
goto error;
}
@@ -184,7 +184,10 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init)
(char *) pi->name, reg->early_init);
}
- clib_warning ("Loaded plugin: %s", pi->name);
+ if (reg->description)
+ clib_warning ("Loaded plugin: %s (%s)", pi->name, reg->description);
+ else
+ clib_warning ("Loaded plugin: %s", pi->name);
return 0;
error:
@@ -374,7 +377,7 @@ vlib_plugins_show_cmd_fn (vlib_main_t * vm,
plugin_info_t *pi;
s = format (s, " Plugin path is: %s\n\n", pm->plugin_path);
- s = format (s, " %-41s%s\n", "Plugin", "Version");
+ s = format (s, " %-41s%-33s%s\n", "Plugin", "Version", "Description");
/* *INDENT-OFF* */
hash_foreach_mem (key, value, pm->plugin_by_name_hash,
@@ -382,7 +385,8 @@ vlib_plugins_show_cmd_fn (vlib_main_t * vm,
if (key != 0)
{
pi = vec_elt_at_index (pm->plugin_info, value);
- s = format (s, "%3d. %-40s %s\n", index, key, pi->version);
+ s = format (s, "%3d. %-40s %-32s %s\n", index, key, pi->version,
+ pi->reg->description ? pi->reg->description : "");
index++;
}
});
diff --git a/src/vlib/unix/plugin.h b/src/vlib/unix/plugin.h
index 01fec3564fc..d9801ec439a 100644
--- a/src/vlib/unix/plugin.h
+++ b/src/vlib/unix/plugin.h
@@ -62,6 +62,7 @@ typedef CLIB_PACKED(struct {
const char version[32];
const char version_required[32];
const char *early_init;
+ const char *description;
}) vlib_plugin_registration_t;
/* *INDENT-ON* */