153 lines
3.2 KiB
C
153 lines
3.2 KiB
C
/*++
|
|
|
|
Copyright (c) 1991-1996 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
icmpapi.h
|
|
|
|
Abstract:
|
|
|
|
Declarations for the Win32 ICMP Echo request API.
|
|
|
|
Author:
|
|
|
|
Portable Systems Group 30-December-1993
|
|
|
|
Revision History:
|
|
|
|
|
|
Notes:
|
|
|
|
--*/
|
|
|
|
#ifndef _ICMP_INCLUDED_
|
|
#define _ICMP_INCLUDED_
|
|
|
|
|
|
//
|
|
// Exported Routines.
|
|
//
|
|
|
|
//++
|
|
//
|
|
// Routine Name:
|
|
//
|
|
// IcmpCreateFile
|
|
//
|
|
// Routine Description:
|
|
//
|
|
// Opens a handle on which ICMP Echo Requests can be issued.
|
|
//
|
|
// Arguments:
|
|
//
|
|
// None.
|
|
//
|
|
// Return Value:
|
|
//
|
|
// An open file handle or INVALID_HANDLE_VALUE. Extended error information
|
|
// is available by calling GetLastError().
|
|
//
|
|
//--
|
|
|
|
HANDLE
|
|
WINAPI
|
|
IcmpCreateFile(
|
|
VOID
|
|
);
|
|
|
|
|
|
//++
|
|
//
|
|
// Routine Name:
|
|
//
|
|
// IcmpCloseHandle
|
|
//
|
|
// Routine Description:
|
|
//
|
|
// Closes a handle opened by ICMPOpenFile.
|
|
//
|
|
// Arguments:
|
|
//
|
|
// IcmpHandle - The handle to close.
|
|
//
|
|
// Return Value:
|
|
//
|
|
// TRUE if the handle was closed successfully, otherwise FALSE. Extended
|
|
// error information is available by calling GetLastError().
|
|
//
|
|
//--
|
|
|
|
BOOL
|
|
WINAPI
|
|
IcmpCloseHandle(
|
|
HANDLE IcmpHandle
|
|
);
|
|
|
|
|
|
|
|
//++
|
|
//
|
|
// Routine Name:
|
|
//
|
|
// IcmpSendEcho
|
|
//
|
|
// Routine Description:
|
|
//
|
|
// Sends an ICMP Echo request and returns any replies. The
|
|
// call returns when the timeout has expired or the reply buffer
|
|
// is filled.
|
|
//
|
|
// Arguments:
|
|
//
|
|
// IcmpHandle - An open handle returned by ICMPCreateFile.
|
|
//
|
|
// DestinationAddress - The destination of the echo request.
|
|
//
|
|
// RequestData - A buffer containing the data to send in the
|
|
// request.
|
|
//
|
|
// RequestSize - The number of bytes in the request data buffer.
|
|
//
|
|
// RequestOptions - Pointer to the IP header options for the request.
|
|
// May be NULL.
|
|
//
|
|
// ReplyBuffer - A buffer to hold any replies to the request.
|
|
// On return, the buffer will contain an array of
|
|
// ICMP_ECHO_REPLY structures followed by the
|
|
// options and data for the replies. The buffer
|
|
// should be large enough to hold at least one
|
|
// ICMP_ECHO_REPLY structure plus
|
|
// MAX(RequestSize, 8) bytes of data since an ICMP
|
|
// error message contains 8 bytes of data.
|
|
//
|
|
// ReplySize - The size in bytes of the reply buffer.
|
|
//
|
|
// Timeout - The time in milliseconds to wait for replies.
|
|
//
|
|
// Return Value:
|
|
//
|
|
// Returns the number of ICMP_ECHO_REPLY structures stored in ReplyBuffer.
|
|
// The status of each reply is contained in the structure. If the return
|
|
// value is zero, extended error information is available via
|
|
// GetLastError().
|
|
//
|
|
//--
|
|
|
|
DWORD
|
|
WINAPI
|
|
IcmpSendEcho(
|
|
HANDLE IcmpHandle,
|
|
IPAddr DestinationAddress,
|
|
LPVOID RequestData,
|
|
WORD RequestSize,
|
|
PIP_OPTION_INFORMATION RequestOptions,
|
|
LPVOID ReplyBuffer,
|
|
DWORD ReplySize,
|
|
DWORD Timeout
|
|
);
|
|
|
|
|
|
#endif // _ICMP_INCLUDED_
|
|
|