---
name: "netsnmp_stash_cache"
section: "3snmp"
platform: "linux"
package: "libsnmp-dev"
version: "5.4.3~dfsg-2.8+deb7u1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/netsnmp_stash_cache"
---

# netsnmp\_stash\_cache(3snmp)

Automatically caches data for certain handlers.

## NAME

stash\_cache -

Automatically caches data for certain handlers.

### Functions

**netsnmp\_stash\_cache\_info** \* **netsnmp\_get\_new\_stash\_cache** (void)\
 **netsnmp\_mib\_handler** \* **netsnmp\_get\_timed\_bare\_stash\_cache\_handler** (int timeout, oid \*rootoid, size\_t rootoid\_len)\
 *returns a stash\_cache handler that can be injected into a given handler chain (with the specified timeout and root OID values), but \*only\* if that handler chain explicitly supports stash cache processing.*  **netsnmp\_mib\_handler** \* **netsnmp\_get\_bare\_stash\_cache\_handler** (void)\
 *returns a single stash\_cache handler that can be injected into a given handler chain (with a fixed timeout), but \*only\* if that handler chain explicitly supports stash cache processing.*  **netsnmp\_mib\_handler** \* **netsnmp\_get\_stash\_cache\_handler** (void)\
 *returns a stash\_cache handler sub-chain that can be injected into a given (arbitrary) handler chain, using a fixed cache timeout.*  **netsnmp\_mib\_handler** \* **netsnmp\_get\_timed\_stash\_cache\_handler** (int timeout, oid \*rootoid, size\_t rootoid\_len)\
 *returns a stash\_cache handler sub-chain that can be injected into a given (arbitrary) handler chain, using a configurable cache timeout.*  **netsnmp\_oid\_stash\_node** \*\* **netsnmp\_extract\_stash\_cache** (**netsnmp\_agent\_request\_info** \*reqinfo)\
 *extracts a pointer to the stash\_cache info from the reqinfo structure.*  int **netsnmp\_stash\_cache\_helper** (**netsnmp\_mib\_handler** \*handler, **netsnmp\_handler\_registration** \*reginfo, **netsnmp\_agent\_request\_info** \*reqinfo, **netsnmp\_request\_info** \*requests)\
 int **\_netsnmp\_stash\_cache\_load** (**netsnmp\_cache** \*cache, void \*magic)\
 *updates a given cache depending on whether it needs to or not.*  void **\_netsnmp\_stash\_cache\_free** (**netsnmp\_cache** \*cache, void \*magic)\
 void **netsnmp\_init\_stash\_cache\_helper** (void)\
 *initializes the stash\_cache helper which then registers a stash\_cache handler as a run-time injectable handler for configuration file use.*

## Detailed Description

Automatically caches data for certain handlers.

This handler caches data in an optimized way which may aleviate the need for the lower level handlers to perform as much optimization. Specifically, somewhere in the lower level handlers must be a handler that supports the MODE\_GET\_STASH operation. Note that the table\_iterator helper supports this.

## Function Documentation

### int \_netsnmp\_stash\_cache\_load (netsnmp\_cache \* cache, void \* magic)

updates a given cache depending on whether it needs to or not.

Definition at line 195 of file stash\_cache.c.

### netsnmp\_oid\_stash\_node\*\* netsnmp\_extract\_stash\_cache (netsnmp\_agent\_request\_info \* reqinfo)

extracts a pointer to the stash\_cache info from the reqinfo structure.

Definition at line 113 of file stash\_cache.c.

### netsnmp\_mib\_handler\* netsnmp\_get\_bare\_stash\_cache\_handler (void)

returns a single stash\_cache handler that can be injected into a given handler chain (with a fixed timeout), but \*only\* if that handler chain explicitly supports stash cache processing.

Definition at line 79 of file stash\_cache.c.

### netsnmp\_mib\_handler\* netsnmp\_get\_stash\_cache\_handler (void)

returns a stash\_cache handler sub-chain that can be injected into a given (arbitrary) handler chain, using a fixed cache timeout.

Definition at line 88 of file stash\_cache.c.

### netsnmp\_mib\_handler\* netsnmp\_get\_timed\_bare\_stash\_cache\_handler (int timeout, oid \* rootoid, size\_t rootoid\_len)

returns a stash\_cache handler that can be injected into a given handler chain (with the specified timeout and root OID values), but \*only\* if that handler chain explicitly supports stash cache processing.

Definition at line 44 of file stash\_cache.c.

### netsnmp\_mib\_handler\* netsnmp\_get\_timed\_stash\_cache\_handler (int timeout, oid \* rootoid, size\_t rootoid\_len)

returns a stash\_cache handler sub-chain that can be injected into a given (arbitrary) handler chain, using a configurable cache timeout.

Definition at line 101 of file stash\_cache.c.

### void netsnmp\_init\_stash\_cache\_helper (void)

initializes the stash\_cache helper which then registers a stash\_cache handler as a run-time injectable handler for configuration file use.

Definition at line 238 of file stash\_cache.c.

## Author

Generated automatically by Doxygen for net-snmp from the source code.
