libnetconf 0.10.0-0.10.0
NETCONF Library
Loading...
Searching...
No Matches
notifications.h
Go to the documentation of this file.
1
40#ifndef NC_NOTIFICATIONS_H_
41#define NC_NOTIFICATIONS_H_
42
43#include <time.h>
44
45#include "netconf.h"
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51#define NCNTF_STREAM_DEFAULT "NETCONF"
52#define NCNTF_STREAM_BASE NCNTF_STREAM_DEFAULT
53
69
78
85char* ncntf_status(void);
86
95int ncntf_stream_new(const char* name, const char* desc, int replay);
96
105int ncntf_stream_allow_events(const char* stream, const char* event);
106
113char** ncntf_stream_list(void);
114
127int ncntf_stream_info(const char* stream, char** desc, char** start);
128
135int ncntf_stream_isavailable(const char* name);
136
144void ncntf_stream_iter_start(const char* stream);
145
157char* ncntf_stream_iter_next(const char* stream, time_t start, time_t stop, time_t *event_time);
158
166void ncntf_stream_iter_finish(const char* stream);
167
214int ncntf_event_new(time_t etime, NCNTF_EVENT event, ...);
215
224nc_ntf* ncntf_notif_create(time_t event_time, const char* content);
225
232
241
248char* ncntf_notif_get_content(const nc_ntf* notif);
249
256time_t ncntf_notif_get_time(const nc_ntf* notif);
257
271
285long long int ncntf_dispatch_send(struct nc_session* session, const nc_rpc* subscribe_rpc);
286
301long long int ncntf_dispatch_receive(struct nc_session *session, void (*process_ntf)(time_t eventtime, const char* content));
302
311int ncntf_session_get_active_subscription(struct nc_session *session);
312
313#ifdef __cplusplus
314}
315#endif
316
317#endif /* NC_NOTIFICATIONS_H_ */
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.
NCNTF_EVENT_BY
Enumeration of the possible source of events.
Definition notifications.h:74
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 ...
int ncntf_stream_new(const char *name, const char *desc, int replay)
Create a new NETCONF event stream.
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...
struct nc_msg nc_ntf
Event notification message.
Definition netconf.h:68
int ncntf_session_get_active_subscription(struct nc_session *session)
Check if a session has an active notification subscription.
NCNTF_EVENT ncntf_notif_get_type(const nc_ntf *notif)
Get a specific notification type.
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...
int ncntf_stream_isavailable(const char *name)
Test if the given stream is already created and available.
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.
nc_ntf * ncntf_notif_create(time_t event_time, const char *content)
Create a new <notification> message with the given eventTime and content.
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...
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....
void ncntf_notif_free(nc_ntf *ntf)
Free the notification message.
char ** ncntf_stream_list(void)
Get the list of NETCONF event notifications streams.
char * ncntf_status(void)
Get the status data in xml form describing the currently used streams.
NCNTF_EVENT
Enumeration of supported NETCONF event notifications.
Definition notifications.h:58
time_t ncntf_notif_get_time(const nc_ntf *notif)
Get Time of the event reported in the notification message.
char * ncntf_notif_get_content(const nc_ntf *notif)
Get description of the event reported in the notification message.
int ncntf_stream_info(const char *stream, char **desc, char **start)
Get some more details about the specified NETCONF event notifications stream.
@ NCNTF_EVENT_BY_SERVER
Definition notifications.h:75
@ NCNTF_EVENT_BY_USER
Definition notifications.h:76
@ NCNTF_NTF_COMPLETE
Definition notifications.h:62
@ NCNTF_BASE_SESSION_END
Definition notifications.h:66
@ NCNTF_GENERIC
Definition notifications.h:60
@ NCNTF_BASE_CONFIRMED_COMMIT
Definition notifications.h:67
@ NCNTF_BASE_SESSION_START
Definition notifications.h:65
@ NCNTF_BASE_CFG_CHANGE
Definition notifications.h:63
@ NCNTF_REPLAY_COMPLETE
Definition notifications.h:61
@ NCNTF_ERROR
Definition notifications.h:59
@ NCNTF_BASE_CPBLT_CHANGE
Definition notifications.h:64
struct nc_msg nc_reply
reply message.
Definition netconf.h:62
struct nc_msg nc_rpc
rpc message.
Definition netconf.h:56
libnetconf's general public functions and structures definitions.