mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
Kernel/AK: Add is_zero helpers for IP and MAC addresses
This commit is contained in:
parent
fac1148679
commit
4a4e66b2d0
2 changed files with 10 additions and 0 deletions
|
@ -72,6 +72,11 @@ public:
|
|||
bool operator==(const IPv4Address& other) const { return m_data_as_u32 == other.m_data_as_u32; }
|
||||
bool operator!=(const IPv4Address& other) const { return m_data_as_u32 != other.m_data_as_u32; }
|
||||
|
||||
bool is_zero() const
|
||||
{
|
||||
return m_data_as_u32 == 0;
|
||||
}
|
||||
|
||||
private:
|
||||
union {
|
||||
u8 m_data[4];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue