[This is preliminary documentation and subject to change.]
The WinSNMP SnmpSetPduData function updates selected data fields in the specified SNMP protocol data unit (PDU).
SNMPAPI_STATUS SnmpSetPduData(
HSNMP_PDU PDU, // handle to the PDU
const smiINT *PDU_type, // pointer to the PDU type
const smiINT32 *request_id, // pointer to the PDU request
// identifier
const smiINT *non_repeaters, // valid only for an
// SNMP_PDU_GETBULK request
const smiINT *max_repetitions, // valid only for an
// SNMP_PDU_GETBULK request
const HSNMP_VBL *varbindlist // handle to variable bindings list
);
If the function succeeds, the return value is SNMPAPI_SUCCESS.
If the function fails, the return value is SNMPAPI_FAILURE. To get extended error information, call SnmpGetLastError. The SnmpGetLastError function can return one of the following errors.
Error Code | Description |
---|---|
SNMPAPI_NOT_INITIALIZED | The SnmpStartup function did not complete successfully. |
SNMPAPI_ALLOC_ERROR | An error occurred during memory allocation. |
SNMPAPI_PDU_INVALID | The PDU type is invalid. |
SNMPAPI_VBL_INVALID | The variable bindings list is invalid. |
SNMPAPI_NOOP | All input parameters are NULL. The SNMP operation was not performed. |
SNMPAPI_OTHER_ERROR | An unknown or undefined error occurred. |
All parameters of the SnmpSetPduData function are required. However, all parameters, except the PDU parameter, can be NULL. If the WinSNMP manager application passes NULL in a parameter, SnmpSetPduData does not update the corresponding field in the PDU. Because SnmpSetPduData passes parameters as pointers to values, an application can still update a PDU field with NULL.
The value of one PDU field can be valid alone, but may be invalidated in combination with values for other fields. The implementation validates the PDU and the other message elements when the manager application calls the SnmpSendMsg or the SnmpEncodeMsg functions. The implementation rejects invalid PDUs.
Windows NT: Requires version 5.0 or later. Available as a redistributable for Windows NT 4.0.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winsnmp.h.
Import Library: Use wsnmp32.lib.
WinSNMP Manager API Overview, WinSNMP Functions, SnmpSendMsg, SnmpEncodeMsg