Add ping to cli example, misc debug
This commit is contained in:
parent
379644a570
commit
30f9e174fa
7 changed files with 74 additions and 8 deletions
|
|
@ -1959,7 +1959,6 @@ netconf_hello_server(clixon_handle h,
|
|||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*! Add internal error info to existing netconf error message by rewriting
|
||||
*
|
||||
* If a eg sanity check detects errors in internal messages passing, such as from a plugin or
|
||||
|
|
|
|||
|
|
@ -1496,6 +1496,7 @@ yn_insert1(yang_stmt *ys_parent,
|
|||
* ...ynext...
|
||||
* }
|
||||
* @endcode
|
||||
* @note NULL children are skipped, which means inext may increment by more than 1
|
||||
*/
|
||||
yang_stmt *
|
||||
yn_iter(yang_stmt *yparent,
|
||||
|
|
@ -2496,6 +2497,22 @@ yang_spec_dump(yang_stmt *yspec,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/*! Dump pointers to children, debug function
|
||||
*/
|
||||
int
|
||||
yang_dump1(FILE *f,
|
||||
yang_stmt *yn)
|
||||
{
|
||||
yang_stmt *ys;
|
||||
int inext;
|
||||
|
||||
inext = 0;
|
||||
while ((ys = yn_iter(yn, &inext)) != NULL) {
|
||||
fprintf(stderr, "%2d %p %s %s\n", inext-1, ys, yang_key2str(yang_keyword_get(ys)), yang_argument_get(ys));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Print yang specification to cligen buf
|
||||
*
|
||||
* @param[in] cb Cligen buffer. This is where the pretty print is.
|
||||
|
|
|
|||
|
|
@ -908,6 +908,7 @@ yang_schema_yspec_rm(clixon_handle h,
|
|||
int retval = -1;
|
||||
yang_stmt *yspec = NULL;
|
||||
char *xpath = NULL;
|
||||
|
||||
int ret;
|
||||
|
||||
if ((ret = xml_yang_mount_get(h, xmnt, NULL, &xpath, &yspec)) < 0)
|
||||
|
|
@ -915,6 +916,18 @@ yang_schema_yspec_rm(clixon_handle h,
|
|||
if (ret == 1 && xpath != NULL && yspec != NULL){
|
||||
if (yang_cvec_rm(yspec, xpath) < 0)
|
||||
goto done;
|
||||
#if 0
|
||||
cvec *cvv;
|
||||
/* see https://github.com/clicon/clixon-controller/issues/169
|
||||
* cannot remove yspec since it may still be in use by caches
|
||||
*/
|
||||
cvv = yang_cvec_get(yspec);
|
||||
if (cvv && cvec_len(cvv) == 0){
|
||||
ys_prune_self(yspec);
|
||||
ys_free(yspec);
|
||||
yspec = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
retval = 0;
|
||||
done:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue