| Crates.io | ifaddrsx |
| lib.rs | ifaddrsx |
| version | 0.3.0 |
| created_at | 2025-02-02 07:42:19.671706+00 |
| updated_at | 2025-02-02 07:42:19.671706+00 |
| description | Retrieve the names and IP addresses of all active network interfaces. |
| homepage | |
| repository | https://github.com/spritetong/ifaddrsx |
| max_upload_size | |
| id | 1539350 |
| size | 24,629 |
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