Gnutella::Packets::VendorMessages::SupportedMessages Class Reference

#include <SupportedMessages.h> [code]

Inherits Gnutella::Packets::VendorMessages::VendorMessage.

Inheritance diagram for Gnutella::Packets::VendorMessages::SupportedMessages:

Inheritance graph
[legend]
Collaboration diagram for Gnutella::Packets::VendorMessages::SupportedMessages:

Collaboration graph
[legend]
List of all members.

Detailed Description

Supported Messages Gnutella Vendor Message.

Represents the null/0v0 Vendor Message. The message contains a vector of vendor message IDs which a Gnutella node understands. This message should be sent over a new connection right after the initial keep-alive ping.

The format of the payload is: 2 bytes unsigned little-endian integer containing the vectorSize, followed by vecorSize * 8 bytes. Each vector element has the layout of the vector message header (4 bytes vendor ID, 2 bytes message type, 2 bytes message version).

Definition at line 45 of file SupportedMessages.h.

Public Member Functions

SupportedMessagescopy () const
 A virtual copy contructor.
QString name () const
 SupportedMessages ()
 SupportedMessages (const QByteArray &rawHeader, const QByteArray &rawPayload)
 ~SupportedMessages ()
void addMessage (const VendorCode &, quint16 messageType, quint16 versionNumber)

Static Public Member Functions

static SupportedMessagescastFrom (Packet &packet)
static const SupportedMessagescastFrom (const Packet &packet)

Protected Member Functions

virtual bool prepareReadPayload (const QByteArray &rawPayload)
 Checks the lenght of the QueryStatusResponse payload.
virtual void readPayload (QDataStream &stream)
 Reads the QueryStatusResponse payload.
virtual int prepareWritePayload () const
 Returns the number of bytes in the QueryStatusResponse payload.
virtual void writePayload (QDataStream &stream) const
 Writes the QueryStatusResponse payload.

Private Attributes

Gnutella::Packets::VendorMessages::SupportedMessages::Data p

Classes

struct  Data
struct  Message


Constructor & Destructor Documentation

SupportedMessages::SupportedMessages  ) 
 

Creates a SupportedMessages vendor message.

Definition at line 30 of file SupportedMessages.cpp.

SupportedMessages::SupportedMessages const QByteArray &  rawHeader,
const QByteArray &  rawPayload
 

Creates a QueryStatusResponse object from the raw bytes in rawHeader and rawPayload.

Definition at line 39 of file SupportedMessages.cpp.

SupportedMessages::~SupportedMessages  ) 
 

Destroys a QueryStatusResponse object.

Definition at line 52 of file SupportedMessages.cpp.


Member Function Documentation

void SupportedMessages::addMessage const VendorCode ,
quint16  messageType,
quint16  versionNumber
 

Definition at line 95 of file SupportedMessages.cpp.

static const SupportedMessages& Gnutella::Packets::VendorMessages::SupportedMessages::castFrom const Packet packet  )  [inline, static]
 

Reimplemented from Gnutella::Packets::VendorMessages::VendorMessage.

Definition at line 49 of file SupportedMessages.h.

static SupportedMessages& Gnutella::Packets::VendorMessages::SupportedMessages::castFrom Packet packet  )  [inline, static]
 

Reimplemented from Gnutella::Packets::VendorMessages::VendorMessage.

Definition at line 48 of file SupportedMessages.h.

SupportedMessages* Gnutella::Packets::VendorMessages::SupportedMessages::copy  )  const [inline, virtual]
 

A virtual copy contructor.

Implements Gnutella::Packets::Packet.

Definition at line 51 of file SupportedMessages.h.

QString Gnutella::Packets::VendorMessages::SupportedMessages::name  )  const [inline, virtual]
 

Todo:
remove this?

Implements Gnutella::Packets::Packet.

Definition at line 52 of file SupportedMessages.h.

bool SupportedMessages::prepareReadPayload const QByteArray &  rawPayload  )  [protected, virtual]
 

Checks the lenght of the QueryStatusResponse payload.

Implements Gnutella::Packets::VendorMessages::VendorMessage.

Definition at line 57 of file SupportedMessages.cpp.

int SupportedMessages::prepareWritePayload  )  const [protected, virtual]
 

Returns the number of bytes in the QueryStatusResponse payload.

Implements Gnutella::Packets::VendorMessages::VendorMessage.

Definition at line 78 of file SupportedMessages.cpp.

void SupportedMessages::readPayload QDataStream &  stream  )  [protected, virtual]
 

Reads the QueryStatusResponse payload.

Implements Gnutella::Packets::VendorMessages::VendorMessage.

Definition at line 63 of file SupportedMessages.cpp.

void SupportedMessages::writePayload QDataStream &  stream  )  const [protected, virtual]
 

Writes the QueryStatusResponse payload.

Implements Gnutella::Packets::VendorMessages::VendorMessage.

Definition at line 84 of file SupportedMessages.cpp.


Member Data Documentation

struct Gnutella::Packets::VendorMessages::SupportedMessages::Data Gnutella::Packets::VendorMessages::SupportedMessages::p [private]
 

Reimplemented from Gnutella::Packets::VendorMessages::VendorMessage.


The documentation for this class was generated from the following files: