126
127
Reload the cache if required.
128
129
Definition at line 385 of file cache_handler.c.
130
References netsnmp_cache_check_expired(), and netsnmp_cache_s::valid.
132
Referenced by netsnmp_cache_helper_handler().
133
130
.SS "int netsnmp_cache_check_expired (\fBnetsnmp_cache\fP * cache)"
135
Check if the cache timeout has passed.
137
Sets and return the expired flag.
132
Check if the cache timeout has passed. Sets and return the expired flag.
139
134
Definition at line 370 of file cache_handler.c.
141
References atime_ready(), netsnmp_cache_s::expired, NULL, netsnmp_cache_s::timeout, netsnmp_cache_s::timestamp, and netsnmp_cache_s::valid.
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)"
148
139
Definition at line 136 of file cache_handler.c.
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.
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)"
155
142
find existing cache
157
144
Definition at line 120 of file cache_handler.c.
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)"
167
152
returns a cache handler that can be injected into a given handler chain.
169
154
Definition at line 247 of file cache_handler.c.
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.
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)"
176
157
functionally the same as calling \fBnetsnmp_register_handler()\fP but also injects a cache handler at the same time for you.
178
159
Definition at line 295 of file cache_handler.c.
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)"
183
162
Implements the cache handler.
189
168
next handler called automatically - 'AUTO_NEXT'
191
170
Definition at line 420 of file cache_handler.c.
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.
195
Referenced by netsnmp_cache_handler_get().
196
171
.SS "int netsnmp_cache_is_valid (\fBnetsnmp_agent_request_info\fP * reqinfo, const char * name)"
198
173
Is the cache valid for a given request?
200
175
Definition at line 402 of file cache_handler.c.
202
References netsnmp_cache_reqinfo_extract(), and netsnmp_cache_s::valid.
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)"
207
178
Extract the cache information for a given request (PDU).
209
180
Definition at line 350 of file cache_handler.c.
211
References _build_cache_name(), netsnmp_agent_get_list_data(), and SNMP_FREE.
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)"
216
183
Insert the cache information for a given request (PDU).
218
185
Definition at line 333 of file cache_handler.c.
220
References _build_cache_name(), netsnmp_agent_add_list_data(), netsnmp_agent_get_list_data(), netsnmp_create_data_list(), NULL, and SNMP_FREE.
222
Referenced by netsnmp_cache_helper_handler().
223
186
.SS "unsigned int netsnmp_cache_timer_start (\fBnetsnmp_cache\fP * cache)"
225
188
starts the recurring cache_load callback
227
190
Definition at line 191 of file cache_handler.c.
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.
231
Referenced by netsnmp_cache_handler_get().
232
191
.SS "void netsnmp_cache_timer_stop (\fBnetsnmp_cache\fP * cache)"
234
193
stops the recurring cache_load callback
236
195
Definition at line 226 of file cache_handler.c.
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)"
241
198
Extract the cache information for a given request (PDU).
243
200
Definition at line 362 of file cache_handler.c.
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)"
248
203
returns a cache handler that can be injected into a given handler chain.
250
205
Definition at line 276 of file cache_handler.c.
252
References netsnmp_mib_handler_s::myvoid, netsnmp_cache_create(), netsnmp_cache_handler_get(), and NULL.
254
Referenced by netsnmp_register_cache_handler().
255
206
.SS "int netsnmp_is_cache_valid (\fBnetsnmp_agent_request_info\fP * reqinfo)"
208
Is the cache valid for a given request? for backwards compatability. for backwards compat
259
210
\fBnetsnmp_cache_is_valid()\fP is preferred.
261
212
Definition at line 413 of file cache_handler.c.
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)"
266
215
functionally the same as calling \fBnetsnmp_register_handler()\fP but also injects a cache handler at the same time for you.
268
217
Definition at line 308 of file cache_handler.c.
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)"
273
run regularly to automatically release cached resources.
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).
277
222
Definition at line 575 of file cache_handler.c.
279
References netsnmp_cache_s::flags, netsnmp_cache_check_expired(), netsnmp_cache_s::next, NULL, and netsnmp_cache_s::valid.
225
Generated automatically by Doxygen for net-snmp from the source code.