MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Match

Method Match

codelab/network_functions.cc:481–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481bool NetworkAddressMatcher::Match(const NetworkAddressRep& addr) const {
482 if (addr.IsZeroValue()) {
483 return false;
484 }
485 if (addr.IsIPv4()) {
486 for (const auto& range : ranges_v4_) {
487 if (addr.GetIPv4() >= range.min_incl &&
488 addr.GetIPv4() <= range.max_incl) {
489 return true;
490 }
491 }
492 }
493
494 // TODO(uncreated-issue/86): ipv6 support
495 return false;
496}
497
498bool NetworkAddressMatcher::IsEqualTo(
499 const NetworkAddressMatcher& other) const {

Callers 4

ExtractFunction · 0.80
ExtractAllFunction · 0.80
ReplaceNFunction · 0.80
containsAddressFunction · 0.80

Calls 3

IsIPv4Method · 0.80
GetIPv4Method · 0.80
IsZeroValueMethod · 0.45

Tested by

no test coverage detected