| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 ////////////////////////////////////////////////////////////////////// | 118 ////////////////////////////////////////////////////////////////////// |
| 119 // Global Constants and Types | 119 // Global Constants and Types |
| 120 ////////////////////////////////////////////////////////////////////// | 120 ////////////////////////////////////////////////////////////////////// |
| 121 | 121 |
| 122 const char * const ICMP_DLL_NAME = "Iphlpapi.dll"; | 122 const char * const ICMP_DLL_NAME = "Iphlpapi.dll"; |
| 123 const char * const ICMP_CREATE_FUNC = "IcmpCreateFile"; | 123 const char * const ICMP_CREATE_FUNC = "IcmpCreateFile"; |
| 124 const char * const ICMP_CLOSE_FUNC = "IcmpCloseHandle"; | 124 const char * const ICMP_CLOSE_FUNC = "IcmpCloseHandle"; |
| 125 const char * const ICMP_SEND_FUNC = "IcmpSendEcho"; | 125 const char * const ICMP_SEND_FUNC = "IcmpSendEcho"; |
| 126 const char * const ICMP6_CREATE_FUNC = "Icmp6CreateFile"; | 126 const char * const ICMP6_CREATE_FUNC = "Icmp6CreateFile"; |
| 127 const char * const ICMP6_CLOSE_FUNC = "Icmp6CloseHandle"; | |
| 128 const char * const ICMP6_SEND_FUNC = "Icmp6SendEcho2"; | 127 const char * const ICMP6_SEND_FUNC = "Icmp6SendEcho2"; |
| 129 | 128 |
| 130 inline uint32 ReplySize(uint32 data_size, int family) { | 129 inline uint32 ReplySize(uint32 data_size, int family) { |
| 131 if (family == AF_INET) { | 130 if (family == AF_INET) { |
| 132 // A ping error message is 8 bytes long, so make sure we allow for at least | 131 // A ping error message is 8 bytes long, so make sure we allow for at least |
| 133 // 8 bytes of reply data. | 132 // 8 bytes of reply data. |
| 134 return sizeof(ICMP_ECHO_REPLY) + std::max<uint32>(8, data_size); | 133 return sizeof(ICMP_ECHO_REPLY) + std::max<uint32>(8, data_size); |
| 135 } else if (family == AF_INET6) { | 134 } else if (family == AF_INET6) { |
| 136 // Per MSDN, Send6IcmpEcho2 needs at least one ICMPV6_ECHO_REPLY, | 135 // Per MSDN, Send6IcmpEcho2 needs at least one ICMPV6_ECHO_REPLY, |
| 137 // 8 bytes for ICMP header, _and_ an IO_BLOCK_STATUS (2 pointers), | 136 // 8 bytes for ICMP header, _and_ an IO_BLOCK_STATUS (2 pointers), |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // Return Value: | 351 // Return Value: |
| 353 // | 352 // |
| 354 // Returns the number of ICMP_ECHO_REPLY structures stored in ReplyBuffer. | 353 // Returns the number of ICMP_ECHO_REPLY structures stored in ReplyBuffer. |
| 355 // The status of each reply is contained in the structure. If the return | 354 // The status of each reply is contained in the structure. If the return |
| 356 // value is zero, extended error information is available via | 355 // value is zero, extended error information is available via |
| 357 // GetLastError(). | 356 // GetLastError(). |
| 358 // | 357 // |
| 359 ////////////////////////////////////////////////////////////////////// | 358 ////////////////////////////////////////////////////////////////////// |
| 360 | 359 |
| 361 } // namespace rtc | 360 } // namespace rtc |
| OLD | NEW |