39#define UUID_NODE_LEN (6U)
41#define UUID_STR_LEN (36U)
57#define UUID_VERSION_MASK (0xF000)
64typedef struct __attribute__((packed)) {
127 return (time_hi_vers & 0xF000) >> 12;
140 return (memcmp(uuid1, uuid2,
sizeof(
uuid_t)) == 0);
Functions to work with different byte orders.
static uint16_t byteorder_ntohs(network_uint16_t v)
Convert from network byte order to host byte order, 16 bit.
void uuid_v3(uuid_t *uuid, const uuid_t *ns, const uint8_t *name, size_t len)
Generate a version 3(md5 based) UUID from a namespace and a byte array.
#define UUID_NODE_LEN
Size of the node identifier in bytes.
const uuid_t uuid_namespace_url
URL namespace UUID.
static unsigned uuid_version(const uuid_t *uuid)
Retrieve the type number of a UUID.
void uuid_to_string(const uuid_t *uuid, char *str)
Generate an UUID string from an UUID structure.
const uuid_t uuid_namespace_iso
ISO OID namespace UUID.
static bool uuid_equal(const uuid_t *uuid1, const uuid_t *uuid2)
Compare two UUID's.
const uuid_t uuid_namespace_dns
DNS namespace UUID.
int uuid_from_string(uuid_t *uuid, const char *str)
Populate an UUID structure from an UUID string.
const uuid_t uuid_namespace_x500
X.500 DN namespace UUID.
void uuid_v5(uuid_t *uuid, const uuid_t *ns, const uint8_t *name, size_t len)
Generate a version 5(sha1 based) UUID from a namespace and a byte array.
void uuid_v4(uuid_t *uuid)
Generate a version 4(Full random) UUID.
network_uint16_t time_mid
The middle field of the timestamp
network_uint16_t time_hi
The high field of the timestamp multiplexed with the version number.
uint8_t clk_seq_hi_res
The high field of the clock sequence Multiplexed with the variant
network_uint32_t time_low
The low field of the timestamp
uint8_t clk_seq_low
The low field of the clock sequence
A 16 bit integer in big endian aka network byte order.
A 32 bit integer in big endian aka network byte order.