rust-pcap / pcap

Rust language pcap library
Apache License 2.0
610 stars 138 forks source link

Windows support for `capture-stream` feature #191

Closed ColinFinck closed 2 years ago

ColinFinck commented 2 years ago

I'm currently using the pcap-async crate to perform packet capturing in asynchronous code. I'm thinking about switching to this crate due to the Windows support via Npcap/WinPcap. But you write that the capture-stream feature is only supported on Linux and macOS.

What is the reason for that? Can this be easily fixed?

Wojtek242 commented 2 years ago

If you look into https://github.com/ebfull/pcap/blob/master/src/stream.rs, you will see that the capture-stream relies on std::os::unix::io::RawFd. I don't know know how hard this would be to untangle though as I do exactly 0 windows development myself...

If you do try and succeed, feel free to submit a PR!