* Pushed tag to 4.0.1.PRE
* Restconf RFC 8040 increased feature compliance
* Cache-Control: no-cache added in HTTP responses (RFC Section 5.5)
* Restconf monitoring capabilities (RFC Section 9.1)
* Added support for Yang extensions
* New plugin callback: ca_extension
* Main backend example includes example code on how to implement a Yang extension in a plugin.
* JSON changes
* Non-pretty-print output removed all extra spaces.
* Example: `{"nacm-example:x": 42}` --> {"nacm-example:x":42}`
* Empty JSON container changed from `null` to `{}`.
* Empty list and leafs remain as `null`
* Removed unnecessary configure dependencies
* libnsl, libcrypt, libm, if_vlan,...
* pseudo-plugin added, to enable callbacks also for main programs. Useful for extensions
* Yang Unique statements with multiple schema identifiers did not work on some platforms due to memory error.
This commit is contained in:
parent
fe46a0e093
commit
e7b60619da
60 changed files with 1619 additions and 568 deletions
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (C) 2009-2019 Olof Hagsand and Benny Holmgren
|
||||
Copyright (C) 2009-2019 Olof Hagsand
|
||||
|
||||
This file is part of CLIXON.
|
||||
|
||||
|
|
@ -32,6 +32,8 @@
|
|||
***** END LICENSE BLOCK *****
|
||||
|
||||
* JSON support functions.
|
||||
* JSON syntax is according to:
|
||||
* http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
|
||||
*/
|
||||
#ifndef _CLIXON_JSON_H
|
||||
#define _CLIXON_JSON_H
|
||||
|
|
|
|||
|
|
@ -106,6 +106,20 @@ typedef int (plgstart_t)(clicon_handle); /* Plugin start */
|
|||
*/
|
||||
typedef int (plgexit_t)(clicon_handle); /* Plugin exit */
|
||||
|
||||
/* For yang extension handling.
|
||||
* Called at parsing of yang module containing a statement of an extension.
|
||||
* A plugin may identify the extension by its name, and perform actions
|
||||
* on the yang statement, such as transforming the yang.
|
||||
* A callback is made for every statement, which means that several calls per
|
||||
* extension can be made.
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] yext Yang node of extension
|
||||
* @param[in] ys Yang node of (unknown) statement belonging to extension
|
||||
* @retval 0 OK, all callbacks executed OK
|
||||
* @retval -1 Error in one callback
|
||||
*/
|
||||
typedef int (plgextension_t)(clicon_handle h, yang_stmt *yext, yang_stmt *ys);
|
||||
|
||||
/*! Called by restconf to check credentials and return username
|
||||
*/
|
||||
|
||||
|
|
@ -168,6 +182,7 @@ struct clixon_plugin_api{
|
|||
plginit2_t *ca_init; /* Clixon plugin Init (implicit) */
|
||||
plgstart_t *ca_start; /* Plugin start */
|
||||
plgexit_t *ca_exit; /* Plugin exit */
|
||||
plgextension_t *ca_extension; /* Yang extension handler */
|
||||
union {
|
||||
struct { /* cli-specific */
|
||||
cli_prompthook_t *ci_prompt; /* Prompt hook */
|
||||
|
|
@ -189,7 +204,6 @@ struct clixon_plugin_api{
|
|||
trans_cb_t *cb_trans_revert; /* Transaction revert */
|
||||
trans_cb_t *cb_trans_end; /* Transaction completed */
|
||||
trans_cb_t *cb_trans_abort; /* Transaction aborted */
|
||||
|
||||
} cau_backend;
|
||||
|
||||
} u;
|
||||
|
|
@ -245,12 +259,16 @@ clixon_plugin *clixon_plugin_find(clicon_handle h, char *name);
|
|||
|
||||
int clixon_plugins_load(clicon_handle h, char *function, char *dir, char *regexp);
|
||||
|
||||
int clixon_pseudo_plugin(clicon_handle h, char *name, clixon_plugin **cpp);
|
||||
|
||||
int clixon_plugin_start(clicon_handle h);
|
||||
|
||||
int clixon_plugin_exit(clicon_handle h);
|
||||
|
||||
int clixon_plugin_auth(clicon_handle h, void *arg);
|
||||
|
||||
int clixon_plugin_extension(clicon_handle h, yang_stmt *yext, yang_stmt *ys);
|
||||
|
||||
/* rpc callback API */
|
||||
int rpc_callback_register(clicon_handle h, clicon_rpc_cb cb, void *arg, char *namespace, char *name);
|
||||
int rpc_callback_delete_all(clicon_handle h);
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@ struct xml;
|
|||
|
||||
typedef struct yang_stmt yang_stmt; /* Defined in clixon_yang_internal */
|
||||
|
||||
|
||||
typedef int (yang_applyfn_t)(yang_stmt *ys, void *arg);
|
||||
|
||||
/*
|
||||
|
|
@ -157,6 +156,8 @@ int yang_cvec_set(yang_stmt *ys, cvec *cvv);
|
|||
/* Other functions */
|
||||
yang_stmt *yspec_new(void);
|
||||
yang_stmt *ys_new(enum rfc_6020 keyw);
|
||||
yang_stmt *ys_prune(yang_stmt *yp, int i);
|
||||
|
||||
int ys_free(yang_stmt *ys);
|
||||
int yspec_free(yang_stmt *yspec);
|
||||
int ys_cp(yang_stmt *new, yang_stmt *old);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue