EMule protocol specification Appendix A-message encoding general message encoding key points

Source: Internet
Author: User

Translated from Yoram kulbak and Danny Bickson the eMule Protocol Specification

Translation: lzcx

QQ: 402722857

Email: lzcx_cn@yahoo.com.cn

For learning. For more information, see the source.

 

6.1 General message encoding highlights This chapter describes the general message encoding methods for TCP/UDP listeners. 6.1.1 Byte orderAll messages are encoded with little-Endian instead of big-Endian and big-Endian.
Is the agreed network byte order. This is easy to explain. In fact, the client/server is based on Microsoft Windows and runs on Intel processors. 6.1.2 Message HeaderAll messages have a 6-byte header with the following structure: 1. Protocol-one byte, protocol id-0xe3 is eDonkey, and 0xc5 is emule2. size-4 bytes message size-
The message size, in bytes, does not contain the header. For example, if the message does not contain any payload, for example, in section 6.4.11, the message length is zero. 3. Type-one byte, type-unique message ID 6.1.3 Message tagThe label is similar to the TLV (type, length, value) structure, used to add optional data to the eMule message. There are several types of labels. This chapter lists all the labels. When it comes to a specific tag in a protocol message, only the tag type is specified. Readers should take this chapter as a reference to determine the accurate structure of the protocol message. Each tag has four fields, and they are not continuous in the message: 1. type-1 byte integer 2. name-it can be one of the following l Variable Length string L 1 byte integer 3. value-it can be one of the following L 4-byte integer L 4-byte floating point number l Variable Length string 4. the special-1-byte Integer type is used. The label that is used to specify a specific value is called an integer tag. Similarly, we have a string tag and a floating point tag. The type value of the string tag is 2, the type value of the integer tag is 3, and the type value of the floating point tag is 4. When a tag is encoded for sending, It is encoded in the above order, for example, type, name, and value. Type is encoded into one byte. The name is encoded into two byte length values, which can be a string name or an integer name. For example, the integer name 0x15 is encoded in the order of 0x01.
0x00 0x15. Fixed value ranges (like integer and floating-point numbers) are written as they do, and string values are encoded in the same length value format. Note: The name provided by the tag has no specific protocol meaning, but is easy to reference in later protocol message descriptions.

Trackback:

Http://tb.blog.csdn.net/TrackBack.aspx? Postid = 621564

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.