diff options
Diffstat (limited to 'lib/yang.h')
| -rw-r--r-- | lib/yang.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/yang.h b/lib/yang.h index 25703b1879..57131f478b 100644 --- a/lib/yang.h +++ b/lib/yang.h @@ -536,6 +536,21 @@ extern struct lyd_node *yang_dnode_dup(const struct lyd_node *dnode); extern void yang_dnode_free(struct lyd_node *dnode); /* + * Add a libyang data node to an RPC/action output container. + * + * output + * RPC/action output container. + * + * xpath + * XPath of the data node to add, relative to the output container. + * + * value + * String representing the value of the data node. + */ +extern void yang_dnode_rpc_output_add(struct lyd_node *output, + const char *xpath, const char *value); + +/* * Create a new yang_data structure. * * xpath @@ -620,6 +635,25 @@ extern LY_ERR yang_parse_notification(const char *xpath, LYD_FORMAT format, const char *data, struct lyd_node **notif); /* + * Parse a YANG RPC. + * + * Args: + * xpath: xpath of an RPC/action. + * format: LYD_FORMAT of input data. + * data: input data. + * reply: true if the data represents a reply to an RPC/action. + * rpc: pointer to the libyang data tree to store the parsed RPC/action. + * If data represents an action, the pointer to the action node is + * still returned, but it's part of the full data tree with all its + * parents. + * + * Returns: + * LY_ERR from underlying calls. + */ +LY_ERR yang_parse_rpc(const char *xpath, LYD_FORMAT format, const char *data, + bool reply, struct lyd_node **rpc); + +/* * "Print" the yang tree in `root` into dynamic sized array. * * Args: |
