blob: 97a9dd84048b97e2cb50fc4fede84480323003b3 [file] [log] [blame]
Theodore Ts'o1e3472c1997-04-29 14:53:37 +00001/*
2 * Internal routine for unpacking UUID
Theodore Ts'o19c78dc1997-04-29 16:17:09 +00003 *
4 * Copyright (C) 1996, 1997 Theodore Ts'o.
5 *
6 * %Begin-Header%
7 * This file may be redistributed under the terms of the GNU Public
8 * License.
9 * %End-Header%
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000010 */
11
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000012#include <string.h>
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000013#include "uuidP.h"
14
15void uuid_unpack(uuid_t in, struct uuid *uu)
16{
17 __u8 *ptr = in;
18 __u32 tmp;
19
20 tmp = *ptr++;
21 tmp = (tmp << 8) | *ptr++;
22 tmp = (tmp << 8) | *ptr++;
23 tmp = (tmp << 8) | *ptr++;
24 uu->time_low = tmp;
25
26 tmp = *ptr++;
27 tmp = (tmp << 8) | *ptr++;
28 uu->time_mid = tmp;
29
30 tmp = *ptr++;
31 tmp = (tmp << 8) | *ptr++;
32 uu->time_hi_and_version = tmp;
33
34 tmp = *ptr++;
35 tmp = (tmp << 8) | *ptr++;
36 uu->clock_seq = tmp;
37
38 memcpy(uu->node, ptr, 6);
39}
40