| 642 | } |
| 643 | |
| 644 | static inline int NetmaskBits(uint8_t x) |
| 645 | { |
| 646 | switch(x) { |
| 647 | case 0x00: return 0; |
| 648 | case 0x80: return 1; |
| 649 | case 0xc0: return 2; |
| 650 | case 0xe0: return 3; |
| 651 | case 0xf0: return 4; |
| 652 | case 0xf8: return 5; |
| 653 | case 0xfc: return 6; |
| 654 | case 0xfe: return 7; |
| 655 | case 0xff: return 8; |
| 656 | default: return -1; |
| 657 | } |
| 658 | } |
| 659 | |
| 660 | std::string CSubNet::ToString() const |
| 661 | { |