17 #ifndef SYSREPO_SUBSCRIBED_NOTIFICATIONS_H_
18 #define SYSREPO_SUBSCRIBED_NOTIFICATIONS_H_
50 struct timespec stop_time;
60 struct timespec start_time;
65 struct timespec anchor_time;
69 uint32_t dampening_period;
96 struct ly_set **mod_set);
125 struct timespec *replay_start_time,
int *fd, uint32_t *sub_id);
142 const struct timespec *anchor_time,
const struct timespec *stop_time,
int *fd, uint32_t *sub_id);
164 const struct timespec *stop_time,
int sub_no_thread,
sr_subscription_ctx_t **sub,
int *fd, uint32_t *sub_id);
258 const char *request_xpath, uint32_t request_id,
struct lyd_node **parent,
void *private_data);
299 int srsn_read_notif(
int fd,
const struct ly_ctx *ly_ctx,
struct timespec *timestamp,
struct lyd_node **notif);
311 int srsn_poll(
int fd, uint32_t timeout_ms);
320 typedef void (*
srsn_notif_cb)(
const struct lyd_node *notif,
const struct timespec *timestamp,
void *cb_data);
int srsn_subscribe(sr_session_ctx_t *session, const char *stream, const char *xpath_filter, const struct timespec *stop_time, const struct timespec *start_time, int sub_no_thread, sr_subscription_ctx_t **sub, struct timespec *replay_start_time, int *fd, uint32_t *sub_id)
Subscribe for receiving notifications according to 'ietf-subscribed-notifications' YANG...
public API sysrepo header
int srsn_filter_subtree2xpath(const struct lyd_node *subtree, sr_session_ctx_t *session, char **xpath_filter)
Transform a subtree filter into an XPath filter.
int srsn_yang_push_periodic(sr_session_ctx_t *session, sr_datastore_t ds, const char *xpath_filter, uint32_t period_ms, const struct timespec *anchor_time, const struct timespec *stop_time, int *fd, uint32_t *sub_id)
Subscribe for receiving notifications according to 'ietf-yang-push' YANG periodic subscriptions...
sr_datastore_t
Datastores that sysrepo supports. To change which datastore a session operates on, use sr_session_switch_ds.
int srsn_suspend(uint32_t sub_id, const char *reason)
Suspend a subscribed-notifications subscription.
int srsn_resume(uint32_t sub_id)
Resume a subscribed-notifications subscription.
int srsn_modify_xpath_filter(uint32_t sub_id, const char *xpath_filter)
Modify a generic subscription xpath-filter.
struct sr_subscription_ctx_s sr_subscription_ctx_t
Sysrepo subscription context returned from sr_*_subscribe calls, it is supposed to be released by the...
int srsn_yang_push_modify_periodic(uint32_t sub_id, uint32_t period_ms, const struct timespec *anchor_time)
Modify a yang-push periodic subscription.
int srsn_read_dispatch_init(sr_conn_ctx_t *conn, srsn_notif_cb cb)
Init read dispatch for notifications, overwrites any previous parameters.
int srsn_read_dispatch_destroy(void)
Stop the dispatched thread and clear all the used resources.
struct sr_session_ctx_s sr_session_ctx_t
Sysrepo session on a connection.
int srsn_yang_push_on_change(sr_session_ctx_t *session, sr_datastore_t ds, const char *xpath_filter, uint32_t dampening_period_ms, int sync_on_start, int excluded_changes[SRSN_COUNT_YP_CHANGE], const struct timespec *stop_time, int sub_no_thread, sr_subscription_ctx_t **sub, int *fd, uint32_t *sub_id)
Subscribe for receiving notifications according to 'ietf-yang-push' YANG on-change subscriptions...
struct sr_conn_ctx_s sr_conn_ctx_t
Sysrepo connection.
int srsn_notif_sent(uint32_t sub_id)
Increase the sent-notifications counter in case of additional manually-generated notifications (such ...
int srsn_yang_push_on_change_resync(uint32_t sub_id)
Resync a yang-push on-change subscription.
int srsn_read_dispatch_add(int fd, void *cb_data)
Add another subscription to be handled by the dispatched thread.
srsn_sub_type_t
Type of the subscribed-notifications subscription.
uint32_t srsn_read_dispatch_count(void)
Get the number of subscriptions currently handled by the dispatched thread.
void(* srsn_notif_cb)(const struct lyd_node *notif, const struct timespec *timestamp, void *cb_data)
Callback for reading notifications.
void srsn_oper_data_subscriptions_free(srsn_state_sub_t *subs, uint32_t count)
Free subscription state data.
int srsn_yang_push_modify_on_change(uint32_t sub_id, uint32_t dampening_period_ms)
Modify a yang-push on-change subscription.
int srsn_terminate(uint32_t sub_id, const char *reason)
Terminate a subscribed-notifications subscription.
int srsn_read_notif(int fd, const struct ly_ctx *ly_ctx, struct timespec *timestamp, struct lyd_node **notif)
Read a notification.
int srsn_poll(int fd, uint32_t timeout_ms)
Poll a file descriptor for data to read.
int srsn_oper_data_streams_cb(sr_session_ctx_t *session, uint32_t sub_id, const char *module_name, const char *path, const char *request_xpath, uint32_t request_id, struct lyd_node **parent, void *private_data)
Sysrepo sr_oper_get_items_cb() providing data of the subtree '/ietf-subscribed-notification:streams'...
int srsn_stream_collect_mods(const char *stream, const char *xpath_filter, const struct ly_ctx *ly_ctx, struct ly_set **mod_set)
Collect modules to subscribe to.
int srsn_oper_data_sub(uint32_t sub_id, srsn_state_sub_t **sub)
Get subscription state data of a single subscription.
int srsn_modify_stop_time(uint32_t sub_id, const struct timespec *stop_time)
Modify a generic subscription stop-time.
int srsn_oper_data_subscriptions(srsn_state_sub_t **subs, uint32_t *count)
Get subscription state data with most of the information in the subtree '/ietf-subscribed-notificatio...
int srsn_read_dispatch_start(int fd, sr_conn_ctx_t *conn, srsn_notif_cb cb, void *cb_data)
Deprecated, came functionality as calling srsn_read_dispatch_init() and srsn_read_dispatch_add().