Lines Matching refs:uuid
39 #include <sys/uuid.h>
47 CTASSERT(sizeof(struct uuid) == 16);
50 uuid_generate(struct uuid *uuid)
54 cprng_fast(uuid, sizeof(*uuid));
57 uuid->time_hi_and_version &= ~(uint32_t)0xf000;
58 uuid->time_hi_and_version |= 0x4000;
61 uuid->clock_seq_hi_and_reserved &= ~(uint8_t)0x40;
62 uuid->clock_seq_hi_and_reserved |= 0x80;
68 struct uuid *store, tmp;
94 uuidgen(struct uuid *store, int count)
103 uuid_snprintf(char *buf, size_t sz, const struct uuid *uuid)
108 uuid->time_low, uuid->time_mid, uuid->time_hi_and_version,
109 uuid->clock_seq_hi_and_reserved, uuid->clock_seq_low,
110 uuid->node[0], uuid->node[1], uuid->node[2], uuid->node[3],
111 uuid->node[4], uuid->node[5]);
115 uuid_printf(const struct uuid *uuid)
119 (void) uuid_snprintf(buf, sizeof(buf), uuid);
125 * Encode/Decode UUID into octet-stream.
142 uuid_enc_le(void *buf, const struct uuid *uuid)
147 le32enc(p, uuid->time_low);
148 le16enc(p + 4, uuid->time_mid);
149 le16enc(p + 6, uuid->time_hi_and_version);
150 p[8] = uuid->clock_seq_hi_and_reserved;
151 p[9] = uuid->clock_seq_low;
153 p[10 + i] = uuid->node[i];
157 uuid_dec_le(void const *buf, struct uuid *uuid)
162 uuid->time_low = le32dec(p);
163 uuid->time_mid = le16dec(p + 4);
164 uuid->time_hi_and_version = le16dec(p + 6);
165 uuid->clock_seq_hi_and_reserved = p[8];
166 uuid->clock_seq_low = p[9];
168 uuid->node[i] = p[10 + i];
172 uuid_enc_be(void *buf, const struct uuid *uuid)
177 be32enc(p, uuid->time_low);
178 be16enc(p + 4, uuid->time_mid);
179 be16enc(p + 6, uuid->time_hi_and_version);
180 p[8] = uuid->clock_seq_hi_and_reserved;
181 p[9] = uuid->clock_seq_low;
183 p[10 + i] = uuid->node[i];
187 uuid_dec_be(void const *buf, struct uuid *uuid)
192 uuid->time_low = be32dec(p);
193 uuid->time_mid = be16dec(p + 4);
194 uuid->time_hi_and_version = be16dec(p + 6);
195 uuid->clock_seq_hi_and_reserved = p[8];
196 uuid->clock_seq_low = p[9];
198 uuid->node[i] = p[10 + i];