Documentation
¶
Index ¶
- Constants
- Variables
- func ParseParams(params []string) (isSrc bool, noResolve bool)
- func ParseRulePayload(ruleRaw string, needTarget bool) (tp, payload, target string, params []string)
- func ProtocolReadersParsed() bool
- func SetProtocolReadersParsedForTest(parsed bool) bool
- type ASN
- type Base
- type CellularRadio
- type DSCP
- type Domain
- type DomainKeyword
- type DomainRegex
- type DomainSuffix
- type DomainWildcard
- type GEOIP
- func (g *GEOIP) Adapter() string
- func (g *GEOIP) DnsFallbackFilter() C.IpMatcher
- func (g *GEOIP) GetCountry() string
- func (g *GEOIP) GetIPMatcher() (router.IPMatcher, error)
- func (g *GEOIP) GetRecodeSize() int
- func (g *GEOIP) Match(metadata *C.Metadata, helper C.RuleMatchHelper) (bool, string)
- func (g *GEOIP) MatchIp(ip netip.Addr) bool
- func (g *GEOIP) Payload() string
- func (g *GEOIP) RuleType() C.RuleType
- type GEOSITE
- func (gs *GEOSITE) Adapter() string
- func (gs *GEOSITE) GetDomainMatcher() (router.DomainMatcher, error)
- func (gs *GEOSITE) GetRecodeSize() int
- func (gs *GEOSITE) Match(metadata *C.Metadata, helper C.RuleMatchHelper) (bool, string)
- func (gs *GEOSITE) MatchDomain(domain string) bool
- func (gs *GEOSITE) Payload() string
- func (gs *GEOSITE) RuleType() C.RuleType
- type IPCIDR
- func (i *IPCIDR) Adapter() string
- func (i *IPCIDR) ClashIsSourceIP() bool
- func (i *IPCIDR) ClashPrefix() netip.Prefix
- func (i *IPCIDR) ClashResolvesIP() bool
- func (i *IPCIDR) Match(metadata *C.Metadata, helper C.RuleMatchHelper) (bool, string)
- func (i *IPCIDR) Payload() string
- func (i *IPCIDR) RuleType() C.RuleType
- type IPCIDROption
- type IPSuffix
- type InName
- type InType
- type InUser
- type Match
- type NetworkType
- type ParseRuleFunc
- type Port
- type Process
- type Protocol
- type RematchName
- type SourceAppIdentity
- type Subnet
- type Uid
Constants ¶
View Source
const ( ProtocolHTTP = "HTTP" ProtocolHTTPS = "HTTPS" ProtocolQUIC = "QUIC" ProtocolSTUN = "STUN" ProtocolMTProto = "MTPROTO" )
Variables ¶
View Source
var ( NoResolve = "no-resolve" Src = "src" )
params
Functions ¶
func ParseParams ¶
func ParseRulePayload ¶
func ParseRulePayload(ruleRaw string, needTarget bool) (tp, payload, target string, params []string)
ParseRulePayload parse rule format like: `tp,payload,target(,params...)` or `tp,payload(,params...)` needTarget control the format contains `target` in string
func ProtocolReadersParsed ¶
func ProtocolReadersParsed() bool
Types ¶
type CellularRadio ¶
type CellularRadio struct {
Base
// contains filtered or unexported fields
}
func NewCellularRadio ¶
func NewCellularRadio(payload, adapter string) (*CellularRadio, error)
func (*CellularRadio) Adapter ¶
func (c *CellularRadio) Adapter() string
func (*CellularRadio) Match ¶
func (c *CellularRadio) Match(*C.Metadata, C.RuleMatchHelper) (bool, string)
func (*CellularRadio) Payload ¶
func (c *CellularRadio) Payload() string
func (*CellularRadio) RuleType ¶
func (c *CellularRadio) RuleType() C.RuleType
type DSCP ¶
type DSCP struct {
Base
// contains filtered or unexported fields
}
type Domain ¶
type Domain struct {
Base
// contains filtered or unexported fields
}
type DomainKeyword ¶
type DomainKeyword struct {
Base
// contains filtered or unexported fields
}
func NewDomainKeyword ¶
func NewDomainKeyword(keyword string, adapter string) *DomainKeyword
func (*DomainKeyword) Adapter ¶
func (dk *DomainKeyword) Adapter() string
func (*DomainKeyword) Match ¶
func (dk *DomainKeyword) Match(metadata *C.Metadata, helper C.RuleMatchHelper) (bool, string)
func (*DomainKeyword) Payload ¶
func (dk *DomainKeyword) Payload() string
func (*DomainKeyword) RuleType ¶
func (dk *DomainKeyword) RuleType() C.RuleType
type DomainRegex ¶
type DomainRegex struct {
Base
// contains filtered or unexported fields
}
func NewDomainRegex ¶
func NewDomainRegex(regex string, adapter string) (*DomainRegex, error)
func (*DomainRegex) Adapter ¶
func (dr *DomainRegex) Adapter() string
func (*DomainRegex) Match ¶
func (dr *DomainRegex) Match(metadata *C.Metadata, helper C.RuleMatchHelper) (bool, string)
func (*DomainRegex) Payload ¶
func (dr *DomainRegex) Payload() string
func (*DomainRegex) RuleType ¶
func (dr *DomainRegex) RuleType() C.RuleType
type DomainSuffix ¶
type DomainSuffix struct {
Base
// contains filtered or unexported fields
}
func NewDomainSuffix ¶
func NewDomainSuffix(suffix string, adapter string) *DomainSuffix
func (*DomainSuffix) Adapter ¶
func (ds *DomainSuffix) Adapter() string
func (*DomainSuffix) Match ¶
func (ds *DomainSuffix) Match(metadata *C.Metadata, helper C.RuleMatchHelper) (bool, string)
func (*DomainSuffix) Payload ¶
func (ds *DomainSuffix) Payload() string
func (*DomainSuffix) RuleType ¶
func (ds *DomainSuffix) RuleType() C.RuleType
type DomainWildcard ¶
type DomainWildcard struct {
Base
// contains filtered or unexported fields
}
func NewDomainWildcard ¶
func NewDomainWildcard(pattern string, adapter string) (*DomainWildcard, error)
func (*DomainWildcard) Adapter ¶
func (dw *DomainWildcard) Adapter() string
func (*DomainWildcard) Match ¶
func (dw *DomainWildcard) Match(metadata *C.Metadata, _ C.RuleMatchHelper) (bool, string)
func (*DomainWildcard) Payload ¶
func (dw *DomainWildcard) Payload() string
func (*DomainWildcard) RuleType ¶
func (dw *DomainWildcard) RuleType() C.RuleType
type GEOIP ¶
type GEOIP struct {
Base
// contains filtered or unexported fields
}
func (*GEOIP) DnsFallbackFilter ¶
func (*GEOIP) GetCountry ¶
func (*GEOIP) GetRecodeSize ¶
type GEOSITE ¶
type GEOSITE struct {
Base
// contains filtered or unexported fields
}
func (*GEOSITE) GetDomainMatcher ¶
func (gs *GEOSITE) GetDomainMatcher() (router.DomainMatcher, error)
func (*GEOSITE) GetRecodeSize ¶
func (*GEOSITE) MatchDomain ¶
MatchDomain implements C.DomainMatcher
type IPCIDR ¶
type IPCIDR struct {
Base
// contains filtered or unexported fields
}
func (*IPCIDR) ClashIsSourceIP ¶
func (*IPCIDR) ClashPrefix ¶
func (*IPCIDR) ClashResolvesIP ¶
type IPCIDROption ¶
type IPCIDROption func(*IPCIDR)
func WithIPCIDRNoResolve ¶
func WithIPCIDRNoResolve(noResolve bool) IPCIDROption
func WithIPCIDRSourceIP ¶
func WithIPCIDRSourceIP(b bool) IPCIDROption
type IPSuffix ¶
type IPSuffix struct {
Base
// contains filtered or unexported fields
}
func NewIPSuffix ¶
type InName ¶
type InName struct {
Base
// contains filtered or unexported fields
}
type InType ¶
type InType struct {
Base
// contains filtered or unexported fields
}
type InUser ¶
type InUser struct {
Base
// contains filtered or unexported fields
}
type Match ¶
type Match struct {
Base
// contains filtered or unexported fields
}
type NetworkType ¶
type NetworkType struct {
Base
// contains filtered or unexported fields
}
func NewNetworkType ¶
func NewNetworkType(network, adapter string) (*NetworkType, error)
func (*NetworkType) Adapter ¶
func (n *NetworkType) Adapter() string
func (*NetworkType) Match ¶
func (n *NetworkType) Match(metadata *C.Metadata, helper C.RuleMatchHelper) (bool, string)
func (*NetworkType) Payload ¶
func (n *NetworkType) Payload() string
func (*NetworkType) RuleType ¶
func (n *NetworkType) RuleType() C.RuleType
type ParseRuleFunc ¶
type Port ¶
type Port struct {
Base
// contains filtered or unexported fields
}
type Process ¶
type Process struct {
Base
// contains filtered or unexported fields
}
func NewProcess ¶
type Protocol ¶
type Protocol struct {
Base
// contains filtered or unexported fields
}
func NewProtocol ¶
type RematchName ¶
type RematchName struct {
Base
// contains filtered or unexported fields
}
func NewRematchName ¶
func NewRematchName(iNames, adapter string) (*RematchName, error)
func (*RematchName) Adapter ¶
func (u *RematchName) Adapter() string
func (*RematchName) Match ¶
func (u *RematchName) Match(metadata *C.Metadata, helper C.RuleMatchHelper) (bool, string)
func (*RematchName) Payload ¶
func (u *RematchName) Payload() string
func (*RematchName) RuleType ¶
func (u *RematchName) RuleType() C.RuleType
type SourceAppIdentity ¶
type SourceAppIdentity struct {
Base
// contains filtered or unexported fields
}
func NewSourceAppIdentity ¶
func (*SourceAppIdentity) Adapter ¶
func (rule *SourceAppIdentity) Adapter() string
func (*SourceAppIdentity) Match ¶
func (rule *SourceAppIdentity) Match( metadata *C.Metadata, helper C.RuleMatchHelper, ) (bool, string)
func (*SourceAppIdentity) Payload ¶
func (rule *SourceAppIdentity) Payload() string
func (*SourceAppIdentity) RuleType ¶
func (rule *SourceAppIdentity) RuleType() C.RuleType
Source Files
¶
Click to show internal directories.
Click to hide internal directories.