Ethernet control

I am new to linux. I want to capture ethernet packets above the device driver layer.

I know that all packages go through the dev_queue_xmit functions to pass the package to the top level and the netfi_rx function to get the package.

How can I "enable" this feature for Ethernet traffic control?

what should I work with to accomplish this task?


source to share

2 answers

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



You might want to use raw sockets.

See also this question



All Articles