LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Change In sk_buff structure in 2.6.22 kernel
@ 2008-01-30  5:19 PV Juliet
  2008-01-30  6:27 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: PV Juliet @ 2008-01-30  5:19 UTC (permalink / raw)
  To: linux-kernel

Hi All,


The header fields in the sk_buff structure have been renamed and are
no longer unions.

Networking code and drivers are supposed to use skb->transport_header,
skb->network_header, and skb->skb_mac_header.
But when I am trying to access fields of TCP using the code
struct tcphdr *tcp = skb->transport_header;
tcp->   //accessing proper field
It is not accessing the value properly ...
Can anyone please help me ???


Thanks in advance
Regards
Juliet

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Change In sk_buff structure in 2.6.22 kernel
  2008-01-30  5:19 Change In sk_buff structure in 2.6.22 kernel PV Juliet
@ 2008-01-30  6:27 ` Stephen Hemminger
  2008-01-31  0:41   ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2008-01-30  6:27 UTC (permalink / raw)
  To: PV Juliet; +Cc: linux-kernel

On Wed, 30 Jan 2008 10:49:49 +0530
"PV Juliet" <pvjuliet@gmail.com> wrote:

> Hi All,
> 
> 
> The header fields in the sk_buff structure have been renamed and are
> no longer unions.
> 
> Networking code and drivers are supposed to use skb->transport_header,
> skb->network_header, and skb->skb_mac_header.
> But when I am trying to access fields of TCP using the code
> struct tcphdr *tcp = skb->transport_header;
> tcp->   //accessing proper field
> It is not accessing the value properly ...
> Can anyone please help me ???
> 
> 
> Thanks in advance
> Regards
> Juliet

Read the source (include/linux/skbuff.h)

Use the new accessor functions skb_transport_header(skb), skb_network_header(skb),


-- 
Stephen Hemminger <stephen.hemminger@vyatta.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Change In sk_buff structure in 2.6.22 kernel
  2008-01-30  6:27 ` Stephen Hemminger
@ 2008-01-31  0:41   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2008-01-31  0:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: pvjuliet, linux-kernel

Stephen Hemminger <shemminger@linux-foundation.org> wrote:
>
>> Networking code and drivers are supposed to use skb->transport_header,
>> skb->network_header, and skb->skb_mac_header.
>> But when I am trying to access fields of TCP using the code
>> struct tcphdr *tcp = skb->transport_header;
>> tcp->   //accessing proper field
>> It is not accessing the value properly ...
>> Can anyone please help me ???
>
> Use the new accessor functions skb_transport_header(skb), skb_network_header(skb),

There are also protocol helpers like tcp_hdr.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-31  0:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-30  5:19 Change In sk_buff structure in 2.6.22 kernel PV Juliet
2008-01-30  6:27 ` Stephen Hemminger
2008-01-31  0:41   ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).