Documentation ¶
Index ¶
- func ExchangeDNSPacket(ctx context.Context, router *Router, conn N.PacketConn, buffer *buf.Buffer, ...)
- type ConnectionManager
- type ConnectionMonitor
- type DNSReverseMapping
- type NetworkManager
- func (r *NetworkManager) AutoDetectInterface() bool
- func (r *NetworkManager) AutoDetectInterfaceFunc() control.Func
- func (r *NetworkManager) AutoRedirectOutputMark() uint32
- func (r *NetworkManager) Close() error
- func (r *NetworkManager) DefaultNetworkInterface() *adapter.NetworkInterface
- func (r *NetworkManager) DefaultOptions() adapter.NetworkOptions
- func (r *NetworkManager) InterfaceFinder() control.InterfaceFinder
- func (r *NetworkManager) InterfaceMonitor() tun.DefaultInterfaceMonitor
- func (r *NetworkManager) NetworkInterfaces() []adapter.NetworkInterface
- func (r *NetworkManager) NetworkMonitor() tun.NetworkUpdateMonitor
- func (r *NetworkManager) OnPackagesUpdated(packages int, sharedUsers int)
- func (r *NetworkManager) PackageManager() tun.PackageManager
- func (r *NetworkManager) ProtectFunc() control.Func
- func (r *NetworkManager) RegisterAutoRedirectOutputMark(mark uint32) error
- func (r *NetworkManager) ResetNetwork()
- func (r *NetworkManager) Start(stage adapter.StartStage) error
- func (r *NetworkManager) UpdateInterfaces() error
- func (r *NetworkManager) WIFIState() adapter.WIFIState
- type Router
- func (r *Router) ClearDNSCache()
- func (r *Router) Close() error
- func (r *Router) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.Msg, error)
- func (r *Router) FakeIPStore() adapter.FakeIPStore
- func (r *Router) GeoIPReader() *geoip.Reader
- func (r *Router) LoadGeosite(code string) (adapter.Rule, error)
- func (r *Router) Lookup(ctx context.Context, domain string, strategy dns.DomainStrategy) ([]netip.Addr, error)
- func (r *Router) LookupDefault(ctx context.Context, domain string) ([]netip.Addr, error)
- func (r *Router) NeedWIFIState() bool
- func (r *Router) PreMatch(metadata adapter.InboundContext) error
- func (r *Router) ResetNetwork()
- func (r *Router) RouteConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) errordeprecated
- func (r *Router) RouteConnectionEx(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, ...)
- func (r *Router) RoutePacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error
- func (r *Router) RoutePacketConnectionEx(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, ...)
- func (r *Router) RuleSet(tag string) (adapter.RuleSet, bool)
- func (r *Router) Rules() []adapter.Rule
- func (r *Router) SetTracker(tracker adapter.ConnectionTracker)
- func (r *Router) Start(stage adapter.StartStage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExchangeDNSPacket ¶
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 (m *ConnectionMonitor) Add(ctx context.Context, closer io.Closer) N.CloseHandlerFunc
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
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) FakeIPStore ¶
func (r *Router) FakeIPStore() adapter.FakeIPStore
func (*Router) GeoIPReader ¶
func (*Router) LookupDefault ¶
func (*Router) NeedWIFIState ¶
func (*Router) ResetNetwork ¶
func (r *Router) ResetNetwork()
func (*Router) RouteConnection
deprecated
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) SetTracker ¶
func (r *Router) SetTracker(tracker adapter.ConnectionTracker)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.