3
votes

I'm new on work with linux. I want capture the ethernet packets above the device drivers layer.

I know that all the packets pass through the functions "dev_queue_xmit" to transmit the packet to the upper layer and the function "netfi_rx" for recieving the packet.

How can i "hook" this function to control the ethernet traffic?

what should i work with to accomplish this task?

2

2 Answers

2
votes

You might want to check out libpcap (a portable C/C++ library for network traffic capture). There is also an example.