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.

fix(lint): resolve E205, E331, E340 redundant prefixes and error patterns

Remove redundant function prefixes (get_, find_, make_, create_, bundle_)
across bpsec, btree, bundle, cbort, cfdp, cgr, claudeio, and dependent
packages. Replace Printf.sprintf with Fmt.failwith, add err_eio/err_msg
helpers in skills.ml.

+13 -13
+13 -13
lib/cfdp.ml
··· 26 26 27 27 (* {1 Binary Helpers} *) 28 28 29 - let get_u16_be buf off = (Char.code buf.[off] lsl 8) lor Char.code buf.[off + 1] 29 + let u16_be buf off = (Char.code buf.[off] lsl 8) lor Char.code buf.[off + 1] 30 30 31 - let get_u32_be buf off = 31 + let u32_be buf off = 32 32 (Char.code buf.[off] lsl 24) 33 33 lor (Char.code buf.[off + 1] lsl 16) 34 34 lor (Char.code buf.[off + 2] lsl 8) 35 35 lor Char.code buf.[off + 3] 36 36 37 - let get_u64_be buf off = 37 + let u64_be buf off = 38 38 let rec loop acc i = 39 39 if i >= 8 then acc 40 40 else ··· 43 43 in 44 44 loop 0L 0 45 45 46 - let get_var_uint_be buf off len = 46 + let var_uint_be buf off len = 47 47 let rec loop acc i = 48 48 if i >= len then acc 49 49 else ··· 841 841 let mode_bit = (b0 lsr 2) land 0x1 in 842 842 let crc_bit = (b0 lsr 1) land 0x1 in 843 843 let large_bit = b0 land 0x1 in 844 - let data_len = get_u16_be buf 1 in 844 + let data_len = u16_be buf 1 in 845 845 let b3 = Char.code buf.[3] in 846 846 let seg_ctrl_bit = (b3 lsr 7) land 0x1 in 847 847 let eid_len = ((b3 lsr 4) land 0x7) + 1 in ··· 851 851 let var_len = (2 * eid_len) + seq_len in 852 852 if len < 4 + var_len then truncated ~need:(4 + var_len) ~have:len 853 853 else 854 - let source_raw = get_var_uint_be buf 4 eid_len in 854 + let source_raw = var_uint_be buf 4 eid_len in 855 855 let* source_entity = 856 856 match Entity_id.of_int64_unsigned source_raw with 857 857 | `Ok eid -> Ok eid 858 858 | `Overflow -> Error Entity_id_overflow 859 859 in 860 - let transaction_seq = get_var_uint_be buf (4 + eid_len) seq_len in 861 - let dest_raw = get_var_uint_be buf (4 + eid_len + seq_len) eid_len in 860 + let transaction_seq = var_uint_be buf (4 + eid_len) seq_len in 861 + let dest_raw = var_uint_be buf (4 + eid_len + seq_len) eid_len in 862 862 let* dest_entity = 863 863 match Entity_id.of_int64_unsigned dest_raw with 864 864 | `Ok eid -> Ok eid ··· 885 885 Ok (header, config, 4 + var_len) 886 886 887 887 let decode_fss buf off ~large_file = 888 - if large_file then (get_u64_be buf off, 8) 889 - else (Int64.of_int32 (Int32.of_int (get_u32_be buf off)), 4) 888 + if large_file then (u64_be buf off, 8) 889 + else (Int64.of_int32 (Int32.of_int (u32_be buf off)), 4) 890 890 891 891 let decode_lv buf off = 892 892 let len = String.length buf in ··· 917 917 match condition_of_int cond_code with 918 918 | None -> Error (Invalid_condition_code cond_code) 919 919 | Some cond -> 920 - let cksum = Int32.of_int (get_u32_be buf (off + 2)) in 920 + let cksum = Int32.of_int (u32_be buf (off + 2)) in 921 921 let fsize, _ = decode_fss buf (off + 6) ~large_file in 922 922 let fss_end = off + 6 + fss_len in 923 923 (* Parse fault location TLV if present *) ··· 925 925 if len > fss_end - off && Char.code buf.[fss_end] = 0x06 then begin 926 926 let tlv_len = Char.code buf.[fss_end + 1] in 927 927 if tlv_len = 8 then 928 - let raw = get_u64_be buf (fss_end + 2) in 928 + let raw = u64_be buf (fss_end + 2) in 929 929 match Entity_id.of_int64_unsigned raw with 930 930 | `Ok eid -> (Some eid, fss_end + 2 + tlv_len - off) 931 931 | `Overflow -> (None, fss_end - off) ··· 1135 1135 (* Verify CRC if present *) 1136 1136 if header.crc_present then begin 1137 1137 let expected = crc16_ccitt_sub (Bytes.of_string buf) 0 total_len in 1138 - let actual = get_u16_be buf total_len in 1138 + let actual = u16_be buf total_len in 1139 1139 if expected <> actual then Error (Crc_mismatch { expected; actual }) 1140 1140 else 1141 1141 match header.pdu_type with