Added yang domains for mount-point isolation

New option: `CLICON_YANG_DOMAIN_DIR`
New `clixon-config@2024-08-01.yang` revision
This commit is contained in:
Olof hagsand 2024-09-04 12:03:11 +02:00
parent f5372fb124
commit cc194ac7c5
21 changed files with 696 additions and 198 deletions

View file

@ -466,6 +466,7 @@ You can set-up the example for a simple RFC 8528 Yang schema mount. A single top
1. Enable CLICON_YANG_SCHEMA_MOUNT
2. Define the mount-point using the ietf-yang-schema-mount mount-point extension
3. Start the backend, cli and restconf with `-- -m <name> -M <urn>`, where `name` and `urn` is the name and namespace of the mounted YANG, respectively.
4. Note that the module-set name is hard-coded to "mylabel". If you support isolated domains this must be changed.
A simple example on how to define a mount-point
```

View file

@ -90,6 +90,7 @@ static char *_action_instanceid = NULL;
*
* Start backend with -- -m <yang> -M <namespace>
* Mount this yang on mountpoint
* Note module-set hard-coded to "mylabel"
*/
static char *_mount_yang = NULL;
static char *_mount_namespace = NULL;

View file

@ -37,6 +37,7 @@
* argc/argv after -- in clixon_cli:
* -m <yang> Mount this yang on mountpoint
* -M <namespace> Namespace of mountpoint, note both -m and -M must exist
* Note module-set hard-coded to "mylabel"
*/
#include <stdio.h>
#include <stdlib.h>
@ -221,7 +222,7 @@ example_cli_yang_mount(clixon_handle h,
}
cprintf(cb, "<yang-library xmlns=\"urn:ietf:params:xml:ns:yang:ietf-yang-library\">");
cprintf(cb, "<module-set>");
cprintf(cb, "<name>mount</name>");
cprintf(cb, "<name>mylabel</name>");
cprintf(cb, "<module>");
/* In yang name+namespace is mandatory, but not revision */
cprintf(cb, "<name>%s</name>", _mount_yang); // mandatory

View file

@ -61,6 +61,7 @@ static const char Pad64 = '=';
*
* Start restconf with -- -m <yang> -M <namespace>
* Mount this yang on mountpoint
* Note module-set hard-coded to "mylabel"
*/
static char *_mount_yang = NULL;
static char *_mount_namespace = NULL;