libnetconf2
libnetconf2 copied to clipboard
Questions about nc_recv_reply
https://netopeer.liberouter.org/doc/libnetconf2/devel/html/group__client__session.html#ga3cfe333eeb6dea6fa85d0a9794ab7d7a
Hi, I have a couple of questions about the nc_recv_reply API:
- In nc_recv_reply(), what is the "envp" argument? I'm not sure that I understand what is meant by an XML reply envelope.
- In nc_recv_reply(), what is the method we would need to use to parse the "op" lyd_node? Would it be lyd_parse_op() ?
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<target>
<running/>
</target>
<config>
<test-leaf xmlns="urn:test">52</test-leaf>
</config>
</edit-config>
</rpc>
The rpc element is the envelope (has no definition in YANG), edit-config with the descendants is the actual operation (is defined in YANG).
- I do not understand the question, look into the source if you want to know what function are being used.
lyd_parse_op()is used for parsing both the envelope(s) and the operation data.