42
44
The generated code will define a structure for storage of table related data. This structure must be used, as it contains the index OID for the row, which is used for keeping the array sorted. You can add addition fields or data to the structure for your own use.
44
The generated code will also have code to handle SNMP-SET processing. If your table does not support any SET operations, simply comment out the define <PREFIX>_SET_HANDLING (where <PREFIX> is your table name) in the header file.
46
The generated code will also have code to handle SNMP-SET processing. If your table does not support any SET operations, simply comment out the #define <PREFIX>_SET_HANDLING (where <PREFIX> is your table name) in the header file.
46
48
SET processing modifies the row in-place. The duplicate_row callback will be called to save a copy of the original row. In the event of a failure before the commite phase, the row_copy callback will be called to restore the original row from the copy.
48
Code will be generated to handle row creation. This code may be disabled by commenting out the define <PREFIX>_ROW_CREATION in the header file.
50
Code will be generated to handle row creation. This code may be disabled by commenting out the #define <PREFIX>_ROW_CREATION in the header file.
50
If your table contains a RowStatus object, by default the code will not allow object in an active row to be modified. To allow active rows to be modified, remove the comment block around the define <PREFIX>_CAN_MODIFY_ACTIVE_ROW in the header file.
52
If your table contains a RowStatus object, by default the code will not allow object in an active row to be modified. To allow active rows to be modified, remove the comment block around the #define <PREFIX>_CAN_MODIFY_ACTIVE_ROW in the header file.
52
54
Code will be generated to maintain a secondary index for all rows, stored in a binary tree. This is very useful for finding rows by a key other than the OID index. By default, the functions for maintaining this tree will be based on a character string. NOTE: this will likely be made into a more generic mechanism, using new callback methods, in the near future.
54
The generated code contains many TODO comments. Make sure you check each one to see if it applies to your code. Examples include checking indices for syntax (ranges, etc), initializing default values in newly created rows, checking for row activation and deactivation requirements, etc.
56
The generated code contains many TODO comments. Make sure you check each one to see if it applies to your code. Examples include checking indices for syntax (ranges, etc), initializing default values in newly created rows, checking for row activation and deactivation requirements, etc.
55
57
.SH "Function Documentation"
57
59
.SS "\fBnetsnmp_container\fP* netsnmp_extract_array_context (\fBnetsnmp_request_info\fP * request)"
59
61
find the context data used by the table_array helper
61
Definition at line 213 of file table_array.c.
63
Definition at line 219 of file table_array.c.
63
65
References netsnmp_request_get_list_data().
64
66
.SS "\fBnetsnmp_mib_handler\fP* netsnmp_find_table_array_handler (\fBnetsnmp_handler_registration\fP * reginfo)"
66
68
find the handler for the table_array helper.
68
Definition at line 196 of file table_array.c.
70
Definition at line 202 of file table_array.c.
70
72
References netsnmp_mib_handler_s::access_method, netsnmp_handler_registration_s::handler, netsnmp_mib_handler_s::next, and NULL.
71
73
.SS "int netsnmp_table_array_check_row_status (\fBnetsnmp_table_array_callbacks\fP * cb, \fBnetsnmp_request_group\fP * ag, long * rs_new, long * rs_old)"
73
75
this function is called to validate RowStatus transitions.
75
Definition at line 220 of file table_array.c.
77
Definition at line 226 of file table_array.c.
77
79
References netsnmp_table_array_callbacks_s::can_activate, netsnmp_table_array_callbacks_s::can_deactivate, netsnmp_table_array_callbacks_s::can_delete, netsnmp_request_group_s::existing_row, NULL, netsnmp_request_group_s::row_deleted, and netsnmp_request_group_s::undo_info.
78
80
.SS "int netsnmp_table_container_register (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_table_registration_info\fP * tabreg, \fBnetsnmp_table_array_callbacks\fP * cb, \fBnetsnmp_container\fP * container, int group_rows)"
80
82
register specified callbacks for the specified table/oid.
82
If the group_rows parameter is set, the row related callbacks will be called once for each unique row index. Otherwise, each callback will be called only once, for all objects.
84
If the group_rows parameter is set, the row related callbacks will be called once for each unique row index. Otherwise, each callback will be called only once, for all objects.
84
Definition at line 152 of file table_array.c.
86
Definition at line 153 of file table_array.c.
86
88
References netsnmp_table_array_callbacks_s::can_set, table_container_data_s::cb, netsnmp_container_s::compare, netsnmp_table_array_callbacks_s::delete_row, netsnmp_table_array_callbacks_s::duplicate_row, netsnmp_handler_registration_s::handler, netsnmp_mib_handler_s::myvoid, netsnmp_container_s::ncompare, netsnmp_register_table(), NULL, netsnmp_table_array_callbacks_s::row_copy, snmp_log(), SNMP_MALLOC_TYPEDEF, table_container_data_s::table, and table_container_data_s::tblreg_info.