1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 12:14:26 +01:00

Allow masking IPv4/6 and HW addresses

This commit is contained in:
Matias Fontanini
2016-03-19 15:44:55 -07:00
parent 1f4be63d08
commit 3773443fc8
13 changed files with 127 additions and 33 deletions

View File

@@ -139,4 +139,8 @@ bool IPv4Address::is_broadcast() const {
return* this == broadcast;
}
IPv4Address IPv4Address::operator&(const IPv4Address& mask) const {
return IPv4Address(Endian::be_to_host(ip_addr_ & mask.ip_addr_));
}
} // Tins