How to get a raw socket on windows?

I need to be able to send and receive arbitrary data on my NIC on windows.

Based on my initial research, this is typically accomplished using

  1. https://npcap.com/ (the successor to winpcap)
  2. https://www.winpcap.org/ (no longer maintained)

Unfortunately, the license of npcap prohibits redistributing it, so I will not be able to automatically install it on users computers if I use it, and I won’t be able to build it statically into my executable (I guess?)

So I guess that leaves me with the following solution:

Get the headers from npcap, put them in my repo, using @cImport and expect users to install npcap themselves if they are going to use my application.

Anyone have a better idea???

There is also NDIS, which I don’t know what that is, but maybe I could write a driver?

Win10PCap is GPLv2 and have signed drivers.
Sources