Versions in this module Expand all Collapse all v0 v0.0.20241020 Oct 20, 2024 v0.0.20240223 Feb 23, 2024 Changes in this version + const EventDown + const EventMTUUpdate + const EventUp + var ErrTooManySegments = errors.New("too many segments") + var WintunStaticRequestedGUID *windows.GUID — windows/amd64 + var WintunTunnelType = "WireGuard" — windows/amd64 + type Device interface + BatchSize func() int + Close func() error + Events func() <-chan Event + File func() *os.File + MTU func() (int, error) + Name func() (string, error) + Read func(bufs [][]byte, sizes []int, offset int) (n int, err error) + Write func(bufs [][]byte, offset int) (int, error) + func CreateTUN(ifname string, mtu int) (Device, error) + func CreateTUN(name string, mtu int) (Device, error) + func CreateTUNFromFile(file *os.File, mtu int) (Device, error) + func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID, mtu int) (Device, error) + func CreateUnmonitoredTUNFromFD(fd int) (Device, string, error) + type Event int + type NativeTun struct — darwin/amd64, linux/amd64, windows/amd64 + func (tun *NativeTun) BatchSize() int + func (tun *NativeTun) Close() error + func (tun *NativeTun) Events() <-chan Event + func (tun *NativeTun) File() *os.File + func (tun *NativeTun) ForceMTU(mtu int) + func (tun *NativeTun) LUID() uint64 + func (tun *NativeTun) MTU() (int, error) + func (tun *NativeTun) Name() (string, error) + func (tun *NativeTun) Read(bufs [][]byte, sizes []int, offset int) (int, error) + func (tun *NativeTun) RunningVersion() (version uint32, err error) + func (tun *NativeTun) Write(bufs [][]byte, offset int) (int, error)