Typo in xpath ilen

Doc of backend code
This commit is contained in:
Olof hagsand 2023-01-02 21:21:37 +01:00
parent 6fedf65de7
commit 0df023c70e
3 changed files with 34 additions and 32 deletions

View file

@ -159,8 +159,8 @@ release_all_dbs(clicon_handle h,
* Finally actually remove client struct in handle * Finally actually remove client struct in handle
* @param[in] h Clicon handle * @param[in] h Clicon handle
* @param[in] ce Client handle * @param[in] ce Client handle
* @retval -1 Error (fatal)
* @retval 0 Ok * @retval 0 Ok
* @retval -1 Error (fatal)
* @see backend_client_delete for actual deallocation of client entry struct * @see backend_client_delete for actual deallocation of client entry struct
*/ */
int int
@ -300,7 +300,7 @@ clixon_stats_module_get(clicon_handle h,
/*! Loads all or part of a specified configuration to target configuration /*! Loads all or part of a specified configuration to target configuration
* *
* @param[in] h Clicon handle * @param[in] h Clicon handle
* @param[in] xe Request: <rpc><xn></rpc> * @param[in] xn Request: <rpc><xn></rpc>
* @param[out] cbret Return xml tree, eg <rpc-reply>..., <rpc-error.. * @param[out] cbret Return xml tree, eg <rpc-reply>..., <rpc-error..
* @param[in] arg client-entry * @param[in] arg client-entry
* @param[in] regarg User argument given at rpc_callback_register() * @param[in] regarg User argument given at rpc_callback_register()
@ -1402,8 +1402,8 @@ from_client_hello(clicon_handle h,
/*! An internal clicon message has arrived from a client. Receive and dispatch. /*! An internal clicon message has arrived from a client. Receive and dispatch.
* @param[in] h Clicon handle * @param[in] h Clicon handle
* @param[in] s Socket where message arrived. read from this. * @param[in] ce Client entry (from)
* @param[in] arg Client entry (from). * @param[in] msg Incoming message
* @retval 0 OK * @retval 0 OK
* @retval -1 Error Terminates backend and is never called). Instead errors are * @retval -1 Error Terminates backend and is never called). Instead errors are
* propagated back to client. * propagated back to client.
@ -1672,8 +1672,8 @@ from_client(int s,
/*! Init backend rpc: Set up standard netconf rpc callbacks /*! Init backend rpc: Set up standard netconf rpc callbacks
* @param[in] h Clicon handle * @param[in] h Clicon handle
* @retval -1 Error (fatal)
* @retval 0 OK * @retval 0 OK
* @retval -1 Error (fatal)
* @see ietf-netconf@2011-06-01.yang * @see ietf-netconf@2011-06-01.yang
*/ */
int int

View file

@ -80,12 +80,13 @@
* string regexp checked. * string regexp checked.
* See also db_lv_set() where defaults are also filled in. The case here for defaults * See also db_lv_set() where defaults are also filled in. The case here for defaults
* are if code comes via XML/NETCONF. * are if code comes via XML/NETCONF.
* @param[in] h Clixon handle
* @param[in] yspec Yang spec * @param[in] yspec Yang spec
* @param[in] td Transaction data * @param[in] td Transaction data
* @param[out] xret Error XML tree. Free with xml_free after use * @param[out] xret Error XML tree. Free with xml_free after use
* @retval -1 Error
* @retval 0 Validation failed (with cbret set)
* @retval 1 Validation OK * @retval 1 Validation OK
* @retval 0 Validation failed (with cbret set)
* @retval -1 Error
*/ */
static int static int
generic_validate(clicon_handle h, generic_validate(clicon_handle h,
@ -138,11 +139,11 @@ generic_validate(clicon_handle h,
* and call application callback validations. * and call application callback validations.
* @param[in] h Clicon handle * @param[in] h Clicon handle
* @param[in] db The startup database. The wanted backend state * @param[in] db The startup database. The wanted backend state
* @param[in] td Transaction * @param[in] td Transaction data
* @param[out] cbret CLIgen buffer w error stmt if retval = 0 * @param[out] cbret CLIgen buffer w error stmt if retval = 0
* @retval -1 Error - or validation failed (but cbret not set)
* @retval 0 Validation failed (with cbret set)
* @retval 1 Validation OK * @retval 1 Validation OK
* @retval 0 Validation failed (with cbret set)
* @retval -1 Error - or validation failed (but cbret not set)
* @note Need to differentiate between error and validation fail * @note Need to differentiate between error and validation fail
* *
* 1. Parse startup XML (or JSON) * 1. Parse startup XML (or JSON)
@ -336,9 +337,9 @@ startup_common(clicon_handle h,
* @param[in] db The startup database. The wanted backend state * @param[in] db The startup database. The wanted backend state
* @param[out] xtr (Potentially) transformed XML * @param[out] xtr (Potentially) transformed XML
* @param[out] cbret CLIgen buffer w error stmt if retval = 0 * @param[out] cbret CLIgen buffer w error stmt if retval = 0
* @retval -1 Error - or validation failed (but cbret not set)
* @retval 0 Validation failed (with cbret set)
* @retval 1 Validation OK * @retval 1 Validation OK
* @retval 0 Validation failed (with cbret set)
* @retval -1 Error - or validation failed (but cbret not set)
*/ */
int int
startup_validate(clicon_handle h, startup_validate(clicon_handle h,
@ -386,9 +387,9 @@ startup_validate(clicon_handle h,
* @param[in] h Clicon handle * @param[in] h Clicon handle
* @param[in] db The startup database. The wanted backend state * @param[in] db The startup database. The wanted backend state
* @param[out] cbret CLIgen buffer w error stmt if retval = 0 * @param[out] cbret CLIgen buffer w error stmt if retval = 0
* @retval -1 Error - or validation failed (but cbret not set)
* @retval 0 Validation failed (with cbret set)
* @retval 1 Validation OK * @retval 1 Validation OK
* @retval 0 Validation failed (with cbret set)
* @retval -1 Error - or validation failed (but cbret not set)
* Only called from startup_mode_startup * Only called from startup_mode_startup
*/ */
int int
@ -462,11 +463,12 @@ startup_commit(clicon_handle h,
* Get both source and dest datastore, validate target, compute diffs * Get both source and dest datastore, validate target, compute diffs
* and call application callback validations. * and call application callback validations.
* @param[in] h Clicon handle * @param[in] h Clicon handle
* @param[in] candidate The candidate database. The wanted backend state * @param[in] db The (candidate) database. The wanted backend state
* @param[in] td Transaction data
* @param[out] xret Error XML tree, if retval is 0. Free with xml_free after use * @param[out] xret Error XML tree, if retval is 0. Free with xml_free after use
* @retval -1 Error - or validation failed (but cbret not set)
* @retval 0 Validation failed (with xret set)
* @retval 1 Validation OK * @retval 1 Validation OK
* @retval 0 Validation failed (with xret set)
* @retval -1 Error - or validation failed (but cbret not set)
* @note Need to differentiate between error and validation fail * @note Need to differentiate between error and validation fail
* (only done for generic_validate) * (only done for generic_validate)
* @see startup_common for startup scenario * @see startup_common for startup scenario
@ -569,9 +571,10 @@ validate_common(clicon_handle h,
* *
* @param[in] h Clicon handle * @param[in] h Clicon handle
* @param[in] db A candidate database, typically "candidate" but not necessarily so * @param[in] db A candidate database, typically "candidate" but not necessarily so
* @retval -1 Error - or validation failed * @param[out] cbret CLIgen buffer w error stmt if retval = 0
* @retval 0 Validation failed (with cbret set)
* @retval 1 Validation OK * @retval 1 Validation OK
* @retval 0 Validation failed (with cbret set)
* @retval -1 Error - or validation failed
*/ */
int int
candidate_validate(clicon_handle h, candidate_validate(clicon_handle h,
@ -646,9 +649,9 @@ candidate_validate(clicon_handle h,
* @param[in] xe Request: <rpc><xn></rpc> (or NULL) * @param[in] xe Request: <rpc><xn></rpc> (or NULL)
* @param[in] db A candidate database, not necessarily "candidate" * @param[in] db A candidate database, not necessarily "candidate"
* @param[out] cbret Return xml tree, eg <rpc-reply>..., <rpc-error.. (if retval = 0) * @param[out] cbret Return xml tree, eg <rpc-reply>..., <rpc-error.. (if retval = 0)
* @retval -1 Error - or validation failed
* @retval 0 Validation failed (with cbret set)
* @retval 1 Validation OK * @retval 1 Validation OK
* @retval 0 Validation failed (with cbret set)
* @retval -1 Error - or validation failed
*/ */
int int
candidate_commit(clicon_handle h, candidate_commit(clicon_handle h,

View file

@ -875,7 +875,6 @@ xpath_vec_flag(cxobj *xcur,
goto done; goto done;
if (xr && xr->xc_type == XT_NODESET){ if (xr && xr->xc_type == XT_NODESET){
for (i=0; i<xr->xc_size; i++){ for (i=0; i<xr->xc_size; i++){
int ilen;
x = xr->xc_nodeset[i]; x = xr->xc_nodeset[i];
if (flags==0x0 || xml_flag(x, flags)) if (flags==0x0 || xml_flag(x, flags))
if (cxvec_append(x, vec, &ilen) < 0) if (cxvec_append(x, vec, &ilen) < 0)