Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zimbob10k opened this issue Jul 12, 2016 · 3 comments
Open

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

zimbob10k opened this issue Jul 12, 2016 · 3 comments

Comments

@zimbob10k
Copy link

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
Copy link
Member

hoangle commented Jul 13, 2016

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

@zimbob10k
Copy link
Author

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:

  • Yang model to be used by yangdump to make a stub
  • Filled in stubs and used a specific invoke function
  • Set and created an output callback
  • Copied the buffer into the payload via ses' specifically in a way which causes the validation to break. It mentions xmlany.

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
Copy link
Member

hoangle commented Jul 14, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants