Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vlib: add description field in plugin registration
[vpp.git]
/
src
/
vlib
/
unix
/
plugin.h
diff --git
a/src/vlib/unix/plugin.h
b/src/vlib/unix/plugin.h
index
c17053b
..
d9801ec
100644
(file)
--- a/
src/vlib/unix/plugin.h
+++ b/
src/vlib/unix/plugin.h
@@
-48,7
+48,7
@@
*
* Applications control the plugin search path and name filter by
* declaring the variables vlib_plugin_path and vlib_plugin_name_filter.
*
* Applications control the plugin search path and name filter by
* declaring the variables vlib_plugin_path and vlib_plugin_name_filter.
- * libvlib
_unix
.la supplies weak references for these symbols which
+ * libvlib.la supplies weak references for these symbols which
* effectively disable the scheme. In order for the elf-section magic to
* work, static plugins must be loaded at the earliest possible moment.
*
* effectively disable the scheme. In order for the elf-section magic to
* work, static plugins must be loaded at the earliest possible moment.
*
@@
-56,15
+56,36
@@
* vlib_load_new_plugins().
*/
* vlib_load_new_plugins().
*/
-
+/* *INDENT-OFF* */
+typedef CLIB_PACKED(struct {
+ u8 default_disabled;
+ const char version[32];
+ const char version_required[32];
+ const char *early_init;
+ const char *description;
+}) vlib_plugin_registration_t;
+/* *INDENT-ON* */
typedef struct
{
u8 *name;
typedef struct
{
u8 *name;
+ u8 *filename;
struct stat file_info;
void *handle;
struct stat file_info;
void *handle;
+
+ /* plugin registration */
+ vlib_plugin_registration_t *reg;
+ char *version;
} plugin_info_t;
} plugin_info_t;
+typedef struct
+{
+ char *name;
+ u8 is_disabled;
+ u8 is_enabled;
+ u8 skip_version_check;
+} plugin_config_t;
+
typedef struct
{
/* loaded plugin info */
typedef struct
{
/* loaded plugin info */
@@
-75,8
+96,9
@@
typedef struct
u8 *plugin_path;
u8 *plugin_name_filter;
u8 *plugin_path;
u8 *plugin_name_filter;
- /* handoff structure get callback */
- void *handoff_structure_get_cb;
+ /* plugin configs and hash by name */
+ plugin_config_t *configs;
+ uword *config_index_by_name;
/* usual */
vlib_main_t *vlib_main;
/* usual */
vlib_main_t *vlib_main;
@@
-84,8
+106,14
@@
typedef struct
extern plugin_main_t vlib_plugin_main;
extern plugin_main_t vlib_plugin_main;
+clib_error_t *vlib_plugin_config (vlib_main_t * vm, unformat_input_t * input);
int vlib_plugin_early_init (vlib_main_t * vm);
int vlib_load_new_plugins (plugin_main_t * pm, int from_early_init);
int vlib_plugin_early_init (vlib_main_t * vm);
int vlib_load_new_plugins (plugin_main_t * pm, int from_early_init);
+void *vlib_get_plugin_symbol (char *plugin_name, char *symbol_name);
+
+#define VLIB_PLUGIN_REGISTER() \
+ vlib_plugin_registration_t vlib_plugin_registration \
+ __attribute__((__section__(".vlib_plugin_registration")))
#endif /* __included_plugin_h__ */
#endif /* __included_plugin_h__ */