]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libuuid: add note about RFC4122 UUID layout
authorKarel Zak <kzak@redhat.com>
Fri, 31 Aug 2018 08:08:46 +0000 (10:08 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 31 Aug 2018 08:08:46 +0000 (10:08 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libuuid/src/uuidP.h

index 86a5e266f00ed28ce433f4c893438189daa43a7d..78183ded75d5f07690aa2550cf7f162efb7c1445 100644 (file)
 #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;