Platform SDK: Network Management

SnmpGetRetry

The WinSNMP SnmpGetRetry function returns the retry count value, in units, for the retransmission of SNMP message requests. The retry count applies to calls that a WinSNMP application makes to the SnmpSendMsg function for a specified management entity.

SNMPAPI_STATUS SnmpGetRetry(
  HSNMP_ENTITY hEntity,      // destination management entity 
  smiLPUINT32 nPolicyRetry,  // retry count value from the database 
  smiLPUINT32 nActualRetry   // last actual or estimated response
                             // retry count 
);

Parameters

hEntity
[in] Handle to the destination management entity of interest.
nPolicyRetry
[out] Pointer to an unsigned long integer variable to receive the retry count value for the specified management entity. This is a value that the Microsoft WinSNMP implementation stores in a database. If you do not need the information returned in this parameter, nPolicyRetry must be a NULL pointer.
nActualRetry
[out] Pointer to an unsigned long integer variable to receive the last actual or estimated response retry count for the destination entity, as reported by the implementation. If you do not need the information returned in this parameter, nActualRetry must be a NULL pointer.

Note: This feature has not yet been implemented. If this parameter is a valid pointer, the function returns 0. For additional information, see the following Remarks section.

Return Values

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 specifying a NULL value in its session parameter. 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_ENTITY_INVALID The hEntity parameter is invalid.
SNMPAPI_NOOP The nPolicyRetry and nActualRetry parameters are both NULL. The operation was not performed.
SNMPAPI_OTHER_ERROR An unknown or undefined error occurred.

Remarks

Typically a WinSNMP application, rather than an agent application, calls the SnmpGetRetry function.

A WinSNMP application can modify the retry count value with a call to the SnmpSetRetry function.

The WinSNMP application can monitor the value of the nActualRetry parameter and compare it to the value of the nPolicyRetry parameter to optimize transmission performance. For additional information, see About Retransmission and Managing the Retransmission Policy.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winsnmp.h.
  Library: Use Wsnmp32.lib.

See Also

WinSNMP API Overview, WinSNMP Functions, SnmpSetRetry, SnmpSetRetransmitMode, SnmpGetRetransmitMode