You could look at the source code?
The best idea would be to get your hands on a copy of:
UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets and XTI, W. Richard Stephens, Prentice Hall, 1998, ISBN 0-13-490012-X
The chapter on raw sockets looks at the ping program.
|