mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 08:43:04 +00:00
display correct Min RTT
Fixes bug 1194 svn path=/trunk/; revision=20387
This commit is contained in:
parent
2e47dd68f3
commit
09e73cb4d4
1 changed files with 13 additions and 13 deletions
|
@ -1,5 +1,4 @@
|
||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS ping utility
|
* PROJECT: ReactOS ping utility
|
||||||
* FILE: apps/net/ping/ping.c
|
* FILE: apps/net/ping/ping.c
|
||||||
|
@ -8,17 +7,14 @@
|
||||||
* REVISIONS:
|
* REVISIONS:
|
||||||
* CSH 01/09/2000 Created
|
* CSH 01/09/2000 Created
|
||||||
*/
|
*/
|
||||||
//#include <windows.h>
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifndef _MSC_VER
|
|
||||||
|
|
||||||
#ifdef DBG
|
#ifndef _MSC_VER
|
||||||
#undef DBG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* FIXME: Where should this be? */
|
/* FIXME: Where should this be? */
|
||||||
#ifdef CopyMemory
|
#ifdef CopyMemory
|
||||||
|
@ -35,8 +31,11 @@ typedef long long __int64;
|
||||||
|
|
||||||
char * _i64toa(__int64 value, char *string, int radix);
|
char * _i64toa(__int64 value, char *string, int radix);
|
||||||
|
|
||||||
#endif
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
|
#ifdef DBG
|
||||||
|
#undef DBG
|
||||||
|
#endif
|
||||||
|
|
||||||
/* General ICMP constants */
|
/* General ICMP constants */
|
||||||
#define ICMP_MINSIZE 8 /* Minimum ICMP packet size */
|
#define ICMP_MINSIZE 8 /* Minimum ICMP packet size */
|
||||||
|
@ -453,12 +452,13 @@ static BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from)
|
||||||
|
|
||||||
printf("Reply from %s: bytes=%d time%s%s TTL=%d\n", inet_ntoa(from->sin_addr),
|
printf("Reply from %s: bytes=%d time%s%s TTL=%d\n", inet_ntoa(from->sin_addr),
|
||||||
size - IphLength - sizeof(ICMP_ECHO_PACKET), Sign, Time, IpHeader->TTL);
|
size - IphLength - sizeof(ICMP_ECHO_PACKET), Sign, Time, IpHeader->TTL);
|
||||||
if (RelativeTime.QuadPart < MinRTT.QuadPart) {
|
if (RelativeTime.QuadPart < MinRTT.QuadPart || !MinRTTSet) {
|
||||||
MinRTT.QuadPart = RelativeTime.QuadPart;
|
MinRTT.QuadPart = RelativeTime.QuadPart;
|
||||||
MinRTTSet = TRUE;
|
MinRTTSet = TRUE;
|
||||||
}
|
}
|
||||||
if (RelativeTime.QuadPart > MaxRTT.QuadPart)
|
if (RelativeTime.QuadPart > MaxRTT.QuadPart)
|
||||||
MaxRTT.QuadPart = RelativeTime.QuadPart;
|
MaxRTT.QuadPart = RelativeTime.QuadPart;
|
||||||
|
|
||||||
SumRTT.QuadPart += RelativeTime.QuadPart;
|
SumRTT.QuadPart += RelativeTime.QuadPart;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue