How to ignore own packets by WinPcap?
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…
精彩评论