Library functions in clixon_cli_api.h (e.g cli_commit) is rewritten in new
for (eg cli_commitv). See clixon_cli_api.h for new names. Use restconf format for internal xmldb keys. Eg /a/b=3,4 Changed example to use multiple cli callbacks
This commit is contained in:
parent
c9f1ece53e
commit
7f0b9909b3
30 changed files with 1444 additions and 1054 deletions
|
|
@ -68,7 +68,7 @@ plugin_init(clicon_handle h)
|
|||
|
||||
/*! Example cli function */
|
||||
int
|
||||
mycallback(clicon_handle h, cvec *cvv, cg_var *arg)
|
||||
mycallback(clicon_handle h, cvec *cvv, cvec *argv)
|
||||
{
|
||||
int retval = -1;
|
||||
cxobj *xt = NULL;
|
||||
|
|
@ -77,12 +77,11 @@ mycallback(clicon_handle h, cvec *cvv, cg_var *arg)
|
|||
/* Access cligen callback variables */
|
||||
myvar = cvec_find(cvv, "var"); /* get a cligen variable from vector */
|
||||
cli_output(stderr, "%s: %d\n", __FUNCTION__, cv_int32_get(myvar)); /* get int value */
|
||||
cli_output(stderr, "arg = %s\n", cv_string_get(arg)); /* get string value */
|
||||
cli_output(stderr, "arg = %s\n", cv_string_get(cvec_i(argv,0))); /* get string value */
|
||||
|
||||
/* Show eth0 interfaces config using XPATH */
|
||||
if (xmldb_get(h, "candidate",
|
||||
"/interfaces/interface[name=eth0]",
|
||||
0,
|
||||
&xt, NULL, NULL) < 0)
|
||||
goto done;
|
||||
xml_print(stdout, xt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue