1 /**************************************************************************
4 * Contributed by: Robert Story <rstory@freesnmp.com>
6 * $Id: object_monitor.h,v 1.2 2002/07/18 17:56:17 rstory Exp $
8 * functions and data structures for cooperating code to monitor objects.
10 * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
13 * WARNING! This code is under active development WARNING!
14 * WARNING! and is subject to change at any time. WARNING!
17 * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
19 #ifndef OBJECT_MONITOR_H
20 #define OBJECT_MONITOR_H
31 * cooperative notification from the object being watched
33 NOTIFICATION_COOPERATIVE = 1,
35 * notification that an object has been set vi SNMP-SET
37 NOTIFICATION_SET_REQUEST,
39 * end of current notification types
45 * COOPERATIVE event types
64 typedef struct netsnmp_monitor_callback_header_s {
70 netsnmp_index monitored_object;
75 /** pointer given by watcher at registration */
78 /** pointer passed from the monitored object */
81 /** DO NOT USE, INTERNAL USE ONLY */
82 struct netsnmp_monitor_callback_header_s *private;
86 } netsnmp_monitor_callback_header;
91 typedef struct netsnmp_monitor_callback_set_request_s {
94 netsnmp_monitor_callback_header hdr;
96 /** handler that registered to handle this object */
97 netsnmp_mib_handler *handler;
99 /** pdu containing the set request */
102 /** the set request */
103 netsnmp_request_info *request;
105 } netsnmp_monitor_set_request_data;
110 typedef struct netsnmp_monitor_callback_cooperative_s {
113 netsnmp_monitor_callback_header hdr;
115 } netsnmp_monitor_callback_cooperative;
120 (netsnmp_object_monitor_callback) (netsnmp_monitor_callback_header
126 /**********************************************************************
127 * Registration function prototypes
131 * Register a callback for the specified object.
133 int netsnmp_monitor_register(oid * object, size_t oid_len,
137 netsnmp_object_monitor_callback
141 * Unregister a callback for the specified object.
143 int netsnmp_monitor_unregister(oid * object,
147 netsnmp_object_monitor_callback
151 * check to see if a registration exists for an object/event combination
153 int netsnmp_monitor_check_registered(int event, oid * oid,
157 /**********************************************************************
158 * function prototypes
162 * Notifies the object monitor of an event.
164 void netsnmp_notify_monitor(netsnmp_monitor_callback_header
170 /**********************************************************************
171 * function prototypes
175 * Notifies the object monitor of a cooperative event.
177 void netsnmp_notify_cooperative(int event, oid * object,
178 size_t len, char oid_steal,
186 #endif /** OBJECT_MONITOR_H */