Documentation ¶
Index ¶
- type Device
- 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) 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) 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) 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.