Capture packets from Linux Kernel TCP/IP stack
I need some help regarding to the packet capturing from Kernel TCP/IP stack. I want to capture the UDP packets that are receiving and sending from TCP/IP stack with the help of kernel module only.
I want that the module should
1. Capture the UDP packets incoming and outgoing
2. Make some required changes
3. Re-route the packets toward original destination.
please guide me by referring book, code, ideas etc.