Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / opr / uuid.h
CommitLineData
805e021f
CE
1/*
2 * Copyright (c) 2012 Your File System Inc. All rights reserved.
3 */
4
5#ifndef OPENAFS_OPR_UUID_H
6#define OPENAFS_OPR_UUID_H 1
7
8struct opr_uuid {
9 unsigned char data[16];
10};
11
12struct opr_uuid_unpacked {
13 afs_uint32 time_low;
14 unsigned short time_mid;
15 unsigned short time_hi_and_version;
16 char clock_seq_hi_and_reserved;
17 char clock_seq_low;
18 char node[6];
19};
20
21typedef struct opr_uuid opr_uuid_t;
22typedef opr_uuid_t opr_uuid; /* For XDR */
23
24extern void opr_uuid_create(opr_uuid_t *uuid);
25extern int opr_uuid_isNil(const opr_uuid_t *uuid);
26extern int opr_uuid_equal(const opr_uuid_t *uuid1, const opr_uuid_t *uuid2);
27extern unsigned int opr_uuid_hash(const opr_uuid_t *uuid);
28
29#if !defined(KERNEL)
30extern int opr_uuid_toString(const opr_uuid_t *uuid, char **string);
31extern void opr_uuid_freeString(char *string);
32extern int opr_uuid_fromString(opr_uuid_t *uuid, const char *string);
33#endif
34
35extern void opr_uuid_pack(opr_uuid_t *uuid, const struct opr_uuid_unpacked *raw);
36extern void opr_uuid_unpack(const opr_uuid_t *uuid, struct opr_uuid_unpacked *raw);
37
38#endif