Merge branch 'develop' of https://github.com/clicon/clixon into develop
This commit is contained in:
commit
dcec834455
7 changed files with 48 additions and 11 deletions
18
CHANGELOG.md
18
CHANGELOG.md
|
|
@ -52,10 +52,24 @@
|
||||||
* yang_parse() changed to take either filename or module name and revision.
|
* yang_parse() changed to take either filename or module name and revision.
|
||||||
* Removed clicon_dbspec_name[_set]().
|
* Removed clicon_dbspec_name[_set]().
|
||||||
* Use yang_main_module_name() instead.
|
* Use yang_main_module_name() instead.
|
||||||
* Replaced yang_spec_main with yang_spec_parse_module
|
* Replace code for initializing the main yang module
|
||||||
* Added yang_spec_parse_file
|
* Replace yang_spec_main() with yang_spec_parse_module() as follows:
|
||||||
|
```
|
||||||
|
/* old code */
|
||||||
|
if ((yspec = yang_spec_main(ch)) == NULL)
|
||||||
|
goto done;
|
||||||
|
/* new code */
|
||||||
|
if ((yspec = yspec_new()) == NULL)
|
||||||
|
goto done;
|
||||||
|
clicon_dbspec_yang_set(h, yspec);
|
||||||
|
if (yang_spec_parse_module(h, clicon_yang_module_main(h),
|
||||||
|
clicon_yang_dir(h), clicon_yang_module_revision(h), yspec) < 0)
|
||||||
|
goto done;
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Minor changes
|
### Minor changes
|
||||||
|
* Added CLIXON_DEFAULT_CONFIG=/usr/local/etc/clixon.xml as option and in example (so you dont need to provide -f command-line option).
|
||||||
* Yang 1.1 action syntax added (but function is not supported)
|
* Yang 1.1 action syntax added (but function is not supported)
|
||||||
* New function: clicon_conf_xml() returns configuration tree
|
* New function: clicon_conf_xml() returns configuration tree
|
||||||
* Obsoleted COMPAT_CLIV and COMPAT_XSL that were optional in 3.7
|
* Obsoleted COMPAT_CLIV and COMPAT_XSL that were optional in 3.7
|
||||||
|
|
|
||||||
23
configure
vendored
23
configure
vendored
|
|
@ -638,6 +638,7 @@ wwwdir
|
||||||
with_restconf
|
with_restconf
|
||||||
RANLIB
|
RANLIB
|
||||||
SH_SUFFIX
|
SH_SUFFIX
|
||||||
|
CLIXON_DEFAULT_CONFIG
|
||||||
INSTALLFLAGS
|
INSTALLFLAGS
|
||||||
INSTALL
|
INSTALL
|
||||||
INSTALL_DATA
|
INSTALL_DATA
|
||||||
|
|
@ -685,6 +686,7 @@ infodir
|
||||||
docdir
|
docdir
|
||||||
oldincludedir
|
oldincludedir
|
||||||
includedir
|
includedir
|
||||||
|
runstatedir
|
||||||
localstatedir
|
localstatedir
|
||||||
sharedstatedir
|
sharedstatedir
|
||||||
sysconfdir
|
sysconfdir
|
||||||
|
|
@ -761,6 +763,7 @@ datadir='${datarootdir}'
|
||||||
sysconfdir='${prefix}/etc'
|
sysconfdir='${prefix}/etc'
|
||||||
sharedstatedir='${prefix}/com'
|
sharedstatedir='${prefix}/com'
|
||||||
localstatedir='${prefix}/var'
|
localstatedir='${prefix}/var'
|
||||||
|
runstatedir='${localstatedir}/run'
|
||||||
includedir='${prefix}/include'
|
includedir='${prefix}/include'
|
||||||
oldincludedir='/usr/include'
|
oldincludedir='/usr/include'
|
||||||
docdir='${datarootdir}/doc/${PACKAGE}'
|
docdir='${datarootdir}/doc/${PACKAGE}'
|
||||||
|
|
@ -1013,6 +1016,15 @@ do
|
||||||
| -silent | --silent | --silen | --sile | --sil)
|
| -silent | --silent | --silen | --sile | --sil)
|
||||||
silent=yes ;;
|
silent=yes ;;
|
||||||
|
|
||||||
|
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||||
|
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||||
|
| --run | --ru | --r)
|
||||||
|
ac_prev=runstatedir ;;
|
||||||
|
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||||
|
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||||
|
| --run=* | --ru=* | --r=*)
|
||||||
|
runstatedir=$ac_optarg ;;
|
||||||
|
|
||||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||||
ac_prev=sbindir ;;
|
ac_prev=sbindir ;;
|
||||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||||
|
|
@ -1150,7 +1162,7 @@ fi
|
||||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||||
libdir localedir mandir
|
libdir localedir mandir runstatedir
|
||||||
do
|
do
|
||||||
eval ac_val=\$$ac_var
|
eval ac_val=\$$ac_var
|
||||||
# Remove trailing slashes.
|
# Remove trailing slashes.
|
||||||
|
|
@ -1303,6 +1315,7 @@ Fine tuning of the installation directories:
|
||||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||||
|
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||||
--includedir=DIR C header files [PREFIX/include]
|
--includedir=DIR C header files [PREFIX/include]
|
||||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||||
|
|
@ -2438,6 +2451,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# If yes, compile apps/restconf
|
# If yes, compile apps/restconf
|
||||||
wwwdir=/www-data
|
wwwdir=/www-data
|
||||||
|
|
||||||
|
|
@ -4057,12 +4071,11 @@ fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set default config file location
|
# Set default config file location
|
||||||
|
CLIXON_DEFAULT_CONFIG=/usr/local/etc/clixon.xml
|
||||||
|
|
||||||
# Check whether --with-configfile was given.
|
# Check whether --with-configfile was given.
|
||||||
if test "${with_configfile+set}" = set; then :
|
if test "${with_configfile+set}" = set; then :
|
||||||
withval=$with_configfile; DEFAULT_CONFIG="$withval"
|
withval=$with_configfile; CLIXON_DEFAULT_CONFIG="$withval"
|
||||||
else
|
|
||||||
DEFAULT_CONFIG="$(eval echo ${sysconfdir}/clixon.xml)"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4315,7 +4328,7 @@ _ACEOF
|
||||||
# Default location for config file
|
# Default location for config file
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
#define CLIXON_DEFAULT_CONFIG "${DEFAULT_CONFIG}"
|
#define CLIXON_DEFAULT_CONFIG "${CLIXON_DEFAULT_CONFIG}"
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ AC_SUBST(INSTALL)
|
||||||
AC_SUBST(INSTALL_DATA)
|
AC_SUBST(INSTALL_DATA)
|
||||||
AC_SUBST(INSTALL_PROGRAM)
|
AC_SUBST(INSTALL_PROGRAM)
|
||||||
AC_SUBST(INSTALLFLAGS)
|
AC_SUBST(INSTALLFLAGS)
|
||||||
|
AC_SUBST(CLIXON_DEFAULT_CONFIG)
|
||||||
AC_SUBST(LIBS)
|
AC_SUBST(LIBS)
|
||||||
AC_SUBST(SH_SUFFIX)
|
AC_SUBST(SH_SUFFIX)
|
||||||
AC_SUBST(RANLIB)
|
AC_SUBST(RANLIB)
|
||||||
|
|
@ -158,10 +159,10 @@ if test "x${with_restconf}" == xyes; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set default config file location
|
# Set default config file location
|
||||||
|
CLIXON_DEFAULT_CONFIG=/usr/local/etc/clixon.xml
|
||||||
AC_ARG_WITH([configfile],
|
AC_ARG_WITH([configfile],
|
||||||
[AS_HELP_STRING([--with-configfile=FILE],[set default path to config file])],
|
[AS_HELP_STRING([--with-configfile=FILE],[set default path to config file])],
|
||||||
[DEFAULT_CONFIG="$withval"],
|
[CLIXON_DEFAULT_CONFIG="$withval"],)
|
||||||
[DEFAULT_CONFIG="$(eval echo ${sysconfdir}/clixon.xml)"])
|
|
||||||
|
|
||||||
AC_CHECK_LIB(crypt, crypt)
|
AC_CHECK_LIB(crypt, crypt)
|
||||||
AC_CHECK_HEADERS(crypt.h)
|
AC_CHECK_HEADERS(crypt.h)
|
||||||
|
|
@ -186,7 +187,7 @@ CLIXON_DATADIR="${prefix}/share/clixon"
|
||||||
AC_DEFINE_UNQUOTED(CLIXON_DATADIR, "${CLIXON_DATADIR}", [Clixon data dir for system yang files etc])
|
AC_DEFINE_UNQUOTED(CLIXON_DATADIR, "${CLIXON_DATADIR}", [Clixon data dir for system yang files etc])
|
||||||
|
|
||||||
# Default location for config file
|
# Default location for config file
|
||||||
AC_DEFINE_UNQUOTED(CLIXON_DEFAULT_CONFIG,"${DEFAULT_CONFIG}",[Location for apps to find default config file])
|
AC_DEFINE_UNQUOTED(CLIXON_DEFAULT_CONFIG,"${CLIXON_DEFAULT_CONFIG}",[Location for apps to find default config file])
|
||||||
|
|
||||||
AH_BOTTOM([#include <clixon_custom.h>])
|
AH_BOTTOM([#include <clixon_custom.h>])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@ localstatedir = @localstatedir@
|
||||||
libdir = @exec_prefix@/lib
|
libdir = @exec_prefix@/lib
|
||||||
|
|
||||||
APPNAME = example
|
APPNAME = example
|
||||||
|
# Install here if you want default clixon location:
|
||||||
|
CLIXON_DEFAULT_CONFIG = @CLIXON_DEFAULT_CONFIG@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CFLAGS = @CFLAGS@ -rdynamic -fPIC
|
CFLAGS = @CFLAGS@ -rdynamic -fPIC
|
||||||
|
|
@ -56,6 +58,8 @@ CLI_PLUGIN = $(APPNAME)_cli.so
|
||||||
NETCONF_PLUGIN = $(APPNAME)_netconf.so
|
NETCONF_PLUGIN = $(APPNAME)_netconf.so
|
||||||
RESTCONF_PLUGIN = $(APPNAME)_restconf.so
|
RESTCONF_PLUGIN = $(APPNAME)_restconf.so
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Example docker image. PLEASE CHANGE THIS
|
# Example docker image. PLEASE CHANGE THIS
|
||||||
IMAGE = olofhagsand/clixon_example
|
IMAGE = olofhagsand/clixon_example
|
||||||
|
|
||||||
|
|
@ -120,6 +124,7 @@ distclean: clean
|
||||||
install: $(YANGSPECS) $(CLISPECS) $(BE_PLUGIN) $(BE2_PLUGIN) $(CLI_PLUGIN) $(NETCONF_PLUGIN) $(RESTCONF_PLUGIN) $(APPNAME).xml
|
install: $(YANGSPECS) $(CLISPECS) $(BE_PLUGIN) $(BE2_PLUGIN) $(CLI_PLUGIN) $(NETCONF_PLUGIN) $(RESTCONF_PLUGIN) $(APPNAME).xml
|
||||||
install -d -m 0755 $(DESTDIR)$(sysconfdir)
|
install -d -m 0755 $(DESTDIR)$(sysconfdir)
|
||||||
install -m 0644 $(APPNAME).xml $(DESTDIR)$(sysconfdir)
|
install -m 0644 $(APPNAME).xml $(DESTDIR)$(sysconfdir)
|
||||||
|
# install -m 0644 $(APPNAME).xml $(DESTDIR)$(CLIXON_DEFAULT_CONFIG)
|
||||||
install -d -m 0755 $(DESTDIR)$(datarootdir)/$(APPNAME)/yang
|
install -d -m 0755 $(DESTDIR)$(datarootdir)/$(APPNAME)/yang
|
||||||
install -m 0644 $(YANGSPECS) $(DESTDIR)$(datarootdir)/$(APPNAME)/yang
|
install -m 0644 $(YANGSPECS) $(DESTDIR)$(datarootdir)/$(APPNAME)/yang
|
||||||
install -d -m 0755 $(DESTDIR)$(libdir)/$(APPNAME)/cli
|
install -d -m 0755 $(DESTDIR)$(libdir)/$(APPNAME)/cli
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,7 @@ char *yang_find_myprefix(yang_stmt *ys);
|
||||||
int yang_order(yang_stmt *y);
|
int yang_order(yang_stmt *y);
|
||||||
int yang_print(FILE *f, yang_node *yn);
|
int yang_print(FILE *f, yang_node *yn);
|
||||||
int yang_print_cbuf(cbuf *cb, yang_node *yn, int marginal);
|
int yang_print_cbuf(cbuf *cb, yang_node *yn, int marginal);
|
||||||
|
int ys_populate(yang_stmt *ys, void *arg);
|
||||||
yang_stmt *yang_parse_file(int fd, const char *name, yang_spec *ysp);
|
yang_stmt *yang_parse_file(int fd, const char *name, yang_spec *ysp);
|
||||||
int yang_parse(clicon_handle h, const char *filename,
|
int yang_parse(clicon_handle h, const char *filename,
|
||||||
const char *module, const char *dir,
|
const char *module, const char *dir,
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,7 @@ stream_cb_add(clicon_handle h,
|
||||||
event_stream_t *es;
|
event_stream_t *es;
|
||||||
struct stream_subscription *ss;
|
struct stream_subscription *ss;
|
||||||
|
|
||||||
|
clicon_debug(1, "%s", __FUNCTION__);
|
||||||
if ((es = stream_find(h, stream)) == NULL){
|
if ((es = stream_find(h, stream)) == NULL){
|
||||||
clicon_err(OE_CFG, ENOENT, "Stream %s not found", stream);
|
clicon_err(OE_CFG, ENOENT, "Stream %s not found", stream);
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -289,6 +290,7 @@ stream_notify_xml(clicon_handle h,
|
||||||
event_stream_t *es;
|
event_stream_t *es;
|
||||||
struct stream_subscription *ss;
|
struct stream_subscription *ss;
|
||||||
|
|
||||||
|
clicon_debug(1, "%s", __FUNCTION__);
|
||||||
if ((es = stream_find(h, stream)) == NULL)
|
if ((es = stream_find(h, stream)) == NULL)
|
||||||
goto ok;
|
goto ok;
|
||||||
/* Go thru all global (handle) subscriptions and find matches */
|
/* Go thru all global (handle) subscriptions and find matches */
|
||||||
|
|
@ -332,6 +334,7 @@ stream_notify(clicon_handle h,
|
||||||
char timestr[27];
|
char timestr[27];
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
|
clicon_debug(1, "%s", __FUNCTION__);
|
||||||
va_start(args, event);
|
va_start(args, event);
|
||||||
len = vsnprintf(NULL, 0, event, args) + 1;
|
len = vsnprintf(NULL, 0, event, args) + 1;
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
|
||||||
|
|
@ -1435,7 +1435,7 @@ ys_populate_feature(clicon_handle h,
|
||||||
* See ys_parse_sub for first pass and what can be assumed
|
* See ys_parse_sub for first pass and what can be assumed
|
||||||
* After this pass, cv:s are set for LEAFs and LEAF-LISTs
|
* After this pass, cv:s are set for LEAFs and LEAF-LISTs
|
||||||
*/
|
*/
|
||||||
static int
|
int
|
||||||
ys_populate(yang_stmt *ys,
|
ys_populate(yang_stmt *ys,
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue