OpenClovis / OpenYuma

Fork of the defacto standard Yuma project since it went proprietary. Netconf is a management protocol (similar to SNMP) defined in RFC4741.
68 stars 51 forks source link

Inside of module rpc y_op_invoke code - add data to reply #26

Open zimbob10k opened 8 years ago

zimbob10k commented 8 years ago

Hello,

How do I add data to the RPC's payload which will be sent back to the yangcli? I have lets say an arbitrary buffer.

hoangle commented 8 years ago

It should be defined at 'output' of RPC statements: refer to [https://tools.ietf.org/html/rfc6020#section-4.2.9]

zimbob10k commented 8 years ago

Yes, I know that to be the case, however, getting the buffer inside of the rpc-payload is not trivial from the documentation.

So far I have:

In yangcli, it looks like:

Reply{ Data '...' }

Is there a better way? My data is raw XML and I would like it to be a payload. I noticed that yang doesn't have an output type for that and the ses* code parses it.

hoangle commented 8 years ago

My recommend is to use dummy session and agt_val_parse_nc to parse buffer (i.e xml data) into val value. Take a look at function agt_val_parse_test on agt_val_parse.c