* Changed docker builds

* `clixon-test` built in `docker/test`
    * Renamed from `clixon-system` built in `docker/main`
  * `clixon-example` built in `docker/example`
    * Added netconf ssh subsystem
    * Renamed from `clixon` built in `docker/base`
* Added ietf-yang-schema-mount@2019-01-14.yang
This commit is contained in:
Olof Hagsand 2022-12-11 13:31:19 +01:00
parent 571e26e0d6
commit 61e2f014be
30 changed files with 14044 additions and 2634 deletions

View file

@ -2,9 +2,9 @@ name: Clixon CI
on: on:
push: push:
branches: [ master, with-defaults ] branches: [ master ]
pull_request: pull_request:
branches: [ master, with-defaults ] branches: [ master ]
jobs: jobs:
build: build:

View file

@ -44,6 +44,12 @@ Expected: beginning of 2023
### C/CLI-API changes on existing features ### C/CLI-API changes on existing features
Developers may need to change their code Developers may need to change their code
* Changed docker builds
* `clixon-test` built in `docker/test`
* Renamed from `clixon-system` built in `docker/main`
* `clixon-example` built in `docker/example`
* Added netconf ssh subsystem
* Renamed from `clixon` built in `docker/base`
* C-API * C-API
* Added `sock_flags` parameter to `clixon_proc_socket()` * Added `sock_flags` parameter to `clixon_proc_socket()`

1500
config-aux/config.guess vendored

File diff suppressed because it is too large Load diff

2867
config-aux/config.sub vendored

File diff suppressed because it is too large Load diff

View file

@ -1,250 +1,508 @@
#! /bin/sh #!/bin/sh
#
# install - install a program, script, or datafile # install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
scriptversion=2014-09-12.12; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
# #
# Copyright 1991 by the Massachusetts Institute of Technology # Copyright (C) 1994 X Consortium
# #
# Permission to use, copy, modify, distribute, and sell this software and its # Permission is hereby granted, free of charge, to any person obtaining a copy
# documentation for any purpose is hereby granted without fee, provided that # of this software and associated documentation files (the "Software"), to
# the above copyright notice appear in all copies and that both that # deal in the Software without restriction, including without limitation the
# copyright notice and this permission notice appear in supporting # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# documentation, and that the name of M.I.T. not be used in advertising or # sell copies of the Software, and to permit persons to whom the Software is
# publicity pertaining to distribution of the software without specific, # furnished to do so, subject to the following conditions:
# written prior permission. M.I.T. makes no representations about the #
# suitability of this software for any purpose. It is provided "as is" # The above copyright notice and this permission notice shall be included in
# without express or implied warranty. # all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
# #
# Calling this script install-sh is preferred over install.sh, to prevent # Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it # 'make' implicit rules from creating a file called install from it
# when there is no Makefile. # when there is no Makefile.
# #
# This script is compatible with the BSD install script, but was written # This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction # from scratch.
# shared with many OS's install programs.
tab=' '
# set DOITPROG to echo to test this script nl='
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
' '
IFS="${IFS-${defaultIFS}}" IFS=" $tab$nl"
oIFS="${IFS}" # Set DOITPROG to "echo" to test this script.
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp='' doit=${DOITPROG-}
doit_exec=${doit:-exec}
while [ $# -ne 0 ] ; do # Put in absolute file names if you don't have them in your path;
pathcomp="${pathcomp}${1}" # or use environment vars.
shift
if [ ! -d "${pathcomp}" ] ; chgrpprog=${CHGRPPROG-chgrp}
then chmodprog=${CHMODPROG-chmod}
$mkdirprog "${pathcomp}" chownprog=${CHOWNPROG-chown}
else cmpprog=${CMPPROG-cmp}
true cpprog=${CPPROG-cp}
fi mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
pathcomp="${pathcomp}/" posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi fi
if [ x"$dir_arg" != x ] if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
then # When -d is used, all remaining arguments are directories to create.
$doit $instcmd $dst && # When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if test $# -eq 0; then
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if test -z "$dir_arg"; then
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && echo "$0: no input file specified." >&2
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi exit 1
else fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
# If we're going to rename the final executable, determine the name now. if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if [ x"$transformarg" = x ] if test -z "$dir_arg"; then
then do_exit='(exit $ret); exit $ret'
dstfile=`basename $dst` trap "ret=129; $do_exit" 1
else trap "ret=130; $do_exit" 2
dstfile=`basename $dst $transformbasename | trap "ret=141; $do_exit" 13
sed $transformarg`$transformbasename trap "ret=143; $do_exit" 15
fi
# don't allow the sed command to completely eliminate the filename # Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
if [ x"$dstfile" = x ] *[0-7])
then if test -z "$stripcmd"; then
dstfile=`basename $dst` u_plus_rw=
else else
true u_plus_rw='% 200'
fi fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
# Make a temp file name in the proper directory. for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
dsttmp=$dstdir/#inst.$$# if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Move or copy the file name to the temp name # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
$doit $instcmd $src $dsttmp && if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
trap "rm -f ${dsttmp}" 0 && # If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
# and set any options; do chmod last to preserve setuid bits obsolete_mkdir_used=false
# If any of these fail, we abort the whole thing. If we want to if test $dstdir_status != 0; then
# ignore errors from any of these, just make sure not to ignore case $posix_mkdir in
# errors from the above "$doit $instcmd $src $dsttmp" command. '')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && *[0-7])
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && mkdir_umask=`expr $umask + 22 \
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - $umask % 100 % 40 + $umask % 20 \
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# Now rename the file to the real destination. # With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
$doit $rmcmd -f $dstdir/$dstfile && posix_mkdir=false
$doit $mvcmd $dsttmp $dstdir/$dstfile case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# $RANDOM is not portable (e.g. dash); use it when possible to
# lower collision chance
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
fi && # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
exit 0 # The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

11156
config-aux/ltmain.sh Normal file

File diff suppressed because it is too large Load diff

6
configure vendored
View file

@ -5786,7 +5786,7 @@ fi
ac_config_files="$ac_config_files Makefile lib/Makefile lib/src/Makefile lib/clixon/Makefile apps/Makefile apps/cli/Makefile apps/backend/Makefile apps/netconf/Makefile apps/restconf/Makefile apps/snmp/Makefile include/Makefile etc/Makefile etc/clixonrc example/Makefile example/main/Makefile example/main/example.xml extras/rpm/Makefile docker/Makefile docker/base/Makefile docker/clixon-dev/Makefile docker/main/Makefile util/Makefile yang/Makefile yang/clixon/Makefile yang/mandatory/Makefile doc/Makefile test/Makefile test/config.sh test/cicd/Makefile test/vagrant/Makefile" ac_config_files="$ac_config_files Makefile lib/Makefile lib/src/Makefile lib/clixon/Makefile apps/Makefile apps/cli/Makefile apps/backend/Makefile apps/netconf/Makefile apps/restconf/Makefile apps/snmp/Makefile include/Makefile etc/Makefile etc/clixonrc example/Makefile example/main/Makefile example/main/example.xml extras/rpm/Makefile docker/Makefile docker/clixon-dev/Makefile docker/example/Makefile docker/test/Makefile util/Makefile yang/Makefile yang/clixon/Makefile yang/mandatory/Makefile doc/Makefile test/Makefile test/config.sh test/cicd/Makefile test/vagrant/Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
@ -6498,9 +6498,9 @@ do
"example/main/example.xml") CONFIG_FILES="$CONFIG_FILES example/main/example.xml" ;; "example/main/example.xml") CONFIG_FILES="$CONFIG_FILES example/main/example.xml" ;;
"extras/rpm/Makefile") CONFIG_FILES="$CONFIG_FILES extras/rpm/Makefile" ;; "extras/rpm/Makefile") CONFIG_FILES="$CONFIG_FILES extras/rpm/Makefile" ;;
"docker/Makefile") CONFIG_FILES="$CONFIG_FILES docker/Makefile" ;; "docker/Makefile") CONFIG_FILES="$CONFIG_FILES docker/Makefile" ;;
"docker/base/Makefile") CONFIG_FILES="$CONFIG_FILES docker/base/Makefile" ;;
"docker/clixon-dev/Makefile") CONFIG_FILES="$CONFIG_FILES docker/clixon-dev/Makefile" ;; "docker/clixon-dev/Makefile") CONFIG_FILES="$CONFIG_FILES docker/clixon-dev/Makefile" ;;
"docker/main/Makefile") CONFIG_FILES="$CONFIG_FILES docker/main/Makefile" ;; "docker/example/Makefile") CONFIG_FILES="$CONFIG_FILES docker/example/Makefile" ;;
"docker/test/Makefile") CONFIG_FILES="$CONFIG_FILES docker/test/Makefile" ;;
"util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;;
"yang/Makefile") CONFIG_FILES="$CONFIG_FILES yang/Makefile" ;; "yang/Makefile") CONFIG_FILES="$CONFIG_FILES yang/Makefile" ;;
"yang/clixon/Makefile") CONFIG_FILES="$CONFIG_FILES yang/clixon/Makefile" ;; "yang/clixon/Makefile") CONFIG_FILES="$CONFIG_FILES yang/clixon/Makefile" ;;

View file

@ -401,9 +401,9 @@ AC_OUTPUT(Makefile
example/main/example.xml example/main/example.xml
extras/rpm/Makefile extras/rpm/Makefile
docker/Makefile docker/Makefile
docker/base/Makefile
docker/clixon-dev/Makefile docker/clixon-dev/Makefile
docker/main/Makefile docker/example/Makefile
docker/test/Makefile
util/Makefile util/Makefile
yang/Makefile yang/Makefile
yang/clixon/Makefile yang/clixon/Makefile

View file

@ -41,8 +41,8 @@ LIBS = @LIBS@
SHELL = /bin/sh SHELL = /bin/sh
SUBDIRS = base SUBDIRS = example
SUBDIRS += main SUBDIRS += test
#SUBDIRS += cluster #SUBDIRS += cluster
.PHONY: all clean distclean depend install-include install uninstall test $(SUBDIRS) .PHONY: all clean distclean depend install-include install uninstall test $(SUBDIRS)
@ -62,7 +62,7 @@ distclean: clean
do (cd $$i; $(MAKE) $(MFLAGS) $@); done do (cd $$i; $(MAKE) $(MFLAGS) $@); done
test: test:
$(MAKE) -C main $(MFLAGS) $@ $(MAKE) -C test $(MFLAGS) $@
depend: depend:
for i in $(SUBDIRS); \ for i in $(SUBDIRS); \

View file

@ -2,8 +2,8 @@
This directory contains sub-directories with examples of Clixon docker images: This directory contains sub-directories with examples of Clixon docker images:
* [base](base/README.md) Clixon base image * [example](example/README.md) Clixon main example image
* [clixon-dev](clixon-dev/README.md) Clixon development image * [clixon-dev](clixon-dev/README.md) Clixon development image
* [main](main/README.md) Main example and test application used in upstream CI * [test](test/README.md) Test scripts used in upstream CI

View file

@ -1,20 +0,0 @@
# Clixon base docker image
This directory contains code for building a clixon base docker container.
This clixon base container uses native http.
The clixon docker base image can be used to build clixon
applications. It has the whole code for a clixon release which it
downloads from git.
## Build
Perform the build by `make docker`. This copies the latest _committed_ clixon code into the container.
## Push
You may also do `make push` if you want to push the image, but you may then consider changing the image name (in the makefile:s).
(You may have to login for push with sudo docker login -u <username>)

View file

@ -69,6 +69,17 @@ RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --with-restco
RUN make RUN make
RUN make install RUN make install
RUN make install-include
# Install main example
WORKDIR /clixon/clixon/example/main
RUN make
RUN make install
# Copy startscript
WORKDIR /clixon
COPY startsystem.sh startsystem.sh
RUN install startsystem.sh /clixon/build/bin/
# #
# Stage 2 # Stage 2
@ -95,3 +106,9 @@ EXPOSE 443/tcp
RUN adduser -D -H clicon RUN adduser -D -H clicon
COPY --from=0 /clixon/build/ /usr/local/ COPY --from=0 /clixon/build/ /usr/local/
# Create symlink so you can run clixon without -f arg
RUN ln -s /usr/local/etc/example.xml /usr/local/etc/clixon.xml
# Start daemons
CMD /usr/local/bin/startsystem.sh

View file

@ -40,7 +40,7 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
# docker.hub image. CHANGE THIS IF YOU PUSH YOUR OWN # docker.hub image. CHANGE THIS IF YOU PUSH YOUR OWN
IMG = clixon/clixon # base image IMG = clixon/clixon-example
SHELL = /bin/sh SHELL = /bin/sh
@ -60,7 +60,7 @@ distclean: clean
rm -f Makefile *~ .depend rm -f Makefile *~ .depend
docker: clixon Dockerfile docker: clixon Dockerfile
sudo docker build -t $(IMG) . # --no-cache sudo docker build -t $(IMG) $(DOCKERFLAGS) .
push: push:
sudo docker push $(IMG) sudo docker push $(IMG)

46
docker/example/README.md Normal file
View file

@ -0,0 +1,46 @@
# Clixon main example docker image
This directory contains code for building a clixon main example docker container.
This clixon example container uses native http.
## Build
Perform the build by `make docker`. This copies the latest _committed_ clixon code into the container.
## Start
Start the container:
```
$ ./start.sh
```
If you want to install your pre-existing pub rsa key in the container:
```
$ SSHKEY=true ./start.sh
```
## Run
The CLI directly
```
$ sudo docker exec -it clixon-example clixon_cli
```
The CLI via ssh (if keys setup correctly) where 172.x.x.x is the addresss of eth0
```
$ ssh -t root@172.x.x.x clixon_cli
```
Netconf via ssh:
```
$ ssh root@172.x.x.x -s netconf
```
## Push
You may also do `make push` if you want to push the image, but you may then consider changing the image name (in the makefile:s).
(You may have to login for push with sudo docker login -u <username>)

7
docker/example/cleanup.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# Kill all controller containers (optionally do `make clean`)
sudo docker kill clixon-example 2> /dev/null # ignore errors

View file

@ -35,13 +35,23 @@
# Debug: DBG=1 ./startup.sh # Debug: DBG=1 ./startup.sh
# See also cleanup.sh # See also cleanup.sh
# If tru also install your users pubkey
: ${SSHKEY:=false}
>&2 echo "Running script: $0" >&2 echo "Running script: $0"
sudo docker kill clixon-example 2> /dev/null # ignore errors
# Start clixon-example backend # Start clixon-example backend
sudo docker run --name clixon --rm -td clixon/clixon || err "Error starting clixon" sudo docker run --name clixon-example --rm -td clixon/clixon-example #|| err "Error starting clixon-example"
>&2 echo "clixon started"
# Copy rsa pubkey
if $SSHKEY; then
# install user pub key
sudo docker exec -it clixon-example mkdir -m 700 /root/.ssh
sudo docker cp ~/.ssh/id_rsa.pub clixon-example:/root/.ssh/authorized_keys
sudo docker exec -it clixon-example chown root /root/.ssh/authorized_keys
sudo docker exec -it clixon-example chgrp root /root/.ssh/authorized_keys
fi
>&2 echo "clixon-example started"

65
docker/example/startsystem.sh Executable file
View file

@ -0,0 +1,65 @@
#!/bin/sh
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (C) 2017-2019 Olof Hagsand
# Copyright (C) 2020-2022 Olof Hagsand and 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 *****
# Clixon startscript for native restconf and https
# This script is copied into the container on build time and runs
# _inside_ the container at start in runtime. It gets environment variables
# from the start.sh script.
# It starts a backend, a restconf daemon and exposes ports for restconf, and the sleeps
# See also Dockerfile of the example
# Log msg, see with docker logs
set -ux # e but clixon_backend may fail if test is run in parallell
>&2 echo "$0"
# If set, enable debugging (of backend and restconf daemons)
: ${DBG:=0}
# Start sshd
touch /run/openrc/softlevel
/etc/init.d/sshd start
# But dont use -s exposing local ports since there is problem with self-signed certs?
#/usr/local/bin/clixon_restconf -l f/var/log/restconf.log -D $DBG &
#>&2 echo "clixon_restconf started"
ln -s /usr/local/etc/example.xml clixon.xml
# Start clixon backend
/usr/local/sbin/clixon_backend -D $DBG -s running -l e -f /usr/local/etc/example.xml
>&2 echo "clixon_backend started"
# Alt: let backend be in foreground, but test scripts may
# want to restart backend
/bin/sleep 100000000

View file

@ -167,5 +167,5 @@ COPY --from=0 /usr/local/share/openconfig/* /usr/local/share/openconfig/
COPY --from=0 /usr/local/share/mib-yangs/* /usr/local/share/mib-yangs/ COPY --from=0 /usr/local/share/mib-yangs/* /usr/local/share/mib-yangs/
COPY --from=0 /clixon/build/mibs/* /usr/share/snmp/mibs/ COPY --from=0 /clixon/build/mibs/* /usr/share/snmp/mibs/
# Start the backend and restconf deamons # Start daemons
CMD /usr/local/bin/startsystem.sh CMD /usr/local/bin/startsystem.sh

View file

@ -87,7 +87,7 @@ endif
LIBDEPS = $(top_srcdir)/lib/src/$(CLIXON_LIB) LIBDEPS = $(top_srcdir)/lib/src/$(CLIXON_LIB)
BELIBDEPS = $(top_srcdir)/apps/backend/$(CLIXON_BACKEND_LIB) BELIBDEPS = $(top_srcdir)/apps/backend/$(CLIXON_BACKEND_LIB)
# Utilities, unit testings. Not installed. # Utilities, unit testings.
APPSRC = clixon_util_xml.c APPSRC = clixon_util_xml.c
APPSRC += clixon_util_xml_mod.c APPSRC += clixon_util_xml_mod.c
APPSRC += clixon_util_json.c APPSRC += clixon_util_json.c
@ -129,48 +129,48 @@ clean:
# APPS # APPS
clixon_util_xml: clixon_util_xml.c $(LIBDEPS) clixon_util_xml: clixon_util_xml.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_json: clixon_util_json.c $(LIBDEPS) clixon_util_json: clixon_util_json.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_yang: clixon_util_yang.c $(LIBDEPS) clixon_util_yang: clixon_util_yang.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_xpath: clixon_util_xpath.c $(LIBDEPS) clixon_util_xpath: clixon_util_xpath.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_path: clixon_util_path.c $(LIBDEPS) clixon_util_path: clixon_util_path.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_datastore: clixon_util_datastore.c $(LIBDEPS) clixon_util_datastore: clixon_util_datastore.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -D__PROGRAM__=\"$@\" $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_xml_mod: clixon_util_xml_mod.c $(LIBDEPS) clixon_util_xml_mod: clixon_util_xml_mod.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -D__PROGRAM__=\"$@\" $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_regexp: clixon_util_regexp.c $(LIBDEPS) clixon_util_regexp: clixon_util_regexp.c $(LIBDEPS)
$(CC) $(INCLUDES) -I /usr/include/libxml2 $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) -I /usr/include/libxml2 $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_socket: clixon_util_socket.c $(LIBDEPS) clixon_util_socket: clixon_util_socket.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -D__PROGRAM__=\"$@\" $(LDFLAGS) $^ $(LIBS) -o $@
clixon_util_validate: clixon_util_validate.c $(BELIBDEPS) $(LIBDEPS) clixon_util_validate: clixon_util_validate.c $(BELIBDEPS) $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ -l clixon_backend -o $@ $(LIBS) $(BELIBS) $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -D__PROGRAM__=\"$@\" $(LDFLAGS) $^ -l clixon_backend -o $@ $(LIBS) $(BELIBS)
clixon_util_dispatcher: clixon_util_dispatcher.c $(BELIBDEPS) $(LIBDEPS) clixon_util_dispatcher: clixon_util_dispatcher.c $(BELIBDEPS) $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ -l clixon_backend -o $@ $(LIBS) $(BELIBS) $(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ -l clixon_backend -o $@ $(LIBS) $(BELIBS)
ifdef with_restconf ifdef with_restconf
clixon_util_stream: clixon_util_stream.c $(LIBDEPS) clixon_util_stream: clixon_util_stream.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -lcurl -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -lcurl -o $@
clixon_restconf_callhome_client: clixon_restconf_callhome_client.c $(LIBDEPS) clixon_restconf_callhome_client: clixon_restconf_callhome_client.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(INCLUDES) $(CPPFLAGS) -D__PROGRAM__=\"$@\" $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
endif endif
#clixon_util_grpc: clixon_util_grpc.c $(LIBDEPS) #clixon_util_grpc: clixon_util_grpc.c $(LIBDEPS)
# $(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ # $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
distclean: clean distclean: clean
rm -f Makefile *~ .depend rm -f Makefile *~ .depend
@ -184,6 +184,7 @@ install-include:
install-lib: install-lib:
uninstall: uninstall:
rm -f $(DESTDIR)$(bindir)/$(APPS)
TAGS: TAGS:
find . -name '*.[ch]' -print | etags - find . -name '*.[ch]' -print | etags -

View file

@ -51,6 +51,9 @@ YANGSPECS += ietf-yang-library@2019-01-04.yang
YANGSPECS += ietf-yang-types@2013-07-15.yang YANGSPECS += ietf-yang-types@2013-07-15.yang
YANGSPECS += ietf-datastores@2018-02-14.yang YANGSPECS += ietf-datastores@2018-02-14.yang
YANGSPECS += ietf-yang-patch@2017-02-22.yang YANGSPECS += ietf-yang-patch@2017-02-22.yang
# In RFC 8528 YANG Schema Mount
YANGSPECS += ietf-yang-schema-mount@2019-01-14.yang
# For remaining attribute in list-pagination: # For remaining attribute in list-pagination:
YANGSPECS += ietf-yang-metadata@2016-08-05.yang YANGSPECS += ietf-yang-metadata@2016-08-05.yang
# XXX brings in NACM which breaks tests # XXX brings in NACM which breaks tests

View file

@ -0,0 +1,224 @@
module ietf-yang-schema-mount {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-schema-mount";
prefix yangmnt;
import ietf-inet-types {
prefix inet;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/netmod/>
WG List: <mailto:netmod@ietf.org>
Editor: Martin Bjorklund
<mailto:mbj@tail-f.com>
Editor: Ladislav Lhotka
<mailto:lhotka@nic.cz>";
description
"This module defines a YANG extension statement that can be used
to incorporate data models defined in other YANG modules in a
module. It also defines operational state data that specify the
overall structure of the data model.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
'MAY', and 'OPTIONAL' in this document are to be interpreted as
described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
they appear in all capitals, as shown here.
Copyright (c) 2019 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject to
the license terms contained in, the Simplified BSD License set
forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC 8528;
see the RFC itself for full legal notices.";
revision 2019-01-14 {
description
"Initial revision.";
reference
"RFC 8528: YANG Schema Mount";
}
/*
* Extensions
*/
extension mount-point {
argument label;
description
"The argument 'label' is a YANG identifier, i.e., it is of the
type 'yang:yang-identifier'.
The 'mount-point' statement MUST NOT be used in a YANG
version 1 module, neither explicitly nor via a 'uses'
statement.
The 'mount-point' statement MAY be present as a substatement
of 'container' and 'list' and MUST NOT be present elsewhere.
There MUST NOT be more than one 'mount-point' statement in a
given 'container' or 'list' statement.
If a mount point is defined within a grouping, its label is
bound to the module where the grouping is used.
A mount point defines a place in the node hierarchy where
other data models may be attached. A server that implements a
module with a mount point populates the
'/schema-mounts/mount-point' list with detailed information on
which data models are mounted at each mount point.
Note that the 'mount-point' statement does not define a new
data node.";
}
/*
* State data nodes
*/
container schema-mounts {
config false;
description
"Contains information about the structure of the overall
mounted data model implemented in the server.";
list namespace {
key "prefix";
description
"This list provides a mapping of namespace prefixes that are
used in XPath expressions of 'parent-reference' leafs to the
corresponding namespace URI references.";
leaf prefix {
type yang:yang-identifier;
description
"Namespace prefix.";
}
leaf uri {
type inet:uri;
description
"Namespace URI reference.";
}
}
list mount-point {
key "module label";
description
"Each entry of this list specifies a schema for a particular
mount point.
Each mount point MUST be defined using the 'mount-point'
extension in one of the modules listed in the server's
YANG library instance with conformance type 'implement'.";
leaf module {
type yang:yang-identifier;
description
"Name of a module containing the mount point.";
}
leaf label {
type yang:yang-identifier;
description
"Label of the mount point defined using the 'mount-point'
extension.";
}
leaf config {
type boolean;
default "true";
description
"If this leaf is set to 'false', then all data nodes in the
mounted schema are read-only ('config false'), regardless
of their 'config' property.";
}
choice schema-ref {
mandatory true;
description
"Alternatives for specifying the schema.";
container inline {
presence
"A complete self-contained schema is mounted at the
mount point.";
description
"This node indicates that the server has mounted at least
the module 'ietf-yang-library' at the mount point, and
its instantiation provides the information about the
mounted schema.
Different instances of the mount point may have
different schemas mounted.";
}
container shared-schema {
presence
"The mounted schema together with the 'parent-reference'
make up the schema for this mount point.";
description
"This node indicates that the server has mounted at least
the module 'ietf-yang-library' at the mount point, and
its instantiation provides the information about the
mounted schema. When XPath expressions in the mounted
schema are evaluated, the 'parent-reference' leaf-list
is taken into account.
Different instances of the mount point MUST have the
same schema mounted.";
leaf-list parent-reference {
type yang:xpath1.0;
description
"Entries of this leaf-list are XPath 1.0 expressions
that are evaluated in the following context:
- The context node is the node in the parent data tree
where the mount-point is defined.
- The accessible tree is the parent data tree
*without* any nodes defined in modules that are
mounted inside the parent schema.
- The context position and context size are both equal
to 1.
- The set of variable bindings is empty.
- The function library is the core function library
defined in the W3C XPath 1.0 document
(http://www.w3.org/TR/1999/REC-xpath-19991116) and
the functions defined in Section 10 of RFC 7950.
- The set of namespace declarations is defined by the
'namespace' list under 'schema-mounts'.
Each XPath expression MUST evaluate to a node-set
(possibly empty). For the purposes of evaluating
XPath expressions whose context nodes are defined in
the mounted schema, the union of all these node-sets
together with ancestor nodes are added to the
accessible data tree.
Note that in the case 'ietf-yang-schema-mount' is
itself mounted, a 'parent-reference' in the mounted
module may refer to nodes that were brought into the
accessible tree through a 'parent-reference' in the
parent schema.";
}
}
}
}
}
}