On 2 February 2011 04:25, shankar <[email protected]> wrote:
> ... i need some information regarding some API`s, listed under
>
> netsnmp_create_handler_registration
This routine is used to set up a mapping between a region of
the OID tree (parameters 3&4), and a particular handler routine
(parameter 2)
When the agent receives a request that refers to an OID
within this subtree, it will call the specified handler to deal
with this request.
Strictly speaking, netsnmp_create_handler_registration sets
up a data structure, which is then passed to a routine
netsnmp_register_{something} ( netsnmp_register_instance in
this case) which actually sets up the mapping
> snmp_set_var_typed_value
"Here's a varbind structure (parameter 1).
Set the type (parameter 2) and value (parameters 3 &4)"
See the netsnmp_varbind_api(3) man page
Both of these are standard parts of most MIB module implentations.
If you look through the agent source, you should find plenty of
examples of these calls.
> netsnmp_request_add_list_data
This is a bit more specialised.
It's basically saying
"please associate this item of information with this request,
so that I can retrieve it later"
The call "netsnmp_create_data_list()" gives a name to this
information, and "netsnmp_request_add_list_data()"
attaches this name/value pair to the request.
It's up to the MIB module code, as to how this might be used.
In this case, it's used to save the old value (from before the
SET request), in case it's necessary to reverse the assignment.
If you look at the UNDO block, this uses netsnmp_request_get_list_data()
to retrieve this old value.
Other MIB modules (particularly table-based handlers) often use
different techniques to achieve the same UNDO effect, so there
are fewer examples of this within the agent code.
But the 'data_list' mechanism is a fairly general purpose one,
and can be used for all sorts of data storage/retrieval purposes.
Dave
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders