Crates.io | ifaddrsx |
lib.rs | ifaddrsx |
version | |
source | src |
created_at | 2025-02-02 07:42:19.671706 |
updated_at | 2025-02-02 07:42:19.671706 |
description | Retrieve the names and IP addresses of all active network interfaces. |
homepage | |
repository | https://github.com/spritetong/ifaddrsx |
max_upload_size | |
id | 1539350 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A Rust library for retrieving network interface information, including names and IP addresses of all active network interfaces. This crate provides a cross-platform solution that works on Windows, Linux, macOS, and other Unix-like systems.
Add this to your Cargo.toml
:
[dependencies]
ifaddrsx = "0.3"
use ifaddrsx::get_ifaddrs;
fn main() {
let ifaddrs = get_ifaddrs().unwrap();
for ifaddr in ifaddrs {
println!("Interface: {}", ifaddr.name);
println!(" IP Addresses: {:?}", ifaddr.ips);
}
}
bitflags
: For flag handlingipnetwork
: IP address manipulationlibc
: System library bindingswinapi
with network-related featuresnix
for network operationsThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Sprite Tong spritetong@gmail.com