Lines Matching refs: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 *);
104 uuid_create(struct uuid *uuid) in uuid_create() argument
171 format_uuid(uuid, data->state.clock, timestamp, system_node); in uuid_create()
205 format_uuid(struct uuid *uuid, uint16_t clock_seq, in format_uuid() argument
212 uuid->time_low = (uint32_t)(timestamp & 0xFFFFFFFF); in format_uuid()
213 uuid->time_mid = (uint16_t)((timestamp >> 32) & 0xFFFF); in format_uuid()
214 uuid->time_hi_and_version = (uint16_t)((timestamp >> 48) & 0x0FFF); in format_uuid()
219 uuid->time_hi_and_version |= (1 << 12); in format_uuid()
224 uuid->clock_seq_low = clock_seq & 0xFF; in format_uuid()
229 uuid->clock_seq_hi_and_reserved = (clock_seq & 0x3F00) >> 8; in format_uuid()
235 uuid->clock_seq_hi_and_reserved |= 0x80; in format_uuid()
240 (void) memcpy(&uuid->node_addr, &node, sizeof (uuid->node_addr)); in format_uuid()
303 uuid_print(struct uuid u) in uuid_print()
319 struct_to_string(uuid_t ptr, struct uuid *uu) in struct_to_string()
356 string_to_struct(struct uuid *uuid, uuid_t in) in string_to_struct() argument
367 uuid->time_low = tmp; in string_to_struct()
371 uuid->time_mid = tmp; in string_to_struct()
375 uuid->time_hi_and_version = tmp; in string_to_struct()
378 uuid->clock_seq_hi_and_reserved = tmp; in string_to_struct()
381 uuid->clock_seq_low = tmp; in string_to_struct()
383 (void) memcpy(uuid->node_addr, ptr, 6); in string_to_struct()
393 struct uuid uuid; in uuid_generate_random() local
399 (void) memset(&uuid, 0, sizeof (struct uuid)); in uuid_generate_random()
402 string_to_struct(&uuid, uu); in uuid_generate_random()
407 uuid.time_hi_and_version &= 0xfff; in uuid_generate_random()
408 uuid.time_hi_and_version |= (1 << 14); in uuid_generate_random()
414 uuid.clock_seq_hi_and_reserved &= 0x3f; in uuid_generate_random()
415 uuid.clock_seq_hi_and_reserved |= 0x80; in uuid_generate_random()
417 struct_to_string(uu, &uuid); in uuid_generate_random()
426 struct uuid uuid; in uuid_generate_time() local
431 if (uuid_create(&uuid) < 0) { in uuid_generate_time()
436 struct_to_string(uu, &uuid); in uuid_generate_time()
475 struct uuid uuid; in uuid_unparse_common() local
485 string_to_struct(&uuid, uu); in uuid_unparse_common()
486 clock_seq = uuid.clock_seq_hi_and_reserved; in uuid_unparse_common()
487 clock_seq = (clock_seq << 8) | uuid.clock_seq_low; in uuid_unparse_common()
490 uuid.node_addr[i]); in uuid_unparse_common()
497 uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, clock_seq); in uuid_unparse_common()
557 struct uuid uuid; in uuid_parse() local
578 uuid.time_low = strtoul(in, NULL, 16); in uuid_parse()
579 uuid.time_mid = strtoul(in+9, NULL, 16); in uuid_parse()
580 uuid.time_hi_and_version = strtoul(in+14, NULL, 16); in uuid_parse()
582 uuid.clock_seq_hi_and_reserved = (clock_seq & 0xFF00) >> 8; in uuid_parse()
583 uuid.clock_seq_low = (clock_seq & 0xFF); in uuid_parse()
590 uuid.node_addr[i] = strtoul(buf, NULL, 16); in uuid_parse()
592 struct_to_string(uu, &uuid); in uuid_parse()
607 struct uuid uuid; in uuid_time() local
614 string_to_struct(&uuid, uu); in uuid_time()
615 tmp = (uuid.time_hi_and_version & 0xF000) >> 12; in uuid_time()
616 clk = uuid.clock_seq_hi_and_reserved; in uuid_time()
622 high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16); in uuid_time()
623 clock_reg = uuid.time_low | ((u_longlong_t)high << 32); in uuid_time()