net-snmp 5.7
Data Structures | Defines | Typedefs | Functions
agent_handler.h File Reference

Go to the source code of this file.

Data Structures

struct  netsnmp_mib_handler_s
 the mib handler structure to be registered More...
struct  netsnmp_handler_registration_s
 Root registration info. More...
struct  netsnmp_handler_args_s
struct  netsnmp_delegated_cache_s

Defines

#define MIB_HANDLER_AUTO_NEXT   0x00000001
#define MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE   0x00000002
#define MIB_HANDLER_INSTANCE   0x00000004
#define MIB_HANDLER_CUSTOM4   0x10000000
#define MIB_HANDLER_CUSTOM3   0x20000000
#define MIB_HANDLER_CUSTOM2   0x40000000
#define MIB_HANDLER_CUSTOM1   0x80000000
#define HANDLER_CAN_GETANDGETNEXT   0x01
#define HANDLER_CAN_SET   0x02
#define HANDLER_CAN_GETBULK   0x04
#define HANDLER_CAN_NOT_CREATE   0x08
#define HANDLER_CAN_BABY_STEP   0x10
#define HANDLER_CAN_STASH   0x20
#define HANDLER_CAN_RONLY   (HANDLER_CAN_GETANDGETNEXT)
#define HANDLER_CAN_RWRITE   (HANDLER_CAN_GETANDGETNEXT | HANDLER_CAN_SET)
#define HANDLER_CAN_SET_ONLY   (HANDLER_CAN_SET | HANDLER_CAN_NOT_CREATE)
#define HANDLER_CAN_DEFAULT   (HANDLER_CAN_RONLY | HANDLER_CAN_NOT_CREATE)
#define REQUEST_IS_DELEGATED   1
#define REQUEST_IS_NOT_DELEGATED   0

Typedefs

typedef struct
netsnmp_mib_handler_s 
netsnmp_mib_handler
 Typedefs the netsnmp_mib_handler_s struct into netsnmp_mib_handler.
typedef struct
netsnmp_handler_registration_s 
netsnmp_handler_registration
 Typedefs the netsnmp_handler_registration_s struct into netsnmp_handler_registration.
typedef int( Netsnmp_Node_Handler )(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
typedef struct
netsnmp_handler_args_s 
netsnmp_handler_args
typedef struct
netsnmp_delegated_cache_s 
netsnmp_delegated_cache

Functions

int netsnmp_register_handler (netsnmp_handler_registration *reginfo)
 Registers a MIB handler inside the registration structure.
int netsnmp_unregister_handler (netsnmp_handler_registration *reginfo)
 Unregisters a MIB handler described inside the registration structure.
int netsnmp_register_handler_nocallback (netsnmp_handler_registration *reginfo)
 Registers a MIB handler inside the registration structure.
int netsnmp_inject_handler (netsnmp_handler_registration *reginfo, netsnmp_mib_handler *handler)
 Injects handler into the calling chain of handlers.
int netsnmp_inject_handler_before (netsnmp_handler_registration *reginfo, netsnmp_mib_handler *handler, const char *before_what)
 Injects handler into the calling chain of handlers.
netsnmp_mib_handlernetsnmp_find_handler_by_name (netsnmp_handler_registration *reginfo, const char *name)
 Returns a MIB handler from a chain based on the name.
void * netsnmp_find_handler_data_by_name (netsnmp_handler_registration *reginfo, const char *name)
 Returns a handler's void pointer from a chain based on the name.
NETSNMP_INLINE int netsnmp_call_handler (netsnmp_mib_handler *next_handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
 Calls a MIB handlers chain, starting with specific handler.
int netsnmp_call_next_handler_one_request (netsnmp_mib_handler *current, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
netsnmp_mib_handlernetsnmp_create_handler (const char *name, Netsnmp_Node_Handler *handler_access_method)
netsnmp_handler_registrationnetsnmp_handler_registration_create (const char *name, netsnmp_mib_handler *handler, const oid *reg_oid, size_t reg_oid_len, int modes)
 Creates a MIB handler structure.
netsnmp_handler_registrationnetsnmp_create_handler_registration (const char *name, Netsnmp_Node_Handler *handler_access_method, const oid *reg_oid, size_t reg_oid_len, int modes)
 Creates a handler registration structure with a new MIB handler.
NETSNMP_INLINE
netsnmp_delegated_cache
netsnmp_create_delegated_cache (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests, void *localinfo)
 Creates a cache of information which can be saved for future reference.
NETSNMP_INLINE void netsnmp_free_delegated_cache (netsnmp_delegated_cache *dcache)
 Free a cache once it's no longer used.
NETSNMP_INLINE
netsnmp_delegated_cache
netsnmp_handler_check_cache (netsnmp_delegated_cache *dcache)
 Check if a given delegated cache is still valid.
void netsnmp_register_handler_by_name (const char *name, netsnmp_mib_handler *handler)
 Registers a given handler by name, so that it can be found easily later.
void netsnmp_clear_handler_list (void)
 Clears the entire MIB Handlers registration list.
NETSNMP_INLINE void netsnmp_request_add_list_data (netsnmp_request_info *request, netsnmp_data_list *node)
 Adds data from node list to the request information structure.
NETSNMP_INLINE int netsnmp_request_remove_list_data (netsnmp_request_info *request, const char *name)
 Removes all data from a request.
void * netsnmp_request_get_list_data (netsnmp_request_info *request, const char *name)
 Extracts data from a request.
NETSNMP_INLINE void netsnmp_free_request_data_set (netsnmp_request_info *request)
 Free the extra data stored in a request.
NETSNMP_INLINE void netsnmp_free_request_data_sets (netsnmp_request_info *request)
 Free the extra data stored in a bunch of requests.
void netsnmp_handler_free (netsnmp_mib_handler *handler)
 Deallocates resources associated with a given handler.
netsnmp_mib_handlernetsnmp_handler_dup (netsnmp_mib_handler *handler)
 Duplicates a MIB handler and all subsequent handlers.
netsnmp_handler_registrationnetsnmp_handler_registration_dup (netsnmp_handler_registration *reginfo)
 Duplicates handler registration object and all subsequent handlers.
void netsnmp_handler_registration_free (netsnmp_handler_registration *reginfo)
 Free resources associated with a handler registration object.
void netsnmp_handler_mark_requests_as_delegated (netsnmp_request_info *requests, int isdelegated)
 Sets a list of requests as delegated or not delegated.
void * netsnmp_handler_get_parent_data (netsnmp_request_info *, const char *)

Detailed Description

Definition in file agent_handler.h.