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

CG1Neighbour Class Reference

#include <G1Neighbour.h>

Inheritance diagram for CG1Neighbour:

CNeighbour CConnection List of all members.

Public Member Functions

 CG1Neighbour (CNeighbour *pBase)
virtual ~CG1Neighbour ()
virtual BOOL Send (CPacket *pPacket, BOOL bRelease=TRUE, BOOL bBuffered=FALSE)
BOOL SendPing (DWORD dwNow=0, GGUID *pGUID=NULL)
void OnNewPong (CPongItem *pPong)
virtual BOOL SendQuery (CQuerySearch *pSearch, CPacket *pPacket, BOOL bLocal)
void SendG2Push (GGUID *pGUID, CPacket *pPacket)

Protected Member Functions

virtual BOOL OnRead ()
virtual BOOL OnWrite ()
virtual BOOL OnRun ()
BOOL ProcessPackets ()
BOOL OnPacket (CG1Packet *pPacket)
BOOL OnPing (CG1Packet *pPacket)
BOOL OnPong (CG1Packet *pPacket)
BOOL OnBye (CG1Packet *pPacket)
BOOL OnVendor (CG1Packet *pPacket)
BOOL OnPush (CG1Packet *pPacket)
BOOL OnQuery (CG1Packet *pPacket)
BOOL OnHit (CG1Packet *pPacket)
void SendClusterAdvisor ()
BOOL OnClusterAdvisor (CG1Packet *pPacket)

Protected Attributes

DWORD m_tLastInPing
DWORD m_tLastOutPing
DWORD m_tClusterHost
DWORD m_tClusterSent
BYTE m_nPongNeeded [PONG_NEEDED_BUFFER]
GGUID m_pLastPingID
BYTE m_nLastPingHops
BYTE m_nHopsFlow
CG1PacketBufferm_pOutbound

Constructor & Destructor Documentation

CG1Neighbour::CG1Neighbour CNeighbour pBase  ) 
 

Definition at line 70 of file G1Neighbour.cpp.

References G1_PACKET_PING, G1_PACKET_VENDOR, CSettings::Gnutella1, IDS_HANDSHAKE_ONLINE, CNeighbour::m_bVendorMsg, m_nHopsFlow, m_nPongNeeded, m_pOutbound, CConnection::m_pOutput, CNeighbour::m_pZOutput, CConnection::m_sAddress, CConnection::m_sUserAgent, m_tLastOutPing, CNeighbour::m_tLastPacket, CShareazaApp::Message(), MSG_DEFAULT, CG1Packet::New(), PONG_NEEDED_BUFFER, Send(), Settings, theApp, CSettings::sGnutella1::VendorMsg, CPacket::WriteLongLE(), and CPacket::WriteShortLE().

CG1Neighbour::~CG1Neighbour  )  [virtual]
 

Definition at line 126 of file G1Neighbour.cpp.

References m_pOutbound.


Member Function Documentation

BOOL CG1Neighbour::OnBye CG1Packet pPacket  )  [protected]
 

Definition at line 682 of file G1Neighbour.cpp.

References IDS_CONNECTION_BYE, CConnection::m_sAddress, CShareazaApp::Message(), MSG_ERROR, and theApp.

Referenced by OnPacket().

BOOL CG1Neighbour::OnClusterAdvisor CG1Packet pPacket  )  [protected]
 

Definition at line 975 of file G1Neighbour.cpp.

References CHostCacheList::Add(), CPacket::GetRemaining(), CHostCache::Gnutella1, HostCache, m_tClusterHost, CPacket::RazaVerify(), CPacket::ReadLongLE(), CPacket::ReadShortLE(), SendClusterAdvisor(), and SHAREAZA_VENDOR_T.

Referenced by OnVendor().

BOOL CG1Neighbour::OnHit CG1Packet pPacket  )  [protected]
 

Definition at line 1274 of file G1Neighbour.cpp.

References CStatistics::Current, IDS_PROTOCOL_BAD_HIT, CNeighbour::m_nDropCount, CPacket::m_nLength, CConnection::m_sAddress, CShareazaApp::Message(), MSG_ERROR, CNeighbour::OnCommonHit(), Statistics, and theApp.

Referenced by OnPacket().

void CG1Neighbour::OnNewPong CPongItem pPong  ) 
 

Definition at line 663 of file G1Neighbour.cpp.

References m_nLastPingHops, m_nPongNeeded, m_pLastPingID, and Send().

Referenced by CNeighboursWithG1::OnG1Pong().

BOOL CG1Neighbour::OnPacket CG1Packet pPacket  )  [protected]
 

Definition at line 299 of file G1Neighbour.cpp.

References CStatistics::Current, G1_PACKET_BYE, G1_PACKET_HIT, G1_PACKET_PING, G1_PACKET_PONG, G1_PACKET_PUSH, G1_PACKET_QUERY, G1_PACKET_QUERY_ROUTE, G1_PACKET_VENDOR, G1_PACKET_VENDOR_APP, CSettings::Gnutella1, IDS_PROTOCOL_HIGH_TTL, IDS_PROTOCOL_UNKNOWN, CG1Packet::m_nHops, CNeighbour::m_nInputCount, CG1Packet::m_nTTL, CG1Packet::m_nType, CConnection::m_sAddress, CNeighbour::m_tLastPacket, CSettings::sGnutella1::MaximumTTL, CShareazaApp::Message(), MSG_ERROR, NULL, OnBye(), CNeighbour::OnCommonQueryHash(), OnHit(), OnPing(), OnPong(), OnPush(), OnQuery(), OnVendor(), Settings, CPacket::SmartDump(), Statistics, CSettings::sGnutella1::StrictPackets, and theApp.

Referenced by ProcessPackets().

BOOL CG1Neighbour::OnPing CG1Packet pPacket  )  [protected]
 

Definition at line 378 of file G1Neighbour.cpp.

References CRouteCache::Add(), CNeighboursWithRouting::Broadcast(), CStatistics::Current, G1_PACKET_PONG, CNeighboursBase::GetIterator(), CNeighboursBase::GetNext(), CLibraryMaps::GetStatistics(), GGEP_MAGIC, CSettings::Gnutella1, CG1Packet::Hop(), IDS_PROTOCOL_GGEP_REQUIRED, IDS_PROTOCOL_SIZE_PING, IDS_PROTOCOL_TOO_LARGE, CNeighboursWithConnect::IsG1Leaf(), CNetwork::IsListening(), LibraryMaps, CPongCache::Lookup(), CNeighbour::m_bGGEP, CNeighbour::m_nDropCount, CG1Packet::m_nHops, m_nLastPingHops, CPacket::m_nLength, CNeighbour::m_nNodeType, m_nPongNeeded, CNeighbour::m_nState, CG1Packet::m_nTTL, CG1Packet::m_pGUID, CNetwork::m_pHost, CConnection::m_pHost, m_pLastPingID, CNeighboursWithG1::m_pPingRoute, CNeighboursWithG1::m_pPongCache, CConnection::m_sAddress, m_tLastInPing, CSettings::sGnutella1::MaximumQuery, CShareazaApp::Message(), MSG_ERROR, Neighbours, Network, CG1Packet::New(), nrsConnected, ntHub, NULL, CNeighboursWithG1::OnG1Ping(), CSettings::sGnutella1::PingFlood, PONG_NEEDED_BUFFER, CSettings::sGnutella1::PongCount, CPacket::ReadByte(), Send(), Settings, Statistics, CSettings::sGnutella1::StrictPackets, theApp, CPongItem::ToPacket(), CPacket::WriteLongLE(), and CPacket::WriteShortLE().

Referenced by OnPacket().

BOOL CG1Neighbour::OnPong CG1Packet pPacket  )  [protected]
 

Definition at line 556 of file G1Neighbour.cpp.

References CHostCacheList::Add(), CStatistics::Current, GGEP_MAGIC, CHostCache::Gnutella1, CSettings::Gnutella1, HostCache, IDS_PROTOCOL_GGEP_REQUIRED, IDS_PROTOCOL_SIZE_PONG, IDS_PROTOCOL_ZERO_PONG, CSecurity::IsDenied(), CNetwork::IsFirewalledAddress(), CRouteCache::Lookup(), CNeighbour::m_bGGEP, CNeighbour::m_bShareaza, CNeighbour::m_nDropCount, CNeighbour::m_nFileCount, CNeighbour::m_nFileVolume, CConnection::m_pHost, CNeighboursWithG1::m_pPingRoute, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEBUG, MSG_ERROR, Neighbours, Network, NULL, CNeighboursWithG1::OnG1Pong(), PONG_NEEDED_BUFFER, Security, CNeighbour::Send(), Settings, SHAREAZA_VENDOR_T, Statistics, CSettings::sGnutella1::StrictPackets, and theApp.

Referenced by OnPacket().

BOOL CG1Neighbour::OnPush CG1Packet pPacket  )  [protected]
 

Definition at line 1009 of file G1Neighbour.cpp.

References CStatistics::Current, G2_PACKET_PUSH, GGEP_MAGIC, CSettings::Gnutella1, CGProfile::GUID, Handshakes, CG1Packet::Hop(), IDS_PROTOCOL_GGEP_REQUIRED, IDS_PROTOCOL_SIZE_PUSH, IDS_PROTOCOL_ZERO_PUSH, CSecurity::IsDenied(), CNetwork::IsFirewalledAddress(), CRouteCache::Lookup(), CNeighbour::m_bGGEP, CNeighbour::m_nDropCount, CPacket::m_nLength, CNeighbour::m_nProtocol, CConnection::m_sAddress, CShareazaApp::Message(), MSG_ERROR, MyProfile, Network, CG2Packet::New(), CNetwork::NodeRoute, PROTOCOL_G1, PROTOCOL_G2, CHandshakes::PushTo(), CPacket::Read(), CPacket::ReadByte(), CPacket::ReadLongLE(), CPacket::ReadShortLE(), Security, CNeighbour::Send(), Settings, CPacket::Shorten(), Statistics, CSettings::sGnutella1::StrictPackets, theApp, CPacket::Write(), CPacket::WriteByte(), CPacket::WriteLongLE(), CG2Packet::WritePacket(), and CPacket::WriteShortLE().

Referenced by OnPacket().

BOOL CG1Neighbour::OnQuery CG1Packet pPacket  )  [protected]
 

Definition at line 1141 of file G1Neighbour.cpp.

References CRouteCache::Add(), CStatistics::Current, CLocalSearch::Execute(), CQuerySearch::FromPacket(), CSettings::Gnutella1, IDS_PROTOCOL_BAD_QUERY, IDS_PROTOCOL_LEAF_FORWARD, IDS_PROTOCOL_TOO_LARGE, CNetwork::IsListening(), CNeighbour::m_nDropCount, CG1Packet::m_nHops, CPacket::m_nLength, CNeighbour::m_nNodeType, CG1Packet::m_pGUID, CConnection::m_sAddress, CSettings::sGnutella1::MaximumQuery, CShareazaApp::Message(), MSG_DEBUG, MSG_ERROR, Neighbours, Network, ntHub, ntLeaf, NULL, CNetwork::OnQuerySearch(), CNetwork::QueryRoute, CNeighboursWithRouting::RouteQuery(), Settings, Statistics, and theApp.

Referenced by OnPacket().

BOOL CG1Neighbour::OnRead  )  [protected, virtual]
 

Reimplemented from CNeighbour.

Definition at line 137 of file G1Neighbour.cpp.

References CNeighbour::OnRead(), and ProcessPackets().

BOOL CG1Neighbour::OnRun  )  [protected, virtual]
 

Reimplemented from CNeighbour.

Definition at line 191 of file G1Neighbour.cpp.

References NULL, CNeighbour::OnRun(), and SendPing().

BOOL CG1Neighbour::OnVendor CG1Packet pPacket  )  [protected]
 

Definition at line 724 of file G1Neighbour.cpp.

References CStatistics::Current, CSettings::Gnutella1, CNeighbour::m_nDropCount, m_nHopsFlow, CShareazaApp::m_nVersion, CG1Packet::New(), OnClusterAdvisor(), CSearchManager::OnQueryStatusRequest(), SearchManager, Send(), Settings, Statistics, theApp, CSettings::sGnutella1::VendorMsg, CPacket::WriteLongLE(), and CPacket::WriteShortLE().

Referenced by OnPacket().

BOOL CG1Neighbour::OnWrite  )  [protected, virtual]
 

Reimplemented from CNeighbour.

Definition at line 148 of file G1Neighbour.cpp.

References CG1PacketBuffer::GetPacketToSend(), CG1PacketBuffer::m_nDropped, CBuffer::m_nLength, CNeighbour::m_nLostCount, CNeighbour::m_nOutbound, CG1PacketBuffer::m_nTotal, m_pOutbound, CConnection::m_pOutput, CNeighbour::m_pZOutput, CNeighbour::OnWrite(), CPacket::Release(), and CG1Packet::ToBuffer().

BOOL CG1Neighbour::ProcessPackets  )  [protected]
 

Definition at line 247 of file G1Neighbour.cpp.

References CConnection::Close(), CSettings::Gnutella1, IDS_PROTOCOL_TOO_LARGE, CBuffer::m_nLength, CBuffer::m_pBuffer, CConnection::m_pInput, CNeighbour::m_pZInput, CSettings::sGnutella1::MaximumPacket, CG1Packet::New(), OnPacket(), CPacket::Release(), CBuffer::Remove(), and Settings.

Referenced by OnRead().

BOOL CG1Neighbour::Send CPacket pPacket,
BOOL  bRelease = TRUE,
BOOL  bBuffered = FALSE
[virtual]
 

Reimplemented from CNeighbour.

Definition at line 209 of file G1Neighbour.cpp.

References CG1PacketBuffer::Add(), CStatistics::Current, CNeighbour::m_nOutputCount, CPacket::m_nProtocol, CNeighbour::m_nState, CG1Packet::m_nTTL, m_pOutbound, nrsConnected, NULL, PROTOCOL_G1, CConnection::QueueRun(), CPacket::Release(), CPacket::SmartDump(), and Statistics.

Referenced by CG1Neighbour(), OnNewPong(), OnPing(), OnVendor(), SendClusterAdvisor(), SendG2Push(), SendPing(), and SendQuery().

void CG1Neighbour::SendClusterAdvisor  )  [protected]
 

Definition at line 918 of file G1Neighbour.cpp.

References G1_PACKET_VENDOR, CHostCacheList::GetNewest(), CHostCache::Gnutella1, CSettings::Gnutella1, HostCache, CNeighbour::m_bShareaza, CPacket::m_pBuffer, CVendorCache::m_pShareaza, m_tClusterHost, m_tClusterSent, CG1Packet::New(), NULL, CPacket::RazaSign(), Send(), Settings, VendorCache, CSettings::sGnutella1::VendorMsg, CPacket::WriteLongLE(), and CPacket::WriteShortLE().

Referenced by OnClusterAdvisor().

void CG1Neighbour::SendG2Push GGUID pGUID,
CPacket pPacket
 

Definition at line 1117 of file G1Neighbour.cpp.

References G1_PACKET_PUSH, CPacket::GetRemaining(), CSettings::Gnutella1, CSettings::sGnutella1::MaximumTTL, CG1Packet::New(), CPacket::ReadLongLE(), CPacket::ReadShortLE(), Send(), Settings, CPacket::Write(), CPacket::WriteLongLE(), and CPacket::WriteShortLE().

Referenced by CNetwork::RoutePacket().

BOOL CG1Neighbour::SendPing DWORD  dwNow = 0,
GGUID pGUID = NULL
 

Definition at line 353 of file G1Neighbour.cpp.

References G1_PACKET_PING, CSettings::Gnutella1, CNeighbour::m_nNodeType, m_tLastOutPing, CNeighboursWithConnect::NeedMoreHubs(), CNeighboursWithConnect::NeedMoreLeafs(), Neighbours, CG1Packet::New(), ntLeaf, NULL, CSettings::sGnutella1::PingRate, PROTOCOL_G1, Send(), and Settings.

Referenced by CNeighboursWithG1::OnG1Ping(), and OnRun().

BOOL CG1Neighbour::SendQuery CQuerySearch pSearch,
CPacket pPacket,
BOOL  bLocal
[virtual]
 

Reimplemented from CNeighbour.

Definition at line 1218 of file G1Neighbour.cpp.

References CQueryHashTable::Check(), CQuerySearch::m_bAndG1, CQueryHashTable::m_bLive, CG1Packet::m_nHops, m_nHopsFlow, CNeighbour::m_nNodeType, CPacket::m_nProtocol, CNeighbour::m_nState, CNeighbour::m_pQueryTableRemote, CNeighbour::m_tLastQuery, nrsConnected, ntHub, ntLeaf, NULL, PROTOCOL_G1, and Send().


Member Data Documentation

BYTE CG1Neighbour::m_nHopsFlow [protected]
 

Definition at line 68 of file G1Neighbour.h.

Referenced by CG1Neighbour(), OnVendor(), and SendQuery().

BYTE CG1Neighbour::m_nLastPingHops [protected]
 

Definition at line 65 of file G1Neighbour.h.

Referenced by OnNewPong(), and OnPing().

BYTE CG1Neighbour::m_nPongNeeded[PONG_NEEDED_BUFFER] [protected]
 

Definition at line 61 of file G1Neighbour.h.

Referenced by CG1Neighbour(), OnNewPong(), and OnPing().

GGUID CG1Neighbour::m_pLastPingID [protected]
 

Definition at line 64 of file G1Neighbour.h.

Referenced by OnNewPong(), and OnPing().

CG1PacketBuffer* CG1Neighbour::m_pOutbound [protected]
 

Definition at line 73 of file G1Neighbour.h.

Referenced by CG1Neighbour(), OnWrite(), Send(), and ~CG1Neighbour().

DWORD CG1Neighbour::m_tClusterHost [protected]
 

Definition at line 55 of file G1Neighbour.h.

Referenced by OnClusterAdvisor(), and SendClusterAdvisor().

DWORD CG1Neighbour::m_tClusterSent [protected]
 

Definition at line 56 of file G1Neighbour.h.

Referenced by SendClusterAdvisor().

DWORD CG1Neighbour::m_tLastInPing [protected]
 

Definition at line 53 of file G1Neighbour.h.

Referenced by OnPing().

DWORD CG1Neighbour::m_tLastOutPing [protected]
 

Definition at line 54 of file G1Neighbour.h.

Referenced by CG1Neighbour(), and SendPing().


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