pub struct CreateContext {
pub name: Vec<u8>,
pub data: Vec<u8>,
}Expand description
Generic SMB2_CREATE_CONTEXT envelope.
Per MS-SMB2 §2.2.13.2 each entry has:
Next- offset (bytes) from the start of this entry to the start of the next entry in the chain, or 0 for the last entry.NameOffset/NameLength- name (typically a 4-byte ASCII tag) at an offset relative to the entry start.Reserved- 2 bytes.DataOffset/DataLength- payload at an offset relative to the entry start.
Each entry is held as name and data byte vectors. The chain reader and
writer below handle Next and 8-byte alignment between entries.
Fields§
§name: Vec<u8>§data: Vec<u8>Implementations§
Source§impl CreateContext
impl CreateContext
pub const NAME_EXTA: &'static [u8; 4] = b"ExtA"
pub const NAME_SECD: &'static [u8; 4] = b"SecD"
pub const NAME_DHNQ: &'static [u8; 4] = b"DHnQ"
pub const NAME_DHNC: &'static [u8; 4] = b"DHnC"
pub const NAME_ALSI: &'static [u8; 4] = b"AlSi"
pub const NAME_MXAC: &'static [u8; 4] = b"MxAc"
pub const NAME_TWRP: &'static [u8; 4] = b"TWrp"
pub const NAME_QFID: &'static [u8; 4] = b"QFid"
pub const NAME_RQLS: &'static [u8; 4] = b"RqLs"
pub const NAME_DH2Q: &'static [u8; 4] = b"DH2Q"
pub const NAME_DH2C: &'static [u8; 4] = b"DH2C"
pub const NAME_AAPL: &'static [u8; 4] = b"AAPL"
Sourcepub fn parse_chain(chain: &[u8]) -> Result<Vec<CreateContext>, ProtoError>
pub fn parse_chain(chain: &[u8]) -> Result<Vec<CreateContext>, ProtoError>
Parse a chain of create-contexts from the raw chain bytes.
The chain is empty if chain.is_empty(). Otherwise Next offsets are
followed until one is zero. Each context spans from its start to the
next context, or to the end of the chain for the last one. A context
shorter than its 16-byte header, a name shorter than 4 bytes, or a
name or data outside the context is malformed.
Sourcepub fn encode_chain(
list: &[CreateContext],
out: &mut Vec<u8>,
) -> Result<(), ProtoError>
pub fn encode_chain( list: &[CreateContext], out: &mut Vec<u8>, ) -> Result<(), ProtoError>
Encode a chain of create-contexts into out. Inserts Next offsets
and 8-byte alignment padding between entries.
Trait Implementations§
Source§impl Clone for CreateContext
impl Clone for CreateContext
Source§impl Debug for CreateContext
impl Debug for CreateContext
Source§impl Default for CreateContext
impl Default for CreateContext
impl Eq for CreateContext
Source§impl PartialEq for CreateContext
impl PartialEq for CreateContext
impl StructuralPartialEq for CreateContext
Auto Trait Implementations§
impl Forget for CreateContext
impl Freeze for CreateContext
impl Move for CreateContext
impl RefUnwindSafe for CreateContext
impl Send for CreateContext
impl Sync for CreateContext
impl Unpin for CreateContext
impl UnsafeUnpin for CreateContext
impl UnwindSafe for CreateContext
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.