How to determine packet direction using libpcap?

旧街凉风 提交于 2019-12-11 10:25:14

问题


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:


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.



来源:https://stackoverflow.com/questions/21815485/how-to-determine-packet-direction-using-libpcap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!