blob: c08725832c74d9d40664b8dac04dc02de1b1dc00 [file] [log] [blame]
.TH "table_container" 3 "24 Jun 2011" "Version 5.4.3.pre1" "net-snmp" \" -*- nroff -*-
.ad l
.nh
.SH NAME
table_container \-
.PP
Helps you implement a table when data can be found via a netsnmp_container.
.SS "Functions"
.in +1c
.ti -1c
.RI "\fBcontainer_table_data\fP * \fBnetsnmp_tcontainer_create_table\fP (const char *name, \fBnetsnmp_container\fP *container, long flags)"
.br
.ti -1c
.RI "void \fBnetsnmp_tcontainer_delete_table\fP (\fBcontainer_table_data\fP *table)"
.br
.ti -1c
.RI "int \fBnetsnmp_tcontainer_add_row\fP (\fBcontainer_table_data\fP *table, \fBnetsnmp_index\fP *row)"
.br
.ti -1c
.RI "\fBnetsnmp_index\fP * \fBnetsnmp_tcontainer_remove_row\fP (\fBcontainer_table_data\fP *table, \fBnetsnmp_index\fP *row)"
.br
.ti -1c
.RI "int \fBnetsnmp_tcontainer_replace_row\fP (\fBcontainer_table_data\fP *table, \fBnetsnmp_index\fP *old_row, \fBnetsnmp_index\fP *new_row)"
.br
.ti -1c
.RI "\fBnetsnmp_mib_handler\fP * \fBnetsnmp_container_table_handler_get\fP (\fBnetsnmp_table_registration_info\fP *tabreg, \fBnetsnmp_container\fP *container, char key_type)"
.br
.RI "\fIreturns a netsnmp_mib_handler object for the table_container helper \fP"
.ti -1c
.RI "int \fBnetsnmp_container_table_register\fP (\fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_table_registration_info\fP *tabreg, \fBnetsnmp_container\fP *container, char key_type)"
.br
.ti -1c
.RI "\fBnetsnmp_container\fP * \fBnetsnmp_container_table_container_extract\fP (\fBnetsnmp_request_info\fP *request)"
.br
.RI "\fIretrieve the container used by the table_container helper \fP"
.ti -1c
.RI "void \fBnetsnmp_container_table_row_insert\fP (\fBnetsnmp_request_info\fP *request, \fBnetsnmp_index\fP *row)"
.br
.RI "\fIinserts a newly created table_container entry into a request list \fP"
.ti -1c
.RI "\fBnetsnmp_index\fP * \fBnetsnmp_table_index_find_next_row\fP (\fBnetsnmp_container\fP *c, \fBnetsnmp_table_request_info\fP *tblreq)"
.br
.RI "\fIdeprecated, backwards compatability only \fP"
.in -1c
.SH "Detailed Description"
.PP
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 \fBtable\fP handler.
.PP
This handler will use the index information provided by the \fBtable\fP handler to find the row needed to process the request.
.PP
The container must use one of 3 key types. It is the sub-handler's responsibility to ensure that the container and key type match (unless neither is specified, in which case a default will be used.)
.PP
The current key types are:
.PP
TABLE_CONTAINER_KEY_NETSNMP_INDEX The container should do comparisons based on a key that may be cast to a netsnmp index (netsnmp_index *). This index contains only the index portion of the OID, not the entire OID.
.PP
TABLE_CONTAINER_KEY_VARBIND_INDEX The container should do comparisons based on a key that may be cast to a netsnmp \fBvariable\fP list (netsnmp_variable_list *). This \fBvariable\fP list will contain one varbind for each index component.
.PP
TABLE_CONTAINER_KEY_VARBIND_RAW (NOTE: unimplemented) While not yet implemented, future plans include passing the request varbind with the full OID to a container.
.PP
If a key type is not specified at registration time, the default key type of TABLE_CONTAINER_KEY_NETSNMP_INDEX will be used. If a container is provided, or the handler name is aliased to a container type, the container must use a netsnmp index.
.PP
If no container is provided, a lookup will be made based on the sub-handler's name, or if that isn't found, 'table_container'. The table_container key type will be netsnmp_index.
.PP
The container must, at a minimum, implement find and find_next. If a NULL key is passed to the container, it must return the first item, if any. All containers provided by net-snmp fulfil this requirement.
.PP
This handler will only register to process 'data lookup' modes. In traditional net-snmp modes, that is any GET-like mode (GET, GET-NEXT, GET-BULK) or the first phase of a SET (RESERVE1). In the new baby-steps mode, DATA_LOOKUP is it's own mode, and is a pre-cursor to other modes.
.PP
When called, the handler will call the appropriate container method with the appropriate key type. If a row was not found, the result depends on the mode.
.PP
GET Processing An exact match must be found. If one is not, the error NOSUCHINSTANCE is set.
.PP
GET-NEXT / GET-BULK If no row is found, the column number will be increased (using any valid_columns structure that may have been provided), and the first row will be retrieved. If no first row is found, the processed flag will be set, so that the sub-handler can skip any processing related to the request. The agent will notice this unsatisfied request, and attempt to pass it to the next appropriate handler.
.PP
SET If the hander did not register with the HANDLER_CAN_NOT_CREATE flag set in the registration modes, it is assumed that this is a row creation request and a NULL row is added to the request's data list. The sub-handler is responsbile for dealing with any row creation contraints and inserting any newly created rows into the container and the request's data list.
.PP
If a row is found, it will be inserted into the request's data list. The sub-handler may retrieve it by calling netsnmp_container_table_extract_context(request); * NOTE NOTE NOTE:
.PP
This helper and it's API are still being tested and are subject to change.
.SH "Function Documentation"
.PP
.SS "\fBnetsnmp_container\fP* netsnmp_container_table_container_extract (\fBnetsnmp_request_info\fP * request)"
.PP
retrieve the container used by the table_container helper
.PP
Definition at line 320 of file table_container.c.
.SS "\fBnetsnmp_mib_handler\fP* netsnmp_container_table_handler_get (\fBnetsnmp_table_registration_info\fP * tabreg, \fBnetsnmp_container\fP * container, char key_type)"
.PP
returns a netsnmp_mib_handler object for the table_container helper
.PP
Definition at line 254 of file table_container.c.
.SS "void netsnmp_container_table_row_insert (\fBnetsnmp_request_info\fP * request, \fBnetsnmp_index\fP * row)"
.PP
inserts a newly created table_container entry into a request list
.PP
Definition at line 351 of file table_container.c.
.SS "\fBnetsnmp_index\fP* netsnmp_table_index_find_next_row (\fBnetsnmp_container\fP * c, \fBnetsnmp_table_request_info\fP * tblreq)"
.PP
deprecated, backwards compatability only expected impact to remove: none
.IP "\(bu" 2
used between helpers, shouldn't have been used by end users
.PP
.PP
replacement: none
.IP "\(bu" 2
never should have been a public method in the first place
.PP
.PP
Definition at line 721 of file table_container.c.
.SH "Author"
.PP
Generated automatically by Doxygen for net-snmp from the source code.