开发者

How to include an IP packet in C linux sockets?

I want to include an IP packet in Socket programming. I have a readymade Ip packet which contains igmp packet. I don't want to design igmp protocol but want to use that packet to sent igmp query. By some how the Ip packet I have must be recognize as IP packet 开发者_开发知识库and not as TCP/UDP data.


You have to use the raw socket with sendmsg. This need root permission.


And if you want to send IGMP packets you should use the setsockopt() API to do so.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜