LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   network protocol (https://www.linuxquestions.org/questions/linux-networking-3/network-protocol-898251/)

elpurata2000 08-19-2011 04:48 AM

network protocol
 
Greetings,



How do I create a protocol that caches all the traffic, the incomming before any other protocol, and outgoing before going to the lower layer?

Why do I need this? because I want to modify the packets,

For example:
add vlan tags to incomming packets so my vlan aware linux handles them and remove them on the way out so my non vlan aware pc can handle the packet.

I created a module using dev_add_pack, it works well as a sniffer but it does not prevent the other protocols from getting the packet.

As a test after the "sniffing" I called netif_rx insted of destroying the packet, I endeed up in a loop where I get one packet, sended to process and get back again ( at least that is how I understand it).

Any idea of how to do this?

I am hoping to achieve this without patching the kernel.

BR,
AUGUSTO SALAZAR

elpurata2000 08-23-2011 10:43 AM

ok ok.. not all at once..:D

after reading the web I suspect that the way to do this is via netfilter, now, as before I have achieved a module that works great as a filter, but dont know how to start the packets modifications.

I hope to first be able to change the destination port of the packet.

Any idea? :scratch:


All times are GMT -5. The time now is 03:11 PM.