40 #ifndef NC_NOTIFICATIONS_H_
41 #define NC_NOTIFICATIONS_H_
51 #define NCNTF_STREAM_DEFAULT "NETCONF"
52 #define NCNTF_STREAM_BASE NCNTF_STREAM_DEFAULT
298 long long int ncntf_dispatch_receive(
struct nc_session *session,
void (*process_ntf)(time_t eventtime,
const char* content));
char ** ncntf_stream_list(void)
Get the list of NETCONF event notifications streams.
char * ncntf_notif_get_content(const nc_ntf *notif)
Get description of the event reported in the notification message.
NCNTF_EVENT_BY
Enumeration of the possible source of events.
Definition: notifications.h:74
struct nc_msg nc_reply
reply message.
Definition: netconf.h:62
long long int ncntf_dispatch_receive(struct nc_session *session, void(*process_ntf)(time_t eventtime, const char *content))
Subscribe for receiving notifications from the given session according to parameters in the given sub...
struct nc_msg nc_ntf
Event notification message.
Definition: netconf.h:68
char * ncntf_stream_iter_next(const char *stream, time_t start, time_t stop, time_t *event_time)
Pop the next event record from the stream file. The iteration must be started by nc_ntf_stream_iter_s...
nc_ntf * ncntf_notif_create(time_t event_time, const char *content)
Create a new <notification> message with the given eventTime and content.
Definition: notifications.h:76
int ncntf_stream_isavailable(const char *name)
Test if the given stream is already created and available.
struct nc_msg nc_rpc
rpc message.
Definition: netconf.h:56
int ncntf_stream_new(const char *name, const char *desc, int replay)
Create a new NETCONF event stream.
long long int ncntf_dispatch_send(struct nc_session *session, const nc_rpc *subscribe_rpc)
Start sending notifications according to the given <create-subscription> NETCONF RPC request...
int ncntf_session_get_active_subscription(struct nc_session *session)
Check if a session has an active notification subscription.
nc_reply * ncntf_subscription_check(const nc_rpc *subscribe_rpc)
Check validity of <create-subscription> message.
int ncntf_event_new(time_t etime, NCNTF_EVENT event,...)
Store a new event in the specified stream. Parameters are specific for different events.
Definition: notifications.h:59
Definition: notifications.h:75
NCNTF_EVENT
Enumeration of supported NETCONF event notifications.
Definition: notifications.h:58
Definition: notifications.h:62
Definition: notifications.h:61
NCNTF_EVENT ncntf_notif_get_type(const nc_ntf *notif)
Get a specific notification type.
time_t ncntf_notif_get_time(const nc_ntf *notif)
Get Time of the event reported in the notification message.
int ncntf_stream_allow_events(const char *stream, const char *event)
Set the rule to allow logging of the specified event on the given Notification stream.
char * ncntf_status(void)
Get the status data in xml form describing the currently used streams.
void ncntf_stream_iter_start(const char *stream)
Start iteration on the events in the specified stream file. Iteration starts on the first event in th...
Definition: notifications.h:60
int ncntf_stream_info(const char *stream, char **desc, char **start)
Get some more details about the specified NETCONF event notifications stream.
Definition: notifications.h:64
Definition: notifications.h:63
void ncntf_stream_iter_finish(const char *stream)
Clean all the structures used for iteration in the specified stream. This function must be called as ...
void ncntf_notif_free(nc_ntf *ntf)
Free the notification message.
Definition: notifications.h:67
libnetconf's general public functions and structures definitions.
Definition: notifications.h:66
Definition: notifications.h:65