leodos_protocols/transport/cfdp/class2/machine/mod.rs
1//! The synchronous, core CFDP state machine.
2//!
3//! This module contains the pure, platform-agnostic logic for the CFDP protocol.
4//! It operates by receiving `Event`s and producing `Action`s, without performing
5//! any I/O itself.
6
7pub use self::receiver::ReceiverMachine;
8pub use self::sender::SenderMachine;
9pub use self::transaction::TransactionId;
10
11pub mod receiver;
12pub mod sender;
13pub mod tracker;
14pub mod transaction;
15
16/// The maximum number of actions that can be generated from a single event.
17pub const MAX_ACTIONS_PER_EVENT: usize = 8;
18/// The maximum number of concurrent transactions supported.
19pub const MAX_CONCURRENT_TRANSACTIONS: usize = 8;
20/// The maximum size of a file data chunk to send in one PDU.
21pub const FILE_DATA_CHUNK_SIZE: usize = 2048;
22
23/// The specific type of timer to be managed.
24#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
25pub enum TimerType {
26 /// Timer for awaiting an acknowledgment PDU.
27 Ack,
28 /// Timer for awaiting missing data after a NAK.
29 Nak,
30 /// Timer for detecting transaction inactivity.
31 Inactivity,
32 /// Timer for periodic keep-alive transmissions.
33 KeepAlive,
34}
35
36/// The type of prompt to request from a remote entity.
37#[derive(Debug)]
38pub enum PromptType {
39 /// Prompt the receiver to send a NAK.
40 Nak,
41 /// Prompt the receiver to send a Keep Alive.
42 KeepAlive,
43}