net-snmp 5.7
Defines | Functions
instance
leaf_handlers

Process individual MIB instances easily. More...

Defines

#define free_wrapper   free

Functions

netsnmp_mib_handlernetsnmp_get_instance_handler (void)
 Creates an instance helper handler, calls netsnmp_create_handler, which then could be registered, using netsnmp_register_handler().
int netsnmp_register_instance (netsnmp_handler_registration *reginfo)
 This function registers an instance helper handler, which is a way of registering an exact OID such that GENEXT requests are handled entirely by the helper.
int netsnmp_register_read_only_instance (netsnmp_handler_registration *reginfo)
 This function injects a "read only" handler into the handler chain prior to serializing/registering the handler.
 netsnmp_feature_child_of (read_only_ulong_instance, instance)
 netsnmp_feature_child_of (ulong_instance, instance)
 netsnmp_feature_child_of (read_only_counter32_instance, instance)
 netsnmp_feature_child_of (read_only_long_instance, instance)
 netsnmp_feature_child_of (long_instance, instance)
 netsnmp_feature_child_of (read_only_uint_instance, instance)
 netsnmp_feature_child_of (uint_instance, instance)
 netsnmp_feature_child_of (read_only_int_instance, instance)
 netsnmp_feature_child_of (register_read_only_int_instance, netsnmp_unused)
 netsnmp_feature_child_of (register_read_only_ulong_instance_context, instance)
 netsnmp_feature_child_of (register_ulong_instance_context, instance)
 netsnmp_feature_child_of (register_read_only_counter32_instance_context, instance)
 netsnmp_feature_child_of (register_read_only_long_instance_context, instance)
 netsnmp_feature_child_of (register_long_instance_context, instance)
 netsnmp_feature_child_of (register_int_instance_context, instance)
 netsnmp_feature_child_of (register_read_only_int_instance_context, instance)
 netsnmp_feature_child_of (read_only_int_instance_context, instance)
 netsnmp_feature_child_of (register_num_file_instance, instance)
 netsnmp_feature_child_of (register_int_instance, instance)
 This function registers an int helper handler to a specified OID.
int netsnmp_instance_num_file_handler (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
int netsnmp_instance_helper_handler (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)

Detailed Description

Process individual MIB instances easily.


Function Documentation

netsnmp_feature_child_of ( register_int_instance  ,
instance   
)

This function registers an int helper handler to a specified OID.

Parameters:
namethe name used for registration pruposes.
reg_oidthe OID where you want to register your integer at
reg_oid_lenthe length of the OID
itthe integer value to be registered during initialization
subhandlera handler to do whatever you want to do, otherwise use NULL to use the default int handler.
Returns:
MIB_REGISTERED_OK is returned if the registration was a success. Failures are MIB_REGISTRATION_FAILED and MIB_DUPLICATE_REGISTRATION.

Definition at line 557 of file instance.c.

netsnmp_mib_handler* netsnmp_get_instance_handler ( void  )

Creates an instance helper handler, calls netsnmp_create_handler, which then could be registered, using netsnmp_register_handler().

Returns:
Returns a pointer to a netsnmp_mib_handler struct which contains the handler's name and the access method

Definition at line 71 of file instance.c.

int netsnmp_instance_num_file_handler ( netsnmp_mib_handler handler,
netsnmp_handler_registration reginfo,
netsnmp_agent_request_info reqinfo,
netsnmp_request_info requests 
)

fall through

Definition at line 582 of file instance.c.

int netsnmp_register_instance ( netsnmp_handler_registration reginfo)

This function registers an instance helper handler, which is a way of registering an exact OID such that GENEXT requests are handled entirely by the helper.

First need to inject it into the calling chain of the handler defined by the netsnmp_handler_registration struct, reginfo. The new handler is injected at the top of the list and will be the new handler to be called first. This function also injects a serialize handler before actually calling netsnmp_register_handle, registering reginfo.

Parameters:
reginfoa handler registration structure which could get created using netsnmp_create_handler_registration. Used to register an instance helper handler.
Returns:
MIB_REGISTERED_OK is returned if the registration was a success. Failures are MIB_REGISTRATION_FAILED and MIB_DUPLICATE_REGISTRATION.
Examples:
delayed_instance.c.

Definition at line 96 of file instance.c.

int netsnmp_register_read_only_instance ( netsnmp_handler_registration reginfo)

This function injects a "read only" handler into the handler chain prior to serializing/registering the handler.

The only purpose of this "read only" handler is to return an appropriate error for any requests passed to it in a SET mode. Inserting it into your handler chain will ensure you're never asked to perform a SET request so you can ignore those error conditions.

Parameters:
reginfoa handler registration structure which could get created using netsnmp_create_handler_registration. Used to register a read only instance helper handler.
Returns:
MIB_REGISTERED_OK is returned if the registration was a success. Failures are MIB_REGISTRATION_FAILED and MIB_DUPLICATE_REGISTRATION.

Definition at line 123 of file instance.c.