mediamtx/internal/core/ip.go
aler9 9062dbf883 move most components into internal/core
in this way coverage can be computed correctly.
2021-07-24 16:09:52 +02:00

23 lines
303 B
Go

package core
import (
"net"
)
func ipEqualOrInRange(ip net.IP, ips []interface{}) bool {
for _, item := range ips {
switch titem := item.(type) {
case net.IP:
if titem.Equal(ip) {
return true
}
case *net.IPNet:
if titem.Contains(ip) {
return true
}
}
}
return false
}