From: Karel Zak Date: Fri, 31 Aug 2018 08:08:46 +0000 (+0200) Subject: libuuid: add note about RFC4122 UUID layout X-Git-Tag: v2.33-rc1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a312758eeee7c3dc3edcece0d60b68daac8ff3b;p=thirdparty%2Futil-linux.git libuuid: add note about RFC4122 UUID layout Signed-off-by: Karel Zak --- diff --git a/libuuid/src/uuidP.h b/libuuid/src/uuidP.h index 86a5e266f0..78183ded75 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;