Interface-rs
A Rust library for parsing and manipulating an interfaces(5)
file.
This library provides structs and functions to load, parse, modify, and save network interface configurations in the Debian-style interfaces(5)
file format. The interfaces(5)
file is typically found at /etc/network/interfaces
on Debian-based systems but may be located elsewhere depending on your system configuration.
Table of Contents
Features
- Load and parse existing configurations from an
interfaces(5)
file. - Modify network interface configurations programmatically.
- Add or remove network interfaces.
- Save changes back to the file system.
- Display interfaces in the correct
interfaces(5)
file format.
Installation
Add interface-rs
to your Cargo.toml
:
[]
= "0.1.0"
Then run:
cargo build
Usage
Loading Interfaces
use NetworkInterfaces;
Retrieving an Interface
use NetworkInterfaces;
Adding a New Interface
use NetworkInterfaces;
use ;
Modifying an Interface
use NetworkInterfaces;
Saving Changes
use NetworkInterfaces;
Documentation
For more detailed information, please refer to the API documentation.
Contributing
Contributions are welcome! If you'd like to contribute to interface-rs
, please follow these steps:
- Fork the repository on GitHub.
- Clone your forked repository locally.
- Create a new branch for your feature or bugfix.
- Commit your changes with clear and descriptive messages.
- Push your changes to your fork.
- Submit a Pull Request to the
main
branch of the original repository.
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
- Inspired by the need for programmatically managing network interface configurations on Debian-based systems.
- Thanks to the Rust community for their excellent tools and documentation.
Note: This library is intended for use on systems that utilize the Debian-style interfaces(5)
file format. It may not be compatible with other network configuration systems.
For any issues or feature requests, please open an issue on the GitHub repository.