.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * UUID/GUID definition |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2010, 2016 Intel Corp. |
---|
5 | 6 | * Huang Ying <ying.huang@intel.com> |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or |
---|
8 | | - * modify it under the terms of the GNU General Public License version |
---|
9 | | - * 2 as published by the Free Software Foundation; |
---|
10 | | - * |
---|
11 | | - * This program is distributed in the hope that it will be useful, |
---|
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - * GNU General Public License for more details. |
---|
15 | 7 | */ |
---|
16 | 8 | #ifndef _LINUX_UUID_H_ |
---|
17 | 9 | #define _LINUX_UUID_H_ |
---|
.. | .. |
---|
51 | 43 | memcpy(dst, src, sizeof(guid_t)); |
---|
52 | 44 | } |
---|
53 | 45 | |
---|
| 46 | +static inline void import_guid(guid_t *dst, const __u8 *src) |
---|
| 47 | +{ |
---|
| 48 | + memcpy(dst, src, sizeof(guid_t)); |
---|
| 49 | +} |
---|
| 50 | + |
---|
| 51 | +static inline void export_guid(__u8 *dst, const guid_t *src) |
---|
| 52 | +{ |
---|
| 53 | + memcpy(dst, src, sizeof(guid_t)); |
---|
| 54 | +} |
---|
| 55 | + |
---|
54 | 56 | static inline bool guid_is_null(const guid_t *guid) |
---|
55 | 57 | { |
---|
56 | 58 | return guid_equal(guid, &guid_null); |
---|
.. | .. |
---|
66 | 68 | memcpy(dst, src, sizeof(uuid_t)); |
---|
67 | 69 | } |
---|
68 | 70 | |
---|
| 71 | +static inline void import_uuid(uuid_t *dst, const __u8 *src) |
---|
| 72 | +{ |
---|
| 73 | + memcpy(dst, src, sizeof(uuid_t)); |
---|
| 74 | +} |
---|
| 75 | + |
---|
| 76 | +static inline void export_uuid(__u8 *dst, const uuid_t *src) |
---|
| 77 | +{ |
---|
| 78 | + memcpy(dst, src, sizeof(uuid_t)); |
---|
| 79 | +} |
---|
| 80 | + |
---|
69 | 81 | static inline bool uuid_is_null(const uuid_t *uuid) |
---|
70 | 82 | { |
---|
71 | 83 | return uuid_equal(uuid, &uuid_null); |
---|
72 | 84 | } |
---|
73 | 85 | |
---|
74 | 86 | void generate_random_uuid(unsigned char uuid[16]); |
---|
| 87 | +void generate_random_guid(unsigned char guid[16]); |
---|
75 | 88 | |
---|
76 | 89 | extern void guid_gen(guid_t *u); |
---|
77 | 90 | extern void uuid_gen(uuid_t *u); |
---|
.. | .. |
---|
85 | 98 | int uuid_parse(const char *uuid, uuid_t *u); |
---|
86 | 99 | |
---|
87 | 100 | /* backwards compatibility, don't use in new code */ |
---|
88 | | -#define uuid_le_gen(u) guid_gen(u) |
---|
89 | | -#define uuid_le_to_bin(guid, u) guid_parse(guid, u) |
---|
90 | | - |
---|
91 | 101 | static inline int uuid_le_cmp(const guid_t u1, const guid_t u2) |
---|
92 | 102 | { |
---|
93 | 103 | return memcmp(&u1, &u2, sizeof(guid_t)); |
---|