All of lore.kernel.org
 help / color / mirror / Atom feed
* Reading network data from an sk_buffer
@ 2017-02-14 15:36 #PATHANGI JANARDHANAN JATINSHRAVAN#
  0 siblings, 0 replies; only message in thread
From: #PATHANGI JANARDHANAN JATINSHRAVAN# @ 2017-02-14 15:36 UTC (permalink / raw)
  To: netdev

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-14 15:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 15:36 Reading network data from an sk_buffer #PATHANGI JANARDHANAN JATINSHRAVAN#

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.