pub enum Error {
Io(Error),
Json(Error),
InvalidPacket(String),
PoolExhausted,
InvalidConfig(String),
Socket(String),
AddressOutOfRange(Ipv4Addr),
LeaseNotFound(String),
}Expand description
Errors that can occur during DHCP server operation.
Variants§
Io(Error)
File system or network I/O error.
Json(Error)
JSON serialization/deserialization error (config or lease files).
InvalidPacket(String)
Malformed DHCP packet received.
This includes packets that are too short, have invalid magic cookies, invalid option lengths, or other protocol violations.
PoolExhausted
The IP address pool is exhausted.
All addresses in the configured pool are either leased, pending offer, or marked as declined. Consider expanding the pool or reducing lease duration.
InvalidConfig(String)
Invalid server configuration.
Returned by Config::validate when the
configuration contains invalid values (e.g., pool_start > pool_end).
Socket(String)
Socket creation or configuration error.
Typically occurs when binding to port 67 without administrator privileges, or when the specified network interface doesn’t exist.
AddressOutOfRange(Ipv4Addr)
Requested IP address is outside the configured pool.
A client requested an IP that is not within pool_start..=pool_end and is not a static binding.
LeaseNotFound(String)
No lease exists for the specified client.
Returned when attempting to renew or release a lease that doesn’t exist.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()