Protocol Converter Module in Linux
I have a typical requirement, I want to have a converter module, that can convert UDP packet to TCP packet. And I need to do it before the packet can be processed in IP layer.
I will explain this complete scenario using an example
Lets say we have 3 machines A, B and C.
A sent an UDP packet
B received UDP packet
At B, when packet is being given to IP layer (from Link / MAC / Ethernet layer) , I want to get hold of packet. I want to delete the UDP and IP header in packet. I want to add TCP and IP header (assuming C is the destination host).
Now from B machine, packet is sent to C machine
Can somebody help me how this can be done. I am using linux machines.
Though libpcap can be one of the option (from wireshark), but it is not suitable for me because of performance reasons. I want a very light weight solution for this problem.