rust-pcap / pcap

Rust language pcap library
Apache License 2.0
620 stars 144 forks source link

Build-time `pcap_lib_version` probe #136

Closed sekineh closed 4 years ago

sekineh commented 4 years ago

It might be useful for linux / macos platforms. (automatically include libpcap version-dependent features)

Similar to: https://github.com/Wojtek242/pcap/pull/3/files

sekineh commented 4 years ago

I set v0.8.0 milestone for now, assuming @Wojtek242 is eager to implement this.

sekineh commented 4 years ago

Note: In npcap, pcap_lib_version() probabry returns "1.9.x" or something, but they don't have *fopen* functions exported. They have *hopen* functions instead.

See the link:

Hmm, we still need cfg(windows) even after we implement version probe?

Wojtek242 commented 4 years ago

Hmm, we still need cfg(windows) even after we implement version probe?

Sadly, that was always the case. For some reason the windows pcap library just does some things its own way. I don't think there is any way to avoid this.

Wojtek242 commented 4 years ago

I set v0.8.0 milestone for now, assuming @Wojtek242 is eager to implement this.

Yes, I will simply port the code from my fork. But let us decide first if we want build.rs or featurs in #118.

Wojtek242 commented 4 years ago

Resolved by #138