pub fn get_default_gateway() -> Result<Gateway, String>
Expand description

Get default Gateway

Examples found in repository?
examples/default_gateway.rs (line 4)
3
4
5
6
7
8
9
10
11
12
13
14
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);
        }
    }
}