sysrepo 3.6.11
YANG-based system repository for all-around configuration management.
Loading...
Searching...
No Matches
Notification Plugin API

Data Structures

struct  srplg_ntf_s
 Notification plugin structure. More...

Macros

#define SRPLG_NOTIFICATION
 Macro to define datastore plugin information in external plugins.
#define SRPLG_NTF_API_VERSION   4
 Notification plugin API version.

Typedefs

typedef 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.
typedef 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.
typedef 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.
typedef void(* srntf_destroy) (const struct lys_module *mod)
 Destroy (delete) all stored notifications of a module.
typedef sr_error_info_t *(* srntf_disable) (const struct lys_module *mod)
 Destroy notification storage of a specific module.
typedef 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.
typedef sr_error_info_t *(* srntf_enable) (const struct lys_module *mod)
 Initialize notification storage for a specific module.
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)
 Replay the next notification of a module.
typedef 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.

Detailed Description


Data Structure Documentation

◆ srplg_ntf_s

struct srplg_ntf_s

Notification plugin structure.

Definition at line 153 of file plugins_notification.h.

Data Fields
srntf_access_check access_check_cb

callback for checking user access to notificaion data

srntf_access_get access_get_cb

callback got getting access rights for notification data

srntf_access_set access_set_cb

callback for setting access rights for notification data

srntf_destroy destroy_cb

destroy all notifications of a module

srntf_disable disable_cb

disable notification storage of a module

srntf_earliest_get earliest_get_cb

get the timestamp of the earliest stored notification

srntf_enable enable_cb

enable notification storage of a module

const char * name

name of the notification implementation plugin by which it is referenced

srntf_replay_next replay_next_cb

replay next notification in order

srntf_store store_cb

store a notification for replay

Macro Definition Documentation

◆ SRPLG_NOTIFICATION

#define SRPLG_NOTIFICATION
Value:
uint32_t srpntf_apiver__ = SRPLG_NTF_API_VERSION; \
const struct srplg_ntf_s srpntf__
#define SRPLG_NTF_API_VERSION
Notification plugin API version.
Notification plugin structure.

Macro to define datastore plugin information in external plugins.

Use as follows: SRPLG_NOTIFICATION = {<filled information of srplg_ntf_s>};

Definition at line 172 of file plugins_notification.h.

◆ SRPLG_NTF_API_VERSION

#define SRPLG_NTF_API_VERSION   4

Notification plugin API version.

Definition at line 43 of file plugins_notification.h.

Typedef Documentation

◆ srntf_access_check

typedef 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.

Parameters
[in]modSpecific module.
[out]readOptional, whether the read permission was granted or not.
[out]writeOptional, whether the write permission was granted or not.
Returns
NULL on success;
Sysrepo error info on error.

Definition at line 141 of file plugins_notification.h.

◆ srntf_access_get

typedef 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.

Parameters
[in]modSpecific module.
[out]ownerOptional, owner of the module data.
[out]groupOptional, group of the module data.
[out]permOptional, permissions of the module data.
Returns
NULL on success;
Sysrepo error info on error.

Definition at line 130 of file plugins_notification.h.

◆ srntf_access_set

typedef 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.

Parameters
[in]modSpecific module.
[in]ownerOptional, new owner of the module notification data.
[in]groupOptional, new group of the module notification data.
[in]permOptional not 0, new permissions of the module notification data.
Returns
NULL on success;
Sysrepo error info on error.

Definition at line 117 of file plugins_notification.h.

◆ srntf_destroy

typedef void(* srntf_destroy) (const struct lys_module *mod)

Destroy (delete) all stored notifications of a module.

Parameters
[in]modSpecific module.

Definition at line 148 of file plugins_notification.h.

◆ srntf_disable

typedef sr_error_info_t *(* srntf_disable) (const struct lys_module *mod)

Destroy notification storage of a specific module.

Stored notifications may be kept and usable once srntf_enable is called again for the module.

Parameters
[in]modSpecific module.
Returns
NULL on success;
Sysrepo error info on error.

Definition at line 65 of file plugins_notification.h.

◆ srntf_earliest_get

typedef 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.

Is called even before srntf_enable().

Parameters
[in]modSpecific module.
[out]tsTimestamp of the earliest notification, zeroed if there are none.
Returns
NULL on success;
Sysrepo error info on error.

Definition at line 105 of file plugins_notification.h.

◆ srntf_enable

typedef sr_error_info_t *(* srntf_enable) (const struct lys_module *mod)

Initialize notification storage for a specific module.

Install is called once for every module on enabled replay.

Parameters
[in]modSpecific module.
Returns
NULL on success;
Sysrepo error info on error.

Definition at line 54 of file plugins_notification.h.

◆ srntf_replay_next

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)

Replay the next notification of a module.

Parameters
[in]modSpecific module.
[in]startNotifications with earlier timestamp cannot be returned.
[in]stopNotifications with equal or later timestamp cannot be returned.
[out]notifNotification data tree.
[out]notif_tsNotification timestamp.
[in,out]stateArbitrary state to keep track of returned notifications, is NULL on first call. When NULL on return, there are no more notifications.
Returns
NULL on success;
Sysrepo error info on error, state was freed.

Definition at line 92 of file plugins_notification.h.

◆ srntf_store

typedef 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.

Parameters
[in]modSpecific module.
[in]notifNotification data tree.
[in]notif_tsNotification timestamp.
Returns
NULL on success;
Sysrepo error info on error.

Definition at line 76 of file plugins_notification.h.