00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OBJECT_MONITOR_H
00020 #define OBJECT_MONITOR_H
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00026
00027
00028
00029 enum {
00030
00031
00032
00033 NOTIFICATION_COOPERATIVE = 1,
00034
00035
00036
00037 NOTIFICATION_SET_REQUEST,
00038
00039
00040
00041 NOTIFICATION_END
00042 };
00043
00044
00045
00046
00047 enum {
00048 EVENT_ROW_ADD = 1,
00049 EVENT_ROW_MOD,
00050 EVENT_ROW_DEL,
00051 EVENT_COL_MOD,
00052 EVENT_OBJ_MOD,
00053 EVENT_END
00054 };
00055
00056
00057
00058
00059
00060
00064 typedef struct netsnmp_monitor_callback_header_s {
00065
00067 unsigned int event;
00068
00070 netsnmp_index monitored_object;
00071
00073 int priority;
00074
00076 void *watcher_data;
00077
00079 void *object_info;
00080
00082 struct netsnmp_monitor_callback_header_s *private;
00083 int refs;
00084
00085
00086 } netsnmp_monitor_callback_header;
00087
00088
00089
00090
00091 typedef struct netsnmp_monitor_callback_set_request_s {
00092
00094 netsnmp_monitor_callback_header hdr;
00095
00097 netsnmp_mib_handler *handler;
00098
00100 netsnmp_pdu *pdu;
00101
00103 netsnmp_request_info *request;
00104
00105 } netsnmp_monitor_set_request_data;
00106
00107
00108
00109
00110 typedef struct netsnmp_monitor_callback_cooperative_s {
00111
00113 netsnmp_monitor_callback_header hdr;
00114
00115 } netsnmp_monitor_callback_cooperative;
00116
00117
00118
00119 typedef void
00120 (netsnmp_object_monitor_callback) (netsnmp_monitor_callback_header
00121 *);
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 int netsnmp_monitor_register(oid * object, size_t oid_len,
00134 int priority,
00135 unsigned int events,
00136 void *watcher_data,
00137 netsnmp_object_monitor_callback
00138 * cb);
00139
00140
00141
00142
00143 int netsnmp_monitor_unregister(oid * object,
00144 size_t oid_len,
00145 int priority,
00146 void *watcher_data,
00147 netsnmp_object_monitor_callback
00148 * cb);
00149
00150
00151
00152
00153 int netsnmp_monitor_check_registered(int event, oid * oid,
00154 int oid_len);
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 void netsnmp_notify_monitor(netsnmp_monitor_callback_header
00165 * cbh);
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 void netsnmp_notify_cooperative(int event, oid * object,
00178 size_t len, char oid_steal,
00179 void *object_info);
00180
00181
00182
00183 #ifdef __cplusplus
00184 }
00185 #endif
00186 #endif