* xml-stats moved from clixon-config.yang as state data to an rpc datastatsin clixon-lib.yang

* Two new plugin callbacks added
  * ca_daemon: Called just after a server has "daemonized", ie put in background.
  * ca_trans_commit_done: Called when all plugin commits have been done.
This commit is contained in:
Olof hagsand 2020-04-23 22:58:57 +02:00
parent 65806f1ef2
commit 1c99bd6a9b
20 changed files with 290 additions and 112 deletions

View file

@ -284,18 +284,24 @@ xml_stats_one(cxobj *x,
}
/*! Return statistics of an XML tree recursively
* @param[in] x XML object
* @param[in] xt XML object
* @param[out] szp Size of this XML obj recursively
* @retval 0 OK
* @retval -1 Error
*/
size_t
int
xml_stats(cxobj *xt,
uint64_t *nrp,
size_t *szp)
{
int retval = -1;
size_t sz = 0;
cxobj *xc;
if (xt == NULL){
clicon_err(OE_XML, EINVAL, "xml node is NULL");
goto done;
}
*nrp += 1;
xml_stats_one(xt, &sz);
if (szp)
@ -308,7 +314,9 @@ xml_stats(cxobj *xt,
*szp += sz;
}
clicon_debug(1, "%s %zu", __FUNCTION__, *szp);
return 0;
retval = 0;
done:
return retval;
}
/*