github.com/labulakalia/water@v0.0.5-0.20231118024244-f351ca6784b6/params_windows.go (about)

     1  package water
     2  
     3  // PlatformSpecificParams defines parameters in Config that are specific to
     4  // Windows. A zero-value of such type is valid.
     5  type PlatformSpecificParams struct {
     6  	// ComponentID associates with the virtual adapter that exists in Windows.
     7  	// This is usually configured when driver for the adapter is installed. A
     8  	// zero-value of this field, i.e., an empty string, causes the interface to
     9  	// use the default ComponentId. The default ComponentId is set to tap0901,
    10  	// the one used by OpenVPN.
    11  	ComponentID string
    12  	// InterfaceName is a friendly name of the network adapter as set in Control Panel.
    13  	// Of course, you may have multiple tap0901 adapters on the system, in which
    14  	// case we need a friendlier way to identify them.
    15  	Name string
    16  	// Network is required when creating a TUN interface. The library will call
    17  	// net.ParseCIDR() to parse this string into LocalIP, RemoteNetaddr,
    18  	// RemoteNetmask. The underlying driver will need those to generate ARP
    19  	// response to Windows kernel, to emulate an TUN interface.
    20  	// Please note that it cannot perceive the IP changes caused by DHCP, user
    21  	// configuration to the adapter and etc,. If IP changed, please reconfigure
    22  	// the adapter using syscall, just like openDev().
    23  	// For detail, please refer
    24  	// https://github.com/OpenVPN/tap-windows6/blob/master/src/device.c#L431
    25  	// and https://github.com/songgao/water/pull/13#issuecomment-270341777
    26  	Network string
    27  }
    28  
    29  func defaultPlatformSpecificParams() PlatformSpecificParams {
    30  	return PlatformSpecificParams{
    31  		ComponentID: "tap0901",
    32  		Network:     "192.168.1.10/24",
    33  		Name: "WaterIface",
    34  	}
    35  }