Protocol design: Implementation of variable long frames

Source: Internet
Author: User

/*   *author  : davidlin           *Date    : 2014-12-25pm           *Email   : [email protected] or [email protected]           *world   : the city of sz,  in China          *Ver      : 000.000.001          *For      : threads for rxtx!       *history :      editor      time             do          *            1) linpeng       2014-12-25       created this file!          *           2)            */               signaling frames, the length of the data frame is different, The length of different data frames is more and more diverse, so the variable-length implementation of frames in communication protocols is of great practical significance. How to achieve:         1. Through the shift of the frame tail;         2. Increments the length item by layer. Like a 2-layer protocol typedef struct net_packet_t {    ip_packet_t     The ip;    size_t    size;    //is used to obtain the IP packet length};typedef  struct ip_packet_t {    char head;    char  pay[max];    //need to shift and grow longer     size_t chksum;    char tail;}; Phy_tx (&net,  net.size);     //send format, sent according to the actual length of the frame


Protocol design: Implementation of variable long frames

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.