File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,9 @@ struct SteamNetworkingIPAddr
144144 } m_ipv4;
145145 };
146146 uint16 m_port; // Host byte order
147+
148+ // / See if two addresses are identical
149+ bool operator ==(const SteamNetworkingIPAddr &x ) const ;
147150};
148151
149152// / An abstract way to represent the identity of a network host
@@ -1056,6 +1059,7 @@ inline bool SteamNetworkingIPAddr::IsIPv4() const { return m_ipv4.m_8zeros == 0
10561059inline uint32 SteamNetworkingIPAddr::GetIPv4 () const { return IsIPv4 () ? ( (uint32 (m_ipv4.m_ip [0 ])<<24 ) | (uint32 (m_ipv4.m_ip [1 ])<<16 ) | (uint32 (m_ipv4.m_ip [2 ])<<8 ) | uint32 (m_ipv4.m_ip [3 ]) ) : 0 ; }
10571060inline void SteamNetworkingIPAddr::SetIPv6LocalHost ( uint16 nPort ) { m_ipv4.m_8zeros = 0 ; m_ipv4.m_0000 = 0 ; m_ipv4.m_ffff = 0 ; m_ipv6[12 ] = 0 ; m_ipv6[13 ] = 0 ; m_ipv6[14 ] = 0 ; m_ipv6[15 ] = 1 ; m_port = nPort; }
10581061inline bool SteamNetworkingIPAddr::IsLocalHost () const { return ( m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0 && m_ipv6[12 ] == 0 && m_ipv6[13 ] == 0 && m_ipv6[14 ] == 0 && m_ipv6[15 ] == 1 ) || ( GetIPv4 () == 0x7f000001 ); }
1062+ inline bool SteamNetworkingIPAddr::operator ==(const SteamNetworkingIPAddr &x ) const { return memcmp ( this , &x, sizeof (SteamNetworkingIPAddr) ) == 0 ; }
10591063
10601064inline void SteamNetworkingIdentity::Clear () { memset ( this , 0 , sizeof (*this ) ); }
10611065inline bool SteamNetworkingIdentity::IsInvalid () const { return m_eType == k_ESteamNetworkingIdentityType_Invalid; }
You can’t perform that action at this time.
0 commit comments