arcbox_dhcp/lib.rs
1//! Lightweight DHCP server and IP allocator for ArcBox.
2//!
3//! This crate provides a self-contained DHCP server implementation with:
4//!
5//! - DHCP DISCOVER/OFFER/REQUEST/ACK flow
6//! - IP address pool allocation and lease management
7//! - DNS server and gateway configuration
8//! - MAC-based IP reservations
9//!
10//! # Example
11//!
12//! ```no_run
13//! use arcbox_dhcp::{DhcpServer, DhcpConfig};
14//! use std::net::Ipv4Addr;
15//!
16//! let config = DhcpConfig::new(
17//! Ipv4Addr::new(192, 168, 64, 1),
18//! Ipv4Addr::new(255, 255, 255, 0),
19//! );
20//!
21//! let mut server = DhcpServer::new(config);
22//! ```
23
24pub mod allocator;
25pub mod config;
26pub mod error;
27pub mod packet;
28pub mod server;
29
30pub use allocator::IpAllocator;
31pub use config::{DEFAULT_LEASE_DURATION, DHCP_CLIENT_PORT, DHCP_SERVER_PORT, DhcpConfig};
32pub use error::{DhcpError, Result};
33pub use packet::{DhcpMessageType, DhcpPacket};
34pub use server::{DhcpLease, DhcpServer};