* C-API: Added clicon_handle parameter to all xml_bind_* calls

This commit is contained in:
Olof hagsand 2023-01-27 10:59:20 +01:00 committed by Olof Hagsand
parent da9bfcbb53
commit 51ebbdf12f
21 changed files with 102 additions and 62 deletions

View file

@ -487,7 +487,7 @@ from_client_edit_config(clicon_handle h,
xml_spec_set(xc, NULL);
/* Populate XML with Yang spec (why not do this in parser?)
*/
if ((ret = xml_bind_yang(xc, YB_MODULE, yspec, &xret)) < 0)
if ((ret = xml_bind_yang(h, xc, YB_MODULE, yspec, &xret)) < 0)
goto done;
if (ret == 0){
if (clixon_xml2cbuf(cbret, xret, 0, 0, -1, 0) < 0)

View file

@ -231,7 +231,7 @@ startup_common(clicon_handle h,
/* Print upgraded db: -q backend switch for debugging/ showing upgraded config only */
if (clicon_quit_upgrade_get(h) == 1){
/* bind yang */
if ((ret = xml_bind_yang(xt, YB_MODULE, yspec, &xret)) < 1){
if ((ret = xml_bind_yang(h, xt, YB_MODULE, yspec, &xret)) < 1){
if (ret == 0){
/* invalid */
clicon_err(OE_XML, EFAULT, "invalid configuration");
@ -257,7 +257,7 @@ startup_common(clicon_handle h,
goto ok;
}
/* After upgrading, XML tree needs to be sorted and yang spec populated */
if ((ret = xml_bind_yang(xt, YB_MODULE, yspec, &xret)) < 0)
if ((ret = xml_bind_yang(h, xt, YB_MODULE, yspec, &xret)) < 0)
goto done;
if (ret == 0){
if (clixon_xml2cbuf(cbret, xret, 0, 0, -1, 0) < 0)

View file

@ -761,7 +761,7 @@ get_list_pagination(clicon_handle h,
}
/* System makes the binding */
if ((ret = xml_bind_yang(xret, YB_MODULE, yspec, &xerr)) < 0)
if ((ret = xml_bind_yang(h, xret, YB_MODULE, yspec, &xerr)) < 0)
goto done;
if (ret == 0){
clicon_debug_xml(1, xret, "Yang bind pagination state");

View file

@ -370,7 +370,7 @@ clixon_plugin_statedata_all(clicon_handle h,
}
clicon_debug_xml(CLIXON_DBG_DETAIL, x, "%s %s STATE:", __FUNCTION__, clixon_plugin_name_get(cp));
/* XXX: ret == 0 invalid yang binding should be handled as internal error */
if ((ret = xml_bind_yang(x, YB_MODULE, yspec, &xerr)) < 0)
if ((ret = xml_bind_yang(h, x, YB_MODULE, yspec, &xerr)) < 0)
goto done;
if (ret == 0){
if (clixon_netconf_internal_error(xerr,

View file

@ -237,7 +237,7 @@ load_extraxml(clicon_handle h,
if (xt)
xml_name_set(xt, NETCONF_INPUT_CONFIG);
/* Now we can yang bind */
if ((ret = xml_bind_yang(xt, YB_MODULE, yspec, &xerr)) < 0)
if ((ret = xml_bind_yang(h, xt, YB_MODULE, yspec, &xerr)) < 0)
goto done;
if (ret == 0){
if (netconf_err2cb(xerr, cbret) < 0)