예제 #1
0
LPCTSTR CNetworkAdapterList::GetHash()
{
	COcsCrypto	myHash;
	CNetworkAdapter myObject;
	POSITION	pos;
	BOOL		bContinue;
	CString		csToHash;

	if (GetCount() == 0)
		return NULL;
	if (!myHash.HashInit())
		return NULL;
	pos = GetHeadPosition();
	bContinue = (pos != NULL);
	if (bContinue)
		// There is one record => get the first
		myObject = GetNext( pos);
	while (bContinue)
	{
		csToHash.Format( _T( "%s%s%s%s%s%s%s%s%s"), myObject.GetDescription(), myObject.GetType(),
						 myObject.GetTypeMIB(), myObject.GetMACAddress(),
						 myObject.GetOperationalStatus(), myObject.GetIPAddress(), myObject.GetIPNetMask(),
						 myObject.GetGateway(), myObject.GetDhcpServer());
		myHash.HashUpdate( csToHash);
		bContinue = (pos != NULL);
		if (bContinue)
			myObject = GetNext( pos);
	}
	return myHash.HashFinal();
}
예제 #2
0
int CNetworkAdapter::operator==(CNetworkAdapter cObject) const
{
	return ((m_csNetNumber == cObject.GetNetNumber()) &&
	(m_lIndex == cObject.GetIfIndex()) &&
	(m_csDescription == cObject.GetDescription()) &&
	(m_csType == cObject.GetType()) &&
	(m_csTypeMIB == cObject.GetTypeMIB()) &&
	(m_csSpeed == cObject.GetSpeed()) &&
	(m_ulSpeed == cObject.GetByteSpeed()) &&
	(m_csHWAddr == cObject.GetMACAddress()) &&	
	(m_csOperStatus == cObject.GetOperationalStatus()) &&
	(m_csIPAddr == cObject.GetIPAddress()) &&	
	(m_csIPNetMask == cObject.GetIPNetMask()) &&
	(m_csGateway == cObject.GetGateway()) &&
	(m_csDhcpServer == cObject.GetDhcpServer()));
}