diff --git a/CHANGELOG.txt b/CHANGELOG.md similarity index 74% rename from CHANGELOG.txt rename to CHANGELOG.md index 84df96ff..0083e82a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.md @@ -1,35 +1,10 @@ -# ***** BEGIN LICENSE BLOCK ***** -# -# Copyright (C) 2009-2017 Olof Hagsand and Benny Holmgren -# -# 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 CHANGELOG -- Datastore text module is now the default. +## 3.3.0 + +May 2017 + +- Datastore text module is now default. - Refined netconf "none" semantics in tests and text datastore diff --git a/README.md b/README.md index 48780720..afc3f14d 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,21 @@ databases with transaction support. Presentations and tutorial is found on the [CLICON project page](http://www.clicon.org) -## 1. Installation +Table of contents +================= + * [Table of contents](#table-of-contents) + * [Installation](#installation) + * [Documentation](#documentation) + * [Dependencies](#dependencies) + * [Licenses](#licenses) + * [History](#history) + * [Datastore](#datastore) + * [Yang](#yang) + * [Netconf](#netconf) + * [Restconf](#restconf) +Installation +============ A typical installation is as follows: ``` configure # Configure clixon to platform @@ -17,13 +30,15 @@ A typical installation is as follows: ``` One example applications is provided, a IETF IP YANG datamodel with generated CLI and configuration interface. -## 2. Documentation - -- [Frequently asked questions](http://www.clicon.org/FAQ.html) -- [Reference manual(http://www.clicon.org/doxygen/index.html) (may not be 100%% synched) - -## 3. Dependencies +Documentation +============= +- [Frequently asked questions](doc/FAQ.md) +- [Reference manual](http://www.clicon.org/doxygen/index.html) (Better: cd doc; make doc) +- [Routing example](example/README.md) +- [Test](test/README.md) +Dependencies +============ Clixon is dependend on the following packages - [CLIgen](http://www.cligen.se) is required for building CLIXON. If you need to build and install CLIgen: @@ -36,22 +51,23 @@ to build and install CLIgen: - Fcgi (if restconf is enabled) - Qdbm key-value store (if keyvalue datastore is enabled) -## 4. Licenses - +Licenses +======== CLIXON is dual license. Either Apache License, Version 2.0 or GNU General Public License Version 2. You choose. See LICENSE.md for license, CHANGELOG for recent changes. -## 5. History - +History +======= CLIXON is a fork of CLICON where legacy key specification has been replaced completely by YANG. This means that legacy CLICON applications such as CLICON/ROST does not run on CLIXON. Clixon origins from work at [KTH](http://www.csc.kth.se/~olofh/10G_OSR) -## 6. Clixon Datastore +Datastore +========= The Clixon datastore is a stand-alone XML based datastore used by Clixon. The idea is to be able to use different datastores. There is currently a key-value plugin based on qdbm and a plain text-file @@ -141,8 +157,8 @@ datastore_client.c for a more elaborate example. xmdlb_plugin_unload(h); ``` -## 7. YANG - +YANG +==== Clixon implements YANG RFC 6020. Clixon generates an interactive CLI for YANG specifications. It also provides Restconf and Netconf clients. @@ -152,8 +168,8 @@ Clixon YANG currently does not provide the following support: - unique - rpc -## 8. Netconf - +Netconf +======= Clixon Netconf implements the following NETCONF standards: - RFC 4741 (NETCONF Configuration Protocol) - RFC 4742 (Using the NETCONF Configuration Protocol over Secure SHell (SSH)) @@ -169,8 +185,8 @@ Clixon NETCONF currently does not support the following Netconf features: - edit-config erropts - edit-config config-text -## 9. Restconf - +Restconf +======== ### Features Clixon restconf is a daemon based on FASTCGI. Instructions are available to @@ -251,4 +267,3 @@ Send command: ``` curl -G http://127.0.0.1/restconf/data/* ``` - diff --git a/apps/backend/backend_client.c b/apps/backend/backend_client.c index 6dd5511e..022e61d6 100644 --- a/apps/backend/backend_client.c +++ b/apps/backend/backend_client.c @@ -621,7 +621,6 @@ from_client_delete_config(clicon_handle h, piddb); goto ok; } - if (xmldb_delete(h, target) < 0){ cprintf(cbret, "" "operation-failed" diff --git a/configure b/configure index 4f7dfcbd..d48a768e 100755 --- a/configure +++ b/configure @@ -2135,7 +2135,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu : ${CFLAGS="-O2"} CLIXON_VERSION_MAJOR="3" -CLIXON_VERSION_MINOR="2" +CLIXON_VERSION_MINOR="3" CLIXON_VERSION_PATCH="0" CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\"" # Fix to specific version (eg 3.5) or head (3) diff --git a/configure.ac b/configure.ac index e5c562bf..c7f30742 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_INIT(lib/clixon/clixon.h.in) : ${CFLAGS="-O2"} CLIXON_VERSION_MAJOR="3" -CLIXON_VERSION_MINOR="2" +CLIXON_VERSION_MINOR="3" CLIXON_VERSION_PATCH="0" CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\"" # Fix to specific version (eg 3.5) or head (3) diff --git a/datastore/text/clixon_xmldb_text.c b/datastore/text/clixon_xmldb_text.c index d9c86ac5..6ef443e8 100644 --- a/datastore/text/clixon_xmldb_text.c +++ b/datastore/text/clixon_xmldb_text.c @@ -726,13 +726,14 @@ match_base_child(cxobj *x0, } /*! Modify a base tree x0 with x1 with yang spec y according to operation op - * @param[in] x0 Base xml tree + * @param[in] x0 Base xml tree (can be NULL in add scenarios) + * @param[in] x0p Parent of x0 * @param[in] x1 xml tree which modifies base * @param[in] op OP_MERGE, OP_REPLACE, OP_REMOVE, etc - * @param[in] y Yang spec corresponding to xml-node x0. NULL if no x0 + * @param[in] y Yang spec corresponding to xml-node x0. NULL if x0 is NULL + * @param[in] yspec Top-level yang spec (if y is NULL) * Assume x0 and x1 are same on entry and that y is the spec * @see put in clixon_keyvalue.c - * XXX: x1 är det som är under x0 */ static int text_modify(cxobj *x0, diff --git a/README.develop b/develop.md similarity index 65% rename from README.develop rename to develop.md index c260d2a7..a5b07413 100644 --- a/README.develop +++ b/develop.md @@ -1,11 +1,12 @@ -This README contains information for developers: +# README for developers Clixon developers + 1. How to document the code 2. How to work in git (branching) 3. How the meta-configure stuff works -1. How to document the code -+++++++++++++++++++++++++++ +## How to document the code +``` /*! This is a small comment on one line * * This is a detailed description @@ -22,36 +23,17 @@ This README contains information for developers: * @retval FALSE This is a description of another return value * @see See also this function */ +``` +## How to work in git (branching) -2. How to work in git (branching) -+++++++++++++++++++++++++++++++++ Basically follows: http://nvie.com/posts/a-successful-git-branching-model/ only somewhat simplified: Do commits in develop branch. When done, merge with master. -$ git checkout develop -Switch to branch develop -$ git add .. -$ git commit .. -$ git push origin develop -Add/commit stuff here (and push) - -Ready for tagging ------------------ -(This is somewhat simplified - no release branch) -$ ./bump-version.sh 3.6.0 -Files modified successfully, version bumped to 3.6.0 -$ git checkout master -Switch to master -$ git merge --no-ff develop -Merge made by recursive. -(Summary of changes) -$ git tag -a 3.6.0 - -3. How the meta-configure stuff works -+++++++++++++++++++++++++++++++++++++ +## How the meta-configure stuff works +``` configure.ac --. | .------> autoconf* -----> configure [aclocal.m4] --+---+ @@ -64,4 +46,4 @@ configure.ac --. [config.h.in] -. v .-> [config.h] -. +--> config.status* -+ +--> make* Makefile.in ---' `-> Makefile ---' - +``` diff --git a/doc/FAQ.txt b/doc/FAQ.md similarity index 100% rename from doc/FAQ.txt rename to doc/FAQ.md diff --git a/example/README b/example/README.md similarity index 86% rename from example/README rename to example/README.md index e449d864..b03e4cf5 100644 --- a/example/README +++ b/example/README.md @@ -1,8 +1,8 @@ -Clixon yang routing example -+++++++++++++++++++++++++++ +# Clixon yang routing example -0. Compile and run ------------------- + +## Compile and run +``` cd example make && sudo make install # Start backend @@ -11,9 +11,10 @@ clixon_backend -f /usr/local/etc/routing.conf -I clixon_cli -f /usr/local/etc/routing.conf # Send netconf command clixon_netconf -f /usr/local/etc/routing.conf +``` -1. Setting data example using netconf -------------------------------------- +## Setting data example using netconf +``` @@ -28,10 +29,10 @@ clixon_netconf -f /usr/local/etc/routing.conf ]]>]]> +``` -2. Getting data using netconf ------------------------------ - +## Getting data using netconf +``` ]]>]]> ]]>]]> @@ -43,25 +44,29 @@ clixon_netconf -f /usr/local/etc/routing.conf ]]>]]> ]]>]]> +``` + +## Creating notification -3. Creating notification ------------------------- The example has an example notification triggering every 10s. To start a notification stream in the session, create a subscription: +``` ROUTING]]>]]> ]]>]]> Routing notification]]>]]> Routing notification]]>]]> ... - +``` This can also be triggered via the CLI: +``` cli> notify cli> Routing notification Routing notification ... +``` + +## Extending -4. Downcall ------------ Clixon has an extension mechanism which can be used to make extended internal netconf messages to the backend configuration engine. You may need this to make some special operation that is not covered by standard @@ -71,11 +76,13 @@ reference. A more realistic downcall would perform some action, such as reading some status. Example: +``` cli> downcall "This is a string" This is a string -cli>p +``` -5. Run as docker container --------------------------- +## Run as docker container +``` cd docker # look in README +``` \ No newline at end of file diff --git a/lib/src/clixon_proto.c b/lib/src/clixon_proto.c index 990e1766..bd782234 100644 --- a/lib/src/clixon_proto.c +++ b/lib/src/clixon_proto.c @@ -301,7 +301,6 @@ clicon_msg_send(int s, strerror(errno), ntohs(msg->op_len), msg->op_body); goto done; } - ok: retval = 0; done: return retval; diff --git a/test/README b/test/README deleted file mode 100644 index e65ab4c3..00000000 --- a/test/README +++ /dev/null @@ -1,9 +0,0 @@ -This directory contains testing code for clixon and the example -routing application: - clixon A top-level script clones clixon in /tmp and starts all.sh - You can _copy_ this file (review it) and place as cron script - all.sh Run through all tests named 'test*.sh' in this directory. - Therefore, if you place a test in this directory matching - 'test*.sh' it will be run automatically. - test1.sh First test - test2.sh Second test,... diff --git a/test/README.md b/test/README.md new file mode 100644 index 00000000..4c13fdd1 --- /dev/null +++ b/test/README.md @@ -0,0 +1,11 @@ +# CLixon tests + +This directory contains testing code for clixon and the example +routing application: +- clixon A top-level script clones clixon in /tmp and starts all.sh. You can _copy_ this file (review it) and place as cron script +- all.sh Run through all tests named 'test*.sh' in this directory. Therefore, if you place a test in this directory matching 'test*.sh' it will be run automatically. +- test1.sh CLI tests +- test2.sh Netconf tests +- test3.sh Restconf tests +- test4.sh Yang tests +- test5.sh Datastore tests