sysrepo  5.2.34
YANG-based system repository for all-around configuration management.
plugins_notification.h
Go to the documentation of this file.
1 
17 #ifndef _SYSREPO_PLUGINS_NOTIFICATION_H
18 #define _SYSREPO_PLUGINS_NOTIFICATION_H
19 
20 #include <stdint.h>
21 #include <sys/types.h>
22 
23 #include <libyang/libyang.h>
24 
25 #include "sysrepo_types.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
32 // Notification Plugin API
34 
43 #define SRPLG_NTF_API_VERSION 5
44 
54 typedef sr_error_info_t *(*srntf_enable)(const struct lys_module *mod);
55 
65 typedef sr_error_info_t *(*srntf_disable)(const struct lys_module *mod);
66 
76 typedef sr_error_info_t *(*srntf_store)(const struct lys_module *mod, const struct lyd_node *notif,
77  const struct timespec *notif_ts);
78 
92 typedef sr_error_info_t *(*srntf_replay_next)(const struct lys_module *mod, const struct timespec *start,
93  const struct timespec *stop, struct lyd_node **notif, struct timespec *notif_ts, void *state);
94 
106 typedef sr_error_info_t *(*srntf_earliest_get)(const struct lys_module *mod, const struct timespec *after,
107  struct timespec *ts);
108 
121 typedef sr_error_info_t *(*srntf_replay_start_get)(const struct lys_module *mod, struct timespec *ts);
122 
133 typedef sr_error_info_t *(*srntf_access_set)(const struct lys_module *mod, const char *owner, const char *group,
134  mode_t perm);
135 
146 typedef sr_error_info_t *(*srntf_access_get)(const struct lys_module *mod, char **owner, char **group, mode_t *perm);
147 
157 typedef sr_error_info_t *(*srntf_access_check)(const struct lys_module *mod, int *read, int *write);
158 
164 typedef void (*srntf_destroy)(const struct lys_module *mod);
165 
169 struct srplg_ntf_s {
170  const char *name;
181 };
182 
189 #define SRPLG_NOTIFICATION \
190  uint32_t srpntf_apiver__ = SRPLG_NTF_API_VERSION; \
191  const struct srplg_ntf_s srpntf__
192 
195 #ifdef __cplusplus
196 }
197 #endif
198 
199 #endif /* _SYSREPO_PLUGINS_NOTIFICATION_H */
srntf_earliest_get earliest_get_cb
srntf_disable disable_cb
srntf_replay_next replay_next_cb
srntf_destroy destroy_cb
srntf_access_get access_get_cb
srntf_access_check access_check_cb
const char * name
srntf_enable enable_cb
srntf_store store_cb
srntf_replay_start_get replay_start_get_cb
srntf_access_set access_set_cb
Notification plugin structure.
sr_error_info_t *(* srntf_access_check)(const struct lys_module *mod, int *read, int *write)
Check whether the current user has the required access to notification data.
sr_error_info_t *(* srntf_disable)(const struct lys_module *mod)
Destroy notification storage of a specific module.
sr_error_info_t *(* srntf_store)(const struct lys_module *mod, const struct lyd_node *notif, const struct timespec *notif_ts)
Store a notification for replay.
sr_error_info_t *(* srntf_replay_start_get)(const struct lys_module *mod, struct timespec *ts)
Get the timestamp when replay was enabled for the module.
sr_error_info_t *(* srntf_earliest_get)(const struct lys_module *mod, const struct timespec *after, struct timespec *ts)
Get the timestamp of the earliest stored notification of the module.
sr_error_info_t *(* srntf_enable)(const struct lys_module *mod)
Initialize notification storage for a specific module.
sr_error_info_t *(* srntf_access_get)(const struct lys_module *mod, char **owner, char **group, mode_t *perm)
Get access permissions for notification data of a module.
sr_error_info_t *(* srntf_access_set)(const struct lys_module *mod, const char *owner, const char *group, mode_t perm)
Set access permissions for notification data of a module.
void(* srntf_destroy)(const struct lys_module *mod)
Destroy (delete) all stored notifications of a module.
sr_error_info_t *(* srntf_replay_next)(const struct lys_module *mod, const struct timespec *start, const struct timespec *stop, struct lyd_node **notif, struct timespec *notif_ts, void *state)
Replay the next notification of a module.
public sysrepo types header
Detailed sysrepo session error information.