QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 858|回复: 2

请问高手:又没做过用原始套接字解剖和构造ip数据报的程序!

[复制链接]
发表于 2003-7-14 16:41:25 | 显示全部楼层 |阅读模式
能否指点一二
不甚感激
发表于 2003-7-14 21:33:55 | 显示全部楼层
read source code of ping.
回复

使用道具 举报

发表于 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.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-15 10:53 , Processed in 0.074044 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表