[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Reading network data from netback.c

On Sat, Feb 04, 2017 at 08:42:33AM +0000, #PATHANGI JANARDHANAN JATINSHRAVAN# 
> Hi all, Recently, I’ve been trying to modify netback.c to print
> network data that is going into the VM. For example, I’m doing an SSL
> handshake with the VM as the server, and I send the following
> hexadecimal string from the client to the VM:
> 160302002f0100002b03026161616161616161616161616161616161616161616161616161616161616161000002000501000000
> Now,  to read this ingoing data to the VM from netback.c, I’ve been
> trying to get the sk_buff from the function xenvif_rx_action() and
> extract the TCP header from it using the tcp_hdr(skb) function.

Assuming you're using the latest Linux master branch -- make sure you
extract data after the while loop but before xenvif_rx_copy_flush.

> I then try to get the data from the TCP header using the line:
> (unsigned char *)((unsigned char *)tcph + (tcph->doff * 4))

And maybe use some already existing function to extract data instead of
dereferencing on your own?

I don't think there is much I can help from the driver side. I would
suggest you read other code that handles TCP data to get an idea how to
do that.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.