MCPcopy Create free account
hub / github.com/cel-expr/cel-go / netCIDRContainsCIDRString

Function netCIDRContainsCIDRString

ext/network.go:322–330  ·  view source on GitHub ↗
(lhs, rhs ref.Val)

Source from the content-addressed store, hash-verified

320}
321
322func netCIDRContainsCIDRString(lhs, rhs ref.Val) ref.Val {
323 parent := lhs.(CIDR)
324 s := rhs.(types.String)
325 childPrefix, err := parseCIDR(string(s))
326 if err != nil {
327 return types.WrapErr(err)
328 }
329 return types.Bool(parent.Prefix.Overlaps(childPrefix) && parent.Prefix.Bits() <= childPrefix.Bits())
330}
331
332func netCIDRContainsIP(lhs, rhs ref.Val) ref.Val {
333 cidr := lhs.(CIDR)

Callers

nothing calls this directly

Calls 3

WrapErrFunction · 0.92
BoolTypeAlias · 0.92
parseCIDRFunction · 0.85

Tested by

no test coverage detected