How to duplicate packets in PRE_ROUTING hook and send it to multiple machines in simpe way

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

 



I want to send tcp packets received on IP1: P1 to different machines
say IP2:P2, IP3:P3. I have a kernel module which  uses PRE_ROUTING and
POST_ROUTING.But i am not very clear about how can i make copies of
each tcp packet that i recieve in PRE_ROUTING and send it to these
machines __efficiently__ ??

How to make copies ??  skb_clone,pskb_copy,skb_copy ?? i will have to
change ip header before sending to other machines so which functions
to be used ??
Or can i do it in some otherway without making copies of packet.

How to send those packets out ?? Where do i need to add these packets
?? The linked list of packets to be sent out from  device ??
Or do i have access to other data structures from the original packet
which i intercepted at PRE_ROUTING  and and use some information which
is there to add myother packets so that they will aslo go out ??


--Rohit

P.S. I have very good reasons for duplicating these tcp packets , so
why to do this is really not the question  : )
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux