开发者

What do I need to fill in when using IP_HDRINCL

开发者 https://www.devze.com 2023-01-07 01:31 出处:网络
I\'m awaiting the arrival of \"Linux Network Programming\" but in the meantime I thought I\'d ask my brothers (and sisters) here for some info. If I have constructed a raw packet structure containing

I'm awaiting the arrival of "Linux Network Programming" but in the meantime I thought I'd ask my brothers (and sisters) here for some info. If I have constructed a raw packet structure containing the ethernet header, ip header and tcp/udp/icmp header. What do I actually have to fill in when using the option IP_HDRINCL? At first I thought that I had to do everything but now I understand that 开发者_JAVA百科the src and dest mac addresses of the ethernet header could be handled by the kernel. But what is required that I fill in and what values should the other fields have for the kernel to understand that it should fill those in?

Thanx in advance boys (and girls)!


You start with the IP header. But set all members of the IP and TCP/UDP frames correctly.

Your assumptions is correct. Don't include the Ethernet header when you send raw IP frames. Usually Ethernet is used as a low level communication, but there are others.

0

精彩评论

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