feat: add mrs format ipcidr ruleset

This commit is contained in:
wwqgtxx
2024-07-27 10:36:11 +08:00
parent 303f6e4567
commit 4f8a5a5f54
10 changed files with 255 additions and 44 deletions

View File

@@ -112,6 +112,19 @@ func (rt RuleBehavior) String() string {
}
}
func (rt RuleBehavior) Byte() byte {
switch rt {
case Domain:
return 0
case IPCIDR:
return 1
case Classical:
return 2
default:
return 255
}
}
func ParseBehavior(s string) (behavior RuleBehavior, err error) {
switch s {
case "domain":