Crates.io | toe-beans |
lib.rs | toe-beans |
version | 0.6.0 |
created_at | 2024-08-09 18:28:24.879715+00 |
updated_at | 2025-08-26 22:55:02.604262+00 |
description | DHCP library, client, and server |
homepage | https://black-cat.us/toe-beans/toe-beans.html |
repository | https://codeberg.org/black-cat/toe-beans |
max_upload_size | |
id | 1331235 |
size | 822,468 |
This crate provides:
cargo add toe-beans
to install it as a dependency.
You may disable either of the default feature flags (v4_client
/v4_server
) if you don't need the other.
Check out the binaries' code and the docs.rs link above for examples of how to use the library.
cargo install toe-beans
will install both the server and client binaries.
You may use the --bin
cli arg to install only one of the binaries.
Check out this wifi router that uses the server binary.
All versions of this crate are on docs.rs.
Or you may locally (offline):
cargo doc --open
git switch -C <branch-name> <release-tag>
then run cargo doc --open
./rfcs
directory of this repo./CHANGELOG.md
file in this repo.The unsafe_code
lint is set to forbid
which means that unsafe code is not allowed (unless through a third-party crate).
Nearly all of the code within the listen loop of the server is panic free to prevent the server from crashing from a bad request.
A significant amount of work has been put into optimizing the code. Learn more and see benchmark results on our wiki, or run the benchmarks yourself with cargo benches
.
cargo tests
cargo alias. The integration tests check the server and client libraries.dhclient
). Run with docker compose up --build
.Currently, only dhcpv4/ipv4 is handled. Ipv6 support will be added in the future.
The standard RFCs are closely followed, but its hard to promise 100% compatibility with them. Subtle differences may exist.
The message library code is complete with the exception of needing to implement more options.
The server library/binary have successfully assigned/validated an ip address on a router. The server is currently single threaded, configured through a toml file, and leases are stored in another toml file.
The client binary is still a work in progress, but the client library code is more complete.
Warning: I have neither used, nor vetted the safety of any of these alternatives. There might be better options that I'm not aware of.
There were not a lot of dhcp libraries available when I started writing toe-beans. Nowadays there are more options, but to varying degrees of completeness.
Our other projects on https://black-cat.us.
git switch -C hotfix/v0.5.1 tags/v0.5.0
)Cargo.toml
.CHANGELOG.md
.git tag -a v0.2.1 aa15cb8473 -m "v0.2.1" && git push --tags origin
.cargo publish
.Distributed under the terms of the GNU Library General Public License (Version 2.0). See LICENSE file for more information.