|
|
|
@ -6,7 +6,7 @@ import (
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
STR_REDACTED = "[redacted]"
|
|
|
|
|
STR_UNKNOWN = "[uknown]"
|
|
|
|
|
STR_UNKNOWN = "[uknown]"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type RuleAction uint16
|
|
|
|
@ -16,14 +16,14 @@ const (
|
|
|
|
|
RULE_ACTION_ALLOW
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var RuleActionString = map[RuleAction]string {
|
|
|
|
|
RULE_ACTION_DENY: "DENY",
|
|
|
|
|
var RuleActionString = map[RuleAction]string{
|
|
|
|
|
RULE_ACTION_DENY: "DENY",
|
|
|
|
|
RULE_ACTION_ALLOW: "ALLOW",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var RuleActionValue = map[string]RuleAction {
|
|
|
|
|
"DENY": RULE_ACTION_DENY,
|
|
|
|
|
"ALLOW": RULE_ACTION_ALLOW,
|
|
|
|
|
var RuleActionValue = map[string]RuleAction{
|
|
|
|
|
"DENY": RULE_ACTION_DENY,
|
|
|
|
|
"ALLOW": RULE_ACTION_ALLOW,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type RuleMode uint16
|
|
|
|
@ -34,39 +34,38 @@ const (
|
|
|
|
|
RULE_MODE_SYSTEM
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var RuleModeString = map[RuleMode]string {
|
|
|
|
|
RULE_MODE_SESSION: "SESSION",
|
|
|
|
|
var RuleModeString = map[RuleMode]string{
|
|
|
|
|
RULE_MODE_SESSION: "SESSION",
|
|
|
|
|
RULE_MODE_PERMANENT: "PERMANENT",
|
|
|
|
|
RULE_MODE_SYSTEM: "SYSTEM",
|
|
|
|
|
RULE_MODE_SYSTEM: "SYSTEM",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var RuleModeValue = map[string]RuleMode {
|
|
|
|
|
"SESSION": RULE_MODE_SESSION,
|
|
|
|
|
var RuleModeValue = map[string]RuleMode{
|
|
|
|
|
"SESSION": RULE_MODE_SESSION,
|
|
|
|
|
"PERMANENT": RULE_MODE_PERMANENT,
|
|
|
|
|
"SYSTEM": RULE_MODE_SYSTEM,
|
|
|
|
|
"SYSTEM": RULE_MODE_SYSTEM,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type FilterScope uint16
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
APPLY_ONCE FilterScope = iota
|
|
|
|
|
APPLY_SESSION
|
|
|
|
|
APPLY_FOREVER
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var FilterScopeString = map[FilterScope]string {
|
|
|
|
|
APPLY_ONCE: "ONCE",
|
|
|
|
|
var FilterScopeString = map[FilterScope]string{
|
|
|
|
|
APPLY_ONCE: "ONCE",
|
|
|
|
|
APPLY_SESSION: "SESSION",
|
|
|
|
|
APPLY_FOREVER: "FOREVER",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var FilterScopeValue = map[string]FilterScope {
|
|
|
|
|
"ONCE": APPLY_ONCE,
|
|
|
|
|
var FilterScopeValue = map[string]FilterScope{
|
|
|
|
|
"ONCE": APPLY_ONCE,
|
|
|
|
|
"SESSION": APPLY_SESSION,
|
|
|
|
|
"FOREVER": APPLY_FOREVER,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GetFilterScopeString(scope FilterScope) string {
|
|
|
|
|
if val, ok := FilterScopeString[scope]; ok {
|
|
|
|
|
return val
|
|
|
|
@ -91,14 +90,14 @@ const (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var FilterResultString = map[FilterResult]string{
|
|
|
|
|
FILTER_DENY: "DENY",
|
|
|
|
|
FILTER_ALLOW: "ALLOW",
|
|
|
|
|
FILTER_DENY: "DENY",
|
|
|
|
|
FILTER_ALLOW: "ALLOW",
|
|
|
|
|
FILTER_PROMPT: "PROMPT",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var FilterResultValue = map[string]FilterResult {
|
|
|
|
|
"DENY": FILTER_DENY,
|
|
|
|
|
"ALLOW": FILTER_ALLOW,
|
|
|
|
|
var FilterResultValue = map[string]FilterResult{
|
|
|
|
|
"DENY": FILTER_DENY,
|
|
|
|
|
"ALLOW": FILTER_ALLOW,
|
|
|
|
|
"PROMPT": FILTER_PROMPT,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|