net-snmp 5.7
Functions | Variables
Context cache, storing the OIDs under their contexts.
Registry of MIB subtrees, modules, sessions, etc

Maintain the cache used for locating sub-trees registered under different contexts. More...

Functions

subtree_context_cacheget_top_context_cache (void)
 Returns the top element of context subtrees cache.
netsnmp_subtreenetsnmp_subtree_find_first (const char *context_name)
 Finds the first subtree registered under given context.
netsnmp_subtreeadd_subtree (netsnmp_subtree *new_tree, const char *context_name)
 Adds the subtree to Context Cache under given context name.
void netsnmp_remove_subtree (netsnmp_subtree *tree)
netsnmp_subtreenetsnmp_subtree_replace_first (netsnmp_subtree *new_tree, const char *context_name)
 Replaces first subtree registered under given context name.
void clear_context (void)
 Completely clears both the Context cache and the Lookup cache.

Variables

subtree_context_cachecontext_subtrees = NULL

Detailed Description

Maintain the cache used for locating sub-trees registered under different contexts.


Function Documentation

netsnmp_subtree* add_subtree ( netsnmp_subtree new_tree,
const char *  context_name 
)

Adds the subtree to Context Cache under given context name.

Parameters:
context_nameText name of the context we're adding.
new_treeThe subtree to be added.
Returns:
copy of the new_tree pointer, or NULL if cannot add.

Definition at line 336 of file agent_registry.c.

void clear_context ( void  )

Completely clears both the Context cache and the Lookup cache.

Definition at line 414 of file agent_registry.c.

subtree_context_cache* get_top_context_cache ( void  )

Returns the top element of context subtrees cache.

Use it if you wish to sweep through the cache elements. Note that the return may be NULL (cache may be empty).

Returns:
pointer to topmost context subtree cache element.

Definition at line 293 of file agent_registry.c.

netsnmp_subtree* netsnmp_subtree_find_first ( const char *  context_name)

Finds the first subtree registered under given context.

Parameters:
context_nameText name of the context we're searching for.
Returns:
pointer to the first subtree element, or NULL if not found.

Definition at line 305 of file agent_registry.c.

netsnmp_subtree* netsnmp_subtree_replace_first ( netsnmp_subtree new_tree,
const char *  context_name 
)

Replaces first subtree registered under given context name.

Overwrites a subtree pointer in Context Cache for the context name. The previous subtree pointer is lost. If there's no subtree under the supplied name, then a new cache item is created.

Parameters:
new_treeThe new subtree to be set.
context_nameText name of the context we're replacing. It is case sensitive.
Returns:
copy of the new_tree pointer, or NULL on error.

Definition at line 391 of file agent_registry.c.