LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   opening packet captured and reading data (https://www.linuxquestions.org/questions/linux-kernel-70/opening-packet-captured-and-reading-data-934365/)

divdelleah 03-14-2012 04:21 AM

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...

nini09 03-14-2012 03:15 PM

Where or how do you capture packet?

divdelleah 03-20-2012 02:30 PM

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

nini09 03-20-2012 03:11 PM

If the data pointer in skb doesn't work, you can raw pointer.

divdelleah 03-21-2012 05:05 AM

Quote:

Originally Posted by nini09 (Post 4631877)
If the data pointer in skb doesn't work, you can raw pointer.

sorry didnt get u can u elaborate a little....?

nini09 03-21-2012 02:50 PM

You can try 'raw' pointer of 'nh' union in skb.


All times are GMT -5. The time now is 02:00 AM.