Closed yunfengwangluo closed 1 year ago
You can set direction
on a capture: https://docs.rs/pcap/latest/pcap/struct.Capture.html#method.direction. By using the Direction
you can choose whether you only want incoming or outgoing packets. If you still want both, but somehow to distinguish them, you probably will need two captures - one for incoming, one for outgoing.
I hope this asnwers your question! If it doesn't please feel free to re-open the issue and continue the discussion.
I just came into contact with this very good library and I want to differentiate the data obtained. How to distinguish the data received/sent by the network card? You still need to make your own judgment based on the source MAC.