kaitoy / pcap4j

A Java library for capturing, crafting, and sending packets.
https://www.pcap4j.org/
Other
1.16k stars 308 forks source link

setDirestion() in Windows. #265

Open nonokatori opened 4 years ago

nonokatori commented 4 years ago

Hi!

I am writing a sniffer. I need to choose the direction of the packets being caught (source or destination), but the method setDirection(PcapHandle.PcapDirection dir) does not work under Windows. Is there any way to solve this problem? Or is made this method only for Linux?

ardikars commented 4 years ago

From the docs:

pcap_setdirection() isn't necessarily fully supported on all platforms;
some platforms might return an error for all values, and some other platforms might not support PCAP_D_OUT. 
nonokatori commented 4 years ago

Thank you! You helped me a lot!

I thought I was doing something wrong.