Documentation ¶
Index ¶
- type Config
- type Interface
- type LinkOptions
- type Option
- func DevicePermissions(permissions *water.DevicePermissions) Option
- func DeviceType(deviceType water.DeviceType) Option
- func LocalAddress(address string) Option
- func MTU(mtu int) Option
- func MultiQueue(multiQueue bool) Option
- func Name(name string) Option
- func Persist(persist bool) Option
- func TunnelIP(local, remote string) Option
- type VPNService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { water.Config LinkOptions }
Config defines parameters required to create a TUN/TAP interface. It's only used when the device is initialized. A zero-value Config is a valid configuration.
type LinkOptions ¶
LinkOptions defines parameters in Config that are specific to Linux. A zero-value of such type is valid, yielding an interface with default values.
type Option ¶
type Option func(cfg *Config)
Defines a VPN device modifier option.
func DevicePermissions ¶
func DevicePermissions(permissions *water.DevicePermissions) Option
Permissions, if non-nil, specifies the owner and group owner for the interface. A zero-value of this field, i.e. nil, indicates that no changes to owner or group will be made.
func DeviceType ¶
func DeviceType(deviceType water.DeviceType) Option
func LocalAddress ¶
Sets the interface's local address and subnet.
func MultiQueue ¶
MultiQueue specifies whether the multiqueue flag should be set on the interface. From version 3.8, Linux supports multiqueue tuntap which can uses multiple file descriptors (queues) to parallelize packets sending or receiving.
func Name ¶
Name is the name to be set for the interface to be created. This overrides the default name assigned by OS such as tap0 or tun0. A zero-value of this field, i.e. an empty string, indicates that the default name should be used.
type VPNService ¶
type VPNService struct { *Interface // contains filtered or unexported fields }
func (*VPNService) Handler ¶
func (vpn *VPNService) Handler() network.StreamHandler
func (*VPNService) Protocol ¶
func (vpn *VPNService) Protocol() protocol.ID