Documentation ¶
Index ¶
- Constants
- type Device
- func (t *Device) AddSubnet(ctx context.Context, subnet *net.IPNet) error
- 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) SetMTU(mtu int) error
- func (t *Device) WritePacket(from *buffer.Data) (int, error)
Constants ¶
View Source
const ND6_INFINITE_LIFETIME = 0xffffffff
View Source
const SIOCAIFADDR_IN6 = (unix.SIOCAIFADDR & 0xe000ffff) | (uint(unsafe.Sizeof(addrIfReq6{})) << 16)
SIOCAIFADDR_IN6 is the same ioctlHandle identifier as unix.SIOCAIFADDR adjusted with size of addrIfReq6
View Source
const SIOCDIFADDR_IN6 = (unix.SIOCDIFADDR & 0xe000ffff) | (uint(unsafe.Sizeof(addrIfReq6{})) << 16)
SIOCDIFADDR_IN6 is the same ioctlHandle identifier as unix.SIOCDIFADDR adjusted with size of addrIfReq6
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.