Skip to main content

Request

Struct Request 

Source
pub struct Request {
    pub dialects: Vec<u16>,
    pub client_guid: [u8; 16],
    pub contexts: Vec<Context>,
}
Expand description

Parsed SMB2 NEGOTIATE request.

Fields§

§dialects: Vec<u16>

Dialect numbers offered by the client.

§client_guid: [u8; 16]

Client GUID.

§contexts: Vec<Context>

Negotiate contexts (3.1.1 only; empty otherwise).

Implementations§

Source§

impl Request

Source

pub fn parse(b: &[u8]) -> Option<Request>

Parse from the request body (bytes after the 64-byte header).

Two layouts exist ([MS-SMB2] §2.2.3.1): pre-3.1.1 clients place the dialect array directly after the fixed part (offset 28); 3.1.1-aware clients interpose NegotiateContextOffset/Count fields so dialects begin at offset 36. We accept either by validating candidates against the set of known dialect revisions.

Trait Implementations§

Source§

impl Debug for Request

Source§

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

Formats the value using the given formatter. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.