Lines Matching defs:uuid
85 void struct_to_string(uuid_t, struct uuid *);
86 void string_to_struct(struct uuid *, uuid_t);
93 static void format_uuid(struct uuid *, uint16_t, uuid_time_t,
95 static int uuid_create(struct uuid *);
100 * Generates a uuid based on version 1 format.
104 uuid_create(struct uuid *uuid)
171 format_uuid(uuid, data->state.clock, timestamp, system_node);
202 * Fills in passed-in pointer with the resulting uuid.
205 format_uuid(struct uuid *uuid, uint16_t clock_seq,
212 uuid->time_low = (uint32_t)(timestamp & 0xFFFFFFFF);
213 uuid->time_mid = (uint16_t)((timestamp >> 32) & 0xFFFF);
214 uuid->time_hi_and_version = (uint16_t)((timestamp >> 48) & 0x0FFF);
219 uuid->time_hi_and_version |= (1 << 12);
224 uuid->clock_seq_low = clock_seq & 0xFF;
229 uuid->clock_seq_hi_and_reserved = (clock_seq & 0x3F00) >> 8;
235 uuid->clock_seq_hi_and_reserved |= 0x80;
240 (void) memcpy(&uuid->node_addr, &node, sizeof (uuid->node_addr));
300 * Prints a nicely-formatted uuid to stdout.
303 uuid_print(struct uuid u)
316 * Unpacks the structure members in "struct uuid" to a char string "uuid_t".
319 struct_to_string(uuid_t ptr, struct uuid *uu)
353 * Packs the values in the "uuid_t" string into "struct uuid".
356 string_to_struct(struct uuid *uuid, uuid_t in)
367 uuid->time_low = tmp;
371 uuid->time_mid = tmp;
375 uuid->time_hi_and_version = tmp;
378 uuid->clock_seq_hi_and_reserved = tmp;
381 uuid->clock_seq_low = tmp;
383 (void) memcpy(uuid->node_addr, ptr, 6);
393 struct uuid uuid;
399 (void) memset(&uuid, 0, sizeof (struct uuid));
402 string_to_struct(&uuid, uu);
406 uuid.time_hi_and_version |= (1 << 14);
410 uuid.time_hi_and_version &= VER1_MASK;
416 uuid.clock_seq_hi_and_reserved |= 0x80;
422 uuid.node_addr[0] |= 0x80;
423 struct_to_string(uu, &uuid);
432 struct uuid uuid;
437 if (uuid_create(&uuid) < 0) {
442 struct_to_string(uu, &uuid);
446 * Creates a new UUID. The uuid will be generated based on high-quality
465 * Sets the value of the supplied uuid variable uu, to the NULL value.
481 struct uuid uuid;
491 string_to_struct(&uuid, uu);
492 clock_seq = uuid.clock_seq_hi_and_reserved;
493 clock_seq = (clock_seq << 8) | uuid.clock_seq_low;
496 uuid.node_addr[i]);
503 uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, clock_seq);
543 /* uu is NULL uuid */
563 struct uuid uuid;
584 uuid.time_low = strtoul(in, NULL, 16);
585 uuid.time_mid = strtoul(in+9, NULL, 16);
586 uuid.time_hi_and_version = strtoul(in+14, NULL, 16);
588 uuid.clock_seq_hi_and_reserved = (clock_seq & 0xFF00) >> 8;
589 uuid.clock_seq_low = (clock_seq & 0xFF);
596 uuid.node_addr[i] = strtoul(buf, NULL, 16);
598 struct_to_string(uu, &uuid);
613 struct uuid uuid;
620 string_to_struct(&uuid, uu);
621 tmp = (uuid.time_hi_and_version & 0xF000) >> 12;
622 clk = uuid.clock_seq_hi_and_reserved;
628 high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16);
629 clock_reg = uuid.time_low | ((u_longlong_t)high << 32);