2 * Copyright (C) 2014 Samsung Electronics
3 * Przemyslaw Marczak <p.marczak@samsung.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 /* This is structure is in big-endian */
12 unsigned int time_low;
13 unsigned short time_mid;
14 unsigned short time_hi_and_version;
15 unsigned char clock_seq_hi_and_reserved;
16 unsigned char clock_seq_low;
17 unsigned char node[6];
25 #define UUID_STR_LEN 36
26 #define UUID_BIN_LEN sizeof(struct uuid)
28 #define UUID_VERSION_MASK 0xf000
29 #define UUID_VERSION_SHIFT 12
30 #define UUID_VERSION 0x4
32 #define UUID_VARIANT_MASK 0xc0
33 #define UUID_VARIANT_SHIFT 7
34 #define UUID_VARIANT 0x1
36 int uuid_str_valid(const char *uuid);
37 int uuid_str_to_bin(char *uuid_str, unsigned char *uuid_bin, int str_format);
38 void uuid_bin_to_str(unsigned char *uuid_bin, char *uuid_str, int str_format);
39 #ifdef CONFIG_PARTITION_TYPE_GUID
40 int uuid_guid_get_bin(const char *guid_str, unsigned char *guid_bin);
41 int uuid_guid_get_str(unsigned char *guid_bin, char *guid_str);
43 void gen_rand_uuid(unsigned char *uuid_bin);
44 void gen_rand_uuid_str(char *uuid_str, int str_format);