pub struct CompressionTransformHeader {
pub original_compressed_segment_size: u32,
pub compression_algorithm: u16,
pub flags: u16,
pub offset_or_length: u32,
}Expand description
SMB2 COMPRESSION_TRANSFORM_HEADER (MS-SMB2 section 2.2.42).
A compression wrapper that precedes a compressed SMB2 message. This implements the unchained variant (Flags = 0) only. The total header is 16 bytes:
- ProtocolId (4 bytes, must be 0xFC ‘S’ ‘M’ ‘B’)
- OriginalCompressedSegmentSize (4 bytes)
- CompressionAlgorithm (2 bytes)
- Flags (2 bytes)
- Offset (4 bytes) – offset from the end of this header to the start of compressed data
Note: The chained variant (Flags = SMB2_COMPRESSION_FLAG_CHAINED) interprets the last 4 bytes as Length instead of Offset. Chained compression is deferred to a future implementation.
Fields§
§original_compressed_segment_size: u32Size of the original uncompressed data segment.
compression_algorithm: u16The compression algorithm used.
flags: u16Compression flags. Currently only unchained (0x0000) is supported.
offset_or_length: u32For unchained: offset from end of this header to the start of compressed data. For chained: length of the original uncompressed segment (chained is not yet implemented).
Implementations§
Trait Implementations§
Source§impl Clone for CompressionTransformHeader
impl Clone for CompressionTransformHeader
Source§fn clone(&self) -> CompressionTransformHeader
fn clone(&self) -> CompressionTransformHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompressionTransformHeader
impl Debug for CompressionTransformHeader
impl Eq for CompressionTransformHeader
Source§impl Pack for CompressionTransformHeader
impl Pack for CompressionTransformHeader
Source§fn pack(&self, cursor: &mut WriteCursor)
fn pack(&self, cursor: &mut WriteCursor)
Write this value into the cursor.
Source§impl PartialEq for CompressionTransformHeader
impl PartialEq for CompressionTransformHeader
Source§fn eq(&self, other: &CompressionTransformHeader) -> bool
fn eq(&self, other: &CompressionTransformHeader) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CompressionTransformHeader
Source§impl Unpack for CompressionTransformHeader
impl Unpack for CompressionTransformHeader
Source§fn unpack(cursor: &mut ReadCursor<'_>) -> Result<Self>
fn unpack(cursor: &mut ReadCursor<'_>) -> Result<Self>
Read a value from the cursor, advancing its position.
Auto Trait Implementations§
impl Freeze for CompressionTransformHeader
impl RefUnwindSafe for CompressionTransformHeader
impl Send for CompressionTransformHeader
impl Sync for CompressionTransformHeader
impl Unpin for CompressionTransformHeader
impl UnsafeUnpin for CompressionTransformHeader
impl UnwindSafe for CompressionTransformHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more