home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / bin / icmpapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  3.3 KB  |  153 lines

  1. /*++
  2.  
  3. Copyright (c) 1991  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     icmpapi.h
  8.  
  9. Abstract:
  10.  
  11.     Declarations for the Win32 ICMP Echo request API.
  12.  
  13. Author:
  14.  
  15.     Portable Systems Group 30-December-1993
  16.  
  17. Revision History:
  18.  
  19.  
  20. Notes:
  21.  
  22. --*/
  23.  
  24. #ifndef _ICMP_INCLUDED_
  25. #define _ICMP_INCLUDED_
  26.  
  27.  
  28. //
  29. // Exported Routines.
  30. //
  31.  
  32. //++
  33. //
  34. // Routine Name:
  35. //
  36. //     IcmpCreateFile
  37. //
  38. // Routine Description:
  39. //
  40. //     Opens a handle on which ICMP Echo Requests can be issued.
  41. //
  42. // Arguments:
  43. //
  44. //     None.
  45. //
  46. // Return Value:
  47. //
  48. //     An open file handle or INVALID_HANDLE_VALUE. Extended error information
  49. //     is available by calling GetLastError().
  50. //
  51. //--
  52.  
  53. HANDLE
  54. WINAPI
  55. IcmpCreateFile(
  56.     VOID
  57.     );
  58.  
  59.  
  60. //++
  61. //
  62. // Routine Name:
  63. //
  64. //     IcmpCloseHandle
  65. //
  66. // Routine Description:
  67. //
  68. //     Closes a handle opened by ICMPOpenFile.
  69. //
  70. // Arguments:
  71. //
  72. //     IcmpHandle  - The handle to close.
  73. //
  74. // Return Value:
  75. //
  76. //     TRUE if the handle was closed successfully, otherwise FALSE. Extended
  77. //     error information is available by calling GetLastError().
  78. //
  79. //--
  80.  
  81. BOOL
  82. WINAPI
  83. IcmpCloseHandle(
  84.     HANDLE  IcmpHandle
  85.     );
  86.  
  87.  
  88.  
  89. //++
  90. //
  91. // Routine Name:
  92. //
  93. //     IcmpSendEcho
  94. //
  95. // Routine Description:
  96. //
  97. //     Sends an ICMP Echo request and returns any replies. The
  98. //     call returns when the timeout has expired or the reply buffer
  99. //     is filled.
  100. //
  101. // Arguments:
  102. //
  103. //     IcmpHandle           - An open handle returned by ICMPCreateFile.
  104. //
  105. //     DestinationAddress   - The destination of the echo request.
  106. //
  107. //     RequestData          - A buffer containing the data to send in the
  108. //                            request.
  109. //
  110. //     RequestSize          - The number of bytes in the request data buffer.
  111. //
  112. //     RequestOptions       - Pointer to the IP header options for the request.
  113. //                            May be NULL.
  114. //
  115. //     ReplyBuffer          - A buffer to hold any replies to the request.
  116. //                            On return, the buffer will contain an array of
  117. //                            ICMP_ECHO_REPLY structures followed by the
  118. //                            options and data for the replies. The buffer
  119. //                            should be large enough to hold at least one
  120. //                            ICMP_ECHO_REPLY structure plus
  121. //                            MAX(RequestSize, 8) bytes of data since an ICMP
  122. //                            error message contains 8 bytes of data.
  123. //
  124. //     ReplySize            - The size in bytes of the reply buffer.
  125. //
  126. //     Timeout              - The time in milliseconds to wait for replies.
  127. //
  128. // Return Value:
  129. //
  130. //     Returns the number of ICMP_ECHO_REPLY structures stored in ReplyBuffer.
  131. //     The status of each reply is contained in the structure. If the return
  132. //     value is zero, extended error information is available via
  133. //     GetLastError().
  134. //
  135. //--
  136.  
  137. DWORD
  138. WINAPI
  139. IcmpSendEcho(
  140.     HANDLE                   IcmpHandle,
  141.     IPAddr                   DestinationAddress,
  142.     LPVOID                   RequestData,
  143.     WORD                     RequestSize,
  144.     PIP_OPTION_INFORMATION   RequestOptions,
  145.     LPVOID                   ReplyBuffer,
  146.     DWORD                    ReplySize,
  147.     DWORD                    Timeout
  148.     );
  149.  
  150.  
  151. #endif // _ICMP_INCLUDED_
  152.  
  153.