|
发表于 2003-7-14 23:01:52
|
显示全部楼层
If you have not looked it up at
Richard Stevens' book (http://www.kohala.com/start/toc.unpv12e.html)
Unix Network Programming, Volume 1, 2nd Edition (UNPv1)
Networking APIs: Sockets and XTI
yet, this book may be of help to you.
As Dragonfly said, the source code of Ping could be of help in this regard too.
CH 25 Raw Sockets and CH 26 Datalink Access might be of paricular interest to you. Ch 25 provides Stevens' version of Ping and should be a bit easier to follow. Further down the road, CH 26 provides the techniques to capture packets at the datalink level, the basis for applications such as network sniffers, although it is kind of old and obsolete regarding Linux. Anyany, in my opinion, it is very good still.
There is a Chinese translation of the above as well. You should be easy to get it online or at a local bookstore.
Hope it helps.
Good luck. |
|