Regarding parsing of cifs header

Pranay Srivastava pranjas at gmail.com
Mon May 26 04:47:59 EDT 2014


On Mon, May 26, 2014 at 1:20 PM, Ramana Reddy <gtvrreddy at gmail.com> wrote:
> Thanks for your reply. First thing is that I do not want to modify the
> existing cifs driver.
> I have my own virtual Ethernet driver, where the skb buffer is available to
> parse. Now,
> I want to extract the cifs header from this skb buffer, and based on the
> cifs header contents
> ( mainly I am looking for return status), I have to redirect the packet to
> different destination.

skb_clone in case you won't modify the packet. (Data isn't copied here).

skb_copy if you or the intended recipient would modify the skb.(Data
is copied here). Gives you a free pass to do anything.

For UDP packets I guess you'll also need to take off the UDP header
(last time I tried to read from skb of a UDP) but for TCP you'll have
your data ready no need
to strip off the TCP header. Just check in case the skb you've
contains fragments(For TCP connection) but since you only need CIFS
header I don't think you'll have to bother about that, as CIFS header
isn't that big.

>
> Thanks,
> Ramana.
>
>
> On Mon, May 26, 2014 at 12:34 PM, <Valdis.Kletnieks at vt.edu> wrote:
>>
>> On Mon, 26 May 2014 12:21:12 +0530, Ramana Reddy said:
>>
>> > I would like to know how to extract the cifs protocol header from skb
>> > buffer in the linux
>> > kernel. I want to parse the cifs header and do some stuff based on the
>> > content of the header.
>>
>> Depending what you are trying to do, it may be best to add your code
>> to the CIFS driver at the points where the driver is examining the
>> header fields in question.
>>
>> What "do some stuff" are you trying to achieve?
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
        ---P.K.S



More information about the Kernelnewbies mailing list