opcodes.h File Reference

Interface for protocol opcodes used in ed2k network Important: The ed2k protocol overview is generated out from this file, so make sure it is still generated correctly after changing things here. More...

Go to the source code of this file.


Defines

#define FT_ED2K_AUDIO   "Audio"
 mp3/ogg/wma etc
#define FT_ED2K_VIDEO   "Video"
 avi/mpg/mpeg/wmv etc
#define FT_ED2K_IMAGE   "Image"
 png/jpg/gif/tiff etc
#define FT_ED2K_DOCUMENT   "Doc"
 txt/doc/rtf etc
#define FT_ED2K_PROGRAM   "Pro"
 exe/bin/cue/iso etc

Enumerations

enum  ED2K_Protocols { PR_ED2K = 0xe3, PR_EMULE = 0xc5, PR_ZLIB = 0xd4 }
 Protocols. More...
enum  ED2K_ServerLogin {
  OP_LOGINREQUEST = 0x01, CT_NICK = 0x01, CT_VERSION = 0x11, CT_PORT = 0x0f,
  CT_MULEVERSION = 0xfb, CT_FLAGS = 0x20, FL_ZLIB = 0x01, FL_IPINLOGIN = 0x02,
  FL_AUXPORT = 0x04, FL_NEWTAGS = 0x08, FL_UNICODE = 0x10
}
 Login request. More...
enum  ED2K_ServerMessages { OP_SERVERMESSAGE = 0x38, OP_SERVERSTATUS = 0x34, OP_IDCHANGE = 0x40 }
 Server response packets to OP_LOGINREQUEST. More...
enum  ED2K_ServerInfo {
  OP_GETSERVERLIST = 0x14, OP_SERVERLIST = 0x32, OP_SERVERIDENT = 0x41, CT_SERVERNAME = 0x01,
  CT_SERVERDESC = 0x0b
}
 Updating information from server. More...
enum  ED2K_Publishing {
  OP_OFFERFILES = 0x15, CT_FILENAME = 0x01, CT_FILESIZE = 0x02, CT_FILETYPE = 0x03,
  FL_COMPLETE_ID = 0xfcfcfcfc, FL_COMPLETE_PORT = 0xfcfc, FL_PARTIAL_ID = 0xfbfbfbfb, FL_PARTIAL_PORT = 0xfbfb
}
 Publishing shared files. More...
enum  ED2K_Searching {
  OP_SEARCH = 0x16, OP_SEARCHRESULT = 0x33, CT_SOURCES = 0x15, CT_COMPLSRC = 0x30,
  CT_MEDIA_LENGTH = 0xd3, CT_MEDIA_BITRATE = 0xd4, CT_MEDIA_CODEC = 0xd5, CT_LASTSEENCOMPL = 0x05
}
 Searching. More...
enum  ED2K_Hello {
  OP_HELLO = 0x01, CT_MODSTR = 0x55, CT_UDPPORTS = 0xf9, CT_MISCFEATURES = 0xfa,
  OP_HELLOANSWER = 0x4c
}
 Donkeys getting to know each other. More...
enum  ED2K_MuleHello {
  OP_MULEINFO = 0x01, CT_COMPRESSION = 0x20, CT_UDPPORT = 0x21, CT_UDPVER = 0x22,
  CT_SOURCEEXCH = 0x23, CT_COMMENTS = 0x24, CT_EXTREQ = 0x25, CT_COMPATCLIENT = 0x26,
  CT_FEATURES = 0x27, CT_MODVERSION = 0x55, CT_MODPLUS = 0x99, CT_L2HAC = 0x3e,
  OP_MULEINFOANSWER = 0x02
}
 Mules getting to know each other. More...
enum  ED2K_FileRequest {
  OP_REQFILE = 0x58, OP_FILENAME = 0x59, OP_FILEDESC = 0x61, OP_SETREQFILEID = 0x4f,
  OP_REQFILE_STATUS = 0x50, OP_REQFILE_NOFILE = 0x48, OP_REQHASHSET = 0x51, OP_HASHSET = 0x52,
  OP_STARTUPLOADREQ = 0x54, OP_ACCEPTUPLOADREQ = 0x55, OP_QUEUERANKING = 0x5c, OP_MULEQUEUERANK = 0x60
}
 Requesting a file. More...
enum  ED2K_SendingData { OP_REQCHUNKS = 0x47, OP_SENDINGCHUNK = 0x46, OP_PACKEDCHUNK = 0x40, OP_CANCELTRANSFER = 0x56 }
 Transmitting data. More...
enum  ED2K_LowIDCallbacks { OP_REQCALLBACK = 0x1c, OP_CBREQUESTED = 0x35, OP_CALLBACKFAIL = 0x36 }
 LowID callbacks. More...
enum  ED2K_SourceQueries { OP_GETSOURCES = 0x19, OP_FOUNDSOURCES = 0x42, OP_REQSOURCES = 0x81, OP_ANSWERSOURCES = 0x82 }
 Looking for sources. More...
enum  ED2K_Misc { OP_MESSAGE = 0x4e, OP_PORTTEST = 0xfe, OP_CHANGEID = 0x4d }
 Miscellaneous packets. More...
enum  ED2K_SecIdent { OP_SECIDENTSTATE = 0x87, OP_PUBLICKEY = 0x85, OP_SIGNATURE = 0x86 }
 Secure Identification. More...
enum  ED2K_Udp {
  OP_REASKFILEPING = 0x90, OP_REASKACK = 0x91, OP_FILENOTFOUND = 0x92, OP_QUEUEFULL = 0x93,
  OP_GLOBGETSOURCES = 0x9a, OP_GLOBGETSOURCES2 = 0x94, OP_GLOBFOUNDSOURCES = 0x9b, OP_GLOBSTATREQ = 0x96,
  OP_GLOBSTATRES = 0x97
}
enum  ED2K_ServerMet {
  ST_METHEADER = 0x0e, ST_METVERSION = 0xe0, ST_NAME = 0x01, ST_DESC = 0x0b,
  ST_PING = 0x0c, ST_PREFERENCE = 0x0e, ST_FAIL = 0x0d, ST_DYNIP = 0x85,
  ST_MAXUSERS = 0x87, ST_SOFTLIMIT = 0x88, ST_HARDLIMIT = 0x89, ST_LASTPING = 0x90,
  ST_VERSION = 0x91, ST_UDPFLAGS = 0x92, ST_AUXPORTLIST = 0x93, ST_LOWIDUSRS = 0x94
}
 Special tags used in server.met file. More...

Detailed Description

Interface for protocol opcodes used in ed2k network Important: The ed2k protocol overview is generated out from this file, so make sure it is still generated correctly after changing things here.

The code generating it is at the bottom of this file, and it is HIGHLY sensitive about reordering of things, as well as other such stuff. So please, don't reorder stuff here, nor make any other changes - otherwise it'll break the doxygen-generated docs.

Definition in file opcodes.h.


Define Documentation

#define FT_ED2K_AUDIO   "Audio"
 

mp3/ogg/wma etc

Definition at line 83 of file opcodes.h.

Referenced by ED2KFile::ED2KType2HNType(), and ED2KFile::HNType2ED2KType().

#define FT_ED2K_VIDEO   "Video"
 

avi/mpg/mpeg/wmv etc

Definition at line 84 of file opcodes.h.

Referenced by ED2KFile::ED2KType2HNType(), and ED2KFile::HNType2ED2KType().

#define FT_ED2K_IMAGE   "Image"
 

png/jpg/gif/tiff etc

Definition at line 85 of file opcodes.h.

Referenced by ED2KFile::ED2KType2HNType(), and ED2KFile::HNType2ED2KType().

#define FT_ED2K_DOCUMENT   "Doc"
 

txt/doc/rtf etc

Definition at line 86 of file opcodes.h.

Referenced by ED2KFile::ED2KType2HNType(), and ED2KFile::HNType2ED2KType().

#define FT_ED2K_PROGRAM   "Pro"
 

exe/bin/cue/iso etc

Definition at line 87 of file opcodes.h.

Referenced by ED2KFile::ED2KType2HNType(), and ED2KFile::HNType2ED2KType().


Enumeration Type Documentation

enum ED2K_Protocols
 

Protocols.

Enumeration values:
PR_ED2K  Standard, historical eDonkey2000 protocol.
PR_EMULE  eMule extended protocol
PR_ZLIB  Packet payload is compressed with gzip.

Definition at line 33 of file opcodes.h.

enum ED2K_ServerLogin
 

Login request.

Enumeration values:
OP_LOGINREQUEST  <hash>hash<u32>ip<u16>port<TagList>tags
CT_NICK  <string>nick
CT_VERSION  <u8>0x3c
CT_PORT  <u16>port
CT_MULEVERSION  <u32>ver
CT_FLAGS  <u8>flags
FL_ZLIB  zlib compression support
FL_IPINLOGIN  Client sends its own ip during login.
FL_AUXPORT  ???
FL_NEWTAGS  support for new-styled eMule tags
FL_UNICODE  support for unicode

Definition at line 40 of file opcodes.h.

enum ED2K_ServerMessages
 

Server response packets to OP_LOGINREQUEST.

Enumeration values:
OP_SERVERMESSAGE  <u16>len<len>message
OP_SERVERSTATUS  <u32>users<u32>files
OP_IDCHANGE  <u32>newid

Definition at line 55 of file opcodes.h.

enum ED2K_ServerInfo
 

Updating information from server.

Enumeration values:
OP_GETSERVERLIST  (no payload)
OP_SERVERLIST  <u8>count[{<u32>ip<u16>port}*count]
OP_SERVERIDENT  <hash>hash<u32>ip<u16>port<TagList>tags
CT_SERVERNAME  <string>name
CT_SERVERDESC  <string>desc

Definition at line 62 of file opcodes.h.

enum ED2K_Publishing
 

Publishing shared files.

Enumeration values:
OP_OFFERFILES  <u32>count[<count>*{<hash>filehash<u32>ip<u16>port<TagList>tags}]
CT_FILENAME  <string>name
CT_FILESIZE  <u32>size
CT_FILETYPE  <string>type
FL_COMPLETE_ID  File is complete - send this as ID.
FL_COMPLETE_PORT  File is complete - send this as port.
FL_PARTIAL_ID  File is partial - send this as ID.
FL_PARTIAL_PORT  File is partial - send this as port.

Definition at line 71 of file opcodes.h.

enum ED2K_Searching
 

Searching.

Enumeration values:
OP_SEARCH  <searchexpr>
OP_SEARCHRESULT  <u32>count[<count>*{<hash>hash<u32>id<u16>port<Taglist>tags}]
CT_SOURCES  <u32>numsrc
CT_COMPLSRC  <u32>numcomplsrc
CT_MEDIA_LENGTH  <u32>length
CT_MEDIA_BITRATE  <u32>bitrate
CT_MEDIA_CODEC  <string>codec
CT_LASTSEENCOMPL  <u32>lastseencomplete

Definition at line 90 of file opcodes.h.

enum ED2K_Hello
 

Donkeys getting to know each other.

Enumeration values:
OP_HELLO  <hash>hash<u32>ip<u16>port<TagList>tags
CT_MODSTR  <string>modstring
CT_UDPPORTS  <u16>kadudpport<u16>ed2kudpport
CT_MISCFEATURES  <u32>features bitset
OP_HELLOANSWER 

Definition at line 103 of file opcodes.h.

enum ED2K_MuleHello
 

Mules getting to know each other.

Enumeration values:
OP_MULEINFO  <u8>clientver<u8>protver<TagList>tags
CT_COMPRESSION  u32 compression version
CT_UDPPORT  u32 udp port
CT_UDPVER  u32 udp protocol version
CT_SOURCEEXCH  u32 source exchange version
CT_COMMENTS  u32 comment version
CT_EXTREQ  u32 extended request version
CT_COMPATCLIENT  u32 compatible client ID
CT_FEATURES  u32 supported features bitset
CT_MODVERSION  <string>modversion (may also be int)
CT_MODPLUS  mh? (Source: eMule+ Forums ... )
CT_L2HAC  mh? (Source: eMule+ Forums ... )
OP_MULEINFOANSWER  <u8>clientver<u8>protver<TagList>tags

Definition at line 112 of file opcodes.h.

enum ED2K_FileRequest
 

Requesting a file.

Enumeration values:
OP_REQFILE  <hash>hash
OP_FILENAME  <hash>hash<u32>len<len>name
OP_FILEDESC  <u8>rating<u32>len<len>comment
OP_SETREQFILEID  <hash>hash
OP_REQFILE_STATUS  <hash>hash<u16>count<count>partmap
OP_REQFILE_NOFILE  <hash>hash
OP_REQHASHSET  <hash>hash
OP_HASHSET  <hash>hash<u16>cnt[cnt*<hash>parthash]
OP_STARTUPLOADREQ  may contain <hash>hash (emule)
OP_ACCEPTUPLOADREQ  Empty.
OP_QUEUERANKING  <u32>queueranking
OP_MULEQUEUERANK  <u16>queuerank<u16><u32><u32>empty

Definition at line 129 of file opcodes.h.

enum ED2K_SendingData
 

Transmitting data.

Enumeration values:
OP_REQCHUNKS  <hash>hash[3*<u32>begin][3*<u32>end]
OP_SENDINGCHUNK  <hash>hash<u32>begin<u32>end<data>
OP_PACKEDCHUNK  <hash>hash><u32>begin<u32>len<len>data
OP_CANCELTRANSFER  empty

Definition at line 145 of file opcodes.h.

enum ED2K_LowIDCallbacks
 

LowID callbacks.

Enumeration values:
OP_REQCALLBACK  <u32>id
OP_CBREQUESTED  <u32>ip<u16>tcpport
OP_CALLBACKFAIL  empty

Definition at line 153 of file opcodes.h.

enum ED2K_SourceQueries
 

Looking for sources.

Enumeration values:
OP_GETSOURCES  <hash>hash
OP_FOUNDSOURCES  <hash>hash<u8>cnt*[<u32>id<u16>port]
OP_REQSOURCES  <hash>hash
OP_ANSWERSOURCES  <hash>hash<u16>cnt*[<u32>id<u16>port<u32>serverip<u16>serverport]

Definition at line 160 of file opcodes.h.

enum ED2K_Misc
 

Miscellaneous packets.

Enumeration values:
OP_MESSAGE  <u16>len<len>message
OP_PORTTEST  Server: <u16>0x12, Client: <u16>1.
OP_CHANGEID  <u32>oldid<u32>newid

Definition at line 176 of file opcodes.h.

enum ED2K_SecIdent
 

Secure Identification.

Enumeration values:
OP_SECIDENTSTATE  <u8>state<u32>challenge
OP_PUBLICKEY  <u8>len<len>pubkey
OP_SIGNATURE  <u8>len<len>signature

Definition at line 183 of file opcodes.h.

enum ED2K_Udp
 

Enumeration values:
OP_REASKFILEPING  <hash>hash
OP_REASKACK  <u16>queueranking
OP_FILENOTFOUND  empty
OP_QUEUEFULL  empty
OP_GLOBGETSOURCES  cnt*[<hash>hash]
OP_GLOBGETSOURCES2  cnt*[<hash>hash<u32>size]
OP_GLOBFOUNDSOURCES  <hash>hash<u8>cnt*[<u32>id<u16>port]
OP_GLOBSTATREQ  <u32>challenge
OP_GLOBSTATRES  <u32>challenge<u32>users<u32>files<u32>maxusers<u32>softlimit <u32>hardlimit<u32>udpflags<u32>lowusers

Definition at line 189 of file opcodes.h.

enum ED2K_ServerMet
 

Special tags used in server.met file.

Enumeration values:
ST_METHEADER  uint8_t - MET header
ST_METVERSION  uint8_t - server.met version
ST_NAME  string - name of server
ST_DESC  string - description
ST_PING  uint32_t - ping
ST_PREFERENCE  uint32_t - preference
ST_FAIL  uint32_t - failed count
ST_DYNIP  string - dynamic ip address
ST_MAXUSERS  uint32_t - maximum users
ST_SOFTLIMIT  uint32_t - soft file limit
ST_HARDLIMIT  uint32_t - hard file limit
ST_LASTPING  uint32_t - last ping
ST_VERSION  string - version string
ST_UDPFLAGS  uint32_t - UDP flags
ST_AUXPORTLIST  string - Auxiliary ports
ST_LOWIDUSRS  uint32_t - Low-id users

Definition at line 213 of file opcodes.h.