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

Method ipNetCmp

daemon/rule/operator.go:284–296  ·  view source on GitHub ↗
(dstIP interface{})

Source from the content-addressed store, hash-verified

282}
283
284func (o *Operator) ipNetCmp(dstIP interface{}) bool {
285 o.RLock()
286 defer o.RUnlock()
287
288 for host, netMask := range o.lists {
289 n := netMask.(*net.IPNet)
290 if n.Contains(dstIP.(net.IP)) {
291 log.Debug("%s: %s, %s", log.Red("Net list match"), dstIP, host)
292 return true
293 }
294 }
295 return false
296}
297
298func (o *Operator) reListCmp(v interface{}) bool {
299 dstHost := v.(string)

Callers

nothing calls this directly

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected