~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to man/netsnmp_cache_handler.3

  • Committer: Bazaar Package Importer
  • Author(s): Jochen Friedrich
  • Date: 2010-06-10 18:02:54 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100610180254-6ezvupl2clicwdqf
ImportĀ upstreamĀ versionĀ 5.4.3~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH "cache_handler" 3 "5 Sep 2008" "Version 5.4.2" "net-snmp" \" -*- nroff -*-
 
1
.TH "cache_handler" 3 "23 May 2010" "Version 5.4.3.pre1" "net-snmp" \" -*- nroff -*-
2
2
.ad l
3
3
.nh
4
4
.SH NAME
5
 
cache_handler \- Maintains a cache of data for use by lower level handlers.  
 
5
cache_handler \- 
 
6
.PP
 
7
Maintains a cache of data for use by lower level handlers.  
6
8
 
7
 
.PP
8
9
.SS "Functions"
9
10
 
10
11
.in +1c
74
75
.ti -1c
75
76
.RI "int \fBnetsnmp_is_cache_valid\fP (\fBnetsnmp_agent_request_info\fP *reqinfo)"
76
77
.br
77
 
.RI "\fIfor backwards compat \fP"
 
78
.RI "\fIIs the cache valid for a given request? for backwards compatability. \fP"
78
79
.ti -1c
79
80
.RI "int \fBnetsnmp_cache_helper_handler\fP (\fBnetsnmp_mib_handler\fP *handler, \fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_agent_request_info\fP *reqinfo, \fBnetsnmp_request_info\fP *requests)"
80
81
.br
87
88
.SH "Detailed Description"
88
89
.PP 
89
90
Maintains a cache of data for use by lower level handlers. 
90
 
.PP
 
91
 
91
92
This helper checks to see whether the data has been loaded 'recently' (according to the timeout for that particular cache) and calls the registered 'load_cache' routine if necessary. The lower handlers can then work with this local cached data.
92
93
.PP
93
94
A timeout value of -1 will cause \fBnetsnmp_cache_check_expired()\fP to always return true, and thus the cache will be reloaded for every request.
126
127
Reload the cache if required. 
127
128
.PP
128
129
Definition at line 385 of file cache_handler.c.
129
 
.PP
130
 
References netsnmp_cache_check_expired(), and netsnmp_cache_s::valid.
131
 
.PP
132
 
Referenced by netsnmp_cache_helper_handler().
133
130
.SS "int netsnmp_cache_check_expired (\fBnetsnmp_cache\fP * cache)"
134
131
.PP
135
 
Check if the cache timeout has passed. 
136
 
.PP
137
 
Sets and return the expired flag. 
 
132
Check if the cache timeout has passed. Sets and return the expired flag. 
138
133
.PP
139
134
Definition at line 370 of file cache_handler.c.
140
 
.PP
141
 
References atime_ready(), netsnmp_cache_s::expired, NULL, netsnmp_cache_s::timeout, netsnmp_cache_s::timestamp, and netsnmp_cache_s::valid.
142
 
.PP
143
 
Referenced by netsnmp_cache_check_and_reload(), and release_cached_resources().
144
135
.SS "\fBnetsnmp_cache\fP* netsnmp_cache_create (int timeout, NetsnmpCacheLoad * load_hook, NetsnmpCacheFree * free_hook, oid * rootoid, int rootoid_len)"
145
136
.PP
146
137
returns a cache 
147
138
.PP
148
139
Definition at line 136 of file cache_handler.c.
149
 
.PP
150
 
References netsnmp_cache_s::enabled, netsnmp_cache_s::free_cache, netsnmp_cache_s::load_cache, netsnmp_ds_get_int(), netsnmp_cache_s::next, NULL, netsnmp_cache_s::prev, netsnmp_cache_s::rootoid, netsnmp_cache_s::rootoid_len, snmp_duplicate_objid(), snmp_log(), SNMP_MALLOC_TYPEDEF, and netsnmp_cache_s::timeout.
151
 
.PP
152
 
Referenced by netsnmp_get_cache_handler(), and netsnmp_get_timed_bare_stash_cache_handler().
153
140
.SS "\fBnetsnmp_cache\fP* netsnmp_cache_find_by_oid (oid * rootoid, int rootoid_len)"
154
141
.PP
155
142
find existing cache 
156
143
.PP
157
144
Definition at line 120 of file cache_handler.c.
158
 
.PP
159
 
References netsnmp_oid_equals(), netsnmp_cache_s::next, NULL, netsnmp_cache_s::rootoid, and netsnmp_cache_s::rootoid_len.
160
145
.SS "\fBnetsnmp_cache\fP* netsnmp_cache_get_head (void)"
161
146
.PP
162
147
get cache head 
167
152
returns a cache handler that can be injected into a given handler chain. 
168
153
.PP
169
154
Definition at line 247 of file cache_handler.c.
170
 
.PP
171
 
References netsnmp_mib_handler_s::flags, netsnmp_cache_s::flags, MIB_HANDLER_AUTO_NEXT, netsnmp_mib_handler_s::myvoid, netsnmp_cache_helper_handler(), netsnmp_cache_timer_start(), netsnmp_create_handler(), NULL, and netsnmp_cache_s::valid.
172
 
.PP
173
 
Referenced by netsnmp_cache_handler_register(), netsnmp_get_cache_handler(), and netsnmp_get_timed_bare_stash_cache_handler().
174
155
.SS "int netsnmp_cache_handler_register (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_cache\fP * cache)"
175
156
.PP
176
157
functionally the same as calling \fBnetsnmp_register_handler()\fP but also injects a cache handler at the same time for you. 
177
158
.PP
178
159
Definition at line 295 of file cache_handler.c.
179
 
.PP
180
 
References netsnmp_cache_handler_get(), netsnmp_inject_handler(), netsnmp_register_handler(), and NULL.
181
160
.SS "int netsnmp_cache_helper_handler (\fBnetsnmp_mib_handler\fP * handler, \fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * requests)"
182
161
.PP
183
162
Implements the cache handler. 
189
168
next handler called automatically - 'AUTO_NEXT' 
190
169
.PP
191
170
Definition at line 420 of file cache_handler.c.
192
 
.PP
193
 
References netsnmp_cache_s::cache_hint, netsnmp_cache_s::enabled, netsnmp_cache_s::flags, netsnmp_mib_handler_s::flags, netsnmp_cache_s::free_cache, netsnmp_handler_args_s::handler, netsnmp_handler_registration_s::handlerName, netsnmp_cache_s::load_cache, netsnmp_cache_s::magic, MIB_HANDLER_AUTO_NEXT, netsnmp_agent_request_info_s::mode, netsnmp_mib_handler_s::myvoid, netsnmp_cache_check_and_reload(), netsnmp_cache_is_valid(), netsnmp_cache_reqinfo_insert(), netsnmp_ds_get_boolean(), netsnmp_request_set_error_all(), NULL, netsnmp_handler_args_s::reginfo, netsnmp_handler_args_s::reqinfo, netsnmp_handler_args_s::requests, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, snmp_log(), and netsnmp_cache_s::valid.
194
 
.PP
195
 
Referenced by netsnmp_cache_handler_get().
196
171
.SS "int netsnmp_cache_is_valid (\fBnetsnmp_agent_request_info\fP * reqinfo, const char * name)"
197
172
.PP
198
173
Is the cache valid for a given request? 
199
174
.PP
200
175
Definition at line 402 of file cache_handler.c.
201
 
.PP
202
 
References netsnmp_cache_reqinfo_extract(), and netsnmp_cache_s::valid.
203
 
.PP
204
 
Referenced by netsnmp_cache_helper_handler(), and netsnmp_is_cache_valid().
205
176
.SS "\fBnetsnmp_cache\fP* netsnmp_cache_reqinfo_extract (\fBnetsnmp_agent_request_info\fP * reqinfo, const char * name)"
206
177
.PP
207
178
Extract the cache information for a given request (PDU). 
208
179
.PP
209
180
Definition at line 350 of file cache_handler.c.
210
 
.PP
211
 
References _build_cache_name(), netsnmp_agent_get_list_data(), and SNMP_FREE.
212
 
.PP
213
 
Referenced by netsnmp_cache_is_valid(), netsnmp_extract_cache_info(), and netsnmp_stash_cache_helper().
214
181
.SS "void netsnmp_cache_reqinfo_insert (\fBnetsnmp_cache\fP * cache, \fBnetsnmp_agent_request_info\fP * reqinfo, const char * name)"
215
182
.PP
216
183
Insert the cache information for a given request (PDU). 
217
184
.PP
218
185
Definition at line 333 of file cache_handler.c.
219
 
.PP
220
 
References _build_cache_name(), netsnmp_agent_add_list_data(), netsnmp_agent_get_list_data(), netsnmp_create_data_list(), NULL, and SNMP_FREE.
221
 
.PP
222
 
Referenced by netsnmp_cache_helper_handler().
223
186
.SS "unsigned int netsnmp_cache_timer_start (\fBnetsnmp_cache\fP * cache)"
224
187
.PP
225
188
starts the recurring cache_load callback 
226
189
.PP
227
190
Definition at line 191 of file cache_handler.c.
228
 
.PP
229
 
References netsnmp_cache_s::flags, NULL, netsnmp_cache_s::rootoid, netsnmp_cache_s::rootoid_len, snmp_alarm_register(), snmp_log(), netsnmp_cache_s::timeout, and netsnmp_cache_s::timer_id.
230
 
.PP
231
 
Referenced by netsnmp_cache_handler_get().
232
191
.SS "void netsnmp_cache_timer_stop (\fBnetsnmp_cache\fP * cache)"
233
192
.PP
234
193
stops the recurring cache_load callback 
235
194
.PP
236
195
Definition at line 226 of file cache_handler.c.
237
 
.PP
238
 
References netsnmp_cache_s::flags, NULL, snmp_alarm_unregister(), snmp_log(), and netsnmp_cache_s::timer_id.
239
196
.SS "\fBnetsnmp_cache\fP* netsnmp_extract_cache_info (\fBnetsnmp_agent_request_info\fP * reqinfo)"
240
197
.PP
241
198
Extract the cache information for a given request (PDU). 
242
199
.PP
243
200
Definition at line 362 of file cache_handler.c.
244
 
.PP
245
 
References netsnmp_cache_reqinfo_extract().
246
201
.SS "\fBnetsnmp_mib_handler\fP* netsnmp_get_cache_handler (int timeout, NetsnmpCacheLoad * load_hook, NetsnmpCacheFree * free_hook, oid * rootoid, int rootoid_len)"
247
202
.PP
248
203
returns a cache handler that can be injected into a given handler chain. 
249
204
.PP
250
205
Definition at line 276 of file cache_handler.c.
251
 
.PP
252
 
References netsnmp_mib_handler_s::myvoid, netsnmp_cache_create(), netsnmp_cache_handler_get(), and NULL.
253
 
.PP
254
 
Referenced by netsnmp_register_cache_handler().
255
206
.SS "int netsnmp_is_cache_valid (\fBnetsnmp_agent_request_info\fP * reqinfo)"
256
207
.PP
257
 
for backwards compat 
 
208
Is the cache valid for a given request? for backwards compatability. for backwards compat
258
209
.PP
259
210
\fBnetsnmp_cache_is_valid()\fP is preferred. 
260
211
.PP
261
212
Definition at line 413 of file cache_handler.c.
262
 
.PP
263
 
References netsnmp_cache_is_valid().
264
213
.SS "int netsnmp_register_cache_handler (\fBnetsnmp_handler_registration\fP * reginfo, int timeout, NetsnmpCacheLoad * load_hook, NetsnmpCacheFree * free_hook)"
265
214
.PP
266
215
functionally the same as calling \fBnetsnmp_register_handler()\fP but also injects a cache handler at the same time for you. 
267
216
.PP
268
217
Definition at line 308 of file cache_handler.c.
269
 
.PP
270
 
References netsnmp_get_cache_handler(), netsnmp_inject_handler(), netsnmp_register_handler(), NULL, netsnmp_handler_registration_s::rootoid, and netsnmp_handler_registration_s::rootoid_len.
271
218
.SS "void release_cached_resources (unsigned int regNo, void * clientargs)"
272
219
.PP
273
 
run regularly to automatically release cached resources. 
274
 
.PP
275
 
xxx - method to prevent cache from expiring while a request is being processed (e.g. delegated request). proposal: set a flag, which would be cleared when request finished (which could be acomplished by a dummy data list item in agent req info & custom free function). 
 
220
run regularly to automatically release cached resources. xxx - method to prevent cache from expiring while a request is being processed (e.g. delegated request). proposal: set a flag, which would be cleared when request finished (which could be acomplished by a dummy data list item in agent req info & custom free function). 
276
221
.PP
277
222
Definition at line 575 of file cache_handler.c.
278
 
.PP
279
 
References netsnmp_cache_s::flags, netsnmp_cache_check_expired(), netsnmp_cache_s::next, NULL, and netsnmp_cache_s::valid.
 
223
.SH "Author"
 
224
.PP 
 
225
Generated automatically by Doxygen for net-snmp from the source code.