Specifically, I am interested in a programmatic way for acquiring a list of IP addresses such as those returned by ifconfig
.
Preferably, the solution would be cross-platform.
Specifically, I am interested in a programmatic way for acquiring a list of IP addresses such as those returned by ifconfig
.
Preferably, the solution would be cross-platform.
Check out the pnet crate:
extern crate pnet;
use pnet::datalink;
fn main() {
for iface in datalink::interfaces() {
println!("{:?}", iface.ips);
}
}