ifaddrsx
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.
Features
- Get network interface names
- Retrieve IPv4 and IPv6 addresses for each interface
- Cross-platform support (Windows, Linux, macOS, and other Unix-like systems)
- Easy-to-use API
- No unsafe code (except for necessary FFI bindings)
Installation
Add this to your Cargo.toml:
[]
= "0.3"
Usage
use get_ifaddrs;
Platform Support
- Windows (via WinAPI)
- Linux (via netlink)
- macOS and other Unix-like systems (via getifaddrs)
Dependencies
bitflags: For flag handlingipnetwork: IP address manipulationlibc: System library bindings- Platform-specific dependencies:
- Windows:
winapiwith network-related features - Unix:
nixfor network operations
- Windows:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
Sprite Tong spritetong@gmail.com