⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

SmbClient

Struct SmbClient 

Source
pub struct SmbClient { /* private fields */ }
Expand description

SMB2/3 client.

Implementations§

Source§

impl SmbClient

Source

pub fn new(server: &str) -> Self

Create a new SMB client.

Source

pub fn negotiate(&mut self) -> Result<SmbDialect, SmbError>

Negotiate SMB dialect with server.

Source

pub fn session_setup( &mut self, username: &str, password: &str, domain: &str, ) -> Result<u64, SmbError>

Establish an authenticated session via NTLM.

Source

pub fn tree_connect(&mut self, share_path: &str) -> Result<u32, SmbError>

Connect to a share (\\server\share).

Source

pub fn tree_disconnect(&mut self) -> Result<(), SmbError>

Disconnect from a share.

Source

pub fn create( &mut self, path: &str, desired_access: u32, share_access: u32, disposition: CreateDisposition, ) -> Result<SmbFileId, SmbError>

Open or create a file.

Source

pub fn read( &mut self, file_id: &SmbFileId, offset: u64, length: u32, ) -> Result<Vec<u8>, SmbError>

Read from an open file.

Source

pub fn write( &mut self, file_id: &SmbFileId, offset: u64, data: &[u8], ) -> Result<u32, SmbError>

Write to an open file.

Source

pub fn close(&mut self, file_id: &SmbFileId) -> Result<(), SmbError>

Close a file handle.

Source

pub fn query_directory( &mut self, dir_id: &SmbFileId, pattern: &str, ) -> Result<Vec<SmbDirEntry>, SmbError>

Query directory contents.

Source

pub fn sign_message(&self, packet: &mut [u8])

Sign an SMB2 message with HMAC-SHA256.

Source

pub fn verify_signature(&self, packet: &[u8]) -> bool

Verify an SMB2 message signature.

Source

pub fn dialect(&self) -> Option<SmbDialect>

Get the negotiated dialect.

Source

pub fn session_id(&self) -> u64

Get the session ID.

Source

pub fn tree_id(&self) -> u32

Get the tree ID.

Source

pub fn server_addr(&self) -> &str

Get the server address.

Auto Trait Implementations§

§

impl Freeze for SmbClient

§

impl RefUnwindSafe for SmbClient

§

impl Send for SmbClient

§

impl Sync for SmbClient

§

impl Unpin for SmbClient

§

impl UnwindSafe for SmbClient

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.