diff options
-rw-r--r-- | network.h | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -15,9 +15,10 @@ typedef struct packet packet; typedef struct cmd cmd; typedef struct cmd_header cmd_header; -struct packet { - uint32_t size; /* Size of packet, in bytes. */ - cmd cmd; /* Command. */ +struct cmd_header { + uint32_t size; /* Size of command, in bytes, including command header. */ + uint16_t magic; /* Magic Number. Must always be 0x1488. */ + uint16_t id; /* Command ID. */ }; struct cmd { @@ -25,10 +26,9 @@ struct cmd { uint8_t *data; /* Command data. */ }; -struct cmd_header { - uint32_t size; /* Size of command, in bytes, including command header. */ - uint16_t magic; /* Magic Number. Must always be 0x1488. */ - uint16_t id; /* Command ID. */ +struct packet { + uint32_t size; /* Size of packet, in bytes. */ + cmd cmd; /* Command. */ }; #endif |