Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CHostCacheList Class Reference

#include <HostCache.h>

List of all members.

Public Member Functions

 CHostCacheList (PROTOCOLID nProtocol)
virtual ~CHostCacheList ()
CHostCacheHostAdd (IN_ADDR *pAddress, WORD nPort, DWORD tSeen=0, LPCTSTR pszVendor=NULL)
BOOL Add (LPCTSTR pszHost, DWORD tSeen=0, LPCTSTR pszVendor=NULL)
CHostCacheHostFind (IN_ADDR *pAddress) const
BOOL Check (CHostCacheHost *pHost) const
void Remove (CHostCacheHost *pHost)
void OnFailure (IN_ADDR *pAddress, WORD nPort)
DWORD CountHosts () const
void PruneByQueryAck ()
void PruneOldHosts ()
void Clear ()
void Serialize (CArchive &ar, int nVersion)
int Import (LPCTSTR pszFile)
int ImportMET (CFile *pFile)
int LoadDefaultED2KServers ()
CHostCacheHostGetNewest () const
CHostCacheHostGetOldest () const

Public Attributes

PROTOCOLID m_nProtocol
DWORD m_nHosts
DWORD m_nCookie
CHostCacheHostm_pNewest
CHostCacheHostm_pOldest

Protected Member Functions

CHostCacheHostAddInternal (IN_ADDR *pAddress, WORD nPort, DWORD tSeen, LPCTSTR pszVendor)
void RemoveOldest ()

Protected Attributes

DWORD m_nBuffer
CHostCacheHostm_pBuffer
CHostCacheHostm_pFree
CHostCacheHostm_pHash [256]


Constructor & Destructor Documentation

CHostCacheList::CHostCacheList PROTOCOLID  nProtocol  ) 
 

Definition at line 203 of file HostCache.cpp.

References m_nBuffer, m_nCookie, m_nProtocol, m_pBuffer, and NULL.

CHostCacheList::~CHostCacheList  )  [virtual]
 

Definition at line 211 of file HostCache.cpp.

References Clear(), and m_pBuffer.


Member Function Documentation

BOOL CHostCacheList::Add LPCTSTR  pszHost,
DWORD  tSeen = 0,
LPCTSTR  pszVendor = NULL
 

Definition at line 273 of file HostCache.cpp.

References AddInternal(), CSettings::Connection, GNUTELLA_DEFAULT_PORT, CSettings::sConnection::IgnoreOwnIP, CSecurity::IsDenied(), CNetwork::IsFirewalledAddress(), CNetwork::m_pHost, Network, Security, Settings, and TimeFromString().

CHostCacheHost * CHostCacheList::Add IN_ADDR *  pAddress,
WORD  nPort,
DWORD  tSeen = 0,
LPCTSTR  pszVendor = NULL
 

Definition at line 249 of file HostCache.cpp.

References AddInternal(), CSettings::Connection, CSettings::sConnection::IgnoreOwnIP, CSecurity::IsDenied(), CNetwork::IsFirewalledAddress(), CNetwork::m_pHost, Network, NULL, Security, and Settings.

Referenced by ImportMET(), LoadDefaultED2KServers(), CG1Neighbour::OnClusterAdvisor(), CG2Neighbour::OnHAW(), CShakeNeighbour::OnHeaderLine(), CEDClient::OnHello(), CEDNeighbour::OnIdChange(), CG2Neighbour::OnKHL(), CG2Neighbour::OnLNI(), CG1Neighbour::OnPong(), CSearchManager::OnQueryAck(), CG2Neighbour::OnQueryAck(), CDatagrams::OnQueryAck(), CG2Neighbour::OnQueryKeyAns(), CDatagrams::OnQueryKeyAnswer(), CEDNeighbour::OnServerIdent(), CEDNeighbour::OnServerList(), CEDNeighbour::OnServerStatus(), and CDiscoveryServices::RunWebCacheGet().

CHostCacheHost * CHostCacheList::AddInternal IN_ADDR *  pAddress,
WORD  nPort,
DWORD  tSeen,
LPCTSTR  pszVendor
[protected]
 

Definition at line 327 of file HostCache.cpp.

References m_nBuffer, m_nCookie, m_nHosts, CHostCacheHost::m_pAddress, m_pFree, m_pHash, m_pNewest, CHostCacheHost::m_pNextHash, CHostCacheHost::m_pNextTime, m_pOldest, CHostCacheHost::m_pPrevTime, CHostCacheHost::m_tFailure, NULL, RemoveOldest(), CHostCacheHost::Reset(), and CHostCacheHost::Update().

Referenced by Add().

BOOL CHostCacheList::Check CHostCacheHost pHost  )  const
 

Definition at line 421 of file HostCache.cpp.

References CHostCacheHost::m_pNextTime, and m_pOldest.

Referenced by CHostCache::Check().

void CHostCacheList::Clear  ) 
 

Definition at line 220 of file HostCache.cpp.

References CSettings::Gnutella, CSettings::sGnutella::HostCacheSize, m_nBuffer, m_nCookie, m_nHosts, m_nProtocol, CHostCacheHost::m_nProtocol, m_pBuffer, m_pFree, m_pHash, m_pNewest, CHostCacheHost::m_pNextHash, m_pOldest, NULL, and Settings.

Referenced by CHostCache::Clear(), CHostCache::Load(), and ~CHostCacheList().

DWORD CHostCacheList::CountHosts  )  const
 

Definition at line 539 of file HostCache.cpp.

References GetNewest().

Referenced by CWizardNetworksPage::DoDonkeyImport(), CDiscoveryServices::Execute(), CMainWnd::LocalSystemChecks(), and CWizardConnectionPage::OnWizardNext().

CHostCacheHost * CHostCacheList::Find IN_ADDR *  pAddress  )  const
 

Definition at line 398 of file HostCache.cpp.

References CHostCacheHost::m_pAddress, m_pHash, CHostCacheHost::m_pNextHash, and NULL.

Referenced by CHostCache::Find(), CSearchManager::OnQueryAck(), CG2Neighbour::OnQueryKeyReq(), CEDClients::OnServerStatus(), CEDClients::OnUDP(), CEDClients::RunGlobalStatsRequests(), and CEDNeighbour::SendSharedFiles().

CHostCacheHost* CHostCacheList::GetNewest  )  const [inline]
 

Definition at line 76 of file HostCache.h.

References m_pNewest.

Referenced by CountHosts(), CNeighboursWithG2::CreateQueryWeb(), CManagedSearch::ExecuteDonkeyMesh(), CManagedSearch::ExecuteG2Mesh(), CHostCache::Load(), CNeighboursWithConnect::Maintain(), CEDClients::RunGlobalStatsRequests(), CDiscoveryServices::RunWebCacheGet(), CG1Neighbour::SendClusterAdvisor(), CShakeNeighbour::SendHostHeaders(), CG2Neighbour::SendKHL(), and CHostCacheWnd::Update().

CHostCacheHost* CHostCacheList::GetOldest  )  const [inline]
 

Definition at line 81 of file HostCache.h.

References m_pOldest.

Referenced by CNeighboursWithConnect::Maintain().

int CHostCacheList::Import LPCTSTR  pszFile  ) 
 

Definition at line 656 of file HostCache.cpp.

References _tcsistr(), ImportMET(), and NULL.

Referenced by CWizardNetworksPage::DoDonkeyImport(), CHostCache::Load(), and CHostCacheWnd::OnHostcacheImport().

int CHostCacheList::ImportMET CFile *  pFile  ) 
 

Definition at line 675 of file HostCache.cpp.

References Add(), CEDTag::Check(), ED2K_ST_DESCRIPTION, ED2K_ST_MAXFILES, ED2K_ST_MAXUSERS, ED2K_ST_SERVERNAME, ED2K_ST_UDPFLAGS, ED2K_TAG_INT, ED2K_TAG_STRING, CHostCacheHost::m_nFileLimit, CHostCacheHost::m_nUDPFlags, CHostCacheHost::m_nUserLimit, CEDTag::m_nValue, CNetwork::m_pSection, CHostCacheHost::m_sDescription, CHostCacheHost::m_sName, CEDTag::m_sValue, Network, NULL, and CEDTag::Read().

Referenced by Import(), CDonkeyServersDlg::OnRun(), and CDiscoveryServices::RunServerMet().

int CHostCacheList::LoadDefaultED2KServers  ) 
 

Definition at line 737 of file HostCache.cpp.

References Add(), CBuffer::EnsureBuffer(), CSettings::General, CHostCacheHost::m_bPriority, CBuffer::m_nLength, CBuffer::m_pBuffer, CNetwork::m_pSection, CShareazaApp::Message(), MSG_DEFAULT, Network, CSettings::sGeneral::Path, CBuffer::ReadLine(), Settings, and theApp.

Referenced by CWizardConnectionPage::OnWizardNext().

void CHostCacheList::OnFailure IN_ADDR *  pAddress,
WORD  nPort
 

Definition at line 489 of file HostCache.cpp.

References m_pHash, CHostCacheHost::m_pNextHash, and Remove().

Referenced by CHostCache::OnFailure().

void CHostCacheList::PruneByQueryAck  ) 
 

Definition at line 552 of file HostCache.cpp.

References CSettings::Gnutella2, m_pNewest, NULL, CSettings::sGnutella2::QueryHostDeadline, Remove(), and Settings.

Referenced by CSearchManager::OnRun().

void CHostCacheList::PruneOldHosts  ) 
 

Definition at line 577 of file HostCache.cpp.

References CSettings::Gnutella1, CSettings::Gnutella2, CSettings::sGnutella2::HostExpire, CSettings::sGnutella1::HostExpire, m_pNewest, NULL, PROTOCOL_G1, PROTOCOL_G2, Remove(), and Settings.

Referenced by CNetwork::Connect().

void CHostCacheList::Remove CHostCacheHost pHost  ) 
 

Definition at line 434 of file HostCache.cpp.

References m_nCookie, m_nHosts, CHostCacheHost::m_pAddress, m_pFree, m_pHash, m_pNewest, CHostCacheHost::m_pNextHash, CHostCacheHost::m_pNextTime, m_pOldest, and CHostCacheHost::m_pPrevTime.

Referenced by OnFailure(), PruneByQueryAck(), PruneOldHosts(), CHostCache::Remove(), RemoveOldest(), and CEDClients::RunGlobalStatsRequests().

void CHostCacheList::RemoveOldest  )  [protected]
 

Definition at line 481 of file HostCache.cpp.

References m_pOldest, and Remove().

Referenced by AddInternal().

void CHostCacheList::Serialize CArchive &  ar,
int  nVersion
 

Definition at line 607 of file HostCache.cpp.

References m_nHosts, CHostCacheHost::m_pAddress, m_pFree, m_pHash, m_pNewest, CHostCacheHost::m_pNextHash, CHostCacheHost::m_pNextTime, m_pOldest, CHostCacheHost::m_pPrevTime, NULL, CHostCacheHost::Reset(), and CHostCacheHost::Serialize().

Referenced by CHostCache::Serialize().


Member Data Documentation

DWORD CHostCacheList::m_nBuffer [protected]
 

Definition at line 48 of file HostCache.h.

Referenced by AddInternal(), CHostCacheList(), and Clear().

DWORD CHostCacheList::m_nCookie
 

Definition at line 44 of file HostCache.h.

Referenced by AddInternal(), CHostCacheList(), Clear(), CHostCacheWnd::OnHostcachePriority(), CHostCacheWnd::OnTimer(), Remove(), and CHostCacheWnd::Update().

DWORD CHostCacheList::m_nHosts
 

Definition at line 43 of file HostCache.h.

Referenced by AddInternal(), Clear(), CWizardFinishedPage::OnWizardFinish(), Remove(), and Serialize().

PROTOCOLID CHostCacheList::m_nProtocol
 

Definition at line 42 of file HostCache.h.

Referenced by CHostCacheList(), Clear(), and CHostCache::Serialize().

CHostCacheHost* CHostCacheList::m_pBuffer [protected]
 

Definition at line 49 of file HostCache.h.

Referenced by CHostCacheList(), Clear(), and ~CHostCacheList().

CHostCacheHost* CHostCacheList::m_pFree [protected]
 

Definition at line 50 of file HostCache.h.

Referenced by AddInternal(), Clear(), Remove(), and Serialize().

CHostCacheHost* CHostCacheList::m_pHash[256] [protected]
 

Definition at line 51 of file HostCache.h.

Referenced by AddInternal(), Clear(), Find(), OnFailure(), Remove(), and Serialize().

CHostCacheHost* CHostCacheList::m_pNewest
 

Definition at line 45 of file HostCache.h.

Referenced by AddInternal(), Clear(), GetNewest(), PruneByQueryAck(), PruneOldHosts(), Remove(), and Serialize().

CHostCacheHost* CHostCacheList::m_pOldest
 

Definition at line 46 of file HostCache.h.

Referenced by AddInternal(), Check(), Clear(), GetOldest(), Remove(), RemoveOldest(), and Serialize().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:08 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2