CCSDS Frame Security Report (FSR)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

C 46.3%
OCaml 43.4%
PHP 2.3%
Roff 1.4%
Shell 1.2%
Dune 1.0%
Other 4.3%
33 1 0

Clone this repository

https://tangled.org/gazagnaire.org/ocaml-fsr https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-fsr
git@git.recoil.org:gazagnaire.org/ocaml-fsr git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-fsr

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

fsr#

CCSDS Frame Security Report (FSR) for OCaml.

The Frame Security Report is a 32-bit status word transmitted from the recipient to the initiator of a SDLS-secured space link. It reports per-frame acceptance status and security events: bad sequence number, bad MAC, bad security association. Specified in CCSDS 355.1-B-1 §4.2.

Installation#

Install with opam:

$ opam install fsr

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install fsr

Usage#

Encode a clean report, then round-trip through the 32-bit wire format:

# let fsr =
    Fsr.v ~alarm:false ~bad_sn:false ~bad_mac:false ~bad_sa:false
          ~spi:0x0042 ~arsn_lsb:0x7b in
  let word = Fsr.encode fsr in
  Result.map (fun r -> (r.Fsr.spi, r.Fsr.arsn_lsb)) (Fsr.decode word)
- : (int * int, [ `Invalid_version of int | `Not_fsr ]) result = Ok (66, 123)

update drops in the per-frame flags and auto-raises the persistent alarm if any of them is true:

# let fsr =
    Fsr.initial
    |> Fsr.update ~bad_mac:true ~spi:0x0042 ~arsn_lsb:0x01 in
  (Fsr.has_error fsr, fsr.alarm)
- : bool * bool = (true, true)

decode rejects non-FSR words — a Control Word Type of 0 indicates a CLCW, not an FSR:

# Fsr.decode 0l
- : (Fsr.t, [ `Invalid_version of int | `Not_fsr ]) result = Error `Not_fsr

Licence#

ISC