]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - libuuid/src/uuidP.h
libuuid: add header file guard [lgtm scan]
[thirdparty/util-linux.git] / libuuid / src / uuidP.h
index 86a5e266f00ed28ce433f4c893438189daa43a7d..200702c1e5281254a8f4e2bf10960ebc57ba6e5b 100644 (file)
@@ -31,6 +31,8 @@
  * DAMAGE.
  * %End-Header%
  */
+#ifndef _UUID_UUID_PRIVATE_H
+#define _UUID_UUID_PRIVATE_H
 
 #include <inttypes.h>
 #include <sys/types.h>
 #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;
@@ -59,3 +90,5 @@ struct uuid {
  */
 void uuid_pack(const struct uuid *uu, uuid_t ptr);
 void uuid_unpack(const uuid_t in, struct uuid *uu);
+
+#endif /* _UUID_UUID_PRIVATE_H */