pub struct TreeConnectRequest {
pub structure_size: u16,
pub flags: u16,
pub path_offset: u16,
pub path_length: u16,
pub path: Vec<u8>,
}Expand description
SMB2_TREE_CONNECT_REQUEST (MS-SMB2 §2.2.9).
path is UTF-16LE. The wire format gives PathOffset (from the start of
the SMB2 header) and PathLength; we encode/decode the path immediately
following the fixed prefix. 3.1.1 tree-connect extensions are not decoded.
Fields§
§structure_size: u16§flags: u163.1.1: flags. 2.x/3.0/3.0.2: reserved.
path_offset: u16§path_length: u16§path: Vec<u8>UTF-16LE share path bytes (e.g. \\server\share).
Implementations§
Source§impl TreeConnectRequest
impl TreeConnectRequest
Sourcepub const FLAG_CLUSTER_RECONNECT: u16 = 0x0001
pub const FLAG_CLUSTER_RECONNECT: u16 = 0x0001
Flag: SMB2_TREE_CONNECT_FLAG_CLUSTER_RECONNECT (3.1.1).
Sourcepub const FLAG_REDIRECT_TO_OWNER: u16 = 0x0002
pub const FLAG_REDIRECT_TO_OWNER: u16 = 0x0002
Flag: SMB2_TREE_CONNECT_FLAG_REDIRECT_TO_OWNER (3.1.1).
Sourcepub const FLAG_EXTENSION_PRESENT: u16 = 0x0004
pub const FLAG_EXTENSION_PRESENT: u16 = 0x0004
Flag: SMB2_TREE_CONNECT_FLAG_EXTENSION_PRESENT (3.1.1).
Sourcepub fn path_str(&self) -> Option<String>
pub fn path_str(&self) -> Option<String>
Decode the UTF-16LE share path into a String. Returns None if the
stored bytes are not an even length (malformed UTF-16LE).
pub fn parse(buf: &[u8]) -> Result<Self, ProtoError>
pub fn write_to(&self, out: &mut Vec<u8>) -> Result<(), ProtoError>
Trait Implementations§
Source§impl BinRead for TreeConnectRequest
impl BinRead for TreeConnectRequest
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
Read
T from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl BinWrite for TreeConnectRequest
impl BinWrite for TreeConnectRequest
Source§fn write_options<W: Write + Seek>(
&self,
__binrw_generated_var_writer: &mut W,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<()>
fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>
Source§fn write<W>(&self, writer: &mut W) -> Result<(), Error>
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer using default arguments. Read moreSource§fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer assuming big-endian byte order. Read moreSource§fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer assuming little-endian byte order. Read moreSource§fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self to the writer assuming native-endian byte order. Read moreSource§fn write_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Write
Self to the writer using the given arguments. Read moreSource§fn write_be_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Write
Self to the writer, assuming big-endian byte order, using the
given arguments. Read moreSource§impl Clone for TreeConnectRequest
impl Clone for TreeConnectRequest
Source§impl Debug for TreeConnectRequest
impl Debug for TreeConnectRequest
impl Eq for TreeConnectRequest
Source§impl PartialEq for TreeConnectRequest
impl PartialEq for TreeConnectRequest
Source§impl ReadEndian for TreeConnectRequest
impl ReadEndian for TreeConnectRequest
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
The endianness of the type.
impl StructuralPartialEq for TreeConnectRequest
Source§impl WriteEndian for TreeConnectRequest
impl WriteEndian for TreeConnectRequest
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
The endianness of the type.
Auto Trait Implementations§
impl Freeze for TreeConnectRequest
impl RefUnwindSafe for TreeConnectRequest
impl Send for TreeConnectRequest
impl Sync for TreeConnectRequest
impl Unpin for TreeConnectRequest
impl UnsafeUnpin for TreeConnectRequest
impl UnwindSafe for TreeConnectRequest
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