Misc formatting

This commit is contained in:
Olof hagsand 2025-01-10 16:27:40 +01:00
parent 43d9bc845d
commit 3be786c211
7 changed files with 165 additions and 168 deletions

View file

@ -1,7 +1,7 @@
/*
*
***** BEGIN LICENSE BLOCK *****
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
Copyright (C) 2017-2019 Olof Hagsand
Copyright (C) 2020-2022 Olof Hagsand and Rubicon Communications, LLC(Netgate)
@ -25,14 +25,14 @@
in which case the provisions of the GPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of the GPL, and not to allow others to
use your version of this file under the terms of Apache License version 2,
use your version of this file under the terms of Apache License version 2,
indicate your decision by deleting the provisions above and replace them with
the notice and other provisions required by the GPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the Apache License version 2 or the GPL.
***** END LICENSE BLOCK *****
*
*
*/
#ifdef HAVE_CONFIG_H
@ -191,8 +191,8 @@ cli_signal_flush(clixon_handle h)
* @param[in] cvv
* @retval 0 OK
* @retval -1 Error
* Create and add an XML body as child of XML node xbot. Set its value to the last
* CLI variable vector element.
* Create and add an XML body as child of XML node xbot. Set its value to the last
* CLI variable vector element.
*/
int
dbxml_body(cxobj *xbot,
@ -364,8 +364,8 @@ mtpoint_paths(yang_stmt *yspec0,
/*! Modify xml datastore from a callback using xml key format strings
*
* @param[in] h Clixon handle
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] argv Arguments given at the callback:
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] argv Arguments given at the callback:
* <api_path_fmt> Generated API PATH (this is added implicitly, not actually given in the cvv)
* <api_path_fmt>* Added by merge in treeref_merge_co
* [<mt-point>] Optional YANG path-arg/xpath from mount-point
@ -383,8 +383,8 @@ mtpoint_paths(yang_stmt *yspec0,
* argv[0] = "/interfaces/interface/%s/type"
* op: OP_MERGE
* @see cli_callback_generate where arg is generated
* @note The last value may require namespace binding present in nsctx. Note that the nsctx
* cannot normally be supplied by the clispec functions, such as cli_set, but need to be
* @note The last value may require namespace binding present in nsctx. Note that the nsctx
* cannot normally be supplied by the clispec functions, such as cli_set, but need to be
* generated by a function such as clixon_instance_id_bind() or other programmatically.
*/
int
@ -439,7 +439,7 @@ cli_dbxml(clixon_handle h,
/* Get and combined api-path01 */
if (mtpoint_paths(yspec0, mtpoint, api_path_fmt, &api_path_fmt01) < 0)
goto done;
/* Transform template format string + cvv to actual api-path
/* Transform template format string + cvv to actual api-path
* cvvi indicates if all cvv entries were used
*/
if (api_path_fmt2api_path(api_path_fmt01, cvv, yspec0, &api_path, &cvvi) < 0)
@ -447,7 +447,7 @@ cli_dbxml(clixon_handle h,
}
else {
/* Only top-level tree */
/* Transform template format string + cvv to actual api-path
/* Transform template format string + cvv to actual api-path
* cvvi indicates if all cvv entries were used
*/
if (api_path_fmt2api_path(api_path_fmt, cvv, yspec0, &api_path, &cvvi) < 0)
@ -524,7 +524,7 @@ cli_dbxml(clixon_handle h,
/*! Set datastore xml entry
*
* @param[in] h Clixon handle
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] argv Vector. First element xml key format string, eg "/aaa/%s"
* @retval 0 OK
* @retval -1 Error
@ -546,7 +546,7 @@ cli_set(clixon_handle h,
/*! Merge datastore xml entry
*
* @param[in] h Clixon handle
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] argv Vector. First element xml key format string, eg "/aaa/%s"
* @retval 0 OK
* @retval -1 Error
@ -568,7 +568,7 @@ cli_merge(clixon_handle h,
/*! Create datastore xml entry
*
* @param[in] h Clixon handle
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] argv Vector. First element xml key format string, eg "/aaa/%s"
* @retval 0 OK
* @retval -1 Error
@ -590,7 +590,7 @@ cli_create(clixon_handle h,
/*! Remove datastore xml entry
*
* @param[in] h Clixon handle
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] argv Vector. First element xml key format string, eg "/aaa/%s"
* @retval 0 OK
* @retval -1 Error
@ -613,7 +613,7 @@ cli_remove(clixon_handle h,
/*! Delete datastore xml
*
* @param[in] h Clixon handle
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] cvv Vector of cli string and instantiated variables
* @param[in] argv Vector. First element xml key format string, eg "/aaa/%s"
* @retval 0 OK
* @retval -1 Error
@ -830,7 +830,7 @@ cli_commit(clixon_handle h,
/*! Generic validate callback
* @param[in] h Clixon handle
* @param[in] cvv Vector of command variables
* @param[in] argv
* @param[in] argv
* @retval 0 OK
* @retval -1 Error
*/
@ -884,7 +884,7 @@ compare_db_names(clixon_handle h,
goto done;
goto done;
}
/* Note that XML and TEXT uses a (new) structured in-mem algorithm while
/* Note that XML and TEXT uses a (new) structured in-mem algorithm while
* JSON and CLI uses (old) UNIX file diff.
*/
switch (format){
@ -927,7 +927,7 @@ compare_db_names(clixon_handle h,
/*! Compare two dbs using XML. Write to file and run diff
*
* @param[in] h Clixon handle
* @param[in] cvv
* @param[in] cvv
* @param[in] argv <db1> <db2> <format>
* @retval 0 OK
* @retval -1 Error
@ -981,8 +981,8 @@ compare_dbs(clixon_handle h,
* <format> "text"|"xml"|"json"|"cli"|"netconf" (see format_enum)
* @retval 0 OK
* @retval -1 Error
*
* @note that "filename" is local on client filesystem not backend.
*
* @note that "filename" is local on client filesystem not backend.
* @note file is assumed to have a dummy top-tag, eg <clicon></clicon>
* @code
* # cligen spec
@ -1155,7 +1155,7 @@ load_config_file(clixon_handle h,
* Utility function used by cligen spec file
* @param[in] h Clixon handle
* @param[in] cvv Variable vector (containing <varname>)
* @param[in] argv A string: "<dbname> <varname> [<format>]"
* @param[in] argv A string: "<dbname> <varname> [<format>]"
* <dbname> is running, candidate, or startup
* <varname> is name of cligen variable in the "cvv" vector containing file name
* <format> "text"|"xml"|"json"|"cli"|"netconf" (see format_enum)
@ -1270,12 +1270,12 @@ save_config_file(clixon_handle h,
return retval;
}
/*! Delete all elements in a database
/*! Delete all elements in a database
*
* Utility function used by cligen spec file
* @param[in] h Clixon handle
* @param[in] cvv Vector of command variables
* @param[in] argv
* @param[in] argv
* @retval 0 OK
* @retval -1 Error
*/
@ -1387,7 +1387,7 @@ cli_notification_cb(int s,
}
/*! Make a notify subscription to backend and un/register callback for return messages.
*
*
* @param[in] h Clixon handle
* @param[in] cvv Not used
* @param[in] arg A string with <log stream name> <stream status> [<format>]
@ -1397,7 +1397,7 @@ cli_notification_cb(int s,
* @retval -1 Error
* Example code: Start logging of mystream and show logs as xml
* @code
* cmd("comment"), cli_notify("mystream","1","xml");
* cmd("comment"), cli_notify("mystream","1","xml");
* @endcode
*/
int
@ -1436,14 +1436,14 @@ cli_notify(clixon_handle h,
}
/*! Lock database
*
*
* @param[in] h Clixon handle
* @param[in] cvv Not used
* @param[in] arg A string with <database>
* @param[in] arg A string with <database>
* @retval 0 OK
* @retval -1 Error
* @code
* lock("comment"), cli_lock("running");
* lock("comment"), cli_lock("running");
* @endcode
* XXX: format is a memory leak
*/
@ -1468,14 +1468,14 @@ cli_lock(clixon_handle h,
}
/*! Unlock database
*
*
* @param[in] h Clixon handle
* @param[in] cvv Not used
* @param[in] arg A string with <database>
* @param[in] arg A string with <database>
* @retval 0 OK
* @retval -1 Error
* @code
* lock("comment"), cli_unlock("running");
* lock("comment"), cli_unlock("running");
* @endcode
* XXX: format is a memory leak
*/
@ -1500,7 +1500,7 @@ cli_unlock(clixon_handle h,
}
/*! Kill session
*
*
* @param[in] h Clixon handle
* @param[in] cvv Not used
* @param[in] arg variabel w session nr
@ -1538,8 +1538,8 @@ cli_kill_session(clixon_handle h,
/*! Copy one configuration object to antother
*
* Works for objects that are items in a yang list with a keyname, eg as:
* list sender{
* key name;
* list sender{
* key name;
* leaf name{...
*
* @param[in] h Clixon handle
@ -1682,7 +1682,7 @@ cli_copy_config(clixon_handle h,
*
* @param[in] h Clixon handle
* @param[in] cvv Not used
* @param[in] arg A string with <database>
* @param[in] arg A string with <database>
* @retval 0 OK
* @retval -1 Error
*/
@ -1702,11 +1702,11 @@ cli_help(clixon_handle h,
*
* @param[in] h Clixon handle
* @param[in] cvv Not used
* @param[in] arg A string with <database>
* @param[in] arg A string with <database>
* @retval 0 OK
* @retval -1 Error
* @code
* restart("comment") , cli_restart_plugin("myplugin", "restart");
* restart("comment") , cli_restart_plugin("myplugin", "restart");
* @endcode
*/
int
@ -1733,6 +1733,10 @@ cli_restart_plugin(clixon_handle h,
/* Append cvv1 to cvv0 and return a new cvec
*
* @param[in] cvv0 First cvv
* @param[in] cvv1 Second cvv
* @retval cvv New cvv, free with cvec_free
* @retval NULL Error
* @note if cvv0 is non-null, the first element of cvv1 is skipped
*/
cvec*
@ -1807,7 +1811,7 @@ cvec_concat_cb(cvec *cvv,
* @retval 0 OK
* @retval -1 Error
* @code
* actions-daemon("Actions daemon operations") start,
* actions-daemon("Actions daemon operations") start,
* cli_process_control("Action process", "start");
* @endcode
*/