Clixon release 4.0.0

This commit is contained in:
Olof hagsand 2019-07-13 16:33:23 +02:00
parent 2a766c5adf
commit fe46a0e093
12 changed files with 38 additions and 80 deletions

View file

@ -4,23 +4,26 @@
### Summary ### Summary
This is a major uplift of Yang and XML features which motivates a This release is a major uplift of Yang and XML features which
major number increment. Thanks Netgate for allowing me to spend full motivates a major version number increment.
time on increasing the feature-set, the stability and performance.
In short, I consider the Yang and XML support good enough for most In short, I consider the Yang and XML support good enough for most
use-cases. There are still some features not supported, but they are use-cases. There are still features not supported, but hopefully they
relatively uncommon (see [README](https://github.com/clicon/clixon/#yang). are relatively uncommon (see [README](https://github.com/clicon/clixon/#yang).
The next project is to fix compiance of RESTCONF and NETCONF where The next task for uplifting is RESTCONF where several use-cases are
there is some work to lift it to the same level. not supported. There is also a need for NETCONF modernization and
added optional features.
Going forward I plan to make more regular minor releases. With the Going forward I plan to make more regular minor releases. With the
current Trevor CI in place, making releases should not be a large current Trevor CI in place, making releases should not be a large
thing, and it is also safer to just pull a master commit. However, for thing, and it is also safer to just pull a master commit. However, for
synchronizing and tracing I will try to make monthly releases. synchronizing and tracing I will try to make monthly releases.
--Olof Thanks to Netgate for that enabled me to spend full time on Clixon!
Stockholm 13 July 2019
Olof Hagsand
### Major New features ### Major New features
* Yang "refine" feature supported * Yang "refine" feature supported

View file

@ -30,7 +30,6 @@
the terms of any one of the Apache License version 2 or the GPL. the terms of any one of the Apache License version 2 or the GPL.
***** END LICENSE BLOCK ***** ***** END LICENSE BLOCK *****
* *
*/ */

View file

@ -37,24 +37,6 @@
#ifndef _CLI_COMMON_H_ #ifndef _CLI_COMMON_H_
#define _CLI_COMMON_H_ #define _CLI_COMMON_H_
/*! macro to create a single-argument callback from multiple */
#define cb_single_arg(fn) \
int fn(clicon_handle h, cvec *cvv, cg_var *arg) \
{ \
int retval=-1; \
cvec *argv = NULL; \
\
if (arg && (argv = cvec_from_var(arg)) == NULL){ \
clicon_err(OE_UNIX, errno, "cvec_from_var"); \
goto done; \
} \
retval = fn##v(h, cvv, argv); \
done: \
if (argv) cvec_free(argv); \
return retval; \
}
void cli_signal_block(clicon_handle h); void cli_signal_block(clicon_handle h);
void cli_signal_unblock(clicon_handle h); void cli_signal_unblock(clicon_handle h);

View file

@ -239,17 +239,6 @@ expand_dbvar(void *h,
return retval; return retval;
} }
int
expandv_dbvar(void *h,
char *name,
cvec *cvv,
cvec *argv,
cvec *commands,
cvec *helptexts)
{
return expand_dbvar(h, name, cvv, argv, commands, helptexts);
}
/*! List files in a directory /*! List files in a directory
*/ */
int int

View file

@ -59,14 +59,4 @@ int plugin_start(clicon_handle h, int argc, char **argv);
*/ */
int plugin_exit(clicon_handle h); int plugin_exit(clicon_handle h);
/* Called before prompt is printed, return a customized prompt. */
char *plugin_prompt_hook(clicon_handle h, char *mode);
/* Called if a command is not matched w current mode. Return name of next syntax mode to check until NULL */
char *plugin_parse_hook(clicon_handle h, char *cmd, char *name);
/* Called if ^Z entered. Can modify cli command buffer and position */
int plugin_susp_hook(clicon_handle h, char *buf, int prompt_width, int *cursor_loc);
#endif /* _CLIXON_CLI_H_ */ #endif /* _CLIXON_CLI_H_ */

View file

@ -129,8 +129,6 @@ int cli_help(clicon_handle h, cvec *vars, cvec *argv);
int expand_dir(char *dir, int *nr, char ***commands, mode_t flags, int detail); int expand_dir(char *dir, int *nr, char ***commands, mode_t flags, int detail);
int expand_dbvar(void *h, char *name, cvec *cvv, cvec *argv, int expand_dbvar(void *h, char *name, cvec *cvv, cvec *argv,
cvec *commands, cvec *helptexts); cvec *commands, cvec *helptexts);
int expandv_dbvar(void *h, char *name, cvec *cvv, cvec *argv,
cvec *commands, cvec *helptexts);
/* cli_show.c: CLIgen new vector arg callbacks */ /* cli_show.c: CLIgen new vector arg callbacks */
int show_yang(clicon_handle h, cvec *vars, cvec *argv); int show_yang(clicon_handle h, cvec *vars, cvec *argv);

17
configure vendored
View file

@ -663,7 +663,6 @@ build_vendor
build_cpu build_cpu
build build
CLIGEN_PREFIX CLIGEN_PREFIX
CLIGEN_VERSION
CLIXON_VERSION_MINOR CLIXON_VERSION_MINOR
CLIXON_VERSION_MAJOR CLIXON_VERSION_MAJOR
CLIXON_VERSION_STRING CLIXON_VERSION_STRING
@ -2172,13 +2171,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
: ${CFLAGS="-O2 -Wall"} : ${CFLAGS="-O2 -Wall"}
: ${INSTALLFLAGS="-s"} : ${INSTALLFLAGS="-s"}
CLIXON_VERSION_MAJOR="3" CLIXON_VERSION_MAJOR="4"
CLIXON_VERSION_MINOR="10" CLIXON_VERSION_MINOR="0"
CLIXON_VERSION_PATCH="0" CLIXON_VERSION_PATCH="0"
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\"" CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
# Fix to specific CLIgen version (eg 3.5) or head (3) # Check CLIgen
CLIGEN_VERSION="3"
if test "$prefix" = "NONE"; then if test "$prefix" = "NONE"; then
CLIGEN_PREFIX="$ac_default_prefix" CLIGEN_PREFIX="$ac_default_prefix"
else else
@ -2216,7 +2214,6 @@ _ACEOF
# Bind to specific CLIgen version
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CLIXON version is ${CLIXON_VERSION}" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: CLIXON version is ${CLIXON_VERSION}" >&5
@ -4113,7 +4110,7 @@ _ACEOF
LIBS="-lcligen $LIBS" LIBS="-lcligen $LIBS"
else else
as_fn_error $? "CLIgen${CLIGEN_VERSION} missing. Try: git clone https://github.com/olofhagsand/cligen.git" "$LINENO" 5 as_fn_error $? "CLIgen missing. Try: git clone https://github.com/olofhagsand/cligen.git" "$LINENO" 5
fi fi
@ -4498,8 +4495,8 @@ done
# YANG_INSTALLDIR is where clixon installs the Clixon yang files # YANG_INSTALLDIR is where clixon installs the Clixon yang files
# (the files in in yang/clixon) # (the files in in yang/clixon)
# Each application designer may need to place CLIXON_YANG_DIR in their config: # Each application designer may need to place YANG_INSTALLDIR in their config:
# <CLIXON-YANG-DIR>$YANG_INSTALLDIR</CLIXON-YANG_DIR> # <CLICON_YANG_DIR>$YANG_INSTALLDIR</CLICON_YANG_DIR>
# Check whether --with-yang-installdir was given. # Check whether --with-yang-installdir was given.
if test "${with_yang_installdir+set}" = set; then : if test "${with_yang_installdir+set}" = set; then :

View file

@ -42,13 +42,12 @@ AC_INIT(lib/clixon/clixon.h.in)
: ${CFLAGS="-O2 -Wall"} : ${CFLAGS="-O2 -Wall"}
: ${INSTALLFLAGS="-s"} : ${INSTALLFLAGS="-s"}
CLIXON_VERSION_MAJOR="3" CLIXON_VERSION_MAJOR="4"
CLIXON_VERSION_MINOR="10" CLIXON_VERSION_MINOR="0"
CLIXON_VERSION_PATCH="0" CLIXON_VERSION_PATCH="0"
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\"" CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
# Fix to specific CLIgen version (eg 3.5) or head (3) # Check CLIgen
CLIGEN_VERSION="3"
if test "$prefix" = "NONE"; then if test "$prefix" = "NONE"; then
CLIGEN_PREFIX="$ac_default_prefix" CLIGEN_PREFIX="$ac_default_prefix"
else else
@ -69,7 +68,6 @@ AC_SUBST(CLIXON_VERSION)
AC_SUBST(CLIXON_VERSION_STRING) AC_SUBST(CLIXON_VERSION_STRING)
AC_SUBST(CLIXON_VERSION_MAJOR) AC_SUBST(CLIXON_VERSION_MAJOR)
AC_SUBST(CLIXON_VERSION_MINOR) AC_SUBST(CLIXON_VERSION_MINOR)
AC_SUBST(CLIGEN_VERSION) # Bind to specific CLIgen version
AC_SUBST(CLIGEN_PREFIX) AC_SUBST(CLIGEN_PREFIX)
AC_MSG_RESULT(CLIXON version is ${CLIXON_VERSION}) AC_MSG_RESULT(CLIXON version is ${CLIXON_VERSION})
@ -178,7 +176,7 @@ fi
AC_CHECK_HEADERS(cligen/cligen.h,, AC_MSG_ERROR(cligen missing. Try: git clone https://github.com/olofhagsand/cligen.git)) AC_CHECK_HEADERS(cligen/cligen.h,, AC_MSG_ERROR(cligen missing. Try: git clone https://github.com/olofhagsand/cligen.git))
AC_CHECK_LIB(cligen, cligen_init,, AC_MSG_ERROR([CLIgen${CLIGEN_VERSION} missing. Try: git clone https://github.com/olofhagsand/cligen.git])) AC_CHECK_LIB(cligen, cligen_init,, AC_MSG_ERROR([CLIgen missing. Try: git clone https://github.com/olofhagsand/cligen.git]))
# This is for restconf (and fastcgi) # This is for restconf (and fastcgi)
AC_ARG_WITH([restconf], AC_ARG_WITH([restconf],

View file

@ -20,6 +20,9 @@
# Typically add them in your site file # Typically add them in your site file
: ${SKIPLIST:=""} : ${SKIPLIST:=""}
# Some tests (openconfig/yang_models) just test for the cli to return a version
version=4
>&2 echo "Running $testfile" >&2 echo "Running $testfile"
# Site file, an example of this file in README.md # Site file, an example of this file in README.md

View file

@ -23,7 +23,6 @@ fi
OCDIR=$OPENCONFIG/release/models OCDIR=$OPENCONFIG/release/models
cat <<EOF > $cfg cat <<EOF > $cfg
<clixon-config xmlns="http://clicon.org/config"> <clixon-config xmlns="http://clicon.org/config">
<CLICON_CONFIGFILE>$cfg</CLICON_CONFIGFILE> <CLICON_CONFIGFILE>$cfg</CLICON_CONFIGFILE>
@ -104,7 +103,7 @@ new "Openconfig test: $clixon_cli -1f $cfg -y $f show version ($m modules)"
for f in $files; do for f in $files; do
if [ -n "$(head -1 $f|grep '^module')" ]; then if [ -n "$(head -1 $f|grep '^module')" ]; then
new "$clixon_cli -1f $cfg -y $f show version" new "$clixon_cli -1f $cfg -y $f show version"
expectfn "$clixon_cli -1f $cfg -y $f show version" 0 "3." expectfn "$clixon_cli -1f $cfg -y $f show version" 0 "$version."
fi fi
done done

View file

@ -158,7 +158,7 @@ if [ $BE -ne 0 ]; then
fi fi
new "cli defined extension" new "cli defined extension"
expectfn "$clixon_cli -1f $cfg show version" 0 "3." expectfn "$clixon_cli -1f $cfg show version" 0 "$version."
new "empty values in leaf-list" new "empty values in leaf-list"
expecteof "$clixon_netconf -qf $cfg" 0 '<rpc><edit-config><target><candidate/></target><config><x xmlns="urn:example:clixon"><f><e>a</e></f></x></config></edit-config></rpc>]]>]]>' "^<rpc-reply><ok/></rpc-reply>]]>]]>$" expecteof "$clixon_netconf -qf $cfg" 0 '<rpc><edit-config><target><candidate/></target><config><x xmlns="urn:example:clixon"><f><e>a</e></f></x></config></edit-config></rpc>]]>]]>' "^<rpc-reply><ok/></rpc-reply>]]>]]>$"

View file

@ -53,21 +53,21 @@ EOF
new "yangmodels parse: -f $cfg" new "yangmodels parse: -f $cfg"
new "yangmodel Experimental IEEE 802.1: $YANGMODELS/experimental/ieee/802.1" new "yangmodel Experimental IEEE 802.1: $YANGMODELS/experimental/ieee/802.1"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/experimental/ieee/802.1 -p $YANGMODELS/experimental/ieee/1588 show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/experimental/ieee/802.1 -p $YANGMODELS/experimental/ieee/1588 show version" 0 "$version."
new "yangmodel Experimental IEEE 1588: $YANGMODELS/experimental/ieee/1588" new "yangmodel Experimental IEEE 1588: $YANGMODELS/experimental/ieee/1588"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/experimental/ieee/1588 show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/experimental/ieee/1588 show version" 0 "$version."
# Standard IEEE # Standard IEEE
new "yangmodel Standard IEEE 802.1: $YANGMODELS/standard/ieee/draft/802.1" new "yangmodel Standard IEEE 802.1: $YANGMODELS/standard/ieee/draft/802.1"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/standard/ieee/draft/802.1 show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/standard/ieee/draft/802.1 show version" 0 "$version."
new "yangmodel Standard IEEE 802.3: $YANGMODELS/standard/ieee/draft/802.3" new "yangmodel Standard IEEE 802.3: $YANGMODELS/standard/ieee/draft/802.3"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/standard/ieee/draft/802.3 show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/standard/ieee/draft/802.3 show version" 0 "$version."
# Standard IETF # Standard IETF
new "yangmodel Standard IETF: $YANGMODELS/standard/ietf/RFC" new "yangmodel Standard IETF: $YANGMODELS/standard/ietf/RFC"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/standard/ietf/RFC show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/standard/ietf/RFC show version" 0 "$version."
# vendor/junos # vendor/junos
#junos : M/MX, T/TX, Some EX platforms, ACX #junos : M/MX, T/TX, Some EX platforms, ACX
@ -90,7 +90,7 @@ let i=0;
for f in $files; do for f in $files; do
if [ -n "$(head -5 $f|grep '^ module')" ]; then if [ -n "$(head -5 $f|grep '^ module')" ]; then
new "$clixon_cli -1f $cfg -o CLICON_YANG_MAIN_FILE=$f -p $YANGMODELS/vendor/juniper/18.2/18.2R1/common -p $YANGMODELS/vendor/juniper/18.2/18.2R1/junos/conf show version" new "$clixon_cli -1f $cfg -o CLICON_YANG_MAIN_FILE=$f -p $YANGMODELS/vendor/juniper/18.2/18.2R1/common -p $YANGMODELS/vendor/juniper/18.2/18.2R1/junos/conf show version"
expectfn "$clixon_cli -1f $cfg -o CLICON_YANG_MAIN_FILE=$f -p $YANGMODELS/vendor/juniper/18.2/18.2R1/common -p $YANGMODELS/vendor/juniper/18.2/18.2R1/junos/conf -o CLICON_CLI_GENMODEL=0 show version" 0 "3." expectfn "$clixon_cli -1f $cfg -o CLICON_YANG_MAIN_FILE=$f -p $YANGMODELS/vendor/juniper/18.2/18.2R1/common -p $YANGMODELS/vendor/juniper/18.2/18.2R1/junos/conf -o CLICON_CLI_GENMODEL=0 show version" 0 "$version."
let i++; let i++;
sleep 1 sleep 1
fi fi
@ -103,16 +103,16 @@ done
if false; then if false; then
# vendor/cisco/xr # vendor/cisco/xr
new "yangmodel vendor cisco xr 623: $YANGMODELS/vendor/cisco/xr/623" new "yangmodel vendor cisco xr 623: $YANGMODELS/vendor/cisco/xr/623"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/vendor/cisco/xr/623 show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/vendor/cisco/xr/623 show version" 0 "$version."
new "yangmodel vendor cisco xr 632: $YANGMODELS/vendor/cisco/xr/632" new "yangmodel vendor cisco xr 632: $YANGMODELS/vendor/cisco/xr/632"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/vendor/cisco/xr/632 show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/vendor/cisco/xr/632 show version" 0 "$version."
new "yangmodel vendor cisco xr 623: $YANGMODELS/vendor/cisco/xr/642" new "yangmodel vendor cisco xr 623: $YANGMODELS/vendor/cisco/xr/642"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/vendor/cisco/xr/642 show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/vendor/cisco/xr/642 show version" 0 "$version."
new "yangmodel vendor cisco xr 651: $YANGMODELS/vendor/cisco/xr/651" new "yangmodel vendor cisco xr 651: $YANGMODELS/vendor/cisco/xr/651"
expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/vendor/cisco/xr/651 show version" 0 "3." expectfn "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/vendor/cisco/xr/651 show version" 0 "$version."
fi ### cisco fi ### cisco
rm -rf $dir rm -rf $dir