Documentation
¶
Index ¶
- Constants
- type ProtocolHandler
- type TunDevice
- func (tun *TunDevice) BatchSize() int
- func (tun *TunDevice) Close() error
- func (tun *TunDevice) Events() <-chan tun.Event
- func (tun *TunDevice) File() *os.File
- func (tun *TunDevice) ForwardTo(ctx context.Context, upstream network.Network) error
- func (tun *TunDevice) LocalAddresses() ([]netip.Prefix, error)
- func (tun *TunDevice) MTU() (int, error)
- func (tun *TunDevice) Name() (string, error)
- func (tun *TunDevice) Network(resolveConf *network.ResolveConfig) *network.NetstackNetwork
- func (tun *TunDevice) Read(buf [][]byte, sizes []int, offset int) (int, error)
- func (tun *TunDevice) Write(buf [][]byte, offset int) (int, error)
- func (tun *TunDevice) WriteNotify()
Constants ¶
View Source
const IPv6MinMTU = 1280 // IPv6 minimum MTU, required for some PPPoE links.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProtocolHandler ¶
type ProtocolHandler func(stack.TransportEndpointID, *stack.PacketBuffer) bool
ProtocolHandler is a function that handles packets for a specific protocol.
func TCPForwarder ¶
func TCPForwarder(ctx context.Context, ipstack *stack.Stack, upstream network.Network) ProtocolHandler
TCPForwarder forwards TCP connections to an upstream network.
type TunDevice ¶
type TunDevice struct {
// contains filtered or unexported fields
}
func NewTunDevice ¶
func (*TunDevice) LocalAddresses ¶
LocalAddresses returns the list of local addresses assigned to the TUN device.
func (*TunDevice) Network ¶
func (tun *TunDevice) Network(resolveConf *network.ResolveConfig) *network.NetstackNetwork
Network returns the network abstraction for the TUN device.
func (*TunDevice) WriteNotify ¶
func (tun *TunDevice) WriteNotify()
Click to show internal directories.
Click to hide internal directories.