From 9a312758eeee7c3dc3edcece0d60b68daac8ff3b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 31 Aug 2018 10:08:46 +0200 Subject: libuuid: add note about RFC4122 UUID layout Signed-off-by: Karel Zak --- libuuid/src/uuidP.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'libuuid') diff --git a/libuuid/src/uuidP.h b/libuuid/src/uuidP.h index 86a5e266f..78183ded7 100644 --- a/libuuid/src/uuidP.h +++ b/libuuid/src/uuidP.h @@ -45,6 +45,35 @@ #define TIME_OFFSET_HIGH 0x01B21DD2 #define TIME_OFFSET_LOW 0x13814000 +/* + * Note that RFC4122 defines UUID in more details: + * + * Field Data Type Octet Note + * ------------------------------------------------- + * time_low unsigned 32 0-3 The low field of the + * bit integer timestamp + * + * time_mid unsigned 16 4-5 The middle field of the + * bit integer timestamp + * + * time_hi_and_version unsigned 16 6-7 The high field of the + * bit integer timestamp multiplexed + * with the version number + * + * clock_seq_hi_and_rese unsigned 8 8 The high field of the + * rved bit integer clock sequence + * multiplexed with the + * variant + * + * clock_seq_low unsigned 8 9 The low field of the + * bit integer clock sequence + * + * node unsigned 48 10-15 The spatially unique + * bit integer node identifier + * + * We have clock_seq_hi_and_reserved (8bit) and clock_seq_low (8bit) + * merged into clock_seq (16bit). + */ struct uuid { uint32_t time_low; uint16_t time_mid; -- cgit v1.2.3-55-g7522