crash.software
Projects
Pull Requests
Issues
Builds
sing-box
Code
Files
Commits
Branches
Tags
Pull Requests
Code Comments
Code Compare
Issues
List
Boards
Milestones
Builds
Statistics
Contributions
Source Lines
Child Projects
Projects
STRLCPY
sing-box
Files
🤬
Sign In
e6e55621
ROOT
/
route
/
router.go
Search
History
1133 lines
|
ISO-8859-1
|
35 KB
Blame
Outline
2
4
8
No wrap
Soft wrap
Outline
warnDefaultInterfaceOnUnsupportedPlatform
warnDefaultMarkOnNonLinux
warnFindProcessOnUnsupportedPlatform
_
:
adapter.Router
Router
ctx
:
context.Context
logger
:
log.ContextLogger
dnsLogger
:
log.ContextLogger
inboundByTag
:
map[string]adapter.Inbound
outbounds
:
[]adapter.Outbound
outboundByTag
:
map[string]adapter.Outbound
rules
:
[]adapter.Rule
defaultDetour
:
string
defaultOutboundForConnection
:
adapter.Outbound
defaultOutboundForPacketConnection
:
adapter.Outbound
needGeoIPDatabase
:
bool
needGeositeDatabase
:
bool
geoIPOptions
:
option.GeoIPOptions
geositeOptions
:
option.GeositeOptions
geoIPReader
:
*geoip.Reader
geositeReader
:
*geosite.Reader
geositeCache
:
map[string]adapter.Rule
dnsClient
:
*dns.Client
defaultDomainStrategy
:
dns.DomainStrategy
dnsRules
:
[]adapter.DNSRule
defaultTransport
:
dns.Transport
transports
:
[]dns.Transport
transportMap
:
map[string]dns.Transport
transportDomainStrategy
:
map[dns.Transport]dns.DomainStrategy
dnsReverseMapping
:
*DNSReverseMapping
interfaceFinder
:
myInterfaceFinder
autoDetectInterface
:
bool
defaultInterface
:
string
defaultMark
:
int
networkMonitor
:
tun.NetworkUpdateMonitor
interfaceMonitor
:
tun.DefaultInterfaceMonitor
packageManager
:
tun.PackageManager
processSearcher
:
process.Searcher
timeService
:
adapter.TimeService
clashServer
:
adapter.ClashServer
v2rayServer
:
adapter.V2RayServer
platformInterface
:
platform.Interface
NewRouter
( ctx context.Context, logFactory log.Factory, options option.RouteOptions, dnsOptions option.DNSOptions, ntpOptions option.NTPOptions, inbounds []option.Inbound, platformInterface platform.Interface, )
:
(*Router, error)
hasRule
(rules []option.Rule, cond func(rule option.DefaultRule) bool)
:
bool
hasDNSRule
(rules []option.DNSRule, cond func(rule option.DefaultDNSRule) bool)
:
bool
isGeoIPRule
(rule option.DefaultRule)
:
bool
isGeoIPDNSRule
(rule option.DefaultDNSRule)
:
bool
isGeositeRule
(rule option.DefaultRule)
:
bool
isGeositeDNSRule
(rule option.DefaultDNSRule)
:
bool
isProcessRule
(rule option.DefaultRule)
:
bool
isProcessDNSRule
(rule option.DefaultDNSRule)
:
bool
notPrivateNode
(code string)
:
bool
*Router
Initialize
(inbounds []adapter.Inbound, outbounds []adapter.Outbound, defaultOutbound func() adapter.Outbound)
:
error
Outbounds
()
:
[]adapter.Outbound
Start
()
:
error
Close
()
:
error
GeoIPReader
()
:
*geoip.Reader
LoadGeosite
(code string)
:
(adapter.Rule, error)
Outbound
(tag string)
:
(adapter.Outbound, bool)
DefaultOutbound
(network string)
:
adapter.Outbound
RouteConnection
(ctx context.Context, conn net.Conn, metadata adapter.InboundContext)
:
error
RoutePacketConnection
(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext)
:
error
match
(ctx context.Context, metadata *adapter.InboundContext, defaultOutbound adapter.Outbound)
:
(adapter.Rule, adapter.Outbound)
InterfaceFinder
()
:
control.InterfaceFinder
AutoDetectInterface
()
:
bool
AutoDetectInterfaceFunc
()
:
control.Func
DefaultInterface
()
:
string
DefaultMark
()
:
int
Rules
()
:
[]adapter.Rule
NetworkMonitor
()
:
tun.NetworkUpdateMonitor
InterfaceMonitor
()
:
tun.DefaultInterfaceMonitor
PackageManager
()
:
tun.PackageManager
TimeFunc
()
:
func() time.Time
ClashServer
()
:
adapter.ClashServer
SetClashServer
(server adapter.ClashServer)
V2RayServer
()
:
adapter.V2RayServer
SetV2RayServer
(server adapter.V2RayServer)
prepareGeoIPDatabase
()
:
error
prepareGeositeDatabase
()
:
error
downloadGeoIPDatabase
(savePath string)
:
error
downloadGeositeDatabase
(savePath string)
:
error
OnPackagesUpdated
(packages int, sharedUsers int)
NewError
(ctx context.Context, err error)
notifyNetworkUpdate
(int)
:
error
All occurrences
Please wait...
Page is in error, reload to recover