Re: get tcp header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thank you Jan. I know, I'm not very respectful, sorry. I will
carefully read your pdf. and only after the reading I uso this mailing
list: i think that this is the way.
Good book, Jan, great work.

On Tue, Aug 31, 2010 at 8:35 PM, Jan Engelhardt <jengelh@xxxxxxxxxx> wrote:
> On Tuesday 2010-08-31 20:26, Nicola Padovano wrote:
>
>>Hi guys! i know the skb_transport_header to grab the tcp header of a
>>packet...so i can write:
>>struct tcphdr *tcp_header1 = (struct
>>tcphdr*)skb_transport_header(skb), where skb is a certain packet.
>>
>>now, studying some source code that i've found some days ago, i've seen this:
>>
>>struct tcphdr *tcp_header2  = (void*)ip_hdr(skb) + ip_hdrlen(skb);
>>
>>I immediately thought that the two lines were identical, but but I was
>>mistaken...in fact if i write this:
>>
>>printk(KERN_INFO "diff: %d\n",(int)((void*)tcp_header2 - (void*)tcp_header1));
>>
>>i see, "diff: 20"
>>
>>so my question is: what's the difference between the two code lines?
>
>
> skb_transport_header is also explained in the PDF, especially when it
> can not be used.
>



-- 
Nicola Padovano
e-mail: nicola.padovano@xxxxxxxxx
web: http://npadov.blogspot.com/
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux