Modules |
|
| group | table_array: Helps you implement a table when data can be stored locally. The data is stored in a sorted array, using a binary search for lookups. |
| The table_array handler is used (automatically) in conjuntion with the table handler. |
|
| group | table_container: Helps you implement a table when data can be found via a netsnmp_container. |
| The table_container handler is used (automatically) in conjuntion with the table handler. |
|
| group | table_data: Helps you implement a table with datamatted storage. |
| This helper is obsolete. |
|
| group | generic_table_API |
| General requirements for a table helper. |
|
| group | table_iterator: The table iterator helper is designed to simplify the task of writing a table handler for the net-snmp agent when the data being accessed is not in an oid sorted form and must be accessed externally. |
| Functionally, it is a specialized version of the more generic table helper but easies the burden of
GETNEXT processing by manually looping through all the data indexes retrieved through function calls which should be
supplied by the module that wishes help. |
|
| group | tdata: Implement a table with datamatted storage. |
| This helper helps you implement a table where all the rows are expected to be stored within the
agent itself and not in some external storage location. |
|
Defines |
|
| #define | SPARSE_TABLE_HANDLER_NAME "sparse_table" |
Functions |
|
| netsnmp_mib_handler * | netsnmp_get_table_handler (netsnmp_table_registration_info *tabreq) |
| Given a netsnmp_table_registration_info object, creates a table handler. |
|
| int | netsnmp_register_table (netsnmp_handler_registration *reginfo, netsnmp_table_registration_info *tabreq) |
| creates a table handler given the netsnmp_table_registration_info object, inserts it into the
request chain and then calls netsnmp_register_handler() to register the
table into the agent. |
|
| NETSNMP_INLINE netsnmp_table_request_info * | netsnmp_extract_table_info (netsnmp_request_info *request) |
| Extracts the processed table information from a given request. |
|
| netsnmp_table_registration_info * | netsnmp_find_table_registration_info (netsnmp_handler_registration *reginfo) |
| extracts the registered netsnmp_table_registration_info object from a netsnmp_handler_registration
object |
|
| int | table_helper_handler (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) |
| implements the table helper handler |
|
| netsnmp_mib_handler * | netsnmp_sparse_table_handler_get (void) |
| create sparse table handler |
|
| int | netsnmp_sparse_table_register (netsnmp_handler_registration *reginfo, netsnmp_table_registration_info *tabreq) |
| creates a table handler given the netsnmp_table_registration_info object, inserts it into the
request chain and then calls netsnmp_register_handler() to register the
table into the agent. |
|
| int | netsnmp_table_build_result (netsnmp_handler_registration *reginfo, netsnmp_request_info *reqinfo, netsnmp_table_request_info *table_info, u_char type, u_char *result, size_t result_len) |
| Builds the result to be returned to the agent given the table information. |
|
| int | netsnmp_table_build_oid (netsnmp_handler_registration *reginfo, netsnmp_request_info *reqinfo, netsnmp_table_request_info *table_info) |
| given a registration info object, a request object and the table info object it builds the
request->requestvb->name oid from the index values and column information found in the table_info object. |
|
| int | netsnmp_table_build_oid_from_index (netsnmp_handler_registration *reginfo, netsnmp_request_info *reqinfo, netsnmp_table_request_info *table_info) |
| given a registration info object, a request object and the table info object it builds the
request->requestvb->name oid from the index values and column information found in the table_info object. |
|
| int | netsnmp_update_variable_list_from_index (netsnmp_table_request_info *tri) |
| parses an OID into table indexses |
|
| int | netsnmp_update_indexes_from_variable_list (netsnmp_table_request_info *tri) |
| builds an oid given a set of indexes. |
|
| int | netsnmp_check_getnext_reply (netsnmp_request_info *request, oid *prefix, size_t prefix_len, netsnmp_variable_list *newvar, netsnmp_variable_list **outvar) |
| checks the original request against the current data being passed in if its greater than the request
oid but less than the current valid return, set the current valid return to the new value. |
|
This handler truly shows the power of the new handler mechanism. By creating a table handler and injecting it into your calling chain, or by using the netsnmp_register_table() function to register your table, you get access to some pre-parsed information. Specifically, the table handler pulls out the column number and indexes from the request oid so that you don't have to do the complex work to do that parsing within your own code.
To do this, the table handler needs to know up front how your table is structured. To inform it about this, you fill in a table_registeration_info structure that is passed to the table handler. It contains the asn index types for the table as well as the minimum and maximum column that should be used.
|
||||||||||||||||||||||||
|
checks the original request against the current data being passed in if its greater than the request oid but less than the current valid return, set the current valid return to the new value. returns 1 if outvar was replaced with the oid from newvar (success). returns 0 if not. Definition at line 883 of file table.c. References variable_list::name, variable_list::name_length, netsnmp_request_info_s::requestvb, snmp_oid_compare(), snmp_set_var_typed_value(), variable_list::type, variable_list::val, and variable_list::val_len. |
|
|
Extracts the processed table information from a given request. Call this from subhandlers on a request to extract the processed netsnmp_request_info information. The resulting information includes the index values and the column number.
Definition at line 124 of file table.c. References netsnmp_request_get_list_data(). Referenced by _data_lookup(), netsnmp_container_table_row_insert(), netsnmp_insert_iterator_context(), netsnmp_insert_table_row(), and table_helper_handler(). |
|
|
extracts the registered netsnmp_table_registration_info object from a netsnmp_handler_registration object Definition at line 133 of file table.c. References netsnmp_find_handler_data_by_name(), and netsnmp_handler_registration. |
|
|
Given a netsnmp_table_registration_info object, creates a table handler. You can use this table handler by injecting it into a calling chain. When the handler gets called, it'll do processing and store it's information into the request->parent_data structure. The table helper handler pulls out the column number and indexes from the request oid so that you don't have to do the complex work of parsing within your own code.
Definition at line 84 of file table.c. References netsnmp_table_registration_info_s::indexes, netsnmp_mib_handler_s::myvoid, netsnmp_create_handler(), netsnmp_mib_handler, netsnmp_table_registration_info_s::number_indexes, and snmp_log(). Referenced by netsnmp_register_table(), and netsnmp_sparse_table_register(). |
|
||||||||||||
|
creates a table handler given the netsnmp_table_registration_info object, inserts it into the request chain and then calls netsnmp_register_handler() to register the table into the agent. Definition at line 107 of file table.c. References netsnmp_get_table_handler(), netsnmp_handler_registration, netsnmp_inject_handler(), and netsnmp_register_handler(). Referenced by netsnmp_register_table_data(), netsnmp_register_table_iterator(), and netsnmp_table_container_register(). |
|
|
create sparse table handler Definition at line 721 of file table.c. References netsnmp_create_handler(). |
|
||||||||||||
|
creates a table handler given the netsnmp_table_registration_info object, inserts it into the request chain and then calls netsnmp_register_handler() to register the table into the agent. Definition at line 732 of file table.c. References netsnmp_create_handler(), netsnmp_get_table_handler(), netsnmp_handler_registration, netsnmp_inject_handler(), and netsnmp_register_handler(). |
|
||||||||||||||||
|
given a registration info object, a request object and the table info object it builds the request->requestvb->name oid from the index values and column information found in the table_info object. Index values are extracted from the table_info varbinds. .Entry .column Definition at line 783 of file table.c. References build_oid(), netsnmp_table_request_info_s::colnum, netsnmp_table_request_info_s::indexes, variable_list::name, variable_list::name_length, netsnmp_handler_registration, netsnmp_request_info_s::requestvb, netsnmp_handler_registration_s::rootoid, and netsnmp_handler_registration_s::rootoid_len. Referenced by netsnmp_table_build_result(). |
|
||||||||||||||||
|
given a registration info object, a request object and the table info object it builds the request->requestvb->name oid from the index values and column information found in the table_info object. Index values are extracted from the table_info index oid. Definition at line 820 of file table.c. References netsnmp_table_request_info_s::colnum, netsnmp_table_request_info_s::index_oid, netsnmp_table_request_info_s::index_oid_len, variable_list::name, variable_list::name_length, variable_list::name_loc, netsnmp_handler_registration, netsnmp_request_info_s::requestvb, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, and SNMP_FREE. Referenced by _data_lookup(). |
|
||||||||||||||||||||||||||||
|
Builds the result to be returned to the agent given the table information. Use this function to return results from lowel level handlers to the agent. It takes care of building the proper resulting oid (containing proper indexing) and inserts the result value into the returning varbind. Definition at line 750 of file table.c. References variable_list::name, variable_list::name_loc, netsnmp_handler_registration, netsnmp_table_build_oid(), netsnmp_request_info_s::requestvb, and snmp_set_var_typed_value(). |
|
|
builds an oid given a set of indexes. Definition at line 865 of file table.c. References netsnmp_table_request_info_s::index_oid, netsnmp_table_request_info_s::index_oid_len, and netsnmp_table_request_info_s::indexes. Referenced by _data_lookup(). |
|
|
parses an OID into table indexses Definition at line 849 of file table.c. References netsnmp_table_request_info_s::index_oid, netsnmp_table_request_info_s::index_oid_len, and netsnmp_table_request_info_s::indexes. Referenced by _data_lookup(). |
|
||||||||||||||||||||
1.3.9.1
Last modified: Thursday, 01-Mar-2007 16:20:03 PST
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.