2
* Copyright (C) 2006-2010 Citrix Systems Inc.
3
* Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU Lesser General Public License as published
7
* by the Free Software Foundation; version 2.1 only. with the special
8
* exception on linking described in file LICENSE.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Lesser General Public License for more details.
16
Probably need to refactor this; UUIDs are used in two places:
17
+ to uniquely name things across the cluster
18
+ as secure session IDs
20
There is the additional constraint that current Xen tools use
21
a particular format of UUID (the 16 byte variety generated by fresh ())
23
Also, cookies aren't UUIDs and should be put somewhere else.
26
(** A 128-bit UUID. Using phantom types ('a) to achieve the requires type-safety. *)
29
(** Create a fresh UUID *)
30
val make_uuid : unit -> 'a t
31
val make_uuid_prng : unit -> 'a t
32
val make_uuid_urnd : unit -> 'a t
33
val make_uuid_rnd : unit -> 'a t
35
(** Create a UUID from a string. *)
36
val of_string : string -> 'a t
38
(** Marshal a UUID to a string. *)
39
val to_string : 'a t -> string
41
(** A null UUID, as if such a thing actually existed. It turns out to be
45
(** Deprecated alias for {! Uuid.of_string} *)
46
val uuid_of_string : string -> 'a t
48
(** Deprecated alias for {! Uuid.to_string} *)
49
val string_of_uuid : 'a t -> string
51
(** Convert an array to a UUID. *)
52
val uuid_of_int_array : int array -> 'a t
54
(** Convert a UUID to an array. *)
55
val int_array_of_uuid : 'a t -> int array
57
(** Check whether a string is a UUID. *)
58
val is_uuid : string -> bool
60
(** A 512-bit cookie. *)
63
val make_cookie : unit -> cookie
65
val cookie_of_string : string -> cookie
67
val string_of_cookie : cookie -> string