Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish data received/sent by network cards #299

Closed
yunfengwangluo opened this issue May 13, 2023 · 1 comment
Closed

Distinguish data received/sent by network cards #299

yunfengwangluo opened this issue May 13, 2023 · 1 comment

Comments

@yunfengwangluo
Copy link

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.

@Wojtek242
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants