Yang schema mount: replaced config --enable-yang-schame-mount with runtime option CLICON_YANG_SCHEMA_MOUNT
Added config and validation-level as parameters to ca_yang_mount
This commit is contained in:
parent
02841e5c36
commit
585e725aec
19 changed files with 183 additions and 198 deletions
|
|
@ -282,12 +282,15 @@ typedef int (datastore_upgrade_t)(clicon_handle h, const char *db, cxobj *xt, mo
|
|||
* No need to YANG bind.
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] xt XML mount-point in XML tree
|
||||
* @param[out] config If '0' all data nodes in the mounted schema are read-only
|
||||
* @param[out] vallevel Do or dont do full RFC 7950 validation
|
||||
* @param[out] yanglib XML yang-lib module-set tree. Freed by caller.
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
* @see RFC 8528 (schema-mount) and RFC 8525 (yang-lib)
|
||||
*/
|
||||
typedef int (yang_mount_t)(clicon_handle h, cxobj *xt, cxobj **yanglib);
|
||||
typedef int (yang_mount_t)(clicon_handle h, cxobj *xt, int *config,
|
||||
validate_level *vl, cxobj **yanglib);
|
||||
|
||||
/*! YANG module patch
|
||||
*
|
||||
|
|
@ -454,8 +457,8 @@ int clixon_plugin_extension_all(clicon_handle h, yang_stmt *yext, yang_stmt *ys)
|
|||
int clixon_plugin_datastore_upgrade_one(clixon_plugin_t *cp, clicon_handle h, const char *db, cxobj *xt, modstate_diff_t *msd);
|
||||
int clixon_plugin_datastore_upgrade_all(clicon_handle h, const char *db, cxobj *xt, modstate_diff_t *msd);
|
||||
|
||||
int clixon_plugin_yang_mount_one(clixon_plugin_t *cp, clicon_handle h, cxobj *xt, cxobj **yanglib);
|
||||
int clixon_plugin_yang_mount_all(clicon_handle h, cxobj *xt, cxobj **yanglib);
|
||||
int clixon_plugin_yang_mount_one(clixon_plugin_t *cp, clicon_handle h, cxobj *xt, int *config, validate_level *vl, cxobj **yanglib);
|
||||
int clixon_plugin_yang_mount_all(clicon_handle h, cxobj *xt, int *config, validate_level *vl, cxobj **yanglib);
|
||||
|
||||
int clixon_plugin_yang_patch_one(clixon_plugin_t *cp, clicon_handle h, yang_stmt *ymod);
|
||||
int clixon_plugin_yang_patch_all(clicon_handle h, yang_stmt *ymod);
|
||||
|
|
|
|||
|
|
@ -40,16 +40,6 @@
|
|||
#ifndef _CLIXON_VALIDATE_H_
|
||||
#define _CLIXON_VALIDATE_H_
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
/* Validation level at commit */
|
||||
enum validate_level_t {
|
||||
VL_FULL = 0, /* Do full RFC 7950 validation , 0 : backward-compatible */
|
||||
VL_NONE, /* Do not do any validation */
|
||||
};
|
||||
typedef enum validate_level_t validate_level;
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -181,6 +181,12 @@ typedef struct yang_stmt yang_stmt;
|
|||
*/
|
||||
typedef int (yang_applyfn_t)(yang_stmt *ys, void *arg);
|
||||
|
||||
/* Validation level at commit */
|
||||
enum validate_level_t {
|
||||
VL_FULL = 0, /* Do full RFC 7950 validation , 0 : backward-compatible */
|
||||
VL_NONE, /* Do not do any validation */
|
||||
};
|
||||
typedef enum validate_level_t validate_level;
|
||||
|
||||
/* Yang data definition statement
|
||||
* See RFC 7950 Sec 3:
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
* Prototypes
|
||||
*/
|
||||
int yang_schema_mount_point(yang_stmt *y);
|
||||
int xml_yang_mount_get(cxobj *x, yang_stmt **yspec);
|
||||
int xml_yang_mount_get(clicon_handle h, cxobj *x, validate_level *vl, yang_stmt **yspec);
|
||||
int xml_yang_mount_set(cxobj *x, yang_stmt *yspec);
|
||||
int xml_yang_mount_freeall(cvec *cvv);
|
||||
int yang_schema_mount_statedata(clicon_handle h, yang_stmt *yspec, char *xpath, cvec *nsc, cxobj **xret, cxobj **xerr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue