NETFILTER and How to capture data from non linear area of skbuff
i am writing a netfilter module for linux 2.6.34.6-47 / 2.6.35. while i could capture the packets on the incoming hook since the same came as a single packet in probably the allocated skbuff area by the stack, i found that packets going out of the machine are getting splitted into linear and non-linear area. skb->data gives the total length of packet as correct, but when i extract skb-> data to print it, it prints only ip and tcp header. Now to treat the data i need to extract it and then push it back on the route.
To clarify if my application layer data is 3 bytes . the total length by passing pointers is shows as 55 bytes = ( 52 byte of headers (ip+tcp) + 3 byte of data), but i can't access these 3 bytes by using (skb->tail - skb->data). can some one please give some hint how to extract outgoing data for any further action and then put it back on route for further encapsulation by the L2 stack or whatever...
will skb_linearize() or skb_linearize_cow() be of any use , if yes how and why. ?
thx in advance
|