MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CidrMatch

Method CidrMatch

lib/base/utility.cpp:238–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238bool Utility::CidrMatch(const String& pattern, const String& ip)
239{
240 char mask[16];
241 int bits;
242
243 ParseIpMask(pattern, mask, &bits);
244
245 char addr[16];
246 int proto;
247
248 if (!ParseIp(ip, addr, &proto))
249 return false;
250
251 return IpMaskCheck(addr, mask, bits);
252}
253
254/**
255 * Returns the directory component of a path. See dirname(3) for details.

Callers

nothing calls this directly

Calls 3

ParseIpMaskFunction · 0.85
ParseIpFunction · 0.85
IpMaskCheckFunction · 0.85

Tested by

no test coverage detected