route

package
v0.0.0-...-2a1d78e Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: GPL-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExchangeDNSPacket

func ExchangeDNSPacket(ctx context.Context, router *Router, conn N.PacketConn, buffer *buf.Buffer, metadata adapter.InboundContext, destination M.Socksaddr)

Types

type ConnectionManager

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

func NewConnectionManager

func NewConnectionManager(logger logger.ContextLogger) *ConnectionManager

func (*ConnectionManager) Close

func (m *ConnectionManager) Close() error

func (*ConnectionManager) NewConnection

func (m *ConnectionManager) NewConnection(ctx context.Context, this N.Dialer, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc)

func (*ConnectionManager) NewPacketConnection

func (m *ConnectionManager) NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc)

func (*ConnectionManager) Start

func (m *ConnectionManager) Start() error

type ConnectionMonitor

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

func NewConnectionMonitor

func NewConnectionMonitor() *ConnectionMonitor

func (*ConnectionMonitor) Add

func (*ConnectionMonitor) Close

func (m *ConnectionMonitor) Close() error

func (*ConnectionMonitor) Start

func (m *ConnectionMonitor) Start() error

type DNSReverseMapping

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

func NewDNSReverseMapping

func NewDNSReverseMapping() *DNSReverseMapping

func (*DNSReverseMapping) Query

func (m *DNSReverseMapping) Query(address netip.Addr) (string, bool)

func (*DNSReverseMapping) Save

func (m *DNSReverseMapping) Save(address netip.Addr, domain string, ttl int)

type NetworkManager

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

func NewNetworkManager

func NewNetworkManager(ctx context.Context, logger logger.ContextLogger, routeOptions option.RouteOptions) (*NetworkManager, error)

func (*NetworkManager) AutoDetectInterface

func (r *NetworkManager) AutoDetectInterface() bool

func (*NetworkManager) AutoDetectInterfaceFunc

func (r *NetworkManager) AutoDetectInterfaceFunc() control.Func

func (*NetworkManager) AutoRedirectOutputMark

func (r *NetworkManager) AutoRedirectOutputMark() uint32

func (*NetworkManager) Close

func (r *NetworkManager) Close() error

func (*NetworkManager) DefaultNetworkInterface

func (r *NetworkManager) DefaultNetworkInterface() *adapter.NetworkInterface

func (*NetworkManager) DefaultOptions

func (r *NetworkManager) DefaultOptions() adapter.NetworkOptions

func (*NetworkManager) InterfaceFinder

func (r *NetworkManager) InterfaceFinder() control.InterfaceFinder

func (*NetworkManager) InterfaceMonitor

func (r *NetworkManager) InterfaceMonitor() tun.DefaultInterfaceMonitor

func (*NetworkManager) NetworkInterfaces

func (r *NetworkManager) NetworkInterfaces() []adapter.NetworkInterface

func (*NetworkManager) NetworkMonitor

func (r *NetworkManager) NetworkMonitor() tun.NetworkUpdateMonitor

func (*NetworkManager) OnPackagesUpdated

func (r *NetworkManager) OnPackagesUpdated(packages int, sharedUsers int)

func (*NetworkManager) PackageManager

func (r *NetworkManager) PackageManager() tun.PackageManager

func (*NetworkManager) ProtectFunc

func (r *NetworkManager) ProtectFunc() control.Func

func (*NetworkManager) RegisterAutoRedirectOutputMark

func (r *NetworkManager) RegisterAutoRedirectOutputMark(mark uint32) error

func (*NetworkManager) ResetNetwork

func (r *NetworkManager) ResetNetwork()

func (*NetworkManager) Start

func (r *NetworkManager) Start(stage adapter.StartStage) error

func (*NetworkManager) UpdateInterfaces

func (r *NetworkManager) UpdateInterfaces() error

func (*NetworkManager) WIFIState

func (r *NetworkManager) WIFIState() adapter.WIFIState

type Router

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

func NewRouter

func NewRouter(ctx context.Context, logFactory log.Factory, options option.RouteOptions, dnsOptions option.DNSOptions) (*Router, error)

func (*Router) ClearDNSCache

func (r *Router) ClearDNSCache()

func (*Router) Close

func (r *Router) Close() error

func (*Router) Exchange

func (r *Router) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.Msg, error)

func (*Router) FakeIPStore

func (r *Router) FakeIPStore() adapter.FakeIPStore

func (*Router) GeoIPReader

func (r *Router) GeoIPReader() *geoip.Reader

func (*Router) LoadGeosite

func (r *Router) LoadGeosite(code string) (adapter.Rule, error)

func (*Router) Lookup

func (r *Router) Lookup(ctx context.Context, domain string, strategy dns.DomainStrategy) ([]netip.Addr, error)

func (*Router) LookupDefault

func (r *Router) LookupDefault(ctx context.Context, domain string) ([]netip.Addr, error)

func (*Router) NeedWIFIState

func (r *Router) NeedWIFIState() bool

func (*Router) PreMatch

func (r *Router) PreMatch(metadata adapter.InboundContext) error

func (*Router) ResetNetwork

func (r *Router) ResetNetwork()

func (*Router) RouteConnection deprecated

func (r *Router) RouteConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

Deprecated: use RouteConnectionEx instead.

func (*Router) RouteConnectionEx

func (r *Router) RouteConnectionEx(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc)

func (*Router) RoutePacketConnection

func (r *Router) RoutePacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Router) RoutePacketConnectionEx

func (r *Router) RoutePacketConnectionEx(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc)

func (*Router) RuleSet

func (r *Router) RuleSet(tag string) (adapter.RuleSet, bool)

func (*Router) Rules

func (r *Router) Rules() []adapter.Rule

func (*Router) SetTracker

func (r *Router) SetTracker(tracker adapter.ConnectionTracker)

func (*Router) Start

func (r *Router) Start(stage adapter.StartStage) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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