net-snmp 5.7
|
Maintain the cache used for locating sub-trees and OIDs. More...
Data Structures | |
struct | lookup_cache_context_s |
Typedefs | |
typedef struct lookup_cache_context_s | lookup_cache_context |
Functions | |
void | netsnmp_set_lookup_cache_size (int newsize) |
Set the lookup cache size for optimized agent registration performance. | |
int | netsnmp_get_lookup_cache_size (void) |
Retrieves the current value of the lookup cache size Should be called from master agent only - sub-agent doesn't need the cache. | |
NETSNMP_STATIC_INLINE lookup_cache_context * | get_context_lookup_cache (const char *context) |
Returns lookup cache entry for the context of given name. | |
NETSNMP_STATIC_INLINE void | lookup_cache_add (const char *context, netsnmp_subtree *next, netsnmp_subtree *previous) |
Adds an entry to the Lookup Cache under specified context name. | |
NETSNMP_STATIC_INLINE lookup_cache * | lookup_cache_find (const char *context, const oid *name, size_t name_len, int *retcmp) |
Finds an entry in the Lookup Cache. | |
void | clear_lookup_cache (void) |
Variables | |
lookup_cache |
Maintain the cache used for locating sub-trees and OIDs.
NETSNMP_STATIC_INLINE lookup_cache_context* get_context_lookup_cache | ( | const char * | context | ) |
Returns lookup cache entry for the context of given name.
context | Name of the context. Name is case sensitive. |
Definition at line 142 of file agent_registry.c.
NETSNMP_STATIC_INLINE void lookup_cache_add | ( | const char * | context, |
netsnmp_subtree * | next, | ||
netsnmp_subtree * | previous | ||
) |
Adds an entry to the Lookup Cache under specified context name.
context | Name of the context. Name is case sensitive. |
next | Next subtree item. |
previous | Previous subtree item. |
Definition at line 173 of file agent_registry.c.
NETSNMP_STATIC_INLINE lookup_cache* lookup_cache_find | ( | const char * | context, |
const oid * | name, | ||
size_t | name_len, | ||
int * | retcmp | ||
) |
Finds an entry in the Lookup Cache.
context | Case sensitive name of the context. |
name | The OID we're searching for. |
name_len | Number of sub-ids (single integers) in the OID. |
retcmp | Value set to snmp_oid_compare() call result. The value, if set, is always nonnegative. |
Definition at line 223 of file agent_registry.c.
int netsnmp_get_lookup_cache_size | ( | void | ) |
Retrieves the current value of the lookup cache size Should be called from master agent only - sub-agent doesn't need the cache.
Definition at line 131 of file agent_registry.c.
void netsnmp_set_lookup_cache_size | ( | int | newsize | ) |
Set the lookup cache size for optimized agent registration performance.
Note that it is only used by master agent - sub-agent doesn't need the cache. The rough guide is that the cache size should be equal to the maximum number of simultaneous managers you expect to talk to the agent (M) times 80% (or so, he says randomly) the average number (N) of varbinds you expect to receive in a given request for a manager. ie, M times N. Bigger does NOT necessarily mean better. Certainly 16 should be an upper limit. 32 is the hard coded limit.
newsize | set to the maximum size of a cache for a given context. Set to 0 to completely disable caching, or to -1 to set to the default cache size (8), or to a number of your chosing. The |
Definition at line 116 of file agent_registry.c.