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.

irmin: expose Schema GADT, remove all Obj.magic from codecs

+14 -31
+14 -31
lib/cfdp.ml
··· 586 586 let w_eid_len_m1 = Wire.Field.v "eid_len_m1" (bits32 3) 587 587 let w_segment_metadata = Wire.Field.v "segment_metadata" bool32 588 588 let w_seq_len_m1 = Wire.Field.v "seq_len_m1" (bits32 3) 589 - 590 - let w_source_entity = 591 - Wire.Field.v "source_entity" 592 - (Wire.byte_array ~size:Wire.Expr.(Wire.Field.ref w_eid_len_m1 + Wire.int 1)) 593 - 594 - let w_transaction_seq = 595 - Wire.Field.v "transaction_seq" 596 - (Wire.byte_array ~size:Wire.Expr.(Wire.Field.ref w_seq_len_m1 + Wire.int 1)) 597 - 598 - let w_dest_entity = 599 - Wire.Field.v "dest_entity" 600 - (Wire.byte_array ~size:Wire.Expr.(Wire.Field.ref w_eid_len_m1 + Wire.int 1)) 589 + let eid_size = Wire.Expr.(Wire.Field.ref w_eid_len_m1 + Wire.int 1) 590 + let seq_size = Wire.Expr.(Wire.Field.ref w_seq_len_m1 + Wire.int 1) 591 + let w_source_entity = Wire.Field.v "source_entity" (Wire.uint eid_size) 592 + let w_transaction_seq = Wire.Field.v "transaction_seq" (Wire.uint seq_size) 593 + let w_dest_entity = Wire.Field.v "dest_entity" (Wire.uint eid_size) 601 594 602 595 type packed_header = { 603 596 pf_version : int; ··· 611 604 pf_eid_len_m1 : int; 612 605 pf_segment_metadata : bool; 613 606 pf_seq_len_m1 : int; 614 - pf_source_entity : string; 615 - pf_transaction_seq : string; 616 - pf_dest_entity : string; 607 + pf_source_entity : int; 608 + pf_transaction_seq : int; 609 + pf_dest_entity : int; 617 610 } 618 611 (** Internal record matching the full header layout. *) 619 612 ··· 678 671 pf_eid_len_m1 = eid_len - 1; 679 672 pf_segment_metadata = hdr.segment_metadata; 680 673 pf_seq_len_m1 = seq_len - 1; 681 - pf_source_entity = int64_to_be_bytes eid_len hdr.source_entity; 682 - pf_transaction_seq = int64_to_be_bytes seq_len hdr.transaction_seq; 683 - pf_dest_entity = int64_to_be_bytes eid_len hdr.dest_entity; 674 + pf_source_entity = Int64.to_int hdr.source_entity; 675 + pf_transaction_seq = Int64.to_int hdr.transaction_seq; 676 + pf_dest_entity = Int64.to_int hdr.dest_entity; 684 677 } 685 678 686 679 (* {1 Wire Codecs for File Directive PDUs} ··· 1164 1157 if pf.pf_version <> 1 then Error (Invalid_version pf.pf_version) 1165 1158 else 1166 1159 let config = { entity_id_len = eid_len; seq_nr_len = seq_len } in 1167 - let source_raw = be_bytes_to_int64 pf.pf_source_entity in 1168 - let* source_entity = 1169 - match Entity_id.of_int64_unsigned source_raw with 1170 - | `Ok eid -> Ok eid 1171 - | `Overflow -> Error Entity_id_overflow 1172 - in 1173 - let transaction_seq = be_bytes_to_int64 pf.pf_transaction_seq in 1174 - let dest_raw = be_bytes_to_int64 pf.pf_dest_entity in 1175 - let* dest_entity = 1176 - match Entity_id.of_int64_unsigned dest_raw with 1177 - | `Ok eid -> Ok eid 1178 - | `Overflow -> Error Entity_id_overflow 1179 - in 1160 + let source_entity = Int64.of_int pf.pf_source_entity in 1161 + let transaction_seq = Int64.of_int pf.pf_transaction_seq in 1162 + let dest_entity = Int64.of_int pf.pf_dest_entity in 1180 1163 let header = 1181 1164 header ~version:pf.pf_version ~pdu_type_bit:pf.pf_pdu_type 1182 1165 ~direction_bit:pf.pf_direction ~mode_bit:pf.pf_mode