Added new clixon-lib yang module for internal netconf protocol. Currently only extends the standard with a debug RPC.
This commit is contained in:
parent
11479f7ec3
commit
7a8f242a09
14 changed files with 362 additions and 32 deletions
|
|
@ -805,6 +805,9 @@ main(int argc,
|
|||
if ((str = clicon_yang_main_dir(h)) != NULL)
|
||||
if (yang_spec_load_dir(h, str, yspec) < 0)
|
||||
goto done;
|
||||
/* Load clixon lib yang module */
|
||||
if (yang_spec_parse_module(h, "clixon-lib", NULL, yspec) < 0)
|
||||
goto done;
|
||||
/* Load yang module library, RFC7895 */
|
||||
if (yang_modules_init(h) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -446,6 +446,9 @@ main(int argc, char **argv)
|
|||
if (yang_spec_load_dir(h, str, yspec) < 0)
|
||||
goto done;
|
||||
}
|
||||
/* Load clixon lib yang module */
|
||||
if (yang_spec_parse_module(h, "clixon-lib", NULL, yspec) < 0)
|
||||
goto done;
|
||||
|
||||
/* Load yang module library, RFC7895 */
|
||||
if (yang_modules_init(h) < 0)
|
||||
|
|
|
|||
|
|
@ -468,7 +468,9 @@ main(int argc,
|
|||
if (yang_spec_load_dir(h, str, yspec) < 0)
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Load clixon lib yang module */
|
||||
if (yang_spec_parse_module(h, "clixon-lib", NULL, yspec) < 0)
|
||||
goto done;
|
||||
/* Load yang module library, RFC7895 */
|
||||
if (yang_modules_init(h) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -645,7 +645,9 @@ main(int argc,
|
|||
if (yang_spec_load_dir(h, str, yspec) < 0)
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Load clixon lib yang module */
|
||||
if (yang_spec_parse_module(h, "clixon-lib", NULL, yspec) < 0)
|
||||
goto done;
|
||||
/* Load yang module library, RFC7895 */
|
||||
if (yang_modules_init(h) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -1132,27 +1132,23 @@ api_operations_get(clicon_handle h,
|
|||
if (use_xml)
|
||||
cprintf(cbx, "<operations>");
|
||||
else
|
||||
cprintf(cbx, "{\"operations\": ");
|
||||
cprintf(cbx, "{\"operations\": {");
|
||||
ymod = NULL;
|
||||
i = 0;
|
||||
while ((ymod = yn_each((yang_node*)yspec, ymod)) != NULL) {
|
||||
namespace = yang_find_mynamespace(ymod);
|
||||
yc = NULL; i=0;
|
||||
yc = NULL;
|
||||
while ((yc = yn_each((yang_node*)ymod, yc)) != NULL) {
|
||||
if (yc->ys_keyword != Y_RPC)
|
||||
continue;
|
||||
if (use_xml)
|
||||
cprintf(cbx, "<%s xmlns=\"%s\"/>", yc->ys_argument, namespace);
|
||||
else{
|
||||
if (i==0)
|
||||
cprintf(cbx, "{");
|
||||
if (i)
|
||||
if (i++)
|
||||
cprintf(cbx, ",");
|
||||
cprintf(cbx, "\"%s:%s\": null", ymod->ys_argument, yc->ys_argument);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (!use_xml && i)
|
||||
cprintf(cbx, "}");
|
||||
}
|
||||
if (use_xml)
|
||||
cprintf(cbx, "</operations>");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue