| 236 | } |
| 237 | |
| 238 | bool 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. |
nothing calls this directly
no test coverage detected