MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / HasIP

Method HasIP

src/tier1/netadr.cpp:131–151  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Purpose: Does this object have an IP value set -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

129// Purpose: Does this object have an IP value set
130//-----------------------------------------------------------------------------
131bool CIPAddress::HasIP() const
132{
133 switch ( m_usType )
134 {
135 default:
136 Assert( false );
137 // FALLTHROUGH
138 case k_EIPTypeInvalid:
139 return false;
140 case k_EIPTypeV4:
141 if ( m_unIPv4 == 0 )
142 return false;
143 break;
144 case k_EIPTypeV6:
145 if ( m_ipv6Qword[0] == 0 && m_ipv6Qword[1] == 0 )
146 return false;
147 break;
148 }
149
150 return true;
151}
152
153//-----------------------------------------------------------------------------
154// Purpose: Compare this IP address with another for equality

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected