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

Function netCIDRContainsCIDRString

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

Source from the content-addressed store, hash-verified

347}
348
349func netCIDRContainsCIDRString(lhs, rhs ref.Val) ref.Val {
350 parent := lhs.(CIDR)
351 s := rhs.(types.String)
352 childPrefix, err := parseCIDR(string(s))
353 if err != nil {
354 return types.WrapErr(err)
355 }
356 return types.Bool(parent.Prefix.Overlaps(childPrefix) && parent.Prefix.Bits() <= childPrefix.Bits())
357}
358
359func netCIDRContainsIP(lhs, rhs ref.Val) ref.Val {
360 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