How to get a list of local network computers to explore and access remote files?


#1

Hi guys,

Is there a way to get a list of the local network’s computers using Rust standard library? If not, which networking crate do you recommend?

We are using Windows OS and would like to parse all computers found on the network in order to list, explore and access each computer’s drives, folder trees and files.

Please recommend the best (most standard way) to achieve this.

Optionally, we would like to be able to fetch the MAC address of the local computer on which the Rust program is running. Should we use the “interfaces” crate, or are there other/better options? – since the latter crate seems too limited.

Thanks


#2

Maybe this helps you:

(I did just a quick search for SMB / CIFS on crates.io)

Otherwise you could try to use the Windows built-in command line tool netsh:

https://technet.microsoft.com/en-us/library/cc731521(v=ws.10).aspx#BKMK_showneighbors

Use the process module to call the command line tool and parse the result:

https://doc.rust-lang.org/std/process/index.html

For the MAC address you probably mean this crate:

I haven’t used it so I can’t say how limited it is. But you can try to use the command line again:

https://www.windows-commandline.com/get-mac-address-command-line/


#3

Thanks a lot! I will check them up.