Skip to main content

CreateContext

Struct CreateContext 

Source
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

Source

pub const NAME_EXTA: &'static [u8; 4] = b"ExtA"

Source

pub const NAME_SECD: &'static [u8; 4] = b"SecD"

Source

pub const NAME_DHNQ: &'static [u8; 4] = b"DHnQ"

Source

pub const NAME_DHNC: &'static [u8; 4] = b"DHnC"

Source

pub const NAME_ALSI: &'static [u8; 4] = b"AlSi"

Source

pub const NAME_MXAC: &'static [u8; 4] = b"MxAc"

Source

pub const NAME_TWRP: &'static [u8; 4] = b"TWrp"

Source

pub const NAME_QFID: &'static [u8; 4] = b"QFid"

Source

pub const NAME_RQLS: &'static [u8; 4] = b"RqLs"

Source

pub const NAME_DH2Q: &'static [u8; 4] = b"DH2Q"

Source

pub const NAME_DH2C: &'static [u8; 4] = b"DH2C"

Source

pub const NAME_AAPL: &'static [u8; 4] = b"AAPL"

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CreateContext

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for CreateContext

Source§

impl PartialEq for CreateContext

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CreateContext

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

The type of the none-equivalent value that NoneValue::null_value produces.
Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more