Commit | Line | Data |
---|---|---|
a864fb02 MD |
1 | #ifndef _LTT_WRAPPER_UUID_H |
2 | #define _LTT_WRAPPER_UUID_H | |
3 | ||
4 | /* | |
5 | * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com) | |
6 | * | |
7 | * Dual LGPL v2.1/GPL v2 license. | |
8 | */ | |
9 | ||
10 | #include <linux/version.h> | |
11 | ||
12 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) | |
13 | #include <linux/uuid.h> | |
14 | #else | |
15 | ||
16 | #include <linux/random.h> | |
17 | ||
18 | typedef struct { | |
19 | __u8 b[16]; | |
20 | } uuid_le; | |
21 | ||
22 | static inline | |
23 | void uuid_le_gen(uuid_le *u) | |
24 | { | |
c40673b8 | 25 | generate_random_uuid(u->b); |
a864fb02 MD |
26 | } |
27 | ||
28 | #endif | |
29 | #endif /* _LTT_WRAPPER_UUID_H */ |