Documentation ¶
Index ¶
- type Device
- func (t *Device) AddStaticRoute(ctx context.Context, route routing.Route) error
- func (t *Device) AddSubnet(ctx context.Context, subnet *net.IPNet) error
- func (t *Device) Index() int32
- func (t *Device) Name() string
- func (t *Device) ReadPacket(into *buffer.Data) (int, error)
- func (t *Device) RemoveStaticRoute(ctx context.Context, route routing.Route) error
- func (t *Device) RemoveSubnet(ctx context.Context, subnet *net.IPNet) error
- func (t *Device) SetDNS(ctx context.Context, server net.IP, domains []string) (err error)
- func (t *Device) SetMTU(mtu int) error
- func (t *Device) WritePacket(from *buffer.Data, offset int) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
func (*Device) AddStaticRoute ¶ added in v2.4.6
AddStaticRoute adds a specific route. This can be used to prevent certain IP addresses from being routed to the TUN device.
func (*Device) AddSubnet ¶
AddSubnet adds a subnet to this TUN device and creates a route for that subnet which is associated with the device (removing the device will automatically remove the route).
func (*Device) ReadPacket ¶
ReadPacket reads as many bytes as possible into the given buffer.Data and returns the number of bytes actually read
func (*Device) RemoveStaticRoute ¶ added in v2.4.6
RemoveStaticRoute removes a specific route added via AddStaticRoute.
func (*Device) RemoveSubnet ¶
RemoveSubnet removes a subnet from this TUN device and also removes the route for that subnet which is associated with the device.
Click to show internal directories.
Click to hide internal directories.