|
|
| 73 |
* \param other address to which to compare this address |
73 |
* \param other address to which to compare this address |
| 74 |
* \return True if the addresses are equal. False otherwise. |
74 |
* \return True if the addresses are equal. False otherwise. |
| 75 |
*/ |
75 |
*/ |
| 76 |
bool IsEqual (Ipv4Address other) const; |
76 |
bool IsEqual (const Ipv4Address &other) const |
|
|
77 |
{ |
| 78 |
return m_address == other.m_address; |
| 79 |
} |
| 77 |
|
80 |
|
| 78 |
/** |
81 |
/** |
| 79 |
* \brief Get the host-order 32-bit IP address |
82 |
* \brief Get the host-order 32-bit IP address |
|
|
| 142 |
Address ConvertTo (void) const; |
145 |
Address ConvertTo (void) const; |
| 143 |
static uint8_t GetType (void); |
146 |
static uint8_t GetType (void); |
| 144 |
uint32_t m_address; |
147 |
uint32_t m_address; |
|
|
148 |
|
| 149 |
friend bool operator == (Ipv4Address const &a, Ipv4Address const &b); |
| 150 |
friend bool operator != (Ipv4Address const &a, Ipv4Address const &b); |
| 151 |
friend bool operator < (Ipv4Address const &addrA, Ipv4Address const &addrB); |
| 145 |
}; |
152 |
}; |
| 146 |
|
153 |
|
| 147 |
|
154 |
|
|
Lines 177-185
std::ostream& operator<< (std::ostream&
|
Link Here
|
|---|
|
| 177 |
std::ostream& operator<< (std::ostream& os, Ipv4Address const& address); |
184 |
std::ostream& operator<< (std::ostream& os, Ipv4Address const& address); |
| 178 |
std::ostream& operator<< (std::ostream& os, Ipv4Mask const& mask); |
185 |
std::ostream& operator<< (std::ostream& os, Ipv4Mask const& mask); |
| 179 |
|
186 |
|
| 180 |
bool operator == (Ipv4Address const &a, Ipv4Address const &b); |
187 |
inline bool operator == (const Ipv4Address &a, const Ipv4Address &b) |
| 181 |
bool operator != (Ipv4Address const &a, Ipv4Address const &b); |
188 |
{ |
| 182 |
bool operator < (Ipv4Address const &addrA, Ipv4Address const &addrB); |
189 |
return (a.m_address == b.m_address); |
|
|
190 |
} |
| 191 |
inline bool operator != (const Ipv4Address &a, const Ipv4Address &b) |
| 192 |
{ |
| 193 |
return (a.m_address != b.m_address); |
| 194 |
} |
| 195 |
inline bool operator < (const Ipv4Address &a, const Ipv4Address &b) |
| 196 |
{ |
| 197 |
return (a.m_address < b.m_address); |
| 198 |
} |
| 199 |
|
| 183 |
|
200 |
|
| 184 |
class Ipv4AddressHash : public std::unary_function<Ipv4Address, size_t> { |
201 |
class Ipv4AddressHash : public std::unary_function<Ipv4Address, size_t> { |
| 185 |
public: |
202 |
public: |