VB_T * snmpdVbRowExtract ( SNMP_PKT_T * pktp, /* snmp packet */ int start_index, /* starting index */ int compc, /* component count */ OIDC_T * compl, /* component length */ int row_structure_length, /* length of row structure */ struct create_row * row /* row structure */ );
This routine assists in implementing row-creation set operations. It is typically used by the testproc routine for a table. It scans the SNMP packet looking for all the pieces that go together for the purposes of creating a new row in an SNMP table.
The parameter row describes what this routine is looking for. It is a list of MIB leaf pointers referring to variables in the table in question, and a flag indicating if this variable (column) in the table is required. This routine searches the variable bindings in pktp for a match of the MIB leaf pointer specified in the row array and the instance specified by compc and compl. It links the variable bindings found from the first MIB leaf node in the row array. This first variable binding must be in the packet whether it is marked as needed or not, and is the return value of snmpdVbRowExtract( ).
If snmpdVbRowExtract( ) does not find a matching variable binding and that leaf is flagged ROW_FLAG_NEEDED in the row array, the routine returns NULL to indicate an error.
This routine marks the variable bindings in the resulting list as already tested except for the first entry, which is marked as already set. As a result, the agent only calls the set routine associated with the first MIB leaf in the row array. This set routine should handle creation of the necessary data structures and reading the variable binding list to execute the required set operations. You can force other entries set routines to be called by flagging entries with ROW_FLAG_CALL_SET.