* New XML parsing API:

* `clixon_xml_parse_string()`
   * `clixon_xml_parse_file()`
* New JSON parsing API, with same signature as XML parsing:
   * `clixon_json_parse_string()`
   * `clixon_xml_parse_file()`
* XML YANG binding API have been rearranged as follows:
   * `xml_bind_yang_rpc()`
   * `xml_bind_yang_rpc_reply()`
   * `xml_bind_yang()`
   * `xml_bind_yang0()`
This commit is contained in:
Olof hagsand 2020-03-19 21:32:27 +01:00
parent c4b0491754
commit 09a2e09848
54 changed files with 590 additions and 711 deletions

View file

@ -159,7 +159,7 @@ expand_dbvar(void *h,
if (clicon_rpc_get_config(h, NULL, dbstr, xpath, nsc, &xt) < 0) /* XXX */
goto done;
if ((xe = xpath_first(xt, NULL, "/rpc-error")) != NULL){
clicon_rpc_generate_error(xe, "Get configuration", NULL);
clixon_netconf_error(OE_NETCONF, xe, "Get configuration", NULL);
goto ok;
}
xcur = xt; /* default top-of-tree */
@ -176,7 +176,7 @@ expand_dbvar(void *h,
if ((ret = api_path2xml(api_path, yspec, xtop, YC_DATANODE, 0, &xbot, &y, &xerr)) < 0)
goto done;
if (ret == 0){
clicon_rpc_generate_error(xerr, "Expand datastore symbol", NULL);
clixon_netconf_error(OE_NETCONF, xerr, "Expand datastore symbol", NULL);
goto done;
}
}
@ -492,7 +492,7 @@ cli_show_config1(clicon_handle h,
goto done;
}
if ((xerr = xpath_first(xt, NULL, "/rpc-error")) != NULL){
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
clixon_netconf_error(OE_NETCONF, xerr, "Get configuration", NULL);
goto done;
}
/* Print configuration according to format */
@ -633,7 +633,7 @@ show_conf_xpath(clicon_handle h,
if (clicon_rpc_get_config(h, NULL, str, xpath, nsc, &xt) < 0)
goto done;
if ((xerr = xpath_first(xt, NULL, "/rpc-error")) != NULL){
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
clixon_netconf_error(OE_NETCONF, xerr, "Get configuration", NULL);
goto done;
}
@ -735,7 +735,7 @@ cli_show_auto1(clicon_handle h,
goto done;
}
if ((xerr = xpath_first(xt, NULL, "/rpc-error")) != NULL){
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
clixon_netconf_error(OE_NETCONF, xerr, "Get configuration", NULL);
goto done;
}
if ((xp = xpath_first(xt, nsc, "%s", xpath)) != NULL)