libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

Questions about nc_recv_reply

Open rabhat31 opened this issue 3 years ago • 1 comments

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:

  1. In nc_recv_reply(), what is the "envp" argument? I'm not sure that I understand what is meant by an XML reply envelope.
  2. 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() ?

rabhat31 avatar May 18 '22 00:05 rabhat31

<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).

  1. 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.

michalvasko avatar May 18 '22 06:05 michalvasko