diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-25 14:57:59 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-25 14:59:19 -0400 |
commit | c9dc332811b0f98799411de6cbed66957c184188 (patch) | |
tree | 63438a387b5d80299cf2347ed4ba49c2e75402c4 /src/include | |
parent | afcdcf6ae6d95eb828733994c7de30f8ab095dcc (diff) |
dgram: Put CRC32 at the end of the datagram hdr
This makes it easier to compute the checksum as we can simply subtract
from the length of the header
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/dgram.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/dgram.h b/src/include/dgram.h index 0f798ee..31f7c03 100644 --- a/src/include/dgram.h +++ b/src/include/dgram.h @@ -40,18 +40,18 @@ typedef tx_len_t rx_len_t; /* * Represents an ONET datagram * - * @crc32: CRC32 checksum of data + header * @length: Packet length in bytes * @reserved: Reserved for future use * @reserved1: Reserved for future use * @port: Datagram port number to send on + * @crc32: CRC32 checksum of data + header */ struct onet_dgram { - uint32_t crc32; uint16_t length; uint16_t reserved; uint16_t reserved1; uint8_t port; + uint32_t crc32; } __attribute__((packed)); /* |