k06a
k06a

Reputation: 18745

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 capture packets, witch were injected myself. What is the easiest way?

Upvotes: 1

Views: 875

Answers (2)

k06a
k06a

Reputation: 18745

The best way is to use PCAP_OPENFLAG_NOCAPTURE_RPCAP flag..

Upvotes: 2

Ian Goldby
Ian Goldby

Reputation: 6174

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…

Upvotes: 1

Related Questions