rust-pcap / pcap

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

Paths for Upgrading Winpcap to Npcap for Microsoft Windows #196

Closed lambdaiv closed 2 years ago

lambdaiv commented 2 years ago

In an effort to consolidate our efforts to update the crate to use Npcap over winpcap, I made this ticket so we can centralize any discussion. @Wojtek242 has put forth two ideas for upgrading the use of winpcap to Npcap:

  1. Update the documentation to support both winpcap and Npcap options and note that the CI pipeline still relies on winpcap
  2. Fully replace winpcap with npcap and update the CI pipeline to use Npcap

I was considering a third option that combines both of the above:

  1. Update the documentation and CI to use Npcap with winpcap compatibility mode, until we fully remove the old winpcap references
    • Silently install Npcap with the /winpcap_mode switch
    • This would also let us get the new updates and improvements that Npcap contributed towards the winpcap libraries

This allows us to keep the same code, but only update the documentation and CI pipeline until we fully remove the dependence on winpcap. The only issue is that we need to get the paid version of Npcap (Npcap OEM). Fortunately, another contributor asked the nmap folks and they mentioned that we just need to email them to get it sorted out.

From my limited testing, installing Npcap with winpcap compatibility worked without any issues. The tests completed successfully and I was able to get a list of devices.

Thoughts? I can reach back out to nmap to get this started if we want to go that route or we can just wait until we fully remove winpcap in one go.

stappersg commented 2 years ago

My home has many windows. As most homes do have windows. An Igloo is an example of a home without windows.

Point that I trying to make is that this issue should be renamed from

Paths for Upgrading Winpcap to Npcap

into

Paths for Upgrading Winpcap to Npcap for Microsoft Windows

Idea behind this request is to make clear that input is needed from people who care about rust pcap library on Microsoft Windows. Also for creating awareness that there is no incentive for people using rust pcap library on other platforms to care about this particular issue.

lambdaiv commented 2 years ago

That's fair, I'll update the title. 👌🏼

ToshiroZ commented 2 years ago

I do believe upgrading to npcap would be nice. I use the library on windows

Wojtek242 commented 2 years ago

Won't there still be people who use Winpcap (since npcap is paid)? Which would actually mean we (should) always support the winpcap API anyway? If so, then option 3 might be the only way in which case I'd be fine with it. Also, I don't use Windows so I myself have no stake in this ultimately other than I'd rather not have angry people coming along later and complaining about something breaking :-).

Wojtek242 commented 2 years ago

Also, because I don't use Windows, this isn't something I can implement or even help with so somebody else needs to submit a PR.

lambdaiv commented 2 years ago

As far as I know, Npcap is free for personal use and requires a paid license if used in a commercial setting. Npcap is backwards compatible with most of the winpcap interface, but not 100%.

Wojtek242 commented 2 years ago

Npcap is backwards compatible with most of the winpcap interface, but not 100%.

Do you think anybody would complain about the differences? I'd assume where they aren't compatible it's in areas people don't really care about.

lambdaiv commented 2 years ago

I haven't used Npcap on Windows enough to be fully confident, but I would assume that no one would complain. If they did then, it's hard to justify supporting a library that was deprecated with version 4.1.3 in 08 MAR 2013 to be honest.

Wojtek242 commented 2 years ago

If they did then, it's hard to justify supporting a library that was deprecated with version 4.1.3 in 08 MAR 2013 to be honest.

Agreed. If you submit a PR and it passes the tests I think it'll be fine to merge, then wait and see a bit if anybody complains.