pub struct Smb2Header {
pub credit_charge: u16,
pub channel_sequence_status: u32,
pub command: Command,
pub credit_request_response: u16,
pub flags: u32,
pub next_command: u32,
pub message_id: u64,
pub tail: HeaderTail,
pub session_id: u64,
pub signature: [u8; 16],
}Expand description
SMB2 fixed 64-byte header.
On the wire the layout is (offsets in decimal - total 64 bytes):
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | ProtocolId (0xFE 'S' 'M' 'B') |
| 4 | 2 | StructureSize (always 64) |
| 6 | 2 | CreditCharge |
| 8 | 4 | (Channel)Status |
| 12 | 2 | Command |
| 14 | 2 | CreditRequest/CreditResponse |
| 16 | 4 | Flags |
| 20 | 4 | NextCommand |
| 24 | 8 | MessageId |
| 32 | 8 | Reserved/TreeId (sync) or AsyncId (async) |
| 40 | 8 | SessionId |
| 48 | 16 | Signature |
Fields§
§credit_charge: u16§channel_sequence_status: u32Bytes 8..12: in client-to-server requests on 3.x this splits into
ChannelSequence(u16) + Reserved(u16); in server-to-client responses
it carries Status (NTSTATUS). Kept as the raw u32.
command: Command§credit_request_response: u16On requests this is CreditRequest; on responses, CreditResponse.
flags: u32§next_command: u32Offset to the next header in a compound chain, or 0 for the last.
message_id: u64§tail: HeaderTailSync: (reserved, tree_id). Async: async_id. Discriminated by
flags & SMB2_FLAGS_ASYNC_COMMAND.
session_id: u64§signature: [u8; 16]16-byte signature; zeroed on unsigned messages.
Implementations§
Trait Implementations§
Source§impl Clone for Smb2Header
impl Clone for Smb2Header
impl Copy for Smb2Header
Source§impl Debug for Smb2Header
impl Debug for Smb2Header
Source§impl Default for Smb2Header
impl Default for Smb2Header
impl Eq for Smb2Header
Source§impl PartialEq for Smb2Header
impl PartialEq for Smb2Header
impl StructuralPartialEq for Smb2Header
Auto Trait Implementations§
impl Forget for Smb2Header
impl Freeze for Smb2Header
impl Move for Smb2Header
impl RefUnwindSafe for Smb2Header
impl Send for Smb2Header
impl Sync for Smb2Header
impl Unpin for Smb2Header
impl UnsafeUnpin for Smb2Header
impl UnwindSafe for Smb2Header
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
The type of the none-equivalent value that
NoneValue::null_value produces.Source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.