#include <Push.h> [code]
Inherits Gnutella::Packets::Packet.
Inheritance diagram for Gnutella::Packets::Push:


The table below presents the data fields stored in a query hits' payload and how they can be accessed using the Push interface. For a detailed documentation of all basic Gnutella packets and the usage of all their fileds please refer to The Annotated Gnutella Protocol Specification v0.4.
| Byte Offset | Field Name | getFunction | setFunction |
| 0..15 | Servent ID | N/A | N/A |
| 20..23 | IP Address | N/A | N/A |
| 24..25 | Port | N/A | N/A |
| 26..L-1 | Optional Push Data | N/A | N/A |
Definition at line 53 of file Push.h.
Public Member Functions | |
| Push (const QByteArray &rawHeader, const QByteArray &rawPayload) | |
| ~Push () | |
| const QUuid & | serventId () const |
| Gets the servent ID payload field. | |
| const Extensions::GgepBlock & | ggepBlock () const |
| Gets the GGEP block containing all GGEP extensions. | |
| void | setGgepBlock (const Extensions::GgepBlock &block) |
| Sets the GGEP block, which should be filled with all necessary GGEP extensions. | |
| Push * | copy () const |
| A virtual copy contructor. | |
| QString | name () const |
Static Public Member Functions | |
| static Push & | castFrom (Packet &packet) |
| static const Push & | castFrom (const Packet &packet) |
Protected Member Functions | |
| bool | prepareReadPayload (const QByteArray &rawPayload) |
| Verifies the structure of the rawPayload. | |
| void | readPayload (QDataStream &stream) |
| Reads the payload fields from the stream. The structure of the data in the stream is already verified by verifyPayload(). | |
| int | prepareWritePayload () const |
| Gets ready to write the payload and returns the payload length. | |
| void | writePayload (QDataStream &stream) const |
| Writes the payload fields into the stream. | |
Private Attributes | |
| Gnutella::Packets::Push::Data | p |
Classes | |
| struct | Data |
|
||||||||||||
|
Creates a Push object from the raw bytes in rawHeader and rawPayload. |
|
|
|
|
|
|
|
|
|
|
|
A virtual copy contructor.
Implements Gnutella::Packets::Packet. |
|
|
Gets the GGEP block containing all GGEP extensions.
|
|
|
Implements Gnutella::Packets::Packet. |
|
|
Verifies the structure of the rawPayload. Verifies if the rawPayload can be correctly parsed by readPayload(). The function just goes over the whole rawPayload and checks if the structure of the payload is correct. Some data may be gathered and stored to ease the work of readPayload(). For example, the size of the query hit data field can only be calculated with knowledge of the payloadLength, which is not available in the QDataStream object passed to readPayload(). The size of this field is read here and stored for use later in readPayload(). Implements Gnutella::Packets::Packet. |
|
|
Gets ready to write the payload and returns the payload length.
Implements Gnutella::Packets::Packet. |
|
|
Reads the payload fields from the stream. The structure of the data in the stream is already verified by verifyPayload().
Implements Gnutella::Packets::Packet. |
|
|
Gets the servent ID payload field.
|
|
|
Sets the GGEP block, which should be filled with all necessary GGEP extensions.
|
|
|
Writes the payload fields into the stream.
Implements Gnutella::Packets::Packet. |
|
|
|