# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
---
## 0.9.0
### Breaking
- `Socket`'s `unicast` method now accepts a `SocketAddrV4` instead of a `ToSocketAddr`.
- `Socket::MAX_MESSAGE_SIZE` moved to `MAX_MESSAGE_SIZE`.
### Changed
- Optimize encoding with more efficient allocation.
- Add `Debug` to remaining pub types and add lint to enforce doing so.
- Improvements to docker setup.
### Added
- Type aliases `MagicBuffer`, `OptionsBuffer`.
- Constants `MAGIC_SIZE`, `NON_MAGIC_SIZE`.
---
## 0.8.0
### Breaking
- `Slicer` methods are now prefixed with `slice` instead of `parse`.
- `MessageSlicer` has been replaced with `UndecodedMessage` which returns fixed size arrays instead of slices now.
- `from_bytes` accepts an `UndecodedMessage` now.
- Replaced `Deliverable` with `Encodable` and `Decodable` which allows more flexibility when sending/receiving in `Socket`.
### Added
- Type alias called `MessageBuffer`.
- Constants for `Socket::MAX_MESSAGE_SIZE`, `Socket::EMPTY_MESSAGE_BUFFER`.
- Methods for `Socket::receive_raw`, `Socket::receive_mock`.
- `Slicer` methods `slice_unchecked`, `slice_remainder`, and `reset` are now public.
- `UndecodedMessage` can slice fields in any order and non-sequentially.
- `slice_flags_temporary` method to `UndecodedMessage` to make decoding flags easier.
### Changed
- Add comments and a unit test to explain/ensure that decoding never panics.
---
## 0.7.0
### Breaking
- The `Leases` `restore` and `restore_or_new` have been combined into `new`. Whether or not a restore happens is now controlled by the `use_leases_file` `Config` flag.
### Fixed
- Leases file truncation.
### Added
- `Config` now has a `use_leases_file` flag.
### Changed
- Updated dependencies to latest.
---
## 0.6.0
### Breaking
- `static_leases` moved from `Leases` to server `Config`.
### Changed
- Restored static leases are no longer permitted to be unassignable network or broadcast addresses.
- Static leases cant be assigned to anyone other than who they are reserved for.
- Improvements to client binary and docker setup.
---
## 0.5.0
### Breaking
- Disable trace logs in release builds. You may still view them in debug builds.
- The "End" option is automatically added/removed during encode/decode. You should no longer manually add it to your list of options.
- `Client::new` now accepts a `ClientConfig`.
### Added
- constants `CLIENT_PORT`, `TEST_CLIENT_PORT`, `RESOLVED_CLIENT_PORT`, `SERVER_PORT`, `TEST_SERVER_PORT`, and `RESOLVED_SERVER_PORT`.
- The resolved constants are now used in various places. This means that release builds now use the proper privileged ports by default.
- server logs the version of toe-beans it is running when it starts.
### Changed
- Various improvements to client binary. The `dora` command successfully assign an ip address in the new docker test.
---
## 0.4.0
### Breaking
- Use `ip_network` crate instead of `ipnetwork` crate because of the additional methods that the new one provides.
- Remove ip network range from leases file and `IpPool` struct because all range checks have been moved from request handling to server startup.
- Renamed `IpPool` to `Leases` and `ip_pool` to `leases`.
### Changed
- The leases file is kept open instead of being open/closed for every write. This should be more performant.
### Added
- `LeaseTime::INFINITY` const.
---
## 0.3.1
### Fixed
- Restoring from a leases file can no longer have duplicate ip addresses in "available" and "leased".
- Remove network and broadcast addresses from the pool of assignable and assigned addresses.
---
## 0.3.0
### Breaking
- Remove `v4` feature. This should be minimally breaking because `v4_client` and `v4_server` are still default features.
- `IpPool.extend` no longer accepts an ip address as an argument. It will extend an offered lease now too.
- `IpPool.is_expired` is removed for now. Its now available (privately) on `Lease` instead.
- `IpPool.unoffer` has been combined with `IpPool.release`.
- The format of the leases file changed.
### Fixed
- `IpPool` will not try to reuse acked ips after 300 seconds when all available addresses are exhausted. It will instead use `Config.lease_time` which should be longer. `300` should only be for offers.
### Changed
- This project's license has been changed from GPL v3 to LGPL v2. See LICENSE file for more information.
- Improved Flags serializing performance with the new `temporary_to_bytes` method.
- Improved IpPool performance and (a little bit of) memory usage.
---
## 0.2.1
### Fixed
- Failure on `amd64` platforms, due to issue with a dependency crate, where `c_char` was represented as `i8` instead of `u8`. This should also fix docs.rs.
---
## 0.2.0
Initial release!
---
## 0.1.0
Reserve crate name.