SnmpMgrRequest function (mgmtapi.h)
[SNMP is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use Windows Remote Management, which is the Microsoft implementation of WS-Man.]
The SnmpMgrRequest function requests the specified operation be performed with the specified agent. This function is an element of the SNMP Management API.
Syntax
SNMPAPI SNMP_FUNC_TYPE SnmpMgrRequest(
[in] LPSNMP_MGR_SESSION session,
[in] BYTE requestType,
[in, out] RFC1157VarBindList *variableBindings,
[out] AsnInteger *errorStatus,
[out] AsnInteger *errorIndex
);
Parameters
[in] session
Pointer to an internal structure that specifies the session that will perform the request.
Applications should not specify the LPSNMP_MGR_SESSION pointer returned by this function in a different thread. You can specify a pointer returned by SnmpMgrOpen, but only if the calls to SnmpMgrOpen and SnmpMgrRequest originate in the context of the same thread.
[in] requestType
Specifies the SNMP request type. This parameter can be one of the following values defined by SNMPv1.
Note that PDU request types have been renamed. For additional information, see SNMP Variable Types and Request PDU Types.
[in, out] variableBindings
Pointer to the variable bindings list.
[out] errorStatus
Pointer to a variable in which the error status result will be returned. This parameter can be one of the following values defined by SNMPv1.
[out] errorIndex
Pointer to a variable in which the error index result will be returned.
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is NULL. To get extended error information, call GetLastError, which may return one of the following error codes.
Return code | Description |
---|---|
|
The request timed-out. |
|
Unexpected error file descriptors indicated by the Windows Sockets select function. |
Remarks
Retries and time-outs are supplied to the SnmpMgrOpen function. Each variable in the variable bindings list must be initialized to type ASN_NULL for Get and Get Next requests.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | mgmtapi.h |
Library | Mgmtapi.lib |
DLL | Mgmtapi.dll |