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


Use this class when a packet of unknown type is read (see PacketReader). Just the header fileds are parsed since the structure of the payload is not known. The raw data is stored inside the object.
Definition at line 39 of file UnknownPacket.h.
Public Member Functions | |
| UnknownPacket (const QByteArray &rawHeader, const QByteArray &rawPayload) | |
| UnknownPacket * | copy () const |
| A virtual copy contructor. | |
| QString | name () const |
Protected Member Functions | |
| bool | prepareReadPayload (const QByteArray &) |
| Verifies the structure of the rawPayload. | |
| void | readPayload (QDataStream &) |
| 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 &) const |
| Writes the payload fields into the stream. | |
|
||||||||||||
|
Definition at line 28 of file UnknownPacket.cpp. |
|
|
A virtual copy contructor.
Implements Gnutella::Packets::Packet. Definition at line 34 of file UnknownPacket.cpp. |
|
|
Implements Gnutella::Packets::Packet. Definition at line 58 of file UnknownPacket.cpp. |
|
|
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. Definition at line 39 of file UnknownPacket.cpp. |
|
|
Gets ready to write the payload and returns the payload length.
Implements Gnutella::Packets::Packet. Definition at line 48 of file UnknownPacket.cpp. |
|
|
Reads the payload fields from the stream. The structure of the data in the stream is already verified by verifyPayload().
Implements Gnutella::Packets::Packet. Definition at line 44 of file UnknownPacket.cpp. |
|
|
Writes the payload fields into the stream.
Implements Gnutella::Packets::Packet. Definition at line 53 of file UnknownPacket.cpp. |