table
[Net-SNMP Agent handler and extensibility API]

Helps you implement a table. [詳細]


モジュール

 table_array
 Helps you implement a table when data can be stored locally.
 table_container
 Helps you implement a table when data can be found via a netsnmp_container.
 table_data
 Helps you implement a table with datamatted storage.
 generic_table_API
 General requirements for a table helper.
 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.
 tdata
 Implement a table with datamatted storage.

マクロ定義

#define SPARSE_TABLE_HANDLER_NAME   "sparse_table"

関数

netsnmp_mib_handlernetsnmp_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_infonetsnmp_extract_table_info (netsnmp_request_info *request)
 Extracts the processed table information from a given request.
netsnmp_table_registration_infonetsnmp_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_handlernetsnmp_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.

説明

Helps you implement a table.

This handler helps you implement a table by doing some of the processing for you.

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.


関数

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.

returns 1 if outvar was replaced with the oid from newvar (success). returns 0 if not.

table.c884 行で定義されています。

参照先 build_oid_noalloc()variable_list::namevariable_list::name_lengthnetsnmp_request_info_s::requestvbsnmp_clone_varbind()snmp_oid_compare()snmp_set_var_objid()snmp_set_var_typed_value()netsnmp_vardata::stringvariable_list::typevariable_list::valvariable_list::val_len.

NETSNMP_INLINE netsnmp_table_request_info* netsnmp_extract_table_info ( netsnmp_request_info request  ) 

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.

引数:
request populated netsnmp request structure
戻り値:
populated netsnmp_table_request_info structure

table.c125 行で定義されています。

参照先 netsnmp_request_get_list_data().

参照元 _netsnmp_tdata_helper_handler()netsnmp_container_table_row_insert()netsnmp_insert_iterator_context()netsnmp_insert_table_row()netsnmp_table_data_helper_handler()netsnmp_table_data_set_helper_handler()netsnmp_table_iterator_helper_handler()table_helper_handler().

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

table.c134 行で定義されています。

参照先 netsnmp_find_handler_data_by_name().

参照元 netsnmp_table_data_helper_handler()netsnmp_table_iterator_helper_handler().

netsnmp_mib_handler* netsnmp_get_table_handler ( netsnmp_table_registration_info tabreq  ) 

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.

引数:
tabreq is a pointer to a netsnmp_table_registration_info struct. The table handler needs to know up front how your table is structured. A netsnmp_table_registeration_info structure that is passed to the table handler should contain the asn index types for the table as well as the minimum and maximum column that should be used.
戻り値:
Returns a pointer to a netsnmp_mib_handler struct which contains the handler's name and the access method

table.c85 行で定義されています。

参照先 count_varbinds()netsnmp_table_registration_info_s::indexesnetsnmp_mib_handler_s::myvoidnetsnmp_create_handler()NULLnetsnmp_table_registration_info_s::number_indexessnmp_log()table_helper_handler().

参照元 netsnmp_register_table()netsnmp_sparse_table_register().

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.

table.c108 行で定義されています。

参照先 netsnmp_get_table_handler()netsnmp_inject_handler()netsnmp_register_handler().

参照元 netsnmp_container_table_register()netsnmp_register_table_data()netsnmp_register_table_iterator()netsnmp_table_container_register().

netsnmp_mib_handler* netsnmp_sparse_table_handler_get ( void   ) 

create sparse table handler

table.c722 行で定義されています。

参照先 netsnmp_create_handler()SPARSE_TABLE_HANDLER_NAME.

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.

table.c733 行で定義されています。

参照先 netsnmp_create_handler()netsnmp_get_table_handler()netsnmp_inject_handler()netsnmp_register_handler()SPARSE_TABLE_HANDLER_NAME.

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.

Index values are extracted from the table_info varbinds.

.Entry

.column

table.c784 行で定義されています。

参照先 build_oid()netsnmp_table_request_info_s::colnumnetsnmp_table_request_info_s::indexesvariable_list::namevariable_list::name_lengthnetsnmp_request_info_s::requestvbnetsnmp_handler_registration_s::rootoidnetsnmp_handler_registration_s::rootoid_len.

参照元 netsnmp_table_build_result().

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.

Index values are extracted from the table_info index oid.

table.c821 行で定義されています。

参照先 netsnmp_table_request_info_s::colnumnetsnmp_table_request_info_s::index_oidnetsnmp_table_request_info_s::index_oid_lenvariable_list::namevariable_list::name_lengthvariable_list::name_locnetsnmp_request_info_s::requestvbnetsnmp_handler_registration_s::rootoidnetsnmp_handler_registration_s::rootoid_lensnmp_clone_mem()SNMP_FREE.

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.

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.

table.c751 行で定義されています。

参照先 variable_list::namevariable_list::name_locnetsnmp_table_build_oid()NULLnetsnmp_request_info_s::requestvbsnmp_set_var_typed_value().

int netsnmp_update_indexes_from_variable_list ( netsnmp_table_request_info tri  ) 

builds an oid given a set of indexes.

table.c866 行で定義されています。

参照先 build_oid_noalloc()netsnmp_table_request_info_s::index_oidnetsnmp_table_request_info_s::index_oid_lennetsnmp_table_request_info_s::indexesNULL.

int netsnmp_update_variable_list_from_index ( netsnmp_table_request_info tri  ) 

parses an OID into table indexses

table.c850 行で定義されています。

参照先 netsnmp_table_request_info_s::index_oidnetsnmp_table_request_info_s::index_oid_lennetsnmp_table_request_info_s::indexesparse_oid_indexes()snmp_reset_var_buffers().

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

XXX-rks: memory leak. add cleanup handler?

none available

got one ok

for loop

table.c142 行で定義されています。

参照先 netsnmp_table_request_info_s::colnumnetsnmp_mib_handler_s::handler_namenetsnmp_table_request_info_s::index_oidnetsnmp_table_request_info_s::index_oid_lennetsnmp_table_request_info_s::indexesnetsnmp_table_registration_info_s::indexesnetsnmp_table_registration_info_s::max_columnnetsnmp_table_registration_info_s::min_columnnetsnmp_agent_request_info_s::modenetsnmp_mib_handler_s::myvoidnetsnmp_agent_get_list_data()netsnmp_call_next_handler()netsnmp_create_data_list()netsnmp_extract_table_info()netsnmp_free_agent_data_sets()netsnmp_request_add_list_data()netsnmp_set_request_error()netsnmp_request_info_s::nextnetsnmp_mib_handler_s::nextvariable_list::next_variableNULLnetsnmp_table_registration_info_s::number_indexesnetsnmp_table_request_info_s::number_indexesparse_one_oid_index()netsnmp_request_info_s::processednetsnmp_table_request_info_s::reg_infonetsnmp_request_info_s::requestvbnetsnmp_handler_registration_s::rootoidnetsnmp_handler_registration_s::rootoid_lensnmp_clone_varbind()SNMP_FREEsnmp_log()SNMP_MALLOC_TYPEDEFsnmp_oid_compare()snmp_set_var_objid()sprint_realloc_by_type()netsnmp_request_info_s::statusvariable_list::typenetsnmp_table_registration_info_s::valid_columns.

参照元 netsnmp_get_table_handler().


net-snmpに対してSat Sep 5 13:14:29 2009に生成されました。  doxygen 1.4.7