title: Why put struct inside structure without reference name
body: <p>I understand a nested structure like this: </p>
  
  <pre><code>struct student
  {
      struct person
      {
          char name[20];
          int age;
          char dob[10];
      } p ;
  
      int rollno;
      float marks;
  } stu;
  </code></pre>
  
  <p>You will see that the struct person will have a "p" inside for us to access the field. 
  Example <code>stu.p.name</code> refers to the name of the person. But somehow, when I study the code below, I don't see the beauty/purpose of putting a struct inside the struct.</p>
  
  <pre><code>typedef struct {
      uint32_t magic;                   /**&lt; Filter duplicate packets */
      struct {
          bool transmit_self      : 1;  /**&lt; Whether the forwarded packet is for yourself */
          bool transmit_all       : 1;  /**&lt; Whether to send packages to all devices */
          size_t transmit_num     : 10; /**&lt; Number of destination devices forwarded */
          size_t total_size_low   : 12; /**&lt; Total length of the packet */
          uint8_t packet_seq      : 3;  /**&lt; Serial number of the packet */
          size_t total_size_hight : 1;  /**&lt; Total length of the packet */
          uint8_t compress_rate   : 4;  /**&lt; The ratio of the data to the original after compression */
      };
      mwifi_data_type_t type;           /**&lt; The type of data */
  } __attribute__((packed)) mwifi_data_head_t;
  </code></pre>
  
  <p>I can change to this format without any problem:</p>
  
  <pre><code>typedef struct {
      uint32_t magic;                   /**&lt; Filter duplicate packets */
  
          bool transmit_self      : 1;  /**&lt; Whether the forwarded packet is for yourself */
          bool transmit_all       : 1;  /**&lt; Whether to send packages to all devices */
          size_t transmit_num     : 10; /**&lt; Number of destination devices forwarded */
          size_t total_size_low   : 12; /**&lt; Total length of the packet */
          uint8_t packet_seq      : 3;  /**&lt; Serial number of the packet */
          size_t total_size_hight : 1;  /**&lt; Total length of the packet */
          uint8_t compress_rate   : 4;  /**&lt; The ratio of the data to the original after compression */
  
      mwifi_data_type_t type;           /**&lt; The type of data */
  } __attribute__((packed)) mwifi_data_head_t;
  </code></pre>
  
  <p>Compared to the original code, I didn't put a struct inside. Although the behavior would be same, I wish to know why they put the structure like that. My mind keeps asking "why?" Is it a good practice on coding or reserved for some purpose?</p>