packets.h File Reference

This is an implementation header for ED2K protocol parser. More...

#include <hn/osdep.h>
#include <hn/ipv4addr.h>
#include <hn/hash.h>
#include <hn/range.h>
#include "opcodes.h"
#include "ed2kfile.h"
#include "ed2ksearch.h"
#include "ed2ktypes.h"
#include "publickey.h"
#include <boost/tuple/tuple.hpp>

Go to the source code of this file.


Namespaces

namespace  ED2KPacket

Typedefs

typedef AnswerSources AnswerSources2
 This packet can occasionally be sent compressed, however our parser then resets the opcode to PR_ED2K (since compressed packets from Servers should be done so).

Enumerations

enum  ED2K_ClientSoftware {
  CS_EMULE = 0x00, CS_CDONKEY = 0x01, CS_LXMULE = 0x02, CS_AMULE = 0x03,
  CS_SHAREAZA = 0x04, CS_EMULEPLUS = 0x05, CS_HYDRANODE = 0x06, CS_MLDONKEY_NEW2 = 0x0a,
  CS_LPHANT = 0x14, CS_HYBRID = 0x3c, CS_DONKEY = 0x3d, CS_MLDONKEY = 0x3e,
  CS_OLDEMULE = 0x3f, CS_UNKNOWN = 0x36, CS_MLDONKEY_NEW = 0x98
}
 Client software. More...
enum  ED2K_Versions { VER_EDONKEY = 0x3c, VER_OWN }
 Versions. More...

Detailed Description

This is an implementation header for ED2K protocol parser.

This file should never be included directly from user code - instead include "parser.h".

Declares all supported packet objects, both incoming and outgoing, in ED2KPacket namespace to avoid name clashes.

Implementation note: The packet objects, implemented in packets.cpp, should be as smart as possible and require as few usage arguments as possible. This is done to minimize the usage complexity of these packet objects. Only arguments to constructors should be those that we cannot possibly detect ourselves during packet generation. The side-effect of this is that the implementation file will need to include a large amount of ed2k module headers, however the usage simplicity is well worth it.

Definition in file packets.h.


Typedef Documentation

typedef AnswerSources ED2KPacket::AnswerSources2
 

This packet can occasionally be sent compressed, however our parser then resets the opcode to PR_ED2K (since compressed packets from Servers should be done so).

However, in this case, the packet is supposed to be PR_EMULE instead, which leads to the problem, solved by this typedef and duplicate DECLARE_PACKET_FACTORY() macro in factories.h.

Definition at line 910 of file packets.h.


Enumeration Type Documentation

enum ED2K_ClientSoftware
 

Client software.

Enumeration values:
CS_EMULE  Official eMule.
CS_CDONKEY  CDonkey.
CS_LXMULE  lmule, xmule
CS_AMULE  amule
CS_SHAREAZA  shareaza
CS_EMULEPLUS  emuleplus
CS_HYDRANODE  hydranode
CS_MLDONKEY_NEW2  second new mldonkey
CS_LPHANT  lphant
CS_HYBRID  eDonkey2000 Hybrid
CS_DONKEY  eDonkey2000
CS_MLDONKEY  original mldonkey
CS_OLDEMULE  old eMule
CS_UNKNOWN  unknown
CS_MLDONKEY_NEW  first new mldonkey

Definition at line 54 of file packets.h.

enum ED2K_Versions
 

Versions.

Enumeration values:
VER_EDONKEY 
VER_OWN 

Definition at line 73 of file packets.h.