capturing internet packet
Basically I have a program which would send out IP packet periodically.
without modifying the original program, I want to write another program that could capture the IP packet before it is send through the NIC, modify it and send it out.
that means the original program would still call the sendto function but I just dont' send it. I'll capture it, modify it than send it out.
Anyone have an idea how to do it?
================================================
The exact detail is. I am doing a DNS server project. Using MaraDNS I want to do incoming traffic load balancing.
Right now I modified the original MaraDNS source code, and change the DNS reply packet manually.
For intuitive reason, I'm hoping that I don't need to modify the MaraDNS source code in anyway. Moreover I'm hoping that I can make it portable, that is running on other DNS server program also. So best way is directly modifying the packet before it is send. Can someone give a hand?
|