wintun: migrate to wintun.dll API

Rather than having every application using Wintun driver reinvent the
wheel, the Wintun device/adapter/interface management has been moved
from wireguard-go to wintun.dll deployed with Wintun itself.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman
2020-07-22 09:15:49 +02:00
parent 5ca1218a5c
commit 3e08b8aee0
25 changed files with 183 additions and 3725 deletions

View File

@@ -103,8 +103,8 @@ func (descriptor *RingDescriptor) Close() {
}
}
func (wintun *Interface) Register(descriptor *RingDescriptor) (windows.Handle, error) {
handle, err := wintun.handle()
func (wintun *Adapter) Register(descriptor *RingDescriptor) (windows.Handle, error) {
handle, err := wintun.OpenAdapterDeviceObject()
if err != nil {
return 0, err
}