Commit graph

33 commits

Author SHA1 Message Date
Olof Hagsand
99c6f61637 Enhanced for client-side functionality:
- parse of yang from string, not only file
- Decode of xml encoding, not only decoding
2023-01-02 21:29:28 +01:00
Olof Hagsand
f46d675370 Netconf: remove operations attribute from edit-config operations
Added `ISO/IEC 10646` encodings to XML parser: `&#[0-9]+;` and `&#[0-9a-fA-F]+;`
2022-12-20 09:38:42 +01:00
Olof hagsand
d84c529ff1 [Code formatting: Change indentation style to space](https://github.com/clicon/clixon/issues/379)
* Applies to all c/h/y/l/sh files and .editorconfig
2022-10-27 14:21:17 +02:00
Olof hagsand
9d65fb81d7 * Break-out RFC 7950 Section 6.1 tokenization
* This enables full string lexical parsing of some rules previously not fully compliant, including:
    * refine
    * user-augment
    * if-feature
  * Also solves previous tokenization issues
2022-07-25 09:25:11 +02:00
Olof hagsand
77b4468eb3 Updated copyright statements to 2022 2022-01-18 16:36:00 +01:00
Olof hagsand
96b50b88e8 Copyright 2021 2021-01-13 14:40:34 +01:00
Olof hagsand
94cf4a88b3 * Optimizations
* Reduced memory for attribute and body objects, see `XML_NEW_DIFFERENTIATE` compile-time option.
  * Optimized cbuf handling in parsing and xml2cbuf functions.
  * Optimized xml scanner to read strings rather than single chars
  * Optimized xml_merge for the case of disjunct trees.
2020-04-28 22:31:58 +02:00
Olof hagsand
65806f1ef2 Copyright change: LLC -> LLC(Netgate) 2020-04-23 16:55:56 +02:00
Olof hagsand
3b26b22391 internal type/var/prefix name changes for yacc parsing 2020-02-22 11:15:51 +01:00
Olof hagsand
9fa5e216c4 * New "general-purpose" datastore upgrade callback added which i called once on startup, intended for lo
w-level general upgrades and as a complement to module-specific upgrade.
  * Called on startup after initial XML parsing, but before module-specific upgrades
  * Enabled by definign the `.ca_datastore_upgrade`
  * [General-purpose upgrade documentation](https://clixon-docs.readthedocs.io/en/latest/backend.html#ge
neral-purpose)
* JSON parse error messages change from ` on line x: syntax error,..` to `json_parse: line x: syntax err
or`
* Unknown-element error message is more descriptive, eg from `namespace is: urn:example:clixon` to: `Fai
led to find YANG spec of XML node: x with parent: xp in namespace urn:example:clixon`.
* C-API parse and validation API more capable
  * `xml_spec_populate` family of functions extended with three-value return values
    * -1: error, 0: parse OK, 1: parse and YANG binding OK.
  * `xml_parse` and `json_parse` API changes
    * Three value returns: -1: error, 0: parse OK, 1: parse and YANG binding OK.
    * Extended `xml_parse_file2` and `xml_parse_string2` extended API functions with all options available.
      * New concept called `yang_bind` that defines how XML symbols are bound to YANG after parsing
    * Existing API same except `xml_parse_file` `endtag` argument moved to `xml_parse_file2`
* C-API: Added instrumentation: `xml_size` and `xml_stats_get`.
* Fixed: Enabling modstate (CLICON_XMLDB_MODSTATE), changing a revision on a yang, and restarting made the backend daemon exit at start (thanks Matt)
  * Also: ensure to load `ietf-yang-library.yang ` if CLICON_XMLDB_MODSTATE is set
2020-02-20 14:00:01 +01:00
Olof hagsand
a674af6f2c Cleaning up code for xml insignificant whitespace removal
Experimenal explicit index search code
2020-02-07 14:59:57 +01:00
Olof hagsand
ab46ce9820 XML parser failed on ]]]> termination of CDATA. 2019-12-19 21:43:03 +01:00
Olof hagsand
039e08f86a [xml_parse_string() is slow for a long XML string #96](https://github.com/clicon/clixon/issues/96) 2019-11-14 20:57:20 +01:00
Olof hagsand
8c36083e16 * A yang type regex cache added, this helps the performance by avoiding re-running the regcomp command on every iteration.
* An XML namespace cache added (see `xml2ns()`)
* Better performance of XML whitespace parsing/scanning.
2019-04-19 16:01:39 +02:00
Olof Hagsand
66d8573c00 Added docker/base as minimal clixon container and docker/system as full clixon system. 2019-02-11 14:17:29 +01:00
Olof hagsand
03ac48ab2b Removing newlines from XML data [https://github.com/clicon/clixon/issues/65] 2019-01-16 23:17:07 +01:00
Olof hagsand
207858e20d * Support of yangmodels supported, see test_yangmodels.sh
* Added -o "<option>=<value>" command-line option to all programs: backend, cli, netconf, restconf.
* Ignore CR(\r) in yang files for DOS files
2019-01-10 20:52:19 +01:00
Olof hagsand
0103d58994 2019 2019-01-02 15:48:30 +01:00
Olof hagsand
9c57902b96 * XML parser conformance to W3 spec
* Names lexically correct (NCName)
  * Syntactically Correct handling of '<?' (processing instructions) and '<?xml' (XML declaration)
  * XML prolog syntax for 'well-formed' XML
  * <!DOCTYPE (ie DTD) is not supported.
2018-11-18 13:22:08 +01:00
Olof hagsand
7450eae046 * No space after ampersand escaped characters in XML https://github.com/clicon/clixon/issues/52
* Thanks @SCadilhac
2018-10-29 21:41:16 +01:00
Olof hagsand
906763317b * Single quotes for XML attributes https://github.com/clicon/clixon/issues/51
* Thanks @SCadilhac
2018-10-28 11:15:37 +01:00
Olof hagsand
85c4782e36 Dedicated xml,json,yang and xsl parser utility programs added
Sanity check of stdarg (...) added
Cleanup of error messages.
2018-06-17 19:40:06 +02:00
Olof hagsand
9eff879458 CDATA Encode and decode (parsing) support 2018-06-13 22:55:46 +02:00
Dave Cornejo
e2ee6e6757 handle newlines in CDATA properly 2018-06-07 17:56:07 -10:00
Dave Cornejo
8f9a38d2aa add handling of CDATA to XML parser 2018-06-07 13:26:18 -10:00
Olof hagsand
1ac57dedaf Some memleaks and last minute 3.6 release changes. 2018-04-29 18:35:06 +02:00
Olof hagsand
67c0abead7 Fixed issue https://github.com/clicon/clixon/issues/17 special character in strings can break RPCs 2018-04-21 16:32:46 +02:00
Olof hagsand
38f0b446fa 2017->2018 2018-01-01 12:25:33 +01:00
Olof hagsand
e169485985 Datastore cache introduced; Added yang to XML API 2017-12-02 14:49:49 +01:00
Olof hagsand
7a7bfc48a4 experimental xml hash for better performance 2017-09-18 20:53:49 +02:00
Olof hagsand
7880b5d498 mem leak in lex for flex 2.6 2017-04-07 10:59:30 +02:00
Olof hagsand
bc2b606167 dual license 2016-12-30 16:14:48 +01:00
Olof Hagsand
79b77943f9 renamed .h and libs clicon->clixon 2016-02-28 15:27:36 +01:00
Renamed from lib/src/clicon_xml_parse.l (Browse further)