sysrepo
1.4.168
YANG datastore
|
Typedefs | |
typedef int(* | sr_oper_get_items_cb )(sr_session_ctx_t *session, const char *module_name, const char *path, const char *request_xpath, uint32_t request_id, struct lyd_node **parent, void *private_data) |
Callback to be called when operational data at the selected xpath are requested. Data are represented as libyang subtrees. More... | |
Functions | |
int | sr_oper_get_items_subscribe (sr_session_ctx_t *session, const char *module_name, const char *path, sr_oper_get_items_cb callback, void *private_data, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription) |
Register for providing operational data at the given xpath. More... | |
typedef int(* sr_oper_get_items_cb)(sr_session_ctx_t *session, const char *module_name, const char *path, const char *request_xpath, uint32_t request_id, struct lyd_node **parent, void *private_data) |
Callback to be called when operational data at the selected xpath are requested. Data are represented as libyang subtrees.
When the callback is called, the data parent is provided. Any parent children (selected by path
) are removed and should be provided by the callback instead, if they exist. Callback handler can provide any data matching the path
but in case there are other nested subscriptions, they will be called after this one (and when they are called, their parent children will again be removed which can result in nodes provided by the original callback being lost).
[in] | session | Implicit session (do not stop) with information about the event originator session IDs. |
[in] | module_name | Name of the affected module. |
[in] | path | Path identifying the subtree that is supposed to be provided, same as the one used for the subscription. |
[in] | request_xpath | XPath as requested by a client. Can be NULL. |
[in] | request_id | Request ID unique for the specific module_name . |
[in,out] | parent | Pointer to an existing parent of the requested nodes. Is NULL for top-level nodes. Caller is supposed to append the requested nodes to this data subtree and return either the original parent or a top-level node. |
[in] | private_data | Private context opaque to sysrepo, as passed to sr_oper_get_items_subscribe call. |
int sr_oper_get_items_subscribe | ( | sr_session_ctx_t * | session, |
const char * | module_name, | ||
const char * | path, | ||
sr_oper_get_items_cb | callback, | ||
void * | private_data, | ||
sr_subscr_options_t | opts, | ||
sr_subscription_ctx_t ** | subscription | ||
) |
Register for providing operational data at the given xpath.
Required WRITE access.
[in] | session | Session (not DS-specific) to use. |
[in] | module_name | Name of the affected module. |
[in] | path | Path identifying the subtree (not strictly required, all list/leaf-list instances are also valid, for example) which the provider is able to provide. Predicates can be used to provide only specific instances of nodes. Before calling this callback, any existing data matching this path are deleted (unless modified by opts ). |
[in] | callback | Callback to be called when the operational data for the given xpath are requested. |
[in] | private_data | Private context passed to the callback function, opaque to sysrepo. |
[in] | opts | Options overriding default behavior of the subscription, it is supposed to be a bitwise OR-ed value of any sr_subscr_flag_t flags. |
[in,out] | subscription | Subscription context that is supposed to be released by sr_unsubscribe. |