1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +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

@@ -123,9 +123,17 @@ public:
* \param rhs The address to be compared.
* \return bool indicating whether this address is less-than rhs.
*/
bool operator< (const IPv4Address& rhs) const {
bool operator<(const IPv4Address& rhs) const {
return ip_addr_ < rhs.ip_addr_;
}
/**
* \brief Apply a mask to this address
*
* \param mask The mask to be applied
* \return The result of applying the mask to this address
*/
IPv4Address operator&(const IPv4Address& mask) const;
/**
* \brief Returns true if this is a private IPv4 address.