开发者

How to ignore own packets by WinPcap?

开发者 https://www.devze.com 2023-01-24 19:21 出处:网络
When I inject any packet via WinPcap it will be captured in this moment. I dont want to ca开发者_JAVA技巧pture packets, witch were injected myself.

When I inject any packet via WinPcap it will be captured in this moment. I dont want to ca开发者_JAVA技巧pture packets, witch were injected myself. What is the easiest way?


The best way is to use PCAP_OPENFLAG_NOCAPTURE_RPCAP flag..


You could perhaps use a capture filter (pcap_setfilter()) and filter out packets by their source MAC address.

That may not be exactly what you want though, because MAC addresses can be spoofed, you might want to see outgoing packets from other sources on your machine, etc.

The only other thing I can think of would be to compute a hash value of each packet you send, and discard any captured packet with the same hash value.

There's got to be a better way…

0

精彩评论

暂无评论...
验证码 换一张
取 消