LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-25-2011, 03:19 AM   #1
kalloc
LQ Newbie
 
Registered: Feb 2011
Posts: 20

Rep: Reputation: 0
NETFILTER and How to capture data from non linear area of skbuff


i am writing a netfilter module for linux 2.6.34.6-47 / 2.6.35. while i could capture the packets on the incoming hook since the same came as a single packet in probably the allocated skbuff area by the stack, i found that packets going out of the machine are getting splitted into linear and non-linear area. skb->data gives the total length of packet as correct, but when i extract skb-> data to print it, it prints only ip and tcp header. Now to treat the data i need to extract it and then push it back on the route.

To clarify if my application layer data is 3 bytes . the total length by passing pointers is shows as 55 bytes = ( 52 byte of headers (ip+tcp) + 3 byte of data), but i can't access these 3 bytes by using (skb->tail - skb->data). can some one please give some hint how to extract outgoing data for any further action and then put it back on route for further encapsulation by the L2 stack or whatever...

will skb_linearize() or skb_linearize_cow() be of any use , if yes how and why. ?
thx in advance
 
Old 02-26-2011, 05:51 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I deleted one of your double posts.

I also moved your question to it's own thread in the "Linux - Kernel" forum so it can get the exposure it deserves.
 
Old 02-27-2011, 05:36 AM   #3
kalloc
LQ Newbie
 
Registered: Feb 2011
Posts: 20

Original Poster
Rep: Reputation: 0
Thx for moving it to the right forum. but i wonder if there are no users on kernel pgm'ing willing to guide or the thread is not visible for them to help.
Quote:
Originally Posted by jschiwal View Post
I deleted one of your double posts.

I also moved your question to it's own thread in the "Linux - Kernel" forum so it can get the exposure it deserves.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NETFILTER and Extraction of data from non linear area of skbuff kalloc Linux - Kernel 2 03-02-2011 12:36 AM
tcp_header=(struct tcphdr *)(skbuff->data+(skbuff->nh.iph->ihl*4)); How? iamjayanth Linux - Kernel 4 02-25-2011 04:07 AM
NETFILTER and Extraction of data from non linear area of skbuff kalloc Linux - Networking 1 02-25-2011 03:26 AM
problem with netfilter hook function struct skbuff *sock is null.. pavan6754 Programming 1 11-30-2009 05:42 AM
LXer: Linear Optimization with the GNU Linear Programming Kit LXer Syndicated Linux News 0 08-12-2006 04:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 04:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration