fork of https://github.com/shellrow/default-net/tree/v0.16.2 fixes an unsafe bug in sockaddr_to_network_addr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
default-net/examples/default_gateway.rs

15 lines
327 B

4 years ago
use default_net;
fn main(){
match default_net::get_default_gateway() {
Ok(gateway) => {
println!("Default Gateway");
println!("\tMAC: {}", gateway.mac_addr);
println!("\tIP: {}", gateway.ip_addr);
},
Err(e) => {
println!("{}", e);
},
}
4 years ago
}