Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Internal routine for unpacking UUID |
| 3 | */ |
| 4 | |
| 5 | #include "uuidP.h" |
| 6 | |
| 7 | void uuid_unpack(uuid_t in, struct uuid *uu) |
| 8 | { |
| 9 | __u8 *ptr = in; |
| 10 | __u32 tmp; |
| 11 | |
| 12 | tmp = *ptr++; |
| 13 | tmp = (tmp << 8) | *ptr++; |
| 14 | tmp = (tmp << 8) | *ptr++; |
| 15 | tmp = (tmp << 8) | *ptr++; |
| 16 | uu->time_low = tmp; |
| 17 | |
| 18 | tmp = *ptr++; |
| 19 | tmp = (tmp << 8) | *ptr++; |
| 20 | uu->time_mid = tmp; |
| 21 | |
| 22 | tmp = *ptr++; |
| 23 | tmp = (tmp << 8) | *ptr++; |
| 24 | uu->time_hi_and_version = tmp; |
| 25 | |
| 26 | tmp = *ptr++; |
| 27 | tmp = (tmp << 8) | *ptr++; |
| 28 | uu->clock_seq = tmp; |
| 29 | |
| 30 | memcpy(uu->node, ptr, 6); |
| 31 | } |
| 32 | |