Higher abstraction level is Gnutella
The basis class for all Gnutella packets is Packet. It implements many of the details related with parsing a packet from raw data and generating the raw data for a Packet object. The derived classes only need to implement a few pure virtual functions to support parsing and raw bytes generation. Of course the derived classes provide interface that allows setting and getting the packet fields.
Currently supported packets are Ping, Pong, Query, QueryHits, Push, Bye.
The searching-related extensions are not fully implemented and tested yet (XML metadata, EQHD).
Classes | |
| class | Bye |
| class | Packet |
| Base class for all Gnutella packets. More... | |
| class | Ping |
| Encapsulates the Ping Gnutella packet. More... | |
| class | Pong |
| Encapsulates the Pong Gnutella packet. More... | |
| class | Push |
| Encapsulates the Push Gnutella packet. More... | |
| class | Query |
| Encapsulates the Query Gnutella packet. More... | |
| class | QueryHits |
| Encapsulates the QueryHits Gnutella packet. More... | |
| class | QueryRouting |
| class | QueryRoutingPatch |
| class | QueryRoutingReset |
| class | UnknownPacket |
| Represents a packet with unknown payload descriptor. More... | |
| class | VendorCode |
Namespaces | |
| namespace | Extensions |
| namespace | Testing |
| namespace | VendorMessages |
Enumerations | |
| enum | Constants { MinimalByePayloadLength = 3 } |
| enum | PayloadDescriptor { PingDescriptor = 0x00, PongDescriptor = 0x01, QueryDescriptor = 0x80, QueryHitsDescriptor = 0x81, PushDescriptor = 0x40, ByeDescriptor = 0x02, IbmcDescriptor = 0x10, QueryRoutingDescriptor = 0x30, OpenVendorDescriptor = 0x31, StandardVendorDescriptor = 0x32 } |
| enum | PacketConstants { DefaultHops = 0, DefaultTtl = 5, MaximalTtl = 7, HeaderLength = 23, MaximalPayloadLength = 0x00010000 - HeaderLength, MaximalQueryPayloadLength = 0x00001000 - HeaderLength, MaximalPacketLength = HeaderLength + MaximalPayloadLength } |
| Packet-related global constants. More... | |
Functions | |
| QDataStream & | operator>> (QDataStream &in, PayloadDescriptor &pd) |
| Reads a payload descriptor's value from a QDataStream. | |
| QDataStream & | operator<< (QDataStream &out, const PayloadDescriptor &pd) |
| Writes a payload descriptor's value into a QDataStream. | |
| QDataStream & | operator>> (QDataStream &in, QHostAddress &ha) |
| Reads an IP v4 address from a QDataStream. | |
| QDataStream & | operator<< (QDataStream &out, const QHostAddress &ha) |
| Writes an IP v4 address into a QDataStream. | |
| QDataStream & | operator>> (QDataStream &in, Extensions::Extension &extension) |
| QDataStream & | operator<< (QDataStream &out, const Extensions::Extension &extension) |
| QDataStream & | operator>> (QDataStream &stream, VendorCode &vendorCode) |
| QDataStream & | operator<< (QDataStream &stream, const VendorCode &vendorCode) |
|
|
|
|
|
Packet-related global constants.
|
|
|
Defines all known Gnutella descriptors (packets). The payloadDescriptor field of a Gnutella packet header determines the type of the current packet and therefore the contents of its payload
|
|
||||||||||||
|
Definition at line 69 of file VendorCode.cpp. |
|
||||||||||||
|
|
|
||||||||||||
|
Writes an IP v4 address into a QDataStream. Writes a 4 byte IP address ha into the out stream as a big endian value. Definition at line 91 of file Packet.cpp. |
|
||||||||||||
|
Writes a payload descriptor's value into a QDataStream. Writes the single byte pd value into the out stream. Definition at line 65 of file Packet.cpp. |
|
||||||||||||
|
Definition at line 56 of file VendorCode.cpp. |
|
||||||||||||
|
|
|
||||||||||||
|
Reads an IP v4 address from a QDataStream. Reads a 4 byte IP address ha from the in stream as a big endian value. Definition at line 75 of file Packet.cpp. |
|
||||||||||||
|
Reads a payload descriptor's value from a QDataStream. Reads the single byte pd value from the in stream. Definition at line 53 of file Packet.cpp. |