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.
精彩评论