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

Function netCIDRContainsCIDRString

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

Source from the content-addressed store, hash-verified

373}
374
375func netCIDRContainsCIDRString(lhs, rhs ref.Val) ref.Val {
376 parent := lhs.(CIDR)
377 s := rhs.(types.String)
378 childPrefix, err := parseCIDR(string(s))
379 if err != nil {
380 return types.WrapErr(err)
381 }
382 return types.Bool(parent.Prefix.Overlaps(childPrefix) && parent.Prefix.Bits() <= childPrefix.Bits())
383}
384
385func netCIDRContainsIP(lhs, rhs ref.Val) ref.Val {
386 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