| 200 | |
| 201 | #if USE_PING |
| 202 | icmp_handle icmp_open() |
| 203 | { |
| 204 | socket_init(); |
| 205 | auto h = ::socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); |
| 206 | if (h == INVALID_SOCKET) |
| 207 | return nullptr; |
| 208 | |
| 209 | if (h == SOCKET_ERROR) |
| 210 | return nullptr; |
| 211 | |
| 212 | auto *s = new SOCKET; |
| 213 | *s = h; |
| 214 | return (icmp_handle)s; |
| 215 | } |
| 216 | |
| 217 | int icmp_query(icmp_handle handle, const char *ip, uint32_t *timems) |
| 218 | { |
no test coverage detected