| 1295 | } |
| 1296 | |
| 1297 | bool CSubNet::Match(const CNetAddr &addr) const |
| 1298 | { |
| 1299 | if (!valid || !addr.IsValid()) |
| 1300 | return false; |
| 1301 | for(int x=0; x<16; ++x) |
| 1302 | if ((addr.ip[x] & netmask[x]) != network.ip[x]) |
| 1303 | return false; |
| 1304 | return true; |
| 1305 | } |
| 1306 | |
| 1307 | std::string CSubNet::ToString() const |
| 1308 | { |
no test coverage detected