| 632 | } |
| 633 | |
| 634 | bool CSubNet::Match(const CNetAddr &addr) const |
| 635 | { |
| 636 | if (!valid || !addr.IsValid()) |
| 637 | return false; |
| 638 | for(int x=0; x<16; ++x) |
| 639 | if ((addr.ip[x] & netmask[x]) != network.ip[x]) |
| 640 | return false; |
| 641 | return true; |
| 642 | } |
| 643 | |
| 644 | static inline int NetmaskBits(uint8_t x) |
| 645 | { |
no test coverage detected