Ping: SOCK_RAW in Winsock 2.0

Click to open or copy the files for the Ping sample.

This sample illustrates the use of SOCK_RAW in Winsock 2.0 on Windows NTŪ in order to write an ICMP_ECHO utility (commonly seen in the 'ping' program on various systems).

Building SDK Samples

This sample uses the following keywords:

atoi; checksum; decode_resp; exitprocess; fill_icmp_data; fprintf; getcurrentprocessid; gethostbyname; getlasterror; getprocessheap; gettickcount; heapalloc; inet_addr; inet_ntoa; makeword; memcpy; memset; pack; printf; recvfrom; sendto; setsockopt; sleep; usage; wsagetlasterror; wsasocket; wsastartup; xfree; xmalloc