<div dir="ltr"><div><div><div>Hi Pranay Srivastava,<br><br></div>Thanks for your reply. I just want to copy the payload into the buffer with out cloning<br>or copying of skb to reduce the delay as it has to do on every packet.<br>
</div><div>Is there any method in the linux kernel to get only the payload after stripping off the <br></div><div>TCP header. <br><br></div><div>Thanks,<br></div><div>Ramana. <br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, May 26, 2014 at 2:17 PM, Pranay Srivastava <span dir="ltr"><<a href="mailto:pranjas@gmail.com" target="_blank">pranjas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On Mon, May 26, 2014 at 1:20 PM, Ramana Reddy <<a href="mailto:gtvrreddy@gmail.com">gtvrreddy@gmail.com</a>> wrote:<br>
> Thanks for your reply. First thing is that I do not want to modify the<br>
> existing cifs driver.<br>
> I have my own virtual Ethernet driver, where the skb buffer is available to<br>
> parse. Now,<br>
> I want to extract the cifs header from this skb buffer, and based on the<br>
> cifs header contents<br>
> ( mainly I am looking for return status), I have to redirect the packet to<br>
> different destination.<br>
<br>
</div>skb_clone in case you won't modify the packet. (Data isn't copied here).<br>
<br>
skb_copy if you or the intended recipient would modify the skb.(Data<br>
is copied here). Gives you a free pass to do anything.<br>
<br>
For UDP packets I guess you'll also need to take off the UDP header<br>
(last time I tried to read from skb of a UDP) but for TCP you'll have<br>
your data ready no need<br>
to strip off the TCP header. Just check in case the skb you've<br>
contains fragments(For TCP connection) but since you only need CIFS<br>
header I don't think you'll have to bother about that, as CIFS header<br>
isn't that big.<br>
<div class=""><br>
><br>
> Thanks,<br>
> Ramana.<br>
><br>
><br>
> On Mon, May 26, 2014 at 12:34 PM, <<a href="mailto:Valdis.Kletnieks@vt.edu">Valdis.Kletnieks@vt.edu</a>> wrote:<br>
>><br>
>> On Mon, 26 May 2014 12:21:12 +0530, Ramana Reddy said:<br>
>><br>
>> > I would like to know how to extract the cifs protocol header from skb<br>
>> > buffer in the linux<br>
>> > kernel. I want to parse the cifs header and do some stuff based on the<br>
>> > content of the header.<br>
>><br>
>> Depending what you are trying to do, it may be best to add your code<br>
>> to the CIFS driver at the points where the driver is examining the<br>
>> header fields in question.<br>
>><br>
>> What "do some stuff" are you trying to achieve?<br>
><br>
><br>
><br>
</div>> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
---P.K.S<br>
</font></span></blockquote></div><br></div>