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 58 matching lines...) Loading... |
69 public: | 69 public: |
70 WinPing(); | 70 WinPing(); |
71 ~WinPing(); | 71 ~WinPing(); |
72 | 72 |
73 // Determines whether the class was initialized correctly. | 73 // Determines whether the class was initialized correctly. |
74 bool IsValid() { return valid_; } | 74 bool IsValid() { return valid_; } |
75 | 75 |
76 // Attempts to send a ping with the given parameters. | 76 // Attempts to send a ping with the given parameters. |
77 enum PingResult { PING_FAIL, PING_INVALID_PARAMS, | 77 enum PingResult { PING_FAIL, PING_INVALID_PARAMS, |
78 PING_TOO_LARGE, PING_TIMEOUT, PING_SUCCESS }; | 78 PING_TOO_LARGE, PING_TIMEOUT, PING_SUCCESS }; |
79 PingResult Ping( | 79 PingResult Ping(IPAddress ip, |
80 IPAddress ip, uint32 data_size, uint32 timeout_millis, uint8 ttl, | 80 uint32_t data_size, |
81 bool allow_fragments); | 81 uint32_t timeout_millis, |
| 82 uint8_t ttl, |
| 83 bool allow_fragments); |
82 | 84 |
83 private: | 85 private: |
84 HMODULE dll_; | 86 HMODULE dll_; |
85 HANDLE hping_; | 87 HANDLE hping_; |
86 HANDLE hping6_; | 88 HANDLE hping6_; |
87 PIcmpCreateFile create_; | 89 PIcmpCreateFile create_; |
88 PIcmpCloseHandle close_; | 90 PIcmpCloseHandle close_; |
89 PIcmpSendEcho send_; | 91 PIcmpSendEcho send_; |
90 PIcmp6CreateFile create6_; | 92 PIcmp6CreateFile create6_; |
91 PIcmp6SendEcho2 send6_; | 93 PIcmp6SendEcho2 send6_; |
92 char* data_; | 94 char* data_; |
93 uint32 dlen_; | 95 uint32_t dlen_; |
94 char* reply_; | 96 char* reply_; |
95 uint32 rlen_; | 97 uint32_t rlen_; |
96 bool valid_; | 98 bool valid_; |
97 }; | 99 }; |
98 | 100 |
99 } // namespace rtc | 101 } // namespace rtc |
100 | 102 |
101 #endif // WEBRTC_WIN | 103 #endif // WEBRTC_WIN |
102 | 104 |
103 #endif // WEBRTC_BASE_WINPING_H__ | 105 #endif // WEBRTC_BASE_WINPING_H__ |
OLD | NEW |