Loading...
Searching...
No Matches
plugins_notification.h
Go to the documentation of this file.
#ifndef _SYSREPO_PLUGINS_NOTIFICATION_H
#define _SYSREPO_PLUGINS_NOTIFICATION_H
#include <stdint.h>
#include <sys/types.h>
#include <libyang/libyang.h>
#include "sysrepo_types.h"
#ifdef __cplusplus
extern "C" {
#endif
// Notification Plugin API
#define SRPLG_NTF_API_VERSION 4
typedef sr_error_info_t *(*srntf_enable)(const struct lys_module *mod);
typedef sr_error_info_t *(*srntf_disable)(const struct lys_module *mod);
typedef sr_error_info_t *(*srntf_store)(const struct lys_module *mod, const struct lyd_node *notif,
const struct timespec *notif_ts);
typedef 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);
typedef sr_error_info_t *(*srntf_earliest_get)(const struct lys_module *mod, struct timespec *ts);
typedef sr_error_info_t *(*srntf_access_set)(const struct lys_module *mod, const char *owner, const char *group,
mode_t perm);
typedef sr_error_info_t *(*srntf_access_get)(const struct lys_module *mod, char **owner, char **group, mode_t *perm);
typedef sr_error_info_t *(*srntf_access_check)(const struct lys_module *mod, int *read, int *write);
typedef void (*srntf_destroy)(const struct lys_module *mod);
struct srplg_ntf_s {
const char *name;
srntf_enable enable_cb;
srntf_disable disable_cb;
srntf_store store_cb;
srntf_replay_next replay_next_cb;
srntf_earliest_get earliest_get_cb;
srntf_access_set access_set_cb;
srntf_access_get access_get_cb;
srntf_access_check access_check_cb;
srntf_destroy destroy_cb;
};
#define SRPLG_NOTIFICATION \
uint32_t srpntf_apiver__ = SRPLG_NTF_API_VERSION; \
const struct srplg_ntf_s srpntf__
#ifdef __cplusplus
}
#endif
#endif /* _SYSREPO_PLUGINS_NOTIFICATION_H */
srplg_ntf_s::earliest_get_cb
srntf_earliest_get earliest_get_cb
Definition plugins_notification.h:159
srplg_ntf_s::disable_cb
srntf_disable disable_cb
Definition plugins_notification.h:156
srplg_ntf_s::replay_next_cb
srntf_replay_next replay_next_cb
Definition plugins_notification.h:158
srplg_ntf_s::destroy_cb
srntf_destroy destroy_cb
Definition plugins_notification.h:163
srplg_ntf_s::access_get_cb
srntf_access_get access_get_cb
Definition plugins_notification.h:161
srplg_ntf_s::access_check_cb
srntf_access_check access_check_cb
Definition plugins_notification.h:162
srplg_ntf_s::name
const char * name
Definition plugins_notification.h:154
srplg_ntf_s::enable_cb
srntf_enable enable_cb
Definition plugins_notification.h:155
srplg_ntf_s::store_cb
srntf_store store_cb
Definition plugins_notification.h:157
srplg_ntf_s::access_set_cb
srntf_access_set access_set_cb
Definition plugins_notification.h:160
srplg_ntf_s
Notification plugin structure.
Definition plugins_notification.h:153
srntf_disable
sr_error_info_t *(* srntf_disable)(const struct lys_module *mod)
Destroy notification storage of a specific module.
Definition plugins_notification.h:65
srntf_access_check
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.
Definition plugins_notification.h:141
srntf_store
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.
Definition plugins_notification.h:76
srntf_earliest_get
sr_error_info_t *(* srntf_earliest_get)(const struct lys_module *mod, struct timespec *ts)
Get the timestamp of the earliest stored notification of the module.
Definition plugins_notification.h:105
srntf_replay_next
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.
Definition plugins_notification.h:92
srntf_access_set
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.
Definition plugins_notification.h:117
srntf_destroy
void(* srntf_destroy)(const struct lys_module *mod)
Destroy (delete) all stored notifications of a module.
Definition plugins_notification.h:148
srntf_access_get
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.
Definition plugins_notification.h:130
srntf_enable
sr_error_info_t *(* srntf_enable)(const struct lys_module *mod)
Initialize notification storage for a specific module.
Definition plugins_notification.h:54
sysrepo_types.h
public sysrepo types header
sr_error_info_t
Detailed sysrepo session error information.
Definition sysrepo_types.h:169