Platform SDK: Internet Protocol Helper

GetRTTAndHopCount

The GetRTTAndHopCount function determines the round-trip time (RTT) and hop count to the specified destination.

BOOL GetRTTAndHopCount(
  IPAddr DestIpAddress,    // destination IP address 
  PULONG HopCount,         // returned hop count
  ULONG MaxHops,           // limit on number of hops to search
  PULONG RTT               // round-trip time
);

Parameters

DestIpAddress
Specifies the IP address of the destination for which to determine the RTT and hop count.
HopCount
Pointer to a ULONG variable. On successful return, this variable contains the hop count to the destination specified by the DestIpAddress parameter.
MaxHops
Specifies the maximum number of hops to search for the destination. If the number of hops to the destination exceeds this number, the function terminates the search and returns FALSE.
RTT
Round-trip time in milliseconds to the destination specified by DestIpAddress.

Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. Call GetLastError to obtain the error code for the failure.

Remarks

For information about the IPAddr data type, see Types. To convert an IP address between dotted decimal notation and IPAddr format, use the inet_addr and inet_ntoa functions.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP4 or later.
  Windows 95/98: Requires Windows 98.
  Header: Declared in Iphlpapi.h.
  Library: Use Iphlpapi.lib.

See Also

GetBestInterface, GetBestRoute