Merge branch 'master' into feature_openconfig_compress

This commit is contained in:
Olof Hagsand 2021-10-22 09:23:48 +02:00 committed by GitHub
commit 9d8d9ac042
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 997 additions and 139 deletions

View file

@ -1,12 +1,43 @@
/*
* Copyright 2021 Rubicon Communications LLC (Netgate)
*
***** BEGIN LICENSE BLOCK *****
Copyright (C) 2021 Rubicon Communications, LLC(Netgate)
This file is part of CLIXON.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 3 or later (the "GPL"),
in which case the provisions of the GPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of the GPL, and not to allow others to
use your version of this file under the terms of Apache License version 2,
indicate your decision by deleting the provisions above and replace them with
the notice and other provisions required by the GPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the Apache License version 2 or the GPL.
***** END LICENSE BLOCK *****
* @see https://github.com/dcornejo/dispatcher
*/
#ifndef DISPATCH_DISPATCHER_H
#define DISPATCH_DISPATCHER_H
#ifndef _CLIXON_DISPATCH_DISPATCHER_H
#define _CLIXON_DISPATCH_DISPATCHER_H
/*! prototype for a function to handle a path
/*! Prototype for a function to handle a path
* minimally needs the path it's working on, but probably
* we want to hand down cached data somehow
* @param[in] h Generic handler
@ -74,5 +105,6 @@ struct _dispatcher_entry {
int dispatcher_register_handler(dispatcher_entry_t **root, dispatcher_definition *x);
int dispatcher_call_handlers(dispatcher_entry_t *root, void *handle, char *path, void *user_args);
int dispatcher_free(dispatcher_entry_t *root);
int dispatcher_print(FILE *f, int level, dispatcher_entry_t *root);
#endif /* DISPATCH_DISPATCHER_H */
#endif /* _CLIXON_DISPATCH_DISPATCHER_H */

View file

@ -50,7 +50,6 @@
/*
* Types
*/
/*! Registered RPC callback function
* @param[in] h Clicon handle
@ -201,8 +200,8 @@ typedef int (plgreset_t)(clicon_handle h, const char *db);
* A complete valid XML tree is created by the plugin and sent back via xtop, which is merged
* into a complete state tree by the system.
* The plugin should ensure that xpath is matched (using namspace context nsc)
* This callback may be replaced with a "dispatcher" type API in the future where the
* XPath binding is stricter, similar to the pagination API.
* XXX: This callback may be replaced with a "dispatcher" type API in the future where the
* XPath binding is stricter, similar to the pagination API.
*
* @param[in] h Clicon handle
* @param[in] xpath Part of state requested
@ -338,6 +337,7 @@ struct clixon_plugin_api{
#define ca_trans_abort u.cau_backend.cb_trans_abort
#define ca_datastore_upgrade u.cau_backend.cb_datastore_upgrade
/*
* Macros
*/
@ -349,6 +349,10 @@ typedef struct clixon_plugin_api clixon_plugin_api;
* The internal struct is defined in clixon_plugin.c */
typedef struct clixon_plugin clixon_plugin_t;
/*! Structure for checking status before and after a plugin call
* The internal struct is defined in clixon_plugin.c */
typedef struct plugin_context plugin_context_t;
/*
* Prototypes
*/
@ -361,7 +365,6 @@ typedef struct clixon_plugin clixon_plugin_t;
*/
clixon_plugin_api *clixon_plugin_init(clicon_handle h);
clixon_plugin_api *clixon_plugin_api_get(clixon_plugin_t *cp);
char *clixon_plugin_name_get(clixon_plugin_t *cp);
plghndl_t clixon_plugin_handle_get(clixon_plugin_t *cp);
@ -376,6 +379,9 @@ int clixon_plugins_load(clicon_handle h, const char *function, const char *dir,
int clixon_pseudo_plugin(clicon_handle h, const char *name, clixon_plugin_t **cpp);
plugin_context_t * plugin_context_get(void);
int plugin_context_check(plugin_context_t *pc, const char *name, const char *fn);
int clixon_plugin_start_one(clixon_plugin_t *cp, clicon_handle h);
int clixon_plugin_start_all(clicon_handle h);

View file

@ -47,6 +47,8 @@ typedef void (*sigfn_t)(int);
* Prototypes
*/
int set_signal(int signo, void (*handler)(int), void (**oldhandler)(int));
int clixon_signal_save(sigset_t *sigset, struct sigaction sigaction_vec[32]);
int clixon_signal_restore(sigset_t *sigset, struct sigaction sigaction_vec[32]);
void clicon_signal_block(int);
void clicon_signal_unblock(int);

View file

@ -270,6 +270,6 @@ int yang_type_cache_get(yang_stmt *ytype, yang_stmt **resolved, int *opti
int yang_type_cache_set(yang_stmt *ys, yang_stmt *resolved, int options, cvec *cvv,
cvec *patterns, uint8_t fraction);
yang_stmt *yang_anydata_add(yang_stmt *yp, char *name);
int yang_extension_value(yang_stmt *ys, char *name, char *ns, char **value);
int yang_extension_value(yang_stmt *ys, char *name, char *ns, int *exist, char **value);
#endif /* _CLIXON_YANG_H_ */