sysrepo  2.2.170
YANG-based system repository for all-around configuration management.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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. More...
 
#define SRPLG_NTF_API_VERSION   3
 Notification plugin API version. More...
 

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. More...
 
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. More...
 
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. More...
 
typedef sr_error_info_t *(* srntf_disable )(const struct lys_module *mod)
 Destroy notification storage of a specific module. More...
 
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. More...
 
typedef sr_error_info_t *(* srntf_enable )(const struct lys_module *mod)
 Initialize notification storage for a specific module. More...
 
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. More...
 
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. More...
 

Detailed Description


Data Structure Documentation

struct srplg_ntf_s

Notification plugin structure.

Definition at line 146 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_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

#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 164 of file plugins_notification.h.

#define SRPLG_NTF_API_VERSION   3

Notification plugin API version.

Definition at line 43 of file plugins_notification.h.

Typedef Documentation

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.

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.

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.

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.

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.

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.

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.

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.