| /*++ |
| |
| // @@@ START COPYRIGHT @@@ |
| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| // |
| // @@@ END COPYRIGHT @@@ |
| |
| 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_ |
| |