1
#ifndef NETSNMP_CACHE_HANDLER_H
2
#define NETSNMP_CACHE_HANDLER_H
5
* This caching helper provides a generalised (SNMP-manageable) caching
6
* mechanism. Individual SNMP table and scalar/scalar group MIB
7
* implementations can use data caching in a consistent manner, without
8
* needing to handle the generic caching details themselves.
11
#include <net-snmp/library/tools.h>
17
#define CACHE_NAME "cache_info"
19
typedef struct netsnmp_cache_s netsnmp_cache;
21
typedef int (NetsnmpCacheLoad)(netsnmp_cache *, void*);
22
typedef void (NetsnmpCacheFree)(netsnmp_cache *, void*);
24
struct netsnmp_cache_s {
26
* For operation of the data caches
30
int timeout; /* Length of time the cache is valid (in s) */
31
marker_t timestamp; /* When the cache was last loaded */
33
NetsnmpCacheLoad *load_cache;
34
NetsnmpCacheFree *free_cache;
35
void *magic; /* You never know when it might
36
not come in useful .... */
39
* For SNMP-management of the data caches
41
netsnmp_cache *next, *prev;
47
netsnmp_cache* netsnmp_extract_cache_info(netsnmp_agent_request_info *);
48
int netsnmp_is_cache_valid( netsnmp_agent_request_info *);
49
netsnmp_mib_handler *netsnmp_get_cache_handler(int, NetsnmpCacheLoad *,
52
int netsnmp_register_cache_handler(netsnmp_handler_registration *reginfo,
53
int, NetsnmpCacheLoad *,
56
Netsnmp_Node_Handler netsnmp_cache_helper_handler;
61
#endif /* NETSNMP_CACHE_HANDLER_H */