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

CG1Packet Class Reference

#include <G1Packet.h>

Inheritance diagram for CG1Packet:

CPacket List of all members.

Public Member Functions

BOOL Hop ()
void CacheHash ()
virtual BOOL GetRazaHash (SHA1 *pHash, DWORD nLength=0) const
virtual LPCTSTR GetType () const
CString GetGUID () const
virtual void ToBuffer (CBuffer *pBuffer) const
virtual void Debug (LPCTSTR pszReason) const
virtual void Delete ()

Static Public Member Functions

static int GnutellaTypeToIndex (BYTE nType)
static CG1PacketNew (int nType=0, DWORD nTTL=0, GGUID *pGUID=NULL)
static CG1PacketNew (GNUTELLAPACKET *pSource)

Public Attributes

GGUID m_pGUID
BYTE m_nType
BYTE m_nTTL
BYTE m_nHops
int m_nTypeIndex
DWORD m_nHash

Static Public Attributes

static LPCTSTR m_pszPackets [9]

Protected Member Functions

 CG1Packet ()
virtual ~CG1Packet ()

Static Protected Attributes

static CG1PacketPool POOL

Friends

class CG1Packet::CG1PacketPool

Classes

class  CG1PacketPool

Constructor & Destructor Documentation

CG1Packet::CG1Packet  )  [protected]
 

Definition at line 48 of file G1Packet.cpp.

References m_nHash, m_nHops, m_nTTL, m_nType, and m_nTypeIndex.

CG1Packet::~CG1Packet  )  [protected, virtual]
 

Definition at line 62 of file G1Packet.cpp.


Member Function Documentation

void CG1Packet::CacheHash  ) 
 

Definition at line 151 of file G1Packet.cpp.

References m_nHash, CPacket::m_nLength, and CPacket::m_pBuffer.

void CG1Packet::Debug LPCTSTR  pszReason  )  const [virtual]
 

Reimplemented from CPacket.

Definition at line 248 of file G1Packet.cpp.

References CPacket::Debug(), GetType(), m_nHops, m_nTTL, and CPacket::ToASCII().

virtual void CG1Packet::Delete  )  [inline, virtual]
 

Implements CPacket.

Definition at line 148 of file G1Packet.h.

References CPacketPool::Delete(), and POOL.

CString CG1Packet::GetGUID  )  const
 

Definition at line 209 of file G1Packet.cpp.

References m_pGUID, and GGUID::n.

BOOL CG1Packet::GetRazaHash SHA1 pHash,
DWORD  nLength = 0
const [virtual]
 

Reimplemented from CPacket.

Definition at line 173 of file G1Packet.cpp.

References CSHA::Add(), CSHA::Finish(), CSHA::GetHash(), CPacket::m_nLength, m_nType, CPacket::m_pBuffer, and m_pGUID.

LPCTSTR CG1Packet::GetType  )  const [virtual]
 

Reimplemented from CPacket.

Definition at line 201 of file G1Packet.cpp.

References m_nTypeIndex, and m_pszPackets.

Referenced by Debug().

int CG1Packet::GnutellaTypeToIndex BYTE  nType  )  [static]
 

Definition at line 111 of file G1Packet.cpp.

References 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, G1_PACKTYPE_BYE, G1_PACKTYPE_HIT, G1_PACKTYPE_PING, G1_PACKTYPE_PONG, G1_PACKTYPE_PUSH, G1_PACKTYPE_QUERY, G1_PACKTYPE_QUERY_ROUTE, G1_PACKTYPE_UNKNOWN, and G1_PACKTYPE_VENDOR.

Referenced by New().

BOOL CG1Packet::Hop  ) 
 

Definition at line 134 of file G1Packet.cpp.

References m_nHops, and m_nTTL.

Referenced by CG1Neighbour::OnPing(), CG1Neighbour::OnPush(), and CNetwork::RouteHits().

static CG1Packet* CG1Packet::New GNUTELLAPACKET pSource  )  [inline, static]
 

Definition at line 124 of file G1Packet.h.

References GnutellaTypeToIndex(), GNUTELLAPACKET::m_nHops, m_nHops, GNUTELLAPACKET::m_nLength, GNUTELLAPACKET::m_nTTL, m_nTTL, GNUTELLAPACKET::m_nType, m_nType, m_nTypeIndex, GNUTELLAPACKET::m_pGUID, m_pGUID, CPacketPool::New(), POOL, and CPacket::Write().

CG1Packet * CG1Packet::New int  nType = 0,
DWORD  nTTL = 0,
GGUID pGUID = NULL
[static]
 

Definition at line 73 of file G1Packet.cpp.

References CNetwork::CreateID(), CSettings::sGnutella1::DefaultTTL, CSettings::Gnutella1, GnutellaTypeToIndex(), m_nHash, m_nHops, m_nTTL, m_nType, m_nTypeIndex, m_pGUID, Network, CPacketPool::New(), POOL, and Settings.

Referenced by CG1Neighbour::CG1Neighbour(), CLocalSearch::CreatePacketG1(), CG1Neighbour::OnPing(), CG1Neighbour::OnVendor(), CQueryHashTable::PatchTo(), CQueryHashTable::PatchToOldShareaza(), CG1Neighbour::ProcessPackets(), CNetwork::RouteHits(), CNeighboursWithRouting::RouteQuery(), CG1Neighbour::SendClusterAdvisor(), CG1Neighbour::SendG2Push(), CG1Neighbour::SendPing(), CNetwork::SendPush(), CHostBrowser::StreamPacketsG1(), CQuerySearch::ToG1Packet(), CHostCacheHost::ToG1Ping(), and CPongItem::ToPacket().

void CG1Packet::ToBuffer CBuffer pBuffer  )  const [virtual]
 

Implements CPacket.

Definition at line 228 of file G1Packet.cpp.

References CBuffer::Add(), m_nHops, GNUTELLAPACKET::m_nHops, CPacket::m_nLength, GNUTELLAPACKET::m_nLength, m_nTTL, GNUTELLAPACKET::m_nTTL, m_nType, GNUTELLAPACKET::m_nType, CPacket::m_pBuffer, m_pGUID, and GNUTELLAPACKET::m_pGUID.

Referenced by CG1PacketBuffer::Add(), and CG1Neighbour::OnWrite().


Friends And Related Function Documentation

friend class CG1Packet::CG1PacketPool [friend]
 

Definition at line 155 of file G1Packet.h.


Member Data Documentation

DWORD CG1Packet::m_nHash
 

Definition at line 70 of file G1Packet.h.

Referenced by CacheHash(), CG1Packet(), and New().

BYTE CG1Packet::m_nHops
 

Definition at line 66 of file G1Packet.h.

Referenced by CG1Packet(), Debug(), Hop(), CG2Packet::New(), New(), CQueryHashTable::OnPacket(), CG1Neighbour::OnPacket(), CG1Neighbour::OnPing(), CG1Neighbour::OnQuery(), CG1Neighbour::SendQuery(), ToBuffer(), and CPongItem::ToPacket().

BYTE CG1Packet::m_nTTL
 

Definition at line 65 of file G1Packet.h.

Referenced by CG1Packet(), Debug(), Hop(), CG2Packet::New(), New(), CQueryHashTable::OnPacket(), CG1Neighbour::OnPacket(), CG1Neighbour::OnPing(), CG1Neighbour::Send(), and ToBuffer().

BYTE CG1Packet::m_nType
 

Definition at line 64 of file G1Packet.h.

Referenced by CG1Packet(), GetRazaHash(), CG2Packet::New(), New(), CHostBrowser::OnPacket(), CG1Neighbour::OnPacket(), and ToBuffer().

int CG1Packet::m_nTypeIndex
 

Definition at line 69 of file G1Packet.h.

Referenced by CG1PacketBuffer::Add(), CG1Packet(), GetType(), and New().

GGUID CG1Packet::m_pGUID
 

Definition at line 63 of file G1Packet.h.

Referenced by GetGUID(), GetRazaHash(), CG2Packet::New(), New(), CG1Neighbour::OnPing(), CG1Neighbour::OnQuery(), and ToBuffer().

LPCTSTR CG1Packet::m_pszPackets [static]
 

Initial value:

 
{
        
        _T("Unknown"), _T("Ping"), _T("Pong"), _T("Bye"), _T("QRP"), _T("Vendor"), _T("Push"), _T("Query"), _T("Hit")
}

Definition at line 193 of file G1Packet.cpp.

Referenced by GetType(), and CPacketWnd::OnContextMenu().

CG1Packet::CG1PacketPool CG1Packet::POOL [static, protected]
 

Definition at line 42 of file G1Packet.cpp.

Referenced by Delete(), and New().


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