LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-14-2012, 04:21 AM   #1
divdelleah
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Rep: Reputation: Disabled
opening packet captured and reading data


can someone tell me how can i open the packet i have captured n read the data in it... i've printed the headers but i'm not able to print the data even by using the sk_buff->data and sk_buff->tail...

thanks in advance...
 
Old 03-14-2012, 03:15 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,845

Rep: Reputation: 161Reputation: 161
Where or how do you capture packet?
 
Old 03-20-2012, 02:30 PM   #3
divdelleah
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
i'm capturing the packet using netfilter hooks

nfho.hook = hook_func;
nfho.hooknum = NF_INET_PRE_ROUTING;
nfho.pf = PF_INET;
nfho.priority = NF_IP_PRI_LAST;

nf_register_hook(&nfho);

i've been able to read tcp headers udp headers but now i need to print the payload of the packet
 
Old 03-20-2012, 03:11 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,845

Rep: Reputation: 161Reputation: 161
If the data pointer in skb doesn't work, you can raw pointer.
 
Old 03-21-2012, 05:05 AM   #5
divdelleah
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by nini09 View Post
If the data pointer in skb doesn't work, you can raw pointer.
sorry didnt get u can u elaborate a little....?
 
Old 03-21-2012, 02:50 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,845

Rep: Reputation: 161Reputation: 161
You can try 'raw' pointer of 'nh' union in skb.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how do i read the data in the packet that i have captured after packet capture? gajaykrishnan Programming 23 04-19-2006 05:09 AM
what is the method of reading the data in a packet using Libpcap gajaykrishnan Linux - Networking 0 02-20-2005 02:29 AM
captured packet in ethereal anubhuti_k Linux - Networking 1 01-14-2005 06:31 AM

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

All times are GMT -5. The time now is 08:46 AM.

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