How to determine packet direction using libpcap?

2019-08-01 13:35发布

I am working on project using libpcap. Now, I need to know the direction of packet (inbound or outbound) once I got the packet in callback function. I am going to write the methods to compare IP and MAC address between client and these information extract from packet. Am I right?

Could you please help me some comments or advices on this problem?

Thank you for your time.

1条回答
放荡不羁爱自由
2楼-- · 2019-08-01 13:45

The source or target IP address is sufficient. If the source is local, it's outbound. If the target is local, it's inbound. If neither, it's a promiscuous sniff.

查看更多
登录 后发表回答