[<prev] [next>] [day] [month] [year] [list]
Message-ID: <SINPR01MB1662CC11F5BC1A0DA265FC279E580@SINPR01MB1662.apcprd01.prod.exchangelabs.com>
Date: Tue, 14 Feb 2017 15:36:05 +0000
From: #PATHANGI JANARDHANAN JATINSHRAVAN# <JATINSHR001@...tu.edu.sg>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Reading network data from an sk_buffer
Hi,
I have been trying to modify the xen-netback driver to print the data going into a VM from an external source, and have been trying with the example of a SSL Handshake.
I would simply like to read the following message from the netback.c driver in xen-netback:
160302002f0100002b03026161616161616161616161616161616161616161616161616161616161616161000002000501000000
To accomplish this, I have been trying to get the sk_buff the xenvif_rx_action() function in xen-netback, which is called when the network rings are used in xen.
Now, for the relevant part, I've been trying to extract the TCP header from it using the tcp_hdr(skb) function, where skb is the sk_buffer and after that, extract the user_data with the following line of code:
user_data = (unsigned char *)((unsigned char *)tcph + (tcph->doff * 4)), where tcph is the tcp header from the tcp_hdr(skb) function.
I then get the tail of the sk_buffer from the skb_tail_pointer, and am trying to iterate from the user_data variable to the tail obtained.
But I am not able to parse the hexadecimal string as shown above. Printing the userdata portion of the sk_buff using the printk, I notice that I get things like the below:
\xffffffe9\xffffffe9
But never the actual hexadecimal string above that I wish to read.
Any help and guidance will be greatly appreciated.
Thanks,
Jatin
Powered by blists - more mailing lists