XML creation and parse API changes
This commit is contained in:
parent
056b5c97dd
commit
4742fde1e9
21 changed files with 309 additions and 258 deletions
|
|
@ -165,11 +165,11 @@ plugin_statedata(clicon_handle h,
|
|||
cxobj **xvec = NULL;
|
||||
|
||||
/* Example of (static) statedata, real code would poll state */
|
||||
if (xml_parse("<interfaces-state><interface>"
|
||||
"<name>eth0</name>"
|
||||
"<type>eth</type>"
|
||||
"<if-index>42</if-index>"
|
||||
"</interface></interfaces-state>", NULL, xstate) < 0)
|
||||
if (xml_parse_string("<interfaces-state><interface>"
|
||||
"<name>eth0</name>"
|
||||
"<type>eth</type>"
|
||||
"<if-index>42</if-index>"
|
||||
"</interface></interfaces-state>", NULL, &xstate) < 0)
|
||||
goto done;
|
||||
retval = 0;
|
||||
done:
|
||||
|
|
@ -225,7 +225,7 @@ plugin_reset(clicon_handle h,
|
|||
int retval = -1;
|
||||
cxobj *xt = NULL;
|
||||
|
||||
if (clicon_xml_parse_str("<config><interfaces><interface>"
|
||||
if (xml_parse_string("<config><interfaces><interface>"
|
||||
"<name>lo</name><type>local</type>"
|
||||
"</interface></interfaces></config>", NULL, &xt) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ fib_route_rpc(clicon_handle h,
|
|||
/* User supplied variable in CLI command */
|
||||
instance = cvec_find(cvv, "instance"); /* get a cligen variable from vector */
|
||||
/* Create XML for fib-route netconf RPC */
|
||||
if (clicon_xml_parse(&xtop, NULL, "<rpc><fib-route><routing-instance-name>%s</routing-instance-name></fib-route></rpc>", instance) < 0)
|
||||
if (xml_parse_va(&xtop, NULL, "<rpc><fib-route><routing-instance-name>%s</routing-instance-name></fib-route></rpc>", instance) < 0)
|
||||
goto done;
|
||||
/* Skip top-level */
|
||||
xrpc = xml_child_i(xtop, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue