Skip to content

Commit

Permalink
Formatting and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Oct 16, 2024
1 parent f87ff85 commit 3cad374
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 95 deletions.
15 changes: 7 additions & 8 deletions apps/backend/backend_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ client_get_streams(clixon_handle h,
* message. But this needs to be explored in all sub-functions
*/
static int
get_statedata(clixon_handle h,
char *xpath,
cvec *nsc,
cxobj **xret)
get_state_data(clixon_handle h,
char *xpath,
cvec *nsc,
cxobj **xret)
{
int retval = -1;
yang_stmt *yspec;
Expand Down Expand Up @@ -777,7 +777,7 @@ get_list_pagination(clixon_handle h,
}
else {
if (content != CONTENT_CONFIG){
if ((ret = get_statedata(h, xpath?xpath:"/", nsc, &xret)) < 0)
if ((ret = get_state_data(h, xpath?xpath:"/", nsc, &xret)) < 0)
goto done;
if (ret == 0){ /* Error from callback (error in xret) */
if (clixon_xml2cbuf(cbret, xret, 0, 0, NULL, -1, 0) < 0)
Expand Down Expand Up @@ -959,8 +959,8 @@ get_common(clixon_handle h,
withdefaults_type wdef;
char *wdefstr;

wdef = WITHDEFAULTS_EXPLICIT;
clixon_debug(CLIXON_DBG_BACKEND | CLIXON_DBG_DETAIL, "");
wdef = WITHDEFAULTS_EXPLICIT;
username = clicon_username_get(h);
if ((yspec = clicon_dbspec_yang(h)) == NULL){
clixon_err(OE_YANG, ENOENT, "No yang spec9");
Expand Down Expand Up @@ -1008,7 +1008,6 @@ get_common(clixon_handle h,
* If it is empty, all are default values and is regular get
*/
if ((xlpg = xml_find_type(xe, NULL, "list-pagination", CX_ELMNT)) != NULL){

if ((xlpg2 = xml_dup(xlpg)) == NULL)
goto done;
if (xml_default_nopresence(xlpg2, 2, 0) < 0)
Expand Down Expand Up @@ -1095,7 +1094,7 @@ get_common(clixon_handle h,
break;
case CONTENT_ALL: /* both config and state */
case CONTENT_NONCONFIG: /* state data only */
if ((ret = get_statedata(h, xpath?xpath:"/", nsc, &xret)) < 0)
if ((ret = get_state_data(h, xpath?xpath:"/", nsc, &xret)) < 0)
goto done;
if (ret == 0){ /* Error from callback (error in xret) */
if (clixon_xml2cbuf(cbret, xret, 0, 0, NULL, -1, 0) < 0)
Expand Down
4 changes: 0 additions & 4 deletions apps/backend/backend_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ clixon_plugin_daemon_all(clixon_handle h)
* @param[in] h clicon handle
* @param[in] nsc namespace context for xpath
* @param[in] xpath String with XPATH syntax. or NULL for all
* @param[in] pagmode List pagination mode
* @param[in] offset Offset, for list pagination
* @param[in] limit Limit, for list pagination
* @param[out] remaining Remaining elements (if limit is non-zero)
* @param[out] xp If retval=1, state tree created and returned: <config>...
* @retval 1 OK if callback found (and called) xret is set
* @retval 0 Statedata callback failed. no XML tree returned
Expand Down
1 change: 1 addition & 0 deletions example/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Send netconf command:
clixon_netconf -f /usr/local/etc/clixon/example.xml
```
Start clixon restconf daemon (default config listens on http IPv4 0.0.0.0 on port 8080):
(Warning: starting the native restconf daemon opens ports that may make your system less secure)
```
sudo clixon_restconf -f /usr/local/etc/clixon/example.xml
```
Expand Down
Loading

0 comments on commit 3cad374

Please sign in to comment.