struct Server {
leases: [Lease; 8],
}Expand description
The server’s fixed lease pool.
Fields§
§leases: [Lease; 8]Implementations§
Source§impl Server
impl Server
Sourcefn slot_of_addr(ip: Ipv4Address) -> Option<usize>
fn slot_of_addr(ip: Ipv4Address) -> Option<usize>
Slot that owns ip, when the address is inside the pool.
Sourcefn active_slot(&self, mac: [u8; 6], now: Instant) -> Option<usize>
fn active_slot(&self, mac: [u8; 6], now: Instant) -> Option<usize>
Slot actively (unexpired) leased to mac.
Sourcefn assign(&mut self, mac: [u8; 6], now: Instant) -> Option<Ipv4Address>
fn assign(&mut self, mac: [u8; 6], now: Instant) -> Option<Ipv4Address>
Assign a pool address to mac (reusing its existing lease, else
claiming a free or expired slot).
Sourcefn bind_addr(&mut self, mac: [u8; 6], ip: Ipv4Address, now: Instant) -> bool
fn bind_addr(&mut self, mac: [u8; 6], ip: Ipv4Address, now: Instant) -> bool
Bind mac to a specific pool address (the REQUEST path).
Sourcefn handle(&mut self, msg: &ClientMsg, now: Instant) -> Option<Action>
fn handle(&mut self, msg: &ClientMsg, now: Instant) -> Option<Action>
Decide the reply for one client message; None means no answer.
Sourcefn handle_request(&mut self, msg: &ClientMsg, now: Instant) -> Option<Action>
fn handle_request(&mut self, msg: &ClientMsg, now: Instant) -> Option<Action>
REQUEST: confirm a lease (ACK) or send the client back to
DISCOVER (NAK).