libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
notifications.h File Reference

Functions to handle NETCONF Notifications. More...

#include <time.h>
#include "netconf.h"
Include dependency graph for notifications.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NCNTF_STREAM_BASE   NCNTF_STREAM_DEFAULT
 
#define NCNTF_STREAM_DEFAULT   "NETCONF"
 

Enumerations

enum  NCNTF_EVENT {
  NCNTF_ERROR = -1, NCNTF_GENERIC = 0, NCNTF_REPLAY_COMPLETE = 1, NCNTF_NTF_COMPLETE = 2,
  NCNTF_BASE_CFG_CHANGE = 3, NCNTF_BASE_CPBLT_CHANGE = 4, NCNTF_BASE_SESSION_START = 5, NCNTF_BASE_SESSION_END = 6,
  NCNTF_BASE_CONFIRMED_COMMIT = 7
}
 Enumeration of supported NETCONF event notifications. More...
 
enum  NCNTF_EVENT_BY { NCNTF_EVENT_BY_SERVER, NCNTF_EVENT_BY_USER }
 Enumeration of the possible source of events. More...
 

Functions

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 subscribtion RPC. Received notifications are processed by the given process_ntf callback function. Functions stops when the final notification <notificationComplete> is received or when the session is terminated. More...
 
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. All events from the specified stream are processed and sent to the client until the stop time is reached or until the session is terminated. More...
 
int ncntf_event_new (time_t etime, NCNTF_EVENT event,...)
 Store a new event in the specified stream. Parameters are specific for different events. More...
 
nc_ntfncntf_notif_create (time_t event_time, const char *content)
 Create a new <notification> message with the given eventTime and content. More...
 
void ncntf_notif_free (nc_ntf *ntf)
 Free the notification message. More...
 
char * ncntf_notif_get_content (const nc_ntf *notif)
 Get description of the event reported in the notification message. More...
 
time_t ncntf_notif_get_time (const nc_ntf *notif)
 Get Time of the event reported in the notification message. More...
 
NCNTF_EVENT ncntf_notif_get_type (const nc_ntf *notif)
 Get a specific notification type. More...
 
int ncntf_session_get_active_subscription (struct nc_session *session)
 Check if a session has an active notification subscription. More...
 
char * ncntf_status (void)
 Get the status data in xml form describing the currently used streams. More...
 
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. More...
 
int ncntf_stream_info (const char *stream, char **desc, char **start)
 Get some more details about the specified NETCONF event notifications stream. More...
 
int ncntf_stream_isavailable (const char *name)
 Test if the given stream is already created and available. More...
 
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 a closing function to nc_ntf_stream_iter_start() More...
 
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_start() function. More...
 
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 the first part of the stream file. More...
 
char ** ncntf_stream_list (void)
 Get the list of NETCONF event notifications streams. More...
 
int ncntf_stream_new (const char *name, const char *desc, int replay)
 Create a new NETCONF event stream. More...
 
nc_replyncntf_subscription_check (const nc_rpc *subscribe_rpc)
 Check validity of <create-subscription> message. More...
 

Detailed Description

Functions to handle NETCONF Notifications.

Author
Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz Copyright (c) 2012-2014 CESNET, z.s.p.o.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above.

This software is provided ``as is, and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Macro Definition Documentation

#define NCNTF_STREAM_BASE   NCNTF_STREAM_DEFAULT
#define NCNTF_STREAM_DEFAULT   "NETCONF"