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

CG2Packet Class Reference

#include <G2Packet.h>

Inheritance diagram for CG2Packet:

CPacket List of all members.

Public Member Functions

void WritePacket (CG2Packet *pPacket)
void WritePacket (LPCSTR pszType, DWORD nLength, BOOL bCompound=FALSE)
BOOL ReadPacket (LPSTR pszType, DWORD &nLength, BOOL *pbCompound=NULL)
BOOL SkipCompound ()
BOOL SkipCompound (DWORD &nLength, DWORD nRemaining=0)
BOOL GetTo (GGUID *pGUID)
BOOL SeekToWrapped ()
virtual void Reset ()
CG2PacketClone () const
virtual CString ReadString (DWORD nMaximum=0xFFFFFFFF)
virtual void WriteString (LPCTSTR pszString, BOOL bNull=TRUE)
virtual int GetStringLen (LPCTSTR pszString) const
virtual void ToBuffer (CBuffer *pBuffer) const
virtual void Debug (LPCTSTR pszReason) const
virtual void WriteString (LPCSTR pszString, BOOL bNull=TRUE)
BOOL IsType (LPCSTR pszType) const
virtual LPCTSTR GetType () const
virtual void Delete ()

Static Public Member Functions

static CG2PacketReadBuffer (CBuffer *pBuffer)
static CG2PacketNew (LPCSTR pszType=NULL, BOOL bCompound=FALSE)
static CG2PacketNew (BYTE *pSource)
static CG2PacketNew (LPCSTR pszType, CG1Packet *pWrap, int nMinTTL=255)

Public Attributes

CHAR m_sType [9]
BOOL m_bCompound
CString m_sTypeCache

Protected Member Functions

 CG2Packet ()
virtual ~CG2Packet ()

Static Protected Attributes

static CG2PacketPool POOL

Friends

class CG2Packet::CG2PacketPool

Classes

class  CG2PacketPool

Constructor & Destructor Documentation

CG2Packet::CG2Packet  )  [protected]
 

Definition at line 41 of file G2Packet.cpp.

References CPacket::m_bBigEndian, m_bCompound, and m_sType.

CG2Packet::~CG2Packet  )  [protected, virtual]
 

Definition at line 48 of file G2Packet.cpp.


Member Function Documentation

CG2Packet * CG2Packet::Clone  )  const
 

Definition at line 130 of file G2Packet.cpp.

References m_bCompound, CPacket::m_nLength, CPacket::m_pBuffer, m_sType, New(), and CPacket::Write().

Referenced by CNeighboursWithRouting::RouteQuery().

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

Reimplemented from CPacket.

Definition at line 504 of file G2Packet.cpp.

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

Referenced by CDatagrams::OnHit(), CG2Neighbour::OnPush(), CDatagrams::OnPush(), and CDatagrams::Send().

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

Implements CPacket.

Definition at line 115 of file G2Packet.h.

References CPacketPool::Delete(), and POOL.

int CG2Packet::GetStringLen LPCTSTR  pszString  )  const [virtual]
 

Reimplemented from CPacket.

Definition at line 390 of file G2Packet.cpp.

References NULL.

Referenced by CLocalSearch::AddHit(), CLocalSearch::AddHitG2(), CLocalSearch::AlbumToPacket(), CGProfile::CreateAvatar(), CLocalSearch::CreatePacketG2(), CLocalSearch::FolderToPacket(), CDatagrams::OnCrawlRequest(), CG2Neighbour::OnProfileChallenge(), CChatSession::OnProfileChallenge(), CUploadTransferHTTP::RequestHostBrowse(), CChatSession::SendPrivateMessage(), and CQuerySearch::ToG2Packet().

BOOL CG2Packet::GetTo GGUID pGUID  ) 
 

Definition at line 294 of file G2Packet.cpp.

References CPacket::GetRemaining(), m_bCompound, CPacket::m_nPosition, and CPacket::m_pBuffer.

virtual LPCTSTR CG2Packet::GetType  )  const [inline, virtual]
 

Reimplemented from CPacket.

Definition at line 75 of file G2Packet.h.

References m_sType, and m_sTypeCache.

Referenced by Debug().

BOOL CG2Packet::IsType LPCSTR  pszType  )  const [inline]
 

Definition at line 70 of file G2Packet.h.

References m_sType.

Referenced by CChatSession::OnPacket(), CG2Neighbour::OnQuery(), CNetwork::RouteHits(), and CNeighboursWithRouting::RouteQuery().

CG2Packet * CG2Packet::New LPCSTR  pszType,
CG1Packet pWrap,
int  nMinTTL = 255
[static]
 

Definition at line 109 of file G2Packet.cpp.

References CG1Packet::m_nHops, GNUTELLAPACKET::m_nHops, CPacket::m_nLength, GNUTELLAPACKET::m_nLength, CG1Packet::m_nTTL, GNUTELLAPACKET::m_nTTL, CG1Packet::m_nType, GNUTELLAPACKET::m_nType, CPacket::m_pBuffer, CG1Packet::m_pGUID, GNUTELLAPACKET::m_pGUID, New(), and CPacket::Write().

CG2Packet * CG2Packet::New BYTE *  pSource  )  [static]
 

Definition at line 67 of file G2Packet.cpp.

References G2_FLAG_BIG_ENDIAN, G2_FLAG_COMPOUND, CPacket::m_bBigEndian, m_bCompound, m_sType, New(), and CPacket::Write().

static CG2Packet* CG2Packet::New LPCSTR  pszType = NULL,
BOOL  bCompound = FALSE
[inline, static]
 

Definition at line 96 of file G2Packet.h.

References m_bCompound, m_sType, m_sTypeCache, CPacketPool::New(), NULL, and POOL.

Referenced by CLocalSearch::AlbumToPacket(), Clone(), CGProfile::CreateAvatar(), CLocalSearch::CreatePacketG2(), CNeighboursWithG2::CreateQueryWeb(), CLocalSearch::DispatchPacket(), CManagedSearch::ExecuteG2Mesh(), CLocalSearch::FoldersToPacket(), CLocalSearch::FolderToPacket(), New(), CChatSession::OnChatRequest(), CDatagrams::OnCrawlRequest(), CChatSession::OnEstablished(), CG2Neighbour::OnPing(), CDatagrams::OnPing(), CG2Neighbour::OnProfileChallenge(), CChatSession::OnProfileChallenge(), CChatSession::OnProfileDelivery(), CG1Neighbour::OnPush(), CDatagrams::OnQuery(), CG2Neighbour::OnQueryKeyReq(), CDatagrams::OnQueryKeyRequest(), CG2Neighbour::OnRun(), CQueryHashTable::PatchTo(), CG2Neighbour::ProcessPackets(), ReadBuffer(), CChatSession::ReadPackets(), CUploadTransferHTTP::RequestHostBrowse(), CNetwork::RouteHits(), CCrawlSession::SendCrawl(), CG2Neighbour::SendHAW(), CG2Neighbour::SendKHL(), CG2Neighbour::SendLNI(), CChatSession::SendPrivateMessage(), CNetwork::SendPush(), CG2Neighbour::SendStartups(), and CQuerySearch::ToG2Packet().

CG2Packet * CG2Packet::ReadBuffer CBuffer pBuffer  )  [static]
 

Definition at line 454 of file G2Packet.cpp.

References G2_FLAG_BIG_ENDIAN, New(), and NULL.

Referenced by CHostBrowser::StreamPacketsG2(), and CDatagramIn::ToG2Packet().

BOOL CG2Packet::ReadPacket LPSTR  pszType,
DWORD &  nLength,
BOOL *  pbCompound = NULL
 

Definition at line 190 of file G2Packet.cpp.

References G2_FLAG_COMPOUND, CPacket::GetRemaining(), CPacket::m_bBigEndian, CPacket::Read(), CPacket::ReadByte(), and SkipCompound().

Referenced by CChatSession::OnChatAnswer(), CChatSession::OnChatMessage(), CChatSession::OnChatRequest(), CCrawlNode::OnCrawl(), CDatagrams::OnCrawlRequest(), CG2Neighbour::OnKHL(), CG2Neighbour::OnLNI(), CCrawlNode::OnNode(), CG2Neighbour::OnPing(), CDatagrams::OnPong(), CG2Neighbour::OnProfileDelivery(), CChatSession::OnProfileDelivery(), CDatagrams::OnQueryKeyAnswer(), CDatagrams::OnQueryKeyRequest(), CBrowseTreeCtrl::OnTreePacket(), and CQuerySearch::ReadG2Packet().

CString CG2Packet::ReadString DWORD  nMaximum = 0xFFFFFFFF  )  [virtual]
 

Reimplemented from CPacket.

Definition at line 328 of file G2Packet.cpp.

References CPacket::m_nLength, CPacket::m_nPosition, CPacket::m_pBuffer, and NULL.

Referenced by CChatSession::OnChatAnswer(), CChatSession::OnChatMessage(), CG2Neighbour::OnKHL(), CCrawlNode::OnNode(), CG2Neighbour::OnProfileDelivery(), CChatSession::OnProfileDelivery(), CBrowseTreeCtrl::OnTreePacket(), and CQuerySearch::ReadG2Packet().

void CG2Packet::Reset  )  [virtual]
 

Reimplemented from CPacket.

Definition at line 55 of file G2Packet.cpp.

References CPacket::m_bBigEndian, m_bCompound, m_sType, and CPacket::Reset().

BOOL CG2Packet::SeekToWrapped  ) 
 

Definition at line 314 of file G2Packet.cpp.

References CPacket::GetRemaining(), GNUTELLAPACKET::m_nLength, CPacket::m_nPosition, CPacket::m_pBuffer, and SkipCompound().

Referenced by CNetwork::RouteHits(), and CNeighboursWithRouting::RouteQuery().

BOOL CG2Packet::SkipCompound DWORD &  nLength,
DWORD  nRemaining = 0
 

Definition at line 248 of file G2Packet.cpp.

References CPacket::m_bBigEndian, CPacket::m_nPosition, CPacket::Read(), and CPacket::ReadByte().

BOOL CG2Packet::SkipCompound  ) 
 

Definition at line 237 of file G2Packet.cpp.

References m_bCompound, and CPacket::m_nLength.

Referenced by CQueryHashTable::OnPacket(), CG2Neighbour::OnPush(), CDatagrams::OnPush(), ReadPacket(), and SeekToWrapped().

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

Implements CPacket.

Definition at line 411 of file G2Packet.cpp.

References CBuffer::Add(), CBuffer::EnsureBuffer(), G2_FLAG_BIG_ENDIAN, G2_FLAG_COMPOUND, CPacket::m_bBigEndian, m_bCompound, CBuffer::m_nLength, CPacket::m_nLength, CPacket::m_pBuffer, CBuffer::m_pBuffer, and m_sType.

Referenced by CDatagramOut::Create(), CG2Neighbour::OnWrite(), CUploadTransferHTTP::RequestHostBrowse(), and CChatSession::Send().

void CG2Packet::WritePacket LPCSTR  pszType,
DWORD  nLength,
BOOL  bCompound = FALSE
 

Definition at line 150 of file G2Packet.cpp.

References G2_FLAG_BIG_ENDIAN, G2_FLAG_COMPOUND, CPacket::m_bBigEndian, m_bCompound, CPacket::Write(), and CPacket::WriteByte().

void CG2Packet::WritePacket CG2Packet pPacket  ) 
 

Definition at line 140 of file G2Packet.cpp.

References NULL, and CPacket::Write().

Referenced by CLocalSearch::AddHit(), CLocalSearch::AddHitG2(), CHubHorizonPool::AddHorizonHubs(), CLocalSearch::AlbumToPacket(), CGProfile::CreateAvatar(), CLocalSearch::CreatePacketG2(), CNeighboursWithG2::CreateQueryWeb(), CManagedSearch::ExecuteG2Mesh(), CLocalSearch::FoldersToPacket(), CLocalSearch::FolderToPacket(), CChatSession::OnChatRequest(), CDatagrams::OnCrawlRequest(), CG2Neighbour::OnPing(), CG2Neighbour::OnProfileChallenge(), CChatSession::OnProfileChallenge(), CChatSession::OnProfileDelivery(), CG1Neighbour::OnPush(), CDatagrams::OnQuery(), CG2Neighbour::OnQueryKeyReq(), CDatagrams::OnQueryKeyRequest(), CG2Neighbour::OnRun(), CUploadTransferHTTP::RequestHostBrowse(), CCrawlSession::SendCrawl(), CG2Neighbour::SendHAW(), CG2Neighbour::SendKHL(), CG2Neighbour::SendLNI(), CChatSession::SendPrivateMessage(), CNetwork::SendPush(), CG2Neighbour::SendStartups(), and CQuerySearch::ToG2Packet().

void CG2Packet::WriteString LPCSTR  pszString,
BOOL  bNull = TRUE
[virtual]
 

Definition at line 379 of file G2Packet.cpp.

References NULL, CPacket::Write(), and CPacket::WriteByte().

void CG2Packet::WriteString LPCTSTR  pszString,
BOOL  bNull = TRUE
[virtual]
 

Reimplemented from CPacket.

Definition at line 354 of file G2Packet.cpp.

References CPacket::m_szSCHAR, NULL, PACKET_BUF_SCHAR, CPacket::Write(), and CPacket::WriteByte().

Referenced by CLocalSearch::AddHit(), CLocalSearch::AddHitG2(), CLocalSearch::AlbumToPacket(), CGProfile::CreateAvatar(), CLocalSearch::CreatePacketG2(), CLocalSearch::FolderToPacket(), CDatagrams::OnCrawlRequest(), CG2Neighbour::OnProfileChallenge(), CChatSession::OnProfileChallenge(), CUploadTransferHTTP::RequestHostBrowse(), CG2Neighbour::SendHAW(), CG2Neighbour::SendKHL(), CG2Neighbour::SendLNI(), CChatSession::SendPrivateMessage(), and CQuerySearch::ToG2Packet().


Friends And Related Function Documentation

friend class CG2Packet::CG2PacketPool [friend]
 

Definition at line 120 of file G2Packet.h.


Member Data Documentation

BOOL CG2Packet::m_bCompound
 

Definition at line 42 of file G2Packet.h.

Referenced by CG2Packet(), Clone(), GetTo(), New(), CChatSession::OnChatAnswer(), CChatSession::OnChatMessage(), CChatSession::OnChatRequest(), CDatagrams::OnCrawlRequest(), CG2Neighbour::OnKHL(), CG2Neighbour::OnLNI(), CQueryHashTable::OnPacket(), CG2Neighbour::OnPing(), CDatagrams::OnPong(), CG2Neighbour::OnProfileDelivery(), CChatSession::OnProfileDelivery(), CG2Neighbour::OnPush(), CDatagrams::OnQueryKeyAnswer(), CDatagrams::OnQueryKeyRequest(), CQuerySearch::ReadG2Packet(), Reset(), SkipCompound(), ToBuffer(), and WritePacket().

CHAR CG2Packet::m_sType[9]
 

Definition at line 41 of file G2Packet.h.

Referenced by CG2Packet(), Clone(), GetType(), IsType(), New(), Reset(), and ToBuffer().

CString CG2Packet::m_sTypeCache
 

Definition at line 44 of file G2Packet.h.

Referenced by GetType(), and New().

CG2Packet::CG2PacketPool CG2Packet::POOL [static, protected]
 

Definition at line 35 of file G2Packet.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