mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 13:41:23 +08:00
feat: rule-provider support NetWork rule
This commit is contained in:
parent
259736390a
commit
52d559bb38
@ -39,10 +39,6 @@ func ParseRule(tp, payload, target string, params []string) (C.Rule, error) {
|
|||||||
parsed, parseErr = RC.NewProcess(payload, target, true)
|
parsed, parseErr = RC.NewProcess(payload, target, true)
|
||||||
case "PROCESS-PATH":
|
case "PROCESS-PATH":
|
||||||
parsed, parseErr = RC.NewProcess(payload, target, false)
|
parsed, parseErr = RC.NewProcess(payload, target, false)
|
||||||
case "MATCH":
|
|
||||||
parsed = RC.NewMatch(target)
|
|
||||||
case "RULE-SET":
|
|
||||||
parsed, parseErr = RP.NewRuleSet(payload, target)
|
|
||||||
case "NETWORK":
|
case "NETWORK":
|
||||||
parsed, parseErr = RC.NewNetworkType(payload, target)
|
parsed, parseErr = RC.NewNetworkType(payload, target)
|
||||||
case "UID":
|
case "UID":
|
||||||
@ -53,6 +49,10 @@ func ParseRule(tp, payload, target string, params []string) (C.Rule, error) {
|
|||||||
parsed, parseErr = logic.NewOR(payload, target)
|
parsed, parseErr = logic.NewOR(payload, target)
|
||||||
case "NOT":
|
case "NOT":
|
||||||
parsed, parseErr = logic.NewNOT(payload, target)
|
parsed, parseErr = logic.NewNOT(payload, target)
|
||||||
|
case "RULE-SET":
|
||||||
|
parsed, parseErr = RP.NewRuleSet(payload, target)
|
||||||
|
case "MATCH":
|
||||||
|
parsed = RC.NewMatch(target)
|
||||||
default:
|
default:
|
||||||
parseErr = fmt.Errorf("unsupported rule type %s", tp)
|
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)
|
parsed, parseErr = RC.NewProcess(payload, target, true)
|
||||||
case "PROCESS-PATH":
|
case "PROCESS-PATH":
|
||||||
parsed, parseErr = RC.NewProcess(payload, target, false)
|
parsed, parseErr = RC.NewProcess(payload, target, false)
|
||||||
|
case "NETWORK":
|
||||||
|
parsed, parseErr = RC.NewNetworkType(payload, target)
|
||||||
default:
|
default:
|
||||||
parseErr = fmt.Errorf("unsupported rule type %s", tp)
|
parseErr = fmt.Errorf("unsupported rule type %s", tp)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user