Ricardo
Ricardo

Reputation: 642

Ethernet Linux Control

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?

Upvotes: 3

Views: 306

Answers (2)

perreal
perreal

Reputation: 97918

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

Upvotes: 2

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

See also this question

Upvotes: 1

Related Questions