summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2018-10-21 01:05:33 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2018-10-28 23:07:08 +0100
commit694afd97792c870619b8cfb3db480a502fe408e0 (patch)
treed59adaf9da3c4a19deda9988a5cccd8105f5c221
parent563a444ea9f19ec55b53e82f17f5b97357e56691 (diff)
downloadocaml-sid-694afd97792c870619b8cfb3db480a502fe408e0.tar.gz
sid: add interface definition
-rw-r--r--sid.mli44
1 files changed, 44 insertions, 0 deletions
diff --git a/sid.mli b/sid.mli
new file mode 100644
index 0000000..d387aa0
--- /dev/null
+++ b/sid.mli
@@ -0,0 +1,44 @@
+type t
+type sub_auths = Stdint.Uint32.t array
+val sub_auth_max : int
+val create_unsafe : Stdint.Uint32.t array -> Stdint.Uint64.t -> t
+val create : ?sa:Stdint.Uint32.t array -> Stdint.Uint64.t -> t
+val equal_sub_auths : Stdint.Uint32.t array -> Stdint.Uint32.t array -> bool
+val equal : t -> t -> bool
+
+module StringFmt :
+ sig
+ val decode : string -> t
+ val from_string_res : string -> (t, string) result
+ val from_string_opt : string -> t option
+ val encode : t -> string
+ end
+
+module PacketRep :
+ sig
+ val encode : t -> bytes
+ end
+
+module WellKnown :
+ sig
+ val null : t
+ val everyone : t
+ val world : t
+ val local : t
+ val creator_owner_id : t
+ val creator_group_id : t
+ val elite : t
+
+ module Prefix :
+ sig
+ val security_null_sid_authority : ?sa:sub_auths -> unit -> t
+ val security_world_sid_authority : ?sa:sub_auths -> unit -> t
+ val security_local_sid_authority : ?sa:sub_auths -> unit -> t
+ val security_creator_sid_authority : ?sa:sub_auths -> unit -> t
+ val security_nt_authority : ?sa:sub_auths -> unit -> t
+ end
+ end
+
+val of_string : string -> t
+val to_string : t -> string
+