CCSDS File Delivery Protocol (CCSDS 727.0-B-5) for space file transfer
0
fork

Configure Feed

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

chore: extract shared CRC to ocaml-crc and update dependencies

Replace inline CRC-16/32 implementations in aos, bundle, cfdp, pid1, tc,
tm, uslp with shared ocaml-crc dependency. Fix ocaml-crc test formatting.

+4 -21
+1
cfdp.opam
··· 12 12 "dune" {>= "3.21"} 13 13 "ocaml" {>= "5.1"} 14 14 "checkseum" {>= "0.5"} 15 + "crc" {>= "0.1"} 15 16 "fmt" {>= "0.9"} 16 17 "alcotest" {with-test & >= "1.7"} 17 18 "crowbar" {with-test & >= "0.2"}
+1
dune-project
··· 21 21 (depends 22 22 (ocaml (>= 5.1)) 23 23 (checkseum (>= 0.5)) 24 + (crc (>= 0.1)) 24 25 (fmt (>= 0.9)) 25 26 (alcotest (and :with-test (>= 1.7))) 26 27 (crowbar (and :with-test (>= 0.2)))))
+1 -20
lib/cfdp.ml
··· 79 79 Bytes.set buf (off + i) (Char.chr byte) 80 80 done 81 81 82 - (* CRC-16-CCITT table *) 83 - let crc16_table = 84 - let tbl = Array.make 256 0 in 85 - for i = 0 to 255 do 86 - let crc = ref (i lsl 8) in 87 - for _ = 0 to 7 do 88 - if !crc land 0x8000 <> 0 then crc := (!crc lsl 1) lxor 0x1021 89 - else crc := !crc lsl 1 90 - done; 91 - tbl.(i) <- !crc land 0xFFFF 92 - done; 93 - tbl 94 - 95 - let crc16_ccitt_sub buf off len = 96 - let crc = ref 0xFFFF in 97 - for i = off to off + len - 1 do 98 - let idx = (!crc lsr 8) lxor Char.code (Bytes.get buf i) land 0xFF in 99 - crc := (!crc lsl 8) lxor crc16_table.(idx) land 0xFFFF 100 - done; 101 - !crc 82 + let crc16_ccitt_sub = Crc.crc16_ccitt_bytes 102 83 103 84 (* {1 Duration} *) 104 85
+1 -1
lib/dune
··· 1 1 (library 2 2 (name cfdp) 3 3 (public_name cfdp) 4 - (libraries checkseum fmt)) 4 + (libraries checkseum crc fmt))