Added configure option CLICON_PLUGIN_DLOPEN_GLOBAL for config of dlopen()
This commit is contained in:
parent
ad61570a3d
commit
90b7a550b2
5 changed files with 44 additions and 18 deletions
|
|
@ -53,6 +53,7 @@ Users may have to change how they access the system
|
|||
|
||||
* New `clixon-config@2023-05-01.yang` revision
|
||||
* Added options: `CLICON_CONFIG_EXTEND`
|
||||
|
||||
* Moved datastore-format datastype to clixon-lib
|
||||
* New `clixon-lib@2023-05-01.yang` revision
|
||||
* Restructured and extended stats rpc to schema mountpoints
|
||||
|
|
@ -97,8 +98,13 @@ project, along with minor improvements and bugfixes.
|
|||
### API changes on existing protocol/config features
|
||||
Users may have to change how they access the system
|
||||
|
||||
* Changed `configure --with-cligen=dir`
|
||||
* <dir> is considered as `DESTDIR` and consider cligen installed under `DESTDIR/PREFIX`
|
||||
* Changed from: consider cligen installed under `<dir>`
|
||||
* New `clixon-config@2023-03-01.yang` revision
|
||||
* Added options: `CLICON_RESTCONF_NOALPN_DEFAULT`
|
||||
* Added options:
|
||||
* `CLICON_RESTCONF_NOALPN_DEFAULT`
|
||||
* `CLICON_PLUGIN_DLOPEN_GLOBAL`
|
||||
* Extended datastore-format with CLI and text
|
||||
* New `clixon-lib@2023-03-01.yang` revision
|
||||
* Added creator meta-object
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ A straightforward way to reference a pipe tree is by using an explicit pipe-tree
|
|||
@|mypipe, regular_cb();
|
||||
}
|
||||
```
|
||||
Note that the `regular_cb()` is stated as an argument to the mypipe reference. This means it will be preended to each callback in 'mypipe'.
|
||||
Note that the `regular_cb()` is stated as an argument to the mypipe reference. This means it will be prepended to each callback in 'mypipe'.
|
||||
|
||||
For example, in the following CLI call:
|
||||
```
|
||||
|
|
@ -209,7 +209,7 @@ In Clixon:
|
|||
pipetree="|mypipe"; # in CLIgen
|
||||
```
|
||||
|
||||
This autoamtically expands each terminal command into a pipe-tree reference in a dynamic way. For example, assume the command `set, regular_cb();` is specified and a user types `set `.
|
||||
This automatically expands each terminal command into a pipe-tree reference in a dynamic way. For example, assume the command `set, regular_cb();` is specified and a user types `set `.
|
||||
|
||||
This expands the syntax by adding the `@|mypipe, regular_cb()` which is in turn expanded to:
|
||||
```
|
||||
|
|
|
|||
|
|
@ -299,6 +299,7 @@ clixon_plugin_find(clicon_handle h,
|
|||
}
|
||||
|
||||
/*! Load a dynamic plugin object and call its init-function
|
||||
*
|
||||
* @param[in] h Clicon handle
|
||||
* @param[in] file Which plugin to load
|
||||
* @param[in] function Which function symbol to load and call
|
||||
|
|
@ -310,10 +311,10 @@ clixon_plugin_find(clicon_handle h,
|
|||
* @see clixon_plugins_load Load all plugins
|
||||
*/
|
||||
static int
|
||||
plugin_load_one(clicon_handle h,
|
||||
char *file, /* note modified */
|
||||
const char *function,
|
||||
int dlflags,
|
||||
plugin_load_one(clicon_handle h,
|
||||
char *file, /* note modified */
|
||||
const char *function,
|
||||
int dlflags,
|
||||
clixon_plugin_t **cpp)
|
||||
{
|
||||
int retval = -1;
|
||||
|
|
@ -406,14 +407,15 @@ clixon_plugins_load(clicon_handle h,
|
|||
const char *dir,
|
||||
const char *regexp)
|
||||
{
|
||||
int retval = -1;
|
||||
int ndp;
|
||||
struct dirent *dp = NULL;
|
||||
int i;
|
||||
char filename[MAXPATHLEN];
|
||||
clixon_plugin_t *cp = NULL;
|
||||
int ret;
|
||||
int retval = -1;
|
||||
int ndp;
|
||||
struct dirent *dp = NULL;
|
||||
int i;
|
||||
char filename[MAXPATHLEN];
|
||||
clixon_plugin_t *cp = NULL;
|
||||
int ret;
|
||||
plugin_module_struct *ms = plugin_module_struct_get(h);
|
||||
int dlflags;
|
||||
|
||||
clicon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
if (ms == NULL){
|
||||
|
|
@ -427,7 +429,12 @@ clixon_plugins_load(clicon_handle h,
|
|||
for (i = 0; i < ndp; i++) {
|
||||
snprintf(filename, MAXPATHLEN-1, "%s/%s", dir, dp[i].d_name);
|
||||
clicon_debug(CLIXON_DBG_DEFAULT, "Loading plugin '%s'", filename);
|
||||
if ((ret = plugin_load_one(h, filename, function, RTLD_NOW, &cp)) < 0)
|
||||
dlflags = RTLD_NOW;
|
||||
if (clicon_option_bool(h, "CLICON_PLUGIN_DLOPEN_GLOBAL"))
|
||||
dlflags |= RTLD_GLOBAL;
|
||||
else
|
||||
dlflags |= RTLD_LOCAL;
|
||||
if ((ret = plugin_load_one(h, filename, function, dlflags, &cp)) < 0)
|
||||
goto done;
|
||||
if (ret == 0)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -999,7 +999,7 @@ assign_namespace_element(cxobj *x0, /* source */
|
|||
*
|
||||
* If origin body has namespace definitions, copy them. The reason is that
|
||||
* some bodies rely on namespace prefixes, such as NACM path, but there is
|
||||
* no way we can now this here.
|
||||
* no way we can know this here.
|
||||
* However, this may lead to namespace collisions if these prefixes are not
|
||||
* canonical, and may collide with the assign_namespace_element() above (but that
|
||||
* is for element symbols)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ module clixon-config {
|
|||
description
|
||||
"Added options:
|
||||
CLICON_CONFIG_EXTEND
|
||||
Moved datastore-format datastype to clixon-lib
|
||||
CLICON_PLUGIN_DLOPEN_GLOBAL
|
||||
Moved datastore-format datatype to clixon-lib
|
||||
Released in Clixon 6.3";
|
||||
}
|
||||
revision 2023-03-01 {
|
||||
|
|
@ -1003,6 +1004,18 @@ module clixon-config {
|
|||
as well as the CLIgen callbacks.
|
||||
See https://clixon-docs.readthedocs.io/en/latest/backend.html#plugin-callback-guidelines";
|
||||
}
|
||||
leaf CLICON_PLUGIN_DLOPEN_GLOBAL {
|
||||
type boolean;
|
||||
default false;
|
||||
description
|
||||
"Local/global flag for dlopen as described in the man page.
|
||||
This applies to the opening of all clixon plugins (backend/cli/netconf/restconf)
|
||||
when loading the shared .so file with dlopen.
|
||||
If false: Symbols defined in this shared object are not made available to resolve
|
||||
references in subsequently loaded shared objects (default).
|
||||
If true: The symbols defined by this shared object will be made available for symbol res‐
|
||||
olution of subsequently loaded shared objects.";
|
||||
}
|
||||
leaf CLICON_YANG_AUGMENT_ACCEPT_BROKEN {
|
||||
type boolean;
|
||||
default false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue