* 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:
parent
c4b0491754
commit
09a2e09848
54 changed files with 590 additions and 711 deletions
|
|
@ -712,13 +712,13 @@ compare_dbs(clicon_handle h,
|
|||
if (clicon_rpc_get_config(h, NULL, "running", "/", NULL, &xc1) < 0)
|
||||
goto done;
|
||||
if ((xerr = xpath_first(xc1, NULL, "/rpc-error")) != NULL){
|
||||
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
|
||||
clixon_netconf_error(OE_NETCONF, xerr, "Get configuration", NULL);
|
||||
goto done;
|
||||
}
|
||||
if (clicon_rpc_get_config(h, NULL, "candidate", "/", NULL, &xc2) < 0)
|
||||
goto done;
|
||||
if ((xerr = xpath_first(xc2, NULL, "/rpc-error")) != NULL){
|
||||
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
|
||||
clixon_netconf_error(OE_NETCONF, xerr, "Get configuration", NULL);
|
||||
goto done;
|
||||
}
|
||||
if (compare_xmls(xc1, xc2, astext) < 0) /* astext? */
|
||||
|
|
@ -795,7 +795,7 @@ load_config_file(clicon_handle h,
|
|||
clicon_err(OE_UNIX, errno, "open(%s)", filename);
|
||||
goto done;
|
||||
}
|
||||
if (xml_parse_file(fd, NULL, &xt) < 0)
|
||||
if (clixon_xml_parse_file(fd, YB_NONE, NULL, NULL, &xt, NULL) < 0)
|
||||
goto done;
|
||||
if (xt == NULL)
|
||||
goto done;
|
||||
|
|
@ -882,7 +882,7 @@ save_config_file(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;
|
||||
}
|
||||
/* get-config returns a <data> tree. Save as <config> tree so it can be used
|
||||
|
|
@ -1222,7 +1222,7 @@ cli_copy_config(clicon_handle h,
|
|||
if (clicon_rpc_get_config(h, NULL, db, cbuf_get(cb), nsc, &x1) < 0)
|
||||
goto done;
|
||||
if ((xerr = xpath_first(x1, NULL, "/rpc-error")) != NULL){
|
||||
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
|
||||
clixon_netconf_error(OE_NETCONF, xerr, "Get configuration", NULL);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue