go to
www.kohala.com/~rstevens
get the unix network programming volume 1 ed 2 source code.
I think the file is an acronym along those lines, unpv1...
What you want is in the ping directory.
The source is 5 years old, you'll need to edit one to two files
for things to compile properly.