Re: Send a UDP packet through IP raw socket: meaningful? How?

From: Mike Ricketts (mike@earth.li)
Date: Wed Jun 06 2001 - 02:50:36 EST


On Tue, 5 Jun 2001, WEI QU wrote:

> 1) Is it meaningful to send the UDP packet via raw socket rather than
> common UDP socket?

Yes.

> 2) If I need to send the UDP packet through the raw socket without the
> IP_HDRINCL option on, how should I fill in the UDP checksum field of UDP
> header? The checksum will consider the pesudo header, does it mean I have
> to construct the pesudo header by myself just for the checksum
> computation?
>
Yes.

> 3) I find a example of sending UDP packet through raw socket with
> IP_HDRINCL option set, unfortunately I can not find the *udpiphdr struct*
> on Linux, neither can I find it in the sample code of this book.(UNIX
> Network Programming, v1,e2, Figure 26.13). Is this structure system
> dependent?
>
The structure isn't. The naming of it is.
Have a look at sendip (linked from
http://www.earth.li/porjectpurple/). It might do exactly what you
want. If not, it should be close enough that you can figure it out.

-- 
Mike Ricketts <mike@earth.li>               Phone: +44 7968 381810

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org



This archive was generated by hypermail 2b29 : Thu Jun 07 2001 - 21:01:16 EST