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?

+3


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 .



+2


source


You might want to use raw sockets. http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html



See also this question

+1


source







All Articles