Skip to content

Attempts to determine the default route and gets related interface information

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE2.0
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

06chaynes/piface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

piface

crates.io Released API docs

This library will attempt to determine the local machine's default route to the internet and pull related info

Examples

use piface::{PrimaryInterface, Result};

fn main() -> Result<()> {
    let iface = PrimaryInterface::load()?;
    println!("{:#?}", iface);
    Ok(())
}

Outputs:

PrimaryInterface {
    name: "en0",
    mac_address: MacAddress("a4:5e:60:b8:1d:2b"),
    default_route: DefaultRoute {
        gateway: Some(
            "192.168.1.1",
        ),
        interface: Some(
            "en0",
        ),
    },
}

License

piface is licensed under both MIT and Apache 2.0

About

Attempts to determine the default route and gets related interface information

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE2.0
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages