MCPcopy
hub / github.com/evilsocket/opensnitch / cleanListsRule

Method cleanListsRule

daemon/rule/loader.go:310–321  ·  view source on GitHub ↗

cleanListsRule erases the lists loaded of an Operator of type Lists, and stops the workers monitoring the lists.

(oldRule *Rule)

Source from the content-addressed store, hash-verified

308// cleanListsRule erases the lists loaded of an Operator of type Lists,
309// and stops the workers monitoring the lists.
310func (l *Loader) cleanListsRule(oldRule *Rule) {
311 if oldRule.Operator.Type == Lists {
312 oldRule.Operator.StopMonitoringLists()
313 } else if oldRule.Operator.Type == List {
314 for i := 0; i < len(oldRule.Operator.List); i++ {
315 if oldRule.Operator.List[i].Type == Lists {
316 oldRule.Operator.List[i].StopMonitoringLists()
317 break
318 }
319 }
320 }
321}
322
323func (l *Loader) isTemporary(r *Rule) bool {
324 return r.Duration != Restart && r.Duration != Always && r.Duration != Once

Callers 4

ReloadMethod · 0.95
DeleteMethod · 0.95
loadRuleMethod · 0.95
replaceUserRuleMethod · 0.95

Calls 1

StopMonitoringListsMethod · 0.80

Tested by

no test coverage detected