mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-06 06:33:31 +03:00
feat: rule-provider support NetWork rule
This commit is contained in:
parent
259736390a
commit
52d559bb38
2 changed files with 6 additions and 4 deletions
|
@ -39,10 +39,6 @@ func ParseRule(tp, payload, target string, params []string) (C.Rule, error) {
|
|||
parsed, parseErr = RC.NewProcess(payload, target, true)
|
||||
case "PROCESS-PATH":
|
||||
parsed, parseErr = RC.NewProcess(payload, target, false)
|
||||
case "MATCH":
|
||||
parsed = RC.NewMatch(target)
|
||||
case "RULE-SET":
|
||||
parsed, parseErr = RP.NewRuleSet(payload, target)
|
||||
case "NETWORK":
|
||||
parsed, parseErr = RC.NewNetworkType(payload, target)
|
||||
case "UID":
|
||||
|
@ -53,6 +49,10 @@ func ParseRule(tp, payload, target string, params []string) (C.Rule, error) {
|
|||
parsed, parseErr = logic.NewOR(payload, target)
|
||||
case "NOT":
|
||||
parsed, parseErr = logic.NewNOT(payload, target)
|
||||
case "RULE-SET":
|
||||
parsed, parseErr = RP.NewRuleSet(payload, target)
|
||||
case "MATCH":
|
||||
parsed = RC.NewMatch(target)
|
||||
default:
|
||||
parseErr = fmt.Errorf("unsupported rule type %s", tp)
|
||||
}
|
||||
|
|
|
@ -82,6 +82,8 @@ func parseRule(tp, payload, target string, params []string) (C.Rule, error) {
|
|||
parsed, parseErr = RC.NewProcess(payload, target, true)
|
||||
case "PROCESS-PATH":
|
||||
parsed, parseErr = RC.NewProcess(payload, target, false)
|
||||
case "NETWORK":
|
||||
parsed, parseErr = RC.NewNetworkType(payload, target)
|
||||
default:
|
||||
parseErr = fmt.Errorf("unsupported rule type %s", tp)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue