Lines Matching refs:uuid

83 void			struct_to_string(uuid_t, struct uuid *);
84 void string_to_struct(struct uuid *, uuid_t);
91 static void format_uuid(struct uuid *, uint16_t, uuid_time_t,
94 static int uuid_create(struct uuid *);
99 * Generates a uuid based on version 1 format.
103 uuid_create(struct uuid *uuid)
175 format_uuid(uuid, data->state.clock, timestamp, system_node);
206 * Fills in passed-in pointer with the resulting uuid.
209 format_uuid(struct uuid *uuid, uint16_t clock_seq,
216 uuid->time_low = (uint32_t)(timestamp & 0xFFFFFFFF);
217 uuid->time_mid = (uint16_t)((timestamp >> 32) & 0xFFFF);
218 uuid->time_hi_and_version = (uint16_t)((timestamp >> 48) & 0x0FFF);
223 uuid->time_hi_and_version |= (1 << 12);
228 uuid->clock_seq_low = clock_seq & 0xFF;
233 uuid->clock_seq_hi_and_reserved = (clock_seq & 0x3F00) >> 8;
239 uuid->clock_seq_hi_and_reserved |= 0x80;
244 (void) memcpy(&uuid->node_addr, &node, sizeof (uuid->node_addr));
312 * Prints a nicely-formatted uuid to stdout.
315 uuid_print(struct uuid u)
368 * Unpacks the structure members in "struct uuid" to a char string "uuid_t".
371 struct_to_string(uuid_t ptr, struct uuid *uu)
405 * Packs the values in the "uuid_t" string into "struct uuid".
408 string_to_struct(struct uuid *uuid, uuid_t in)
419 uuid->time_low = tmp;
423 uuid->time_mid = tmp;
427 uuid->time_hi_and_version = tmp;
430 uuid->clock_seq_hi_and_reserved = tmp;
433 uuid->clock_seq_low = tmp;
435 (void) memcpy(uuid->node_addr, ptr, 6);
445 struct uuid uuid;
451 (void) memset(&uuid, 0, sizeof (struct uuid));
454 string_to_struct(&uuid, uu);
458 uuid.time_hi_and_version |= (1 << 14);
462 uuid.time_hi_and_version &= VER1_MASK;
468 uuid.clock_seq_hi_and_reserved |= 0x80;
474 uuid.node_addr[0] |= 0x80;
475 struct_to_string(uu, &uuid);
484 struct uuid uuid;
489 if (uuid_create(&uuid) < 0) {
494 struct_to_string(uu, &uuid);
498 * Creates a new UUID. The uuid will be generated based on high-quality
530 * Sets the value of the supplied uuid variable uu, to the NULL value.
546 struct uuid uuid;
562 string_to_struct(&uuid, uu);
563 clock_seq = uuid.clock_seq_hi_and_reserved;
564 clock_seq = (clock_seq << 8) | uuid.clock_seq_low;
566 (void) sprintf(&etheraddr[index++], "%.2x", uuid.node_addr[i]);
572 uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, clock_seq);
590 /* uu is NULL uuid */
610 struct uuid uuid;
631 uuid.time_low = strtoul(in, NULL, 16);
632 uuid.time_mid = strtoul(in+9, NULL, 16);
633 uuid.time_hi_and_version = strtoul(in+14, NULL, 16);
635 uuid.clock_seq_hi_and_reserved = (clock_seq & 0xFF00) >> 8;
636 uuid.clock_seq_low = (clock_seq & 0xFF);
643 uuid.node_addr[i] = strtoul(buf, NULL, 16);
645 struct_to_string(uu, &uuid);
660 struct uuid uuid;
667 string_to_struct(&uuid, uu);
668 tmp = (uuid.time_hi_and_version & 0xF000) >> 12;
669 clk = uuid.clock_seq_hi_and_reserved;
675 high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16);
676 clock_reg = uuid.time_low | ((u_longlong_t)high << 32);