MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / isZero

Method isZero

source/core/StarHostAddress.cpp:67–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67bool HostAddress::isZero() const {
68 if (mode() == NetworkMode::IPv4)
69 return m_address[0] == 0 && m_address[1] == 0 && m_address[2] == 0 && m_address[3] == 0;
70
71 if (mode() == NetworkMode::IPv6) {
72 for (size_t i = 0; i < 16; i++) {
73 if (m_address[i] != 0)
74 return false;
75 }
76 return true;
77 }
78
79 return false;
80}
81
82size_t HostAddress::size() const {
83 switch (m_mode) {

Callers 1

TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64