SpaceOS wire protocol codecs for host-guest communication
at main 44 lines 982 B view raw
1(** Data Product notification payload codec (80 bytes fixed). 2 3 {v 4 0x00 uint32 block_offset 5 0x04 uint32 block_count 6 0x08 uint16 dp_class 7 0x0A uint8 priority 8 0x0B uint8 name_len 9 0x0C bytes name (64 bytes, null-padded) 10 0x4C uint32 crc32 11 v} *) 12 13type t = { 14 block_offset : int; 15 block_count : int; 16 dp_class : int; 17 priority : int; 18 name_len : int; 19 name : string; 20 crc32 : int; 21} 22 23val codec : t Wire.Codec.t 24(** Wire codec for the 80-byte DP notification payload. *) 25 26val v : 27 block_offset:int -> 28 block_count:int -> 29 dp_class:int -> 30 priority:int -> 31 name:string -> 32 crc32:int -> 33 t 34(** [v ~block_offset ~block_count ~dp_class ~priority ~name ~crc32] builds a 35 data product notification. *) 36 37val name_string : t -> string 38(** [name_string t] returns the name with trailing nulls stripped. *) 39 40val pp : t Fmt.t 41(** Pretty-print a data product notification. *) 42 43val equal : t -> t -> bool 44(** Structural equality. *)