* RESTCONF configuration is unified and moved from clixon-config.yang to clixon-restconf.yang
* Except `CLICON_RESTCONF_DIR` which remains in clixon-config.yang due to bootstrapping
* -d <dir> option removed
* This applies to both evhtp and fcgi RESTCONF
* Both can also read config from backend, and be started from backend
* You may need to move config as follows (from clixon-config.yang to clixon-restconf.yang)
* CLICON_RESTCONF_PRETTY -> restconf/pretty
* CLICON_RESTCONF_PATH -> restconf/fcgi-path
This commit is contained in:
parent
72dd31395e
commit
c64878fd4a
58 changed files with 293 additions and 199 deletions
51
CHANGELOG.md
51
CHANGELOG.md
|
|
@ -31,16 +31,44 @@ Expected: February 2021
|
|||
|
||||
### New features
|
||||
|
||||
* RESTCONF failed authentication changed error return code from 403 Forbiden to 401 Unauthorized following RFC 8040
|
||||
* Authentication OK but failed on access, remains as 403 Forbidden
|
||||
* NETCONF Call Home Call Home RFC 8071
|
||||
* See [Netconf/ssh callhome](https://clixon-docs.readthedocs.io/en/latest/netconf.html#callhome)
|
||||
* Solution description using openssh and utility functions, no changes to core clixon
|
||||
* Example: test/test_netconf_ssh_callhome.sh
|
||||
* RESTCONF Call home not done
|
||||
* RESTCONF Call home not yet implemented
|
||||
* New clixon_client API for external access
|
||||
* See [client api docs](https://clixon-docs.readthedocs.io/en/latest/client.html)
|
||||
|
||||
### API changes on existing protocol/config features
|
||||
|
||||
Users may have to change how they access the system
|
||||
|
||||
* RESTCONF configuration is unified and moved from clixon-config.yang to clixon-restconf.yang
|
||||
* Except `CLICON_RESTCONF_DIR` which remains in clixon-config.yang due to bootstrapping
|
||||
* -d <dir> option removed
|
||||
* This applies to both evhtp and fcgi RESTCONF
|
||||
* Both can also read config from backend, and be started from backend
|
||||
* You may need to move config as follows (from clixon-config.yang to clixon-restconf.yang)
|
||||
* CLICON_RESTCONF_PRETTY -> restconf/pretty
|
||||
* CLICON_RESTCONF_PATH -> restconf/fcgi-path
|
||||
* For more info see [clixon-docs](https://clixon-docs.readthedocs.io/en/latest/restconf.html)
|
||||
* RESTCONF failed authentication changed error return code from 403 Forbiden to 401 Unauthorized following RFC 8040
|
||||
* Authentication OK but failed on access, remains as 403 Forbidden
|
||||
* Handling empty netconf XML messages "]]>]]>" is changed from being accepted to return an error.
|
||||
* New clixon-restconf@2020-12-30.yang revision
|
||||
* Added: debug field
|
||||
* Added 'none' as default value for auth-type
|
||||
* Changed http-auth-type enum from 'password' to 'user'
|
||||
* New clixon-lib@2020-12-30.yang revision
|
||||
* Changed: RPC process-control output parameter status to pid
|
||||
* New clixon-config@2020-12-30.yang revision
|
||||
* Removed obsolete RESTCONF and SSL options (CLICON_SSL_* and CLICON_RESTCONF_IP*/HTTP*)
|
||||
* Removed obsolete: CLICON_TRANSACTION_MOD option
|
||||
* Marked as obsolete: CLICON_RESTCONF_PATH CLICON_RESTCONF_PRETTY
|
||||
* Changed namespace of clixon-restconf@2020-10-30.yang from https://clicon.org/restconf ->http://clicon.org/restconf ->
|
||||
* CLIspec dbxml API: Ability to specify deletion of _any_ vs _specific_ entry.
|
||||
* In a cli_del() call, the cvv arg list either exactly matches the api-format-path in which case _any_ deletion is specified, otherwise, if there is an extra element in the cvv list, that is used for a specific delete.
|
||||
|
||||
### C/CLI-API changes on existing features
|
||||
|
||||
Developers may need to change their code
|
||||
|
|
@ -56,23 +84,6 @@ Developers may need to change their code
|
|||
* rpc msg C API rearranged to separate socket/connect from connect
|
||||
* Added `cvv_i` output parameter to `api_path_fmt2api_path()` to see how many cvv entries were used.
|
||||
|
||||
### API changes on existing protocol/config features
|
||||
|
||||
Users may have to change how they access the system
|
||||
|
||||
* Handling empty netconf XML messages "]]>]]>" is changed from being accepted to return an error.
|
||||
* New clixon-restconf@2020-12-30.yang revision
|
||||
* Added: debug field
|
||||
* Added 'none' as default value for auth-type
|
||||
* Changed http-auth-type enum from 'password' to 'user'
|
||||
* New clixon-lib@2020-12-30.yang revision
|
||||
* Changed: RPC process-control output parameter status to pid
|
||||
* New clixon-config@2020-12-30.yang revision
|
||||
* Removed obsolete RESTCONF and SSL options
|
||||
* Changed namespace of clixon-restconf@2020-10-30.yang from https://clicon.org/restconf ->http://clicon.org/restconf ->
|
||||
* CLIspec dbxml API: Ability to specify deletion of _any_ vs _specific_ entry.
|
||||
* In a cli_del() call, the cvv arg list either exactly matches the api-format-path in which case _any_ deletion is specified, otherwise, if there is an extra element in the cvv list, that is used for a specific delete.
|
||||
|
||||
### Minor changes
|
||||
|
||||
* Add ca_reset plugin also when backend starts as `-s none`
|
||||
|
|
|
|||
|
|
@ -599,7 +599,6 @@ restconf_config_init(clicon_handle h,
|
|||
goto disable;
|
||||
}
|
||||
}
|
||||
|
||||
/* get common fields */
|
||||
if ((x = xpath_first(xrestconf, nsc, "auth-type")) != NULL &&
|
||||
(bstr = xml_body(x)) != NULL){
|
||||
|
|
@ -609,6 +608,16 @@ restconf_config_init(clicon_handle h,
|
|||
}
|
||||
restconf_auth_type_set(h, auth_type);
|
||||
}
|
||||
if ((x = xpath_first(xrestconf, nsc, "pretty")) != NULL &&
|
||||
(bstr = xml_body(x)) != NULL){
|
||||
/* XXX redirection to (obsolete) option, fix by replacing its accesses */
|
||||
clicon_option_str_set(h, "CLICON_RESTCONF_PRETTY", bstr);
|
||||
}
|
||||
if ((x = xpath_first(xrestconf, nsc, "fcgi-socket")) != NULL &&
|
||||
(bstr = xml_body(x)) != NULL){
|
||||
/* XXX redirection to (obsolete) option, fix by replacing its accesses */
|
||||
clicon_option_str_set(h, "CLICON_RESTCONF_PATH", bstr);
|
||||
}
|
||||
retval = 1;
|
||||
done:
|
||||
return retval;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
#include "restconf_root.h"
|
||||
|
||||
/* Command line options to be passed to getopt(3) */
|
||||
#define RESTCONF_OPTS "hD:f:E:l:p:d:y:a:u:ro:"
|
||||
#define RESTCONF_OPTS "hD:f:E:l:p:y:a:u:ro:"
|
||||
|
||||
/* See see listen(5) */
|
||||
#define SOCKET_LISTEN_BACKLOG 16
|
||||
|
|
@ -700,15 +700,13 @@ usage(clicon_handle h,
|
|||
"\t-E <dir> \t Extra configuration file directory\n"
|
||||
"\t-l <s|f<file>> \t Log on (s)yslog, (f)ile (syslog is default)\n"
|
||||
"\t-p <dir>\t Yang directory path (see CLICON_YANG_DIR)\n"
|
||||
"\t-d <dir>\t Specify restconf plugin directory dir (default: %s)\n"
|
||||
"\t-y <file>\t Load yang spec file (override yang main module)\n"
|
||||
"\t-a UNIX|IPv4|IPv6 Internal backend socket family\n"
|
||||
"\t-u <path|addr>\t Internal socket domain path or IP addr (see -a)\n"
|
||||
"\t-r \t\t Do not drop privileges if run as root\n"
|
||||
"\t-o <option>=<value> Set configuration option overriding config file (see clixon-config.yang)\n"
|
||||
,
|
||||
argv0,
|
||||
clicon_restconf_dir(h)
|
||||
argv0
|
||||
);
|
||||
exit(0);
|
||||
}
|
||||
|
|
@ -1043,12 +1041,11 @@ restconf_config(clicon_handle h,
|
|||
cxobj *xerr = NULL;
|
||||
uint32_t id = 0; /* Session id, to poll backend up */
|
||||
struct passwd *pw;
|
||||
cxobj *xconfig1 = NULL;
|
||||
cxobj *xrestconf1 = NULL;
|
||||
cxobj *xrestconf1 = NULL; /* Local config file */
|
||||
cxobj *xconfig2 = NULL;
|
||||
cxobj *xrestconf2 = NULL;
|
||||
cxobj *xrestconf2 = NULL; /* Config from backend */
|
||||
int ret;
|
||||
int backend = 1; /* query backend for config */
|
||||
int configure_done = 0; /* First try local then backend */
|
||||
|
||||
/* Set default namespace according to CLICON_NAMESPACE_NETCONF_DEFAULT */
|
||||
xml_nsctx_namespace_netconf_default(h);
|
||||
|
|
@ -1126,6 +1123,7 @@ restconf_config(clicon_handle h,
|
|||
|
||||
/* Here all modules are loaded
|
||||
* Compute and set canonical namespace context
|
||||
|
||||
*/
|
||||
if (xml_nsctx_yangspec(yspec, &nsctx_global) < 0)
|
||||
goto done;
|
||||
|
|
@ -1138,17 +1136,17 @@ restconf_config(clicon_handle h,
|
|||
goto done;
|
||||
}
|
||||
|
||||
/* First get local config */
|
||||
xconfig1 = clicon_conf_xml(h);
|
||||
if ((xrestconf1 = xpath_first(xconfig1, NULL, "restconf")) != NULL){
|
||||
/* First try to get restconf config from local config-file */
|
||||
if ((xrestconf1 = clicon_conf_restconf(h)) != NULL){
|
||||
/* Initialize evhtp with local config: ret 0 means disabled -> need to query remote */
|
||||
if ((ret = cx_evhtp_init(h, xrestconf1, NULL, eh)) < 0)
|
||||
goto done;
|
||||
if (ret == 1)
|
||||
backend = 0;
|
||||
configure_done = 1;
|
||||
}
|
||||
if (backend){ /* Query backend of config. */
|
||||
/* Before evhtp, try again if not done */
|
||||
/* If no local config, or it is disabled, try to query backend of config. */
|
||||
if (!configure_done){
|
||||
/* Loop to wait for backend starting, try again if not done */
|
||||
while (1){
|
||||
if (clicon_hello_req(h, &id) < 0){
|
||||
if (errno == ENOENT){
|
||||
|
|
@ -1174,13 +1172,19 @@ restconf_config(clicon_handle h,
|
|||
clixon_netconf_error(xerr, "Get backend restconf config", NULL);
|
||||
goto done;
|
||||
}
|
||||
/* Extract socket fields from xconfig */
|
||||
/* Extract restconf configuration */
|
||||
if ((xrestconf2 = xpath_first(xconfig2, nsc, "restconf")) != NULL){
|
||||
/* Initialize evhtp with config from backend */
|
||||
if (cx_evhtp_init(h, xrestconf2, nsc, eh) < 0)
|
||||
if ((ret = cx_evhtp_init(h, xrestconf2, nsc, eh)) < 0)
|
||||
goto done;
|
||||
if (ret == 1)
|
||||
configure_done = 1;
|
||||
}
|
||||
}
|
||||
if (!configure_done){ /* Query backend of config. */
|
||||
clicon_err(OE_DAEMON, EFAULT, "Restconf daemon config not found or disabled");
|
||||
goto done;
|
||||
}
|
||||
retval = 0;
|
||||
done:
|
||||
if (xconfig2)
|
||||
|
|
@ -1281,11 +1285,6 @@ main(int argc,
|
|||
if (clicon_option_add(h, "CLICON_YANG_DIR", optarg) < 0)
|
||||
goto done;
|
||||
break;
|
||||
case 'd': /* Plugin directory */
|
||||
if (!strlen(optarg))
|
||||
usage(h, argv0);
|
||||
clicon_option_str_set(h, "CLICON_RESTCONF_DIR", optarg);
|
||||
break;
|
||||
case 'y' : /* Load yang spec file (override yang main module) */
|
||||
clicon_option_str_set(h, "CLICON_YANG_MAIN_FILE", optarg);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#include <signal.h>
|
||||
#include <syslog.h>
|
||||
#include <fcntl.h>
|
||||
#include <pwd.h>
|
||||
#include <time.h>
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
|
|
@ -175,15 +176,13 @@ usage(clicon_handle h,
|
|||
"\t-E <dir> \t Extra configuration file directory\n"
|
||||
"\t-l <s|f<file>> \t Log on (s)yslog, (f)ile (syslog is default)\n"
|
||||
"\t-p <dir>\t Yang directory path (see CLICON_YANG_DIR)\n"
|
||||
"\t-d <dir>\t Specify restconf plugin directory dir (default: %s)\n"
|
||||
"\t-y <file>\t Load yang spec file (override yang main module)\n"
|
||||
"\t-a UNIX|IPv4|IPv6 Internal backend socket family\n"
|
||||
|
||||
"\t-u <path|addr>\t Internal socket domain path or IP addr (see -a)\n"
|
||||
"\t-r \t\t Do not drop privileges if run as root\n"
|
||||
"\t-o \"<option>=<value>\" Give configuration option overriding config file (see clixon-config.yang)\n",
|
||||
argv0,
|
||||
clicon_restconf_dir(h)
|
||||
argv0
|
||||
);
|
||||
exit(0);
|
||||
}
|
||||
|
|
@ -208,7 +207,6 @@ main(int argc,
|
|||
yang_stmt *yspec = NULL;
|
||||
char *stream_path;
|
||||
int finish = 0;
|
||||
int start = 1;
|
||||
char *str;
|
||||
clixon_plugin *cp = NULL;
|
||||
uint32_t id = 0;
|
||||
|
|
@ -217,9 +215,14 @@ main(int argc,
|
|||
size_t cligen_bufthreshold;
|
||||
int dbg = 0;
|
||||
int drop_privileges = 1;
|
||||
cxobj *xconfig = NULL;
|
||||
cxobj *xrestconf = NULL;
|
||||
int ret;
|
||||
cxobj *xrestconf1 = NULL; /* Local config file */
|
||||
cxobj *xconfig2 = NULL;
|
||||
cxobj *xrestconf2 = NULL; /* Config from backend */
|
||||
int configure_done = 0; /* First try local then backend */
|
||||
cvec *nsc = NULL;
|
||||
cxobj *xerr = NULL;
|
||||
struct passwd *pw;
|
||||
|
||||
/* In the startup, logs to stderr & debug flag set later */
|
||||
clicon_log_init(__PROGRAM__, LOG_INFO, logdst);
|
||||
|
|
@ -298,11 +301,6 @@ main(int argc,
|
|||
if (clicon_option_add(h, "CLICON_YANG_DIR", optarg) < 0)
|
||||
goto done;
|
||||
break;
|
||||
case 'd': /* Plugin directory */
|
||||
if (!strlen(optarg))
|
||||
usage(h, argv[0]);
|
||||
clicon_option_str_set(h, "CLICON_RESTCONF_DIR", optarg);
|
||||
break;
|
||||
case 'y' : /* Load yang spec file (override yang main module) */
|
||||
clicon_option_str_set(h, "CLICON_YANG_MAIN_FILE", optarg);
|
||||
break;
|
||||
|
|
@ -390,6 +388,7 @@ main(int argc,
|
|||
if (yang_spec_load_dir(h, str, yspec) < 0)
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Load clixon lib yang module */
|
||||
if (yang_spec_parse_module(h, "clixon-lib", NULL, yspec) < 0)
|
||||
goto done;
|
||||
|
|
@ -428,15 +427,55 @@ main(int argc,
|
|||
/* Call start function in all plugins before we go interactive */
|
||||
if (clixon_plugin_start_all(h) < 0)
|
||||
goto done;
|
||||
xconfig = clicon_conf_xml(h); /* Get local config */
|
||||
if ((xrestconf = xpath_first(xconfig, NULL, "restconf")) != NULL){
|
||||
if ((ret = restconf_config_init(h, xrestconf)) < 0)
|
||||
|
||||
/* First try to get restconf config from local config-file */
|
||||
if ((xrestconf1 = clicon_conf_restconf(h)) != NULL){
|
||||
if ((ret = restconf_config_init(h, xrestconf1)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){
|
||||
clicon_err(OE_DAEMON, EFAULT, "Restconf daemon disabled in config");
|
||||
if (ret == 1)
|
||||
configure_done = 1;
|
||||
}
|
||||
/* If no local config, or it is disabled, try to query backend of config. */
|
||||
if (!configure_done){
|
||||
/* Loop to wait for backend starting, try again if not done */
|
||||
while (1){
|
||||
if (clicon_hello_req(h, &id) < 0){
|
||||
if (errno == ENOENT){
|
||||
fprintf(stderr, "waiting");
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
clicon_err(OE_UNIX, errno, "clicon_session_id_get");
|
||||
goto done;
|
||||
}
|
||||
clicon_session_id_set(h, id);
|
||||
break;
|
||||
}
|
||||
if ((nsc = xml_nsctx_init(NULL, CLIXON_RESTCONF_NS)) == NULL)
|
||||
goto done;
|
||||
if ((pw = getpwuid(getuid())) == NULL){
|
||||
clicon_err(OE_UNIX, errno, "getpwuid");
|
||||
goto done;
|
||||
}
|
||||
if (clicon_rpc_get_config(h, pw->pw_name, "running", "/restconf", nsc, &xconfig2) < 0)
|
||||
goto done;
|
||||
if ((xerr = xpath_first(xconfig2, NULL, "/rpc-error")) != NULL){
|
||||
clixon_netconf_error(xerr, "Get backend restconf config", NULL);
|
||||
goto done;
|
||||
}
|
||||
/* Extract restconf configuration */
|
||||
if ((xrestconf2 = xpath_first(xconfig2, nsc, "restconf")) != NULL){
|
||||
if ((ret = restconf_config_init(h, xrestconf1)) < 0)
|
||||
goto done;
|
||||
if (ret == 1)
|
||||
configure_done = 1;
|
||||
}
|
||||
}
|
||||
if (!configure_done){ /* Query backend of config. */
|
||||
clicon_err(OE_DAEMON, EFAULT, "Restconf daemon config not found or disabled");
|
||||
goto done;
|
||||
}
|
||||
/* XXX see restconf_config_init access directly */
|
||||
if ((sockpath = clicon_option_str(h, "CLICON_RESTCONF_PATH")) == NULL){
|
||||
clicon_err(OE_CFG, errno, "No CLICON_RESTCONF_PATH in clixon configure file");
|
||||
goto done;
|
||||
|
|
@ -486,17 +525,6 @@ main(int argc,
|
|||
}
|
||||
clicon_debug(1, "------------");
|
||||
|
||||
if (start == 0){
|
||||
/* Send hello request to backend to get session-id back
|
||||
* This is done once at the beginning of the session and then this is
|
||||
* used by the client, even though new TCP sessions are created for
|
||||
* each message sent to the backend.
|
||||
*/
|
||||
if (clicon_hello_req(h, &id) < 0)
|
||||
goto done;
|
||||
clicon_session_id_set(h, id);
|
||||
start++;
|
||||
}
|
||||
/* Translate from FCGI parameter form to Clixon runtime data
|
||||
* XXX: potential name collision?
|
||||
*/
|
||||
|
|
@ -555,6 +583,10 @@ main(int argc,
|
|||
} /* while */
|
||||
retval = 0;
|
||||
done:
|
||||
if (xconfig2)
|
||||
xml_free(xconfig2);
|
||||
if (nsc)
|
||||
cvec_free(nsc);
|
||||
stream_child_freeall(h);
|
||||
restconf_terminate(h);
|
||||
return retval;
|
||||
|
|
|
|||
|
|
@ -406,6 +406,7 @@ api_root_restconf(clicon_handle h,
|
|||
}
|
||||
request_method = restconf_param_get(h, "REQUEST_METHOD");
|
||||
path = restconf_uripath(h);
|
||||
/* XXX see restconf_config_init access directly */
|
||||
pretty = clicon_option_bool(h, "CLICON_RESTCONF_PRETTY");
|
||||
/* Get media for output (proactive negotiation) RFC7231 by using
|
||||
* Accept:. This is for methods that have output, such as GET,
|
||||
|
|
|
|||
|
|
@ -394,6 +394,7 @@ api_stream(clicon_handle h,
|
|||
|
||||
clicon_debug(1, "%s", __FUNCTION__);
|
||||
path = restconf_uripath(h);
|
||||
/* XXX see restconf_config_init access directly */
|
||||
pretty = clicon_option_bool(h, "CLICON_RESTCONF_PRETTY");
|
||||
if ((pvec = clicon_strsep(path, "/", &pn)) == NULL)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -90,6 +90,8 @@ int clicon_nacm_cache_set(clicon_handle h, cxobj *xn);
|
|||
cxobj *clicon_conf_xml(clicon_handle h);
|
||||
int clicon_conf_xml_set(clicon_handle h, cxobj *x);
|
||||
|
||||
cxobj *clicon_conf_restconf(clicon_handle h);
|
||||
|
||||
db_elmnt *clicon_db_elmnt_get(clicon_handle h, const char *db);
|
||||
int clicon_db_elmnt_set(clicon_handle h, const char *db, db_elmnt *xc);
|
||||
|
||||
|
|
|
|||
|
|
@ -461,6 +461,24 @@ clicon_conf_xml_set(clicon_handle h,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! Get local YANG specification for Clixon-restconf.yang tree
|
||||
*
|
||||
* That is, get the XML of clixon-config/restconf container of clixon-config.yang
|
||||
* @param[in] h Clicon handle
|
||||
* @retval x XML tree containing restconf xml node frm clixon-restconf.yang
|
||||
* @note The clixon-restconf.yang instance can also be a part of the running datastore if
|
||||
* CLICON_BACKEND_RESTCONF_PROCESS is true
|
||||
*/
|
||||
cxobj *
|
||||
clicon_conf_restconf(clicon_handle h)
|
||||
{
|
||||
cxobj *xconfig = NULL;
|
||||
|
||||
if ((xconfig = clicon_conf_xml(h)) != NULL) /* Get local config */
|
||||
return xpath_first(xconfig, NULL, "restconf");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*! Get authorized user name
|
||||
* @param[in] h Clicon handle
|
||||
* @retval username
|
||||
|
|
|
|||
|
|
@ -519,6 +519,19 @@ clicon_options_main(clicon_handle h)
|
|||
|
||||
clicon_conf_xml_set(h, xconfig);
|
||||
|
||||
#if defined(WITH_RESTCONF) && WITH_RESTCONF == fcgi
|
||||
/* Enable fcgi feature
|
||||
* Due to boot-strapping in first load of clixon config, a feature cannot be added
|
||||
* programmatically after config file load
|
||||
* It could be added to all clixon config files but since it is a compile time option
|
||||
* this is a way to not be so intrusive
|
||||
* If fcgi option gets secondary this should probably be changed
|
||||
*/
|
||||
if (clixon_xml_parse_string("<CLICON_FEATURE>clixon-restconf:fcgi</CLICON_FEATURE>",
|
||||
YB_PARENT, NULL, &xconfig, NULL) < 0)
|
||||
goto done;
|
||||
#endif
|
||||
|
||||
/* Parse clixon yang spec */
|
||||
if (yang_spec_parse_module(h, "clixon-config", NULL, yspec) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -1964,6 +1964,7 @@ if_feature(yang_stmt *yspec,
|
|||
*
|
||||
* @param[in] h Clicon handle
|
||||
* @param[in] ys Feature yang statement to populate.
|
||||
* Bootstrapping: A feature is enabled if found in clixon-config
|
||||
*/
|
||||
static int
|
||||
ys_populate_feature(clicon_handle h,
|
||||
|
|
@ -1980,7 +1981,9 @@ ys_populate_feature(clicon_handle h,
|
|||
char *m;
|
||||
char *f;
|
||||
|
||||
/* get clicon config file in xml form */
|
||||
/* get clicon config file in xml form.
|
||||
* Bootstrapping: A feature is enabled if found in clixon-config
|
||||
*/
|
||||
if ((x = clicon_conf_xml(h)) == NULL)
|
||||
goto ok;
|
||||
if ((ymod = ys_module(ys)) == NULL){
|
||||
|
|
|
|||
|
|
@ -196,13 +196,18 @@ fi
|
|||
# Default restconf configuration: http IPv4
|
||||
# Can be placed in clixon-config
|
||||
# Note that https clause assumes there exists certs and keys in /etc/ssl,...
|
||||
# Args:
|
||||
# 1: auth-type (one of none, client-cert, user)
|
||||
# 2: pretty (if true pretty-print restconf return values)
|
||||
function restconf_config()
|
||||
{
|
||||
AUTH=$1
|
||||
PRETTY=$2
|
||||
|
||||
if [ $RCPROTO = http ]; then
|
||||
RESTCONFIG="<restconf><enable>true</enable><auth-type>$AUTH</auth-type><debug>1</debug><socket><namespace>default</namespace><address>0.0.0.0</address><port>80</port><ssl>false</ssl></socket></restconf>"
|
||||
RESTCONFIG="<restconf><enable>true</enable><auth-type>$AUTH</auth-type><pretty>$PRETTY</pretty><debug>$DBG</debug><socket><namespace>default</namespace><address>0.0.0.0</address><port>80</port><ssl>false</ssl></socket></restconf>"
|
||||
else
|
||||
RESTCONFIG="<restconf><enable>true</enable><auth-type>$AUTH</auth-type><server-cert-path>/etc/ssl/certs/clixon-server-crt.pem</server-cert-path><server-key-path>/etc/ssl/private/clixon-server-key.pem</server-key-path><server-ca-cert-path>/etc/ssl/certs/clixon-ca-crt.pem</server-ca-cert-path><debug>1</debug><socket><namespace>default</namespace><address>0.0.0.0</address><port>443</port><ssl>true</ssl></socket></restconf>"
|
||||
RESTCONFIG="<restconf><enable>true</enable><auth-type>$AUTH</auth-type><server-cert-path>/etc/ssl/certs/clixon-server-crt.pem</server-cert-path><server-key-path>/etc/ssl/private/clixon-server-key.pem</server-key-path><server-ca-cert-path>/etc/ssl/certs/clixon-ca-crt.pem</server-ca-cert-path><debug>$DBG</debug><socket><namespace>default</namespace><address>0.0.0.0</address><port>443</port><ssl>true</ssl></socket></restconf>"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
14
test/long.sh
14
test/long.sh
|
|
@ -21,6 +21,9 @@ cfg=$dir/scaling-conf.xml
|
|||
fyang=$dir/scaling.yang
|
||||
fconfig=$dir/large.xml
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $fyang
|
||||
module scaling{
|
||||
yang-version 1.1;
|
||||
|
|
@ -52,10 +55,10 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_FORMAT>$format</CLICON_XMLDB_FORMAT>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
$RESTCONFIG
|
||||
</clixon-config>
|
||||
EOF
|
||||
|
||||
|
|
@ -122,10 +125,7 @@ done
|
|||
new "Kill restconf daemon"
|
||||
stop_restconf
|
||||
|
||||
if [ $BE -eq 0 ]; then
|
||||
exit # BE
|
||||
fi
|
||||
|
||||
if [ $BE -ne 0 ]; then
|
||||
new "Kill backend"
|
||||
# Check if premature kill
|
||||
pid=`pgrep -u root -f clixon_backend`
|
||||
|
|
@ -134,5 +134,9 @@ if [ -z "$pid" ]; then
|
|||
fi
|
||||
# kill backend
|
||||
stop_backend -f $cfg
|
||||
fi
|
||||
|
||||
# Set by restconf_config
|
||||
unset RESTCONFIG
|
||||
|
||||
rm -rf $dir
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_MODULE_MAIN>scaling</CLICON_YANG_MODULE_MAIN>
|
||||
<CLICON_SOCK>/usr/local/var/example/example.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/example/example.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
</clixon-config>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ if [ ! -d $pdir ]; then
|
|||
fi
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -37,7 +37,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_BACKEND_DIR>$pdir</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ fyang=$dir/main.yang
|
|||
fyang2=$dir/ietf-interfaces@2019-03-04.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -38,7 +38,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_MODULE_LIBRARY_RFC7895>true</CLICON_MODULE_LIBRARY_RFC7895>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_MODULE_LIBRARY_RFC7895>false</CLICON_MODULE_LIBRARY_RFC7895>
|
||||
</clixon-config>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_MODULE_LIBRARY_RFC7895>false</CLICON_MODULE_LIBRARY_RFC7895>
|
||||
</clixon-config>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_CLISPEC_DIR>/usr/local/lib/$APPNAME/clispec</CLICON_CLISPEC_DIR>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
|
|
@ -134,7 +133,6 @@ clixon_plugin_api* clixon_plugin_init(clicon_handle h)
|
|||
|
||||
return api.get_api();
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
new "C++ compile"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ cfg=$dir/choice.xml
|
|||
fyang=$dir/type.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -28,7 +28,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ if [ ! -d $pdir ]; then
|
|||
fi
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -34,7 +34,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_BACKEND_DIR>$pdir</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ cfg=$dir/conf_yang.xml
|
|||
# Use yang in example
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none true
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ cfg=$dir/conf_yang.xml
|
|||
fyang=$dir/example-my-crypto.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -25,7 +25,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_NETCONF_DIR>/usr/local/lib/$APPNAME/netconf</CLICON_NETCONF_DIR>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ cfg=$dir/conf_yang.xml
|
|||
fyang=$dir/nacm-example.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -34,7 +34,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ fyang=$dir/nacm-example.yang
|
|||
fyang2=$dir/itf.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -63,7 +63,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ cfg=$dir/conf_yang.xml
|
|||
fyang=$dir/nacm-example.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -36,7 +36,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_CREDENTIALS>none</CLICON_NACM_CREDENTIALS>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ fyang=$dir/nacm-example.yang
|
|||
fyang2=$dir/nacm-example2.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -43,7 +43,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ cfg=$dir/conf_yang.xml
|
|||
fyang=$dir/nacm-example.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -35,7 +35,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ fyang=$dir/nacm-example.yang
|
|||
: ${format:=xml}
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -31,7 +31,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
|
||||
<CLICON_XMLDB_FORMAT>$format</CLICON_XMLDB_FORMAT>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ fyang=$dir/nacm-example.yang
|
|||
nacmfile=$dir/nacmfile
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
# Note filter out example_backend_nacm.so in CLICON_BACKEND_REGEXP below
|
||||
cat <<EOF > $cfg
|
||||
|
|
@ -35,7 +35,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_MODULE_LIBRARY_RFC7895>false</CLICON_MODULE_LIBRARY_RFC7895>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>external</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_FILE>$nacmfile</CLICON_NACM_FILE>
|
||||
<CLICON_NACM_CREDENTIALS>none</CLICON_NACM_CREDENTIALS>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ cfg=$dir/conf_yang.xml
|
|||
fyang=$dir/nacm-example.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -35,7 +35,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_CREDENTIALS>none</CLICON_NACM_CREDENTIALS>
|
||||
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ cfg=$dir/conf_yang.xml
|
|||
fyang=$dir/nacm-example.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -49,7 +49,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ cfg=$dir/conf_yang.xml
|
|||
fyang=$dir/nacm-example.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -52,7 +52,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_CREDENTIALS>none</CLICON_NACM_CREDENTIALS>
|
||||
<CLICON_NACM_DISABLED_ON_EMPTY>true</CLICON_NACM_DISABLED_ON_EMPTY>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ fyang=$dir/nacm-example.yang
|
|||
# cred:none, exact, except
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $fyang
|
||||
module nacm-example{
|
||||
|
|
@ -84,7 +84,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_MODULE_LIBRARY_RFC7895>false</CLICON_MODULE_LIBRARY_RFC7895>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_NACM_RECOVERY_USER>$recovery</CLICON_NACM_RECOVERY_USER>
|
||||
<CLICON_NACM_MODE>internal</CLICON_NACM_MODE>
|
||||
<CLICON_NACM_CREDENTIALS>$cred</CLICON_NACM_CREDENTIALS>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_DIR>$IETFRFC</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/example/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
<CLICON_XMLDB_FORMAT>$format</CLICON_XMLDB_FORMAT>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>$pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
<CLICON_CLI_MODE>example</CLICON_CLI_MODE>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/example/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
<CLICON_XMLDB_FORMAT>$format</CLICON_XMLDB_FORMAT>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ module scaling{
|
|||
EOF
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -63,7 +63,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/example/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
<CLICON_XMLDB_FORMAT>$format</CLICON_XMLDB_FORMAT>
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/example/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
<CLICON_CLI_MODE>example</CLICON_CLI_MODE>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ fconfig=$dir/large.xml
|
|||
fstate=$dir/state.xml
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -41,7 +41,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_PIDFILE>/usr/local/var/example/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
<CLICON_XMLDB_FORMAT>$format</CLICON_XMLDB_FORMAT>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ fconfig=$dir/large.xml
|
|||
fstate=$dir/state.xml
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -41,7 +41,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_PIDFILE>/usr/local/var/example/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
<CLICON_XMLDB_FORMAT>$format</CLICON_XMLDB_FORMAT>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ if [ "${WITH_RESTCONF}" = "evhtp" ]; then
|
|||
. ./certs.sh
|
||||
else
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
fi
|
||||
|
||||
# This is a fixed 'state' implemented in routing_backend. It is assumed to be always there
|
||||
|
|
@ -64,6 +64,7 @@ if $IPv6; then
|
|||
<server-cert-path>$srvcert</server-cert-path>
|
||||
<server-key-path>$srvkey</server-key-path>
|
||||
<server-ca-cert-path>$cakey</server-ca-cert-path>
|
||||
<pretty>false</pretty>
|
||||
<socket><namespace>default</namespace><address>0.0.0.0</address><port>80</port><ssl>false</ssl></socket>
|
||||
<socket><namespace>default</namespace><address>0.0.0.0</address><port>443</port><ssl>true</ssl></socket>
|
||||
<socket><namespace>default</namespace><address>::</address><port>80</port><ssl>false</ssl></socket>
|
||||
|
|
@ -80,6 +81,7 @@ else
|
|||
<server-cert-path>$srvcert</server-cert-path>
|
||||
<server-key-path>$srvkey</server-key-path>
|
||||
<server-ca-cert-path>$cakey</server-ca-cert-path>
|
||||
<pretty>false</pretty>
|
||||
<socket><namespace>default</namespace><address>0.0.0.0</address><port>80</port><ssl>false</ssl></socket>
|
||||
<socket><namespace>default</namespace><address>0.0.0.0</address><port>443</port><ssl>true</ssl></socket>
|
||||
</restconf>
|
||||
|
|
@ -98,7 +100,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
|
|
@ -109,7 +110,6 @@ cat <<EOF > $cfg
|
|||
</clixon-config>
|
||||
EOF
|
||||
|
||||
|
||||
# Restconf test routine with arguments:
|
||||
# 1. proto:http/https
|
||||
# 2: addr: 127.0.0.1/::1 # IPv4 or IPv6
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ cfg=$dir/conf.xml
|
|||
fyang=$dir/restconf.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
# <CLICON_YANG_MODULE_MAIN>example</CLICON_YANG_MODULE_MAIN>
|
||||
cat <<EOF > $cfg
|
||||
|
|
@ -22,7 +22,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_DIR>$IETFRFC</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>$dir/restconf.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ fxml=$dir/initial.xml
|
|||
fstate=$dir/state.xml
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
# <CLICON_YANG_MODULE_MAIN>example</CLICON_YANG_MODULE_MAIN>
|
||||
cat <<EOF > $cfg
|
||||
|
|
@ -40,7 +40,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_DIR>$dir</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>$dir/restconf.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ cat <<EOF > $dir/example-system.yang
|
|||
EOF
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
# <CLICON_YANG_MODULE_MAIN>example</CLICON_YANG_MODULE_MAIN>
|
||||
cat <<EOF > $cfg
|
||||
|
|
@ -33,7 +33,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_DIR>$IETFRFC</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_MAIN_DIR>$dir</CLICON_YANG_MAIN_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>$dir/restconf.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ cfg=$dir/conf.xml
|
|||
fyang=$dir/list.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
# <CLICON_YANG_MODULE_MAIN>example</CLICON_YANG_MODULE_MAIN>
|
||||
cat <<EOF > $cfg
|
||||
|
|
@ -20,7 +20,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_DIR>$IETFRFC</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>$dir/restconf.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ if [ $? -ne 0 ]; then
|
|||
if [ "$s" = $0 ]; then exit 0; else return 0; fi # skip
|
||||
fi
|
||||
|
||||
|
||||
APPNAME=example
|
||||
|
||||
cfg=$dir/conf.xml
|
||||
|
|
@ -53,6 +52,7 @@ RESTCONFIG=$(cat <<EOF
|
|||
<server-cert-path>$srvcert</server-cert-path>
|
||||
<server-key-path>$srvkey</server-key-path>
|
||||
<server-ca-cert-path>$cakey</server-ca-cert-path>
|
||||
<pretty>false</pretty>
|
||||
<socket> <!-- reference and to get wait-restconf to work -->
|
||||
<namespace>default</namespace>
|
||||
<address>0.0.0.0</address>
|
||||
|
|
@ -88,7 +88,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ fyang=$dir/stream.yang
|
|||
xml=$dir/xml.xml
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
# <CLICON_YANG_MODULE_MAIN>example</CLICON_YANG_MODULE_MAIN>
|
||||
cat <<EOF > $cfg
|
||||
|
|
@ -51,7 +51,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_DIR>$IETFRFC</CLICON_YANG_DIR>
|
||||
<CLICON_YANG_MAIN_FILE>$fyang</CLICON_YANG_MAIN_FILE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ startupdb=$dir/startup_db
|
|||
fjukebox=$dir/example-jukebox.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config user
|
||||
restconf_config user false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -23,7 +23,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_YANG_MAIN_DIR>$dir</CLICON_YANG_MAIN_DIR>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_FEATURE>ietf-netconf:startup</CLICON_FEATURE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_BACKEND_PIDFILE>$dir/restconf.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ cfg=$dir/conf.xml
|
|||
startupdb=$dir/startup_db
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -30,7 +30,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
|
|
@ -151,7 +150,8 @@ cat <<EOF > $cfg
|
|||
<server-cert-path>$srvcert</server-cert-path>
|
||||
<server-key-path>$srvkey</server-key-path>
|
||||
<server-ca-cert-path>$cacert</server-ca-cert-path>
|
||||
<!--debug>1</debug-->
|
||||
<debug>$DBG</debug>
|
||||
<pretty>false</pretty>
|
||||
<socket>
|
||||
<namespace>default</namespace>
|
||||
<address>0.0.0.0</address>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ EOF
|
|||
# Use yang in example
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none true
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ APPNAME=example
|
|||
cfg=$dir/conf.xml
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
# Use yang in example
|
||||
cat <<EOF > $cfg
|
||||
|
|
@ -27,7 +27,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_CLISPEC_DIR>/usr/local/lib/$APPNAME/clispec</CLICON_CLISPEC_DIR>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ fextra1=$dir/extra1.yang # Referenced from sub1
|
|||
fextra2=$dir/extra2.yang # Referenced from sub2
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -43,7 +43,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_MODULE_LIBRARY_RFC7895>false</CLICON_MODULE_LIBRARY_RFC7895>
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ funknown=$dir/yang/unknown.yang
|
|||
fstate=$dir/state.xml
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $fanydata
|
||||
module any{
|
||||
|
|
@ -145,7 +145,6 @@ function testrun()
|
|||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_MODULE_LIBRARY_RFC7895>false</CLICON_MODULE_LIBRARY_RFC7895>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_YANG_UNKNOWN_ANYDATA>$unknown</CLICON_YANG_UNKNOWN_ANYDATA>
|
||||
$F
|
||||
$RESTCONFIG
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ fyang1=$dir/example1.yang
|
|||
fyang2=$dir/example2.yang
|
||||
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
restconf_config none
|
||||
restconf_config none false
|
||||
|
||||
cat <<EOF > $cfg
|
||||
<clixon-config xmlns="http://clicon.org/config">
|
||||
|
|
@ -25,7 +25,6 @@ cat <<EOF > $cfg
|
|||
<CLICON_CLISPEC_DIR>/usr/local/lib/$APPNAME/clispec</CLICON_CLISPEC_DIR>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,11 @@ module clixon-config {
|
|||
CLICON_RESTCONF_HTTPS_PORT
|
||||
CLICON_SSL_SERVER_CERT
|
||||
CLICON_SSL_SERVER_KEY
|
||||
CLICON_SSL_CA_CERT";
|
||||
CLICON_SSL_CA_CERT
|
||||
CLICON_TRANSACTION_MOD
|
||||
Marked as obsolete and moved to clixon-restconf.yang:
|
||||
CLICON_RESTCONF_PATH
|
||||
CLICON_RESTCONF_PRETTY";
|
||||
}
|
||||
revision 2020-11-03 {
|
||||
description
|
||||
|
|
@ -428,7 +432,10 @@ module clixon-config {
|
|||
type string;
|
||||
description
|
||||
"Location of restconf (frontend) .so plugins. Load all .so
|
||||
plugins in this dir as restconf code plugins";
|
||||
plugins in this dir as restconf code plugins
|
||||
Note: This cannot be moved to clixon-restconf.yang because it is needed
|
||||
early in the bootstrapping phase, before clixon-restconf.yang config may
|
||||
be loaded.";
|
||||
}
|
||||
leaf CLICON_RESTCONF_PATH {
|
||||
type string;
|
||||
|
|
@ -436,8 +443,11 @@ module clixon-config {
|
|||
description
|
||||
"FastCGI unix socket. Should be specified in webserver
|
||||
Eg in nginx: fastcgi_pass unix:/www-data/clicon_restconf.sock
|
||||
Only if with-restconf=fcgi, NOT evhtp";
|
||||
Only if with-restconf=fcgi, NOT evhtp
|
||||
Note: Obsolete, use fcgi-socket in clixon-restconf.yang instead";
|
||||
status obsolete;
|
||||
}
|
||||
|
||||
leaf CLICON_RESTCONF_PRETTY {
|
||||
type boolean;
|
||||
default true;
|
||||
|
|
@ -449,7 +459,9 @@ module clixon-config {
|
|||
to get return value in XML or JSON.
|
||||
RFC 8040 examples print XML and JSON in pretty-printed form.
|
||||
Setting this value to false makes restconf return not pretty-printed
|
||||
which may be desirable for performance or tests";
|
||||
which may be desirable for performance or tests
|
||||
Note: Obsolete, use pretty in clixon-restconf.yang instead";
|
||||
status obsolete;
|
||||
}
|
||||
leaf CLICON_CLI_DIR {
|
||||
type string;
|
||||
|
|
@ -775,14 +787,6 @@ module clixon-config {
|
|||
type startup_mode;
|
||||
description "Which method to boot/start clicon backend";
|
||||
}
|
||||
leaf CLICON_TRANSACTION_MOD {
|
||||
type boolean;
|
||||
default false;
|
||||
description "If set, modifications in validation and commit
|
||||
callbacks are written back into the datastore.
|
||||
This is a bad idea and therefore obsoleted.";
|
||||
status obsolete;
|
||||
}
|
||||
leaf CLICON_NACM_MODE {
|
||||
type nacm_mode;
|
||||
default disabled;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,15 @@ module clixon-restconf {
|
|||
description
|
||||
"Initial release";
|
||||
}
|
||||
feature fcgi {
|
||||
description
|
||||
"This feature indicates that the restconf server supports the fast-cgi reverse
|
||||
proxy solution.
|
||||
That is, a reverse proxy is the HTTP front-end and the restconf daemon listens
|
||||
to a fcgi socket.
|
||||
The alternative is the internal HTTP solution using evhtp.";
|
||||
}
|
||||
|
||||
typedef http-auth-type {
|
||||
type enumeration {
|
||||
enum none {
|
||||
|
|
@ -125,6 +134,30 @@ module clixon-restconf {
|
|||
type uint32;
|
||||
default 0;
|
||||
}
|
||||
leaf pretty {
|
||||
type boolean;
|
||||
default true;
|
||||
description
|
||||
"Restconf return value pretty print.
|
||||
Restconf clients may add HTTP header:
|
||||
Accept: application/yang-data+json, or
|
||||
Accept: application/yang-data+xml
|
||||
to get return value in XML or JSON.
|
||||
RFC 8040 examples print XML and JSON in pretty-printed form.
|
||||
Setting this value to false makes restconf return not pretty-printed
|
||||
which may be desirable for performance or tests
|
||||
This replaces the CLICON_RESTCONF_PRETTY option in clixon-config.yang";
|
||||
}
|
||||
leaf fcgi-socket {
|
||||
if-feature fcgi;
|
||||
type string;
|
||||
default "/www-data/fastcgi_restconf.sock";
|
||||
description
|
||||
"FastCGI unix socket. Should be specified in webserver
|
||||
Eg in nginx: fastcgi_pass unix:/www-data/clicon_restconf.sock
|
||||
Only if with-restconf=fcgi, NOT evhtp
|
||||
This replaces CLICON_RESTCONF_PATH option in clixon-config.yang";
|
||||
}
|
||||
list socket {
|
||||
key "namespace address port";
|
||||
leaf namespace {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue