core

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2024 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NicID tcpip.NICID

Functions

func AddrFromAddress

func AddrFromAddress(address tcpip.Address) netip.Addr

func AddressFromAddr

func AddressFromAddr(destination netip.Addr) tcpip.Address

func CreateStack

func CreateStack(cfg *Config) (*stack.Stack, error)

CreateStack creates *stack.Stack with given config.

Types

type Config

type Config struct {
	// LinkEndpoints is the interface implemented by
	// data link layer protocols.
	LinkEndpoint stack.LinkEndpoint

	// TransportHandler is the handler used by internal
	// stack to set transport handlers.
	TransportHandler adapter.TransportHandler

	// MulticastGroups is used by internal stack to add
	// nic to given groups.
	MulticastGroups []net.IP

	// Options are supplement options to apply settings
	// for the internal stack.
	Options []option.Option
}

Config is the configuration to create *stack.Stack.

type Handler

type Handler interface {
	N.UDPConnectionHandler
	E.Handler
}

func CreateProxyHandler

func CreateProxyHandler(a func(adapter.UDPConn)) Handler

type Tunnel

type Tunnel struct{}

func (*Tunnel) HandleTCP

func (*Tunnel) HandleTCP(conn adapter.TCPConn)

func (Tunnel) HandleUDP

func (t Tunnel) HandleUDP(conn adapter.UDPConn)

type UDPBackWriter

type UDPBackWriter struct {
	// contains filtered or unexported fields
}

func (*UDPBackWriter) WritePacket

func (w *UDPBackWriter) WritePacket(packetBuffer *buf.Buffer, destination M.Socksaddr) error

type UDPForwarder

type UDPForwarder struct {
	// contains filtered or unexported fields
}

func NewUDPForwarder

func NewUDPForwarder(ctx context.Context, stack *stack.Stack, handler Handler, udpTimeout int64) *UDPForwarder

func (*UDPForwarder) HandlePacket

func (f *UDPForwarder) HandlePacket(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool

Directories

Path Synopsis
iobased
Package iobased provides the implementation of io.ReadWriter based data-link layer endpoints.
Package iobased provides the implementation of io.ReadWriter based data-link layer endpoints.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL