mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
wintun: add FlushInterface stub
This commit is contained in:
parent
2efafecab5
commit
c4b43e35a7
@ -65,6 +65,11 @@ func CreateTUN(ifname string) (TUNDevice, error) {
|
|||||||
// Set interface name. (Ignore errors.)
|
// Set interface name. (Ignore errors.)
|
||||||
wt.SetInterfaceName(ifname)
|
wt.SetInterfaceName(ifname)
|
||||||
}
|
}
|
||||||
|
err = wt.FlushInterface()
|
||||||
|
if err != nil {
|
||||||
|
wt.DeleteInterface(0)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
signalNameUTF16, err := windows.UTF16PtrFromString(wt.SignalEventName())
|
signalNameUTF16, err := windows.UTF16PtrFromString(wt.SignalEventName())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -322,9 +322,18 @@ func (wintun *Wintun) DeleteInterface(hwndParent uintptr) (bool, bool, error) {
|
|||||||
return false, false, nil
|
return false, false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
//
|
||||||
/// checkReboot checks device install parameters if a system reboot is required.
|
// FlushInterface removes all properties from the interface and gives it only a very
|
||||||
///
|
// vanilla IPv4 and IPv6 configuration with no addresses of any sort assigned.
|
||||||
|
//
|
||||||
|
func (wintun *Wintun) FlushInterface() error {
|
||||||
|
//TODO: implement me!
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// checkReboot checks device install parameters if a system reboot is required.
|
||||||
|
//
|
||||||
func checkReboot(deviceInfoSet setupapi.DevInfo, deviceInfoData *setupapi.SP_DEVINFO_DATA) (bool, error) {
|
func checkReboot(deviceInfoSet setupapi.DevInfo, deviceInfoData *setupapi.SP_DEVINFO_DATA) (bool, error) {
|
||||||
devInstallParams, err := deviceInfoSet.GetDeviceInstallParams(deviceInfoData)
|
devInstallParams, err := deviceInfoSet.GetDeviceInstallParams(deviceInfoData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -458,4 +467,4 @@ func (wintun *Wintun) SignalEventName() string {
|
|||||||
|
|
||||||
func (wintun *Wintun) DataFileName() string {
|
func (wintun *Wintun) DataFileName() string {
|
||||||
return fmt.Sprintf("\\\\.\\Global\\WINTUN_DEVICE_%s", guid.ToString((*windows.GUID)(wintun)))
|
return fmt.Sprintf("\\\\.\\Global\\WINTUN_DEVICE_%s", guid.ToString((*windows.GUID)(wintun)))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user