blob: a070a5a72fd5dbc42ca5993c1518ca5e045289e8 [file] [log] [blame]
.TH "table" 3 "31 May 2012" "Version 5.5.2.rc2" "net-snmp" \" -*- nroff -*-
.ad l
.nh
.SH NAME
table \-
.PP
Helps you implement a table.
.SS "Modules"
.in +1c
.ti -1c
.RI "\fBtable_array\fP"
.br
.PP
.RI "\fIHelps you implement a table when data can be stored locally. \fP"
.ti -1c
.RI "\fBtable_container\fP"
.br
.PP
.RI "\fIHelps you implement a table when data can be found via a netsnmp_container. \fP"
.ti -1c
.RI "\fBtable_data\fP"
.br
.PP
.RI "\fIHelps you implement a table with datamatted storage. \fP"
.ti -1c
.RI "\fBgeneric_table_API\fP"
.br
.PP
.RI "\fIGeneral requirements for a table helper. \fP"
.ti -1c
.RI "\fBtable_iterator\fP"
.br
.PP
.RI "\fIThe 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. \fP"
.ti -1c
.RI "\fBtable_row\fP"
.br
.PP
.RI "\fIHelps you implement a table shared across two or more subagents, or otherwise split into individual row slices. \fP"
.ti -1c
.RI "\fBtdata\fP"
.br
.PP
.RI "\fIImplement a table with datamatted storage. \fP"
.in -1c
.SS "Defines"
.in +1c
.ti -1c
.RI "#define \fBSPARSE_TABLE_HANDLER_NAME\fP 'sparse_table'"
.br
.in -1c
.SS "Functions"
.in +1c
.ti -1c
.RI "\fBnetsnmp_mib_handler\fP * \fBnetsnmp_get_table_handler\fP (\fBnetsnmp_table_registration_info\fP *tabreq)"
.br
.RI "\fIGiven a netsnmp_table_registration_info object, creates a table handler. \fP"
.ti -1c
.RI "int \fBnetsnmp_register_table\fP (\fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_table_registration_info\fP *tabreq)"
.br
.RI "\fIcreates a table handler given the netsnmp_table_registration_info object, inserts it into the request chain and then calls \fBnetsnmp_register_handler()\fP to register the table into the agent. \fP"
.ti -1c
.RI "int \fBnetsnmp_unregister_table\fP (\fBnetsnmp_handler_registration\fP *reginfo)"
.br
.ti -1c
.RI "NETSNMP_INLINE \fBnetsnmp_table_request_info\fP * \fBnetsnmp_extract_table_info\fP (\fBnetsnmp_request_info\fP *request)"
.br
.RI "\fIExtracts the processed table information from a given request. \fP"
.ti -1c
.RI "\fBnetsnmp_table_registration_info\fP * \fBnetsnmp_find_table_registration_info\fP (\fBnetsnmp_handler_registration\fP *reginfo)"
.br
.RI "\fIextracts the registered netsnmp_table_registration_info object from a netsnmp_handler_registration object \fP"
.ti -1c
.RI "int \fBtable_helper_handler\fP (\fBnetsnmp_mib_handler\fP *handler, \fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_agent_request_info\fP *reqinfo, \fBnetsnmp_request_info\fP *requests)"
.br
.RI "\fIimplements the table helper handler \fP"
.ti -1c
.RI "\fBnetsnmp_mib_handler\fP * \fBnetsnmp_sparse_table_handler_get\fP (void)"
.br
.RI "\fIcreate sparse table handler \fP"
.ti -1c
.RI "int \fBnetsnmp_sparse_table_register\fP (\fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_table_registration_info\fP *tabreq)"
.br
.RI "\fIcreates a table handler given the netsnmp_table_registration_info object, inserts it into the request chain and then calls \fBnetsnmp_register_handler()\fP to register the table into the agent. \fP"
.ti -1c
.RI "int \fBnetsnmp_table_build_result\fP (\fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_request_info\fP *reqinfo, \fBnetsnmp_table_request_info\fP *table_info, u_char type, u_char *result, size_t result_len)"
.br
.RI "\fIBuilds the result to be returned to the agent given the table information. \fP"
.ti -1c
.RI "int \fBnetsnmp_table_build_oid\fP (\fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_request_info\fP *reqinfo, \fBnetsnmp_table_request_info\fP *table_info)"
.br
.RI "\fIgiven 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. \fP"
.ti -1c
.RI "int \fBnetsnmp_table_build_oid_from_index\fP (\fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_request_info\fP *reqinfo, \fBnetsnmp_table_request_info\fP *table_info)"
.br
.RI "\fIgiven 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. \fP"
.ti -1c
.RI "int \fBnetsnmp_update_variable_list_from_index\fP (\fBnetsnmp_table_request_info\fP *tri)"
.br
.RI "\fIparses an OID into table indexses \fP"
.ti -1c
.RI "int \fBnetsnmp_update_indexes_from_variable_list\fP (\fBnetsnmp_table_request_info\fP *tri)"
.br
.RI "\fIbuilds an oid given a set of indexes. \fP"
.ti -1c
.RI "int \fBnetsnmp_check_getnext_reply\fP (\fBnetsnmp_request_info\fP *request, oid *prefix, size_t prefix_len, \fBnetsnmp_variable_list\fP *newvar, \fBnetsnmp_variable_list\fP **outvar)"
.br
.RI "\fIchecks 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. \fP"
.ti -1c
.RI "void \fBnetsnmp_table_registration_info_free\fP (\fBnetsnmp_table_registration_info\fP *tri)"
.br
.in -1c
.SH "Detailed Description"
.PP
Helps you implement a table.
This handler helps you implement a table by doing some of the processing for you.
.PP
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 \fBnetsnmp_register_table()\fP 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.
.PP
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.
.SH "Function Documentation"
.PP
.SS "int netsnmp_check_getnext_reply (\fBnetsnmp_request_info\fP * request, oid * prefix, size_t prefix_len, \fBnetsnmp_variable_list\fP * newvar, \fBnetsnmp_variable_list\fP ** outvar)"
.PP
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.
.PP
Definition at line 929 of file table.c.
.SS "NETSNMP_INLINE \fBnetsnmp_table_request_info\fP* netsnmp_extract_table_info (\fBnetsnmp_request_info\fP * request)"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIrequest\fP populated netsnmp request structure
.RE
.PP
\fBReturns:\fP
.RS 4
populated netsnmp_table_request_info structure
.RE
.PP
.PP
Definition at line 143 of file table.c.
.SS "\fBnetsnmp_table_registration_info\fP* netsnmp_find_table_registration_info (\fBnetsnmp_handler_registration\fP * reginfo)"
.PP
extracts the registered netsnmp_table_registration_info object from a netsnmp_handler_registration object
.PP
Definition at line 152 of file table.c.
.SS "\fBnetsnmp_mib_handler\fP* netsnmp_get_table_handler (\fBnetsnmp_table_registration_info\fP * tabreq)"
.PP
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.
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fItabreq\fP 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.
.RE
.PP
\fBReturns:\fP
.RS 4
Returns a pointer to a netsnmp_mib_handler struct which contains the handler's name and the access method
.RE
.PP
.PP
Definition at line 91 of file table.c.
.SS "int netsnmp_register_table (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_table_registration_info\fP * tabreq)"
.PP
creates a table handler given the netsnmp_table_registration_info object, inserts it into the request chain and then calls \fBnetsnmp_register_handler()\fP to register the table into the agent.
.PP
Definition at line 114 of file table.c.
.SS "\fBnetsnmp_mib_handler\fP* netsnmp_sparse_table_handler_get (void)"
.PP
create sparse table handler
.PP
Definition at line 745 of file table.c.
.SS "int netsnmp_sparse_table_register (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_table_registration_info\fP * tabreq)"
.PP
creates a table handler given the netsnmp_table_registration_info object, inserts it into the request chain and then calls \fBnetsnmp_register_handler()\fP to register the table into the agent.
.PP
handler1 is in reginfo... remove and free??
.PP
both handlers now in reginfo, so nothing to do on error
.PP
Definition at line 756 of file table.c.
.SS "int netsnmp_table_build_oid (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_request_info\fP * reqinfo, \fBnetsnmp_table_request_info\fP * table_info)"
.PP
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.
.PP
.Entry
.PP
.column
.PP
Definition at line 832 of file table.c.
.SS "int netsnmp_table_build_oid_from_index (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_request_info\fP * reqinfo, \fBnetsnmp_table_request_info\fP * table_info)"
.PP
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.
.PP
Definition at line 869 of file table.c.
.SS "int netsnmp_table_build_result (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_request_info\fP * reqinfo, \fBnetsnmp_table_request_info\fP * table_info, u_char type, u_char * result, size_t result_len)"
.PP
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.
.PP
Definition at line 799 of file table.c.
.SS "int netsnmp_update_indexes_from_variable_list (\fBnetsnmp_table_request_info\fP * tri)"
.PP
builds an oid given a set of indexes.
.PP
Definition at line 911 of file table.c.
.SS "int netsnmp_update_variable_list_from_index (\fBnetsnmp_table_request_info\fP * tri)"
.PP
parses an OID into table indexses
.PP
Definition at line 895 of file table.c.
.SS "int table_helper_handler (\fBnetsnmp_mib_handler\fP * handler, \fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * requests)"
.PP
implements the table helper handler
.PP
XXX-rks: memory leak. add cleanup handler?
.PP
none available
.PP
got one ok
.PP
for loop
.PP
Definition at line 160 of file table.c.
.SH "Author"
.PP
Generated automatically by Doxygen for net-snmp from the source code.