CFDP initial packet support #14
@ -2,12 +2,26 @@ use crate::cfdp::tlv::EntityIdTlv;
|
|||||||
use crate::cfdp::ConditionCode;
|
use crate::cfdp::ConditionCode;
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use crate::cfdp::pdu::PduHeader;
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub struct EofPdu {
|
pub struct EofPdu {
|
||||||
|
pdu_header: PduHeader,
|
||||||
condition_code: ConditionCode,
|
condition_code: ConditionCode,
|
||||||
file_checksum: u32,
|
file_checksum: u32,
|
||||||
file_size: u64,
|
file_size: u64,
|
||||||
fault_location: Option<EntityIdTlv>,
|
fault_location: Option<EntityIdTlv>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl EofPdu {
|
||||||
|
pub fn new_no_error(pdu_header: PduHeader, file_checksum: u32, file_size: u64) -> Self {
|
||||||
|
Self {
|
||||||
|
pdu_header,
|
||||||
|
condition_code: ConditionCode::NoError,
|
||||||
|
file_checksum,
|
||||||
|
file_size,
|
||||||
|
fault_location: None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user