Commit Graph

10 Commits (88256dbdcfc3b284f5533e5aa2969bf5061db22a)

Author SHA1 Message Date
Dario Nieuwenhuis 88256dbdcf Update to Rust 2018. Fixes #271 2020-12-27 17:54:56 +01:00
Alex Crawford c9f57150a8 Dereference match expressions to clean up patterns
These were flagged by `cargo clippy`:

    warning: you don't need to add `&` to all patterns
2020-12-26 10:32:51 -08:00
whitequark 5bcb358eb5 Rename `new` method on Packet types to `new_checked`.
Fixes #195.

Closes: #254
Approved by: dlrobertson
2018-07-11 12:59:05 +08:00
Dan Robertson 56463f19bd Fix code syle nits
- phy: Fix unused mut ref
 - wire: Fix comment collapse unneeded impl block

Closes: #250
Approved by: whitequark
2018-06-27 21:17:50 +08:00
Dan Robertson e88f58739b Improve the Iterator for IPv6 options
- Add a helper function for returning an error in the implementation of
   next
 - Add an assert in Ipv6OptionsIterator::new that ensures that an
   iterator is not created with a length field larger than that of the
   data buffer we're iterating over.

Closes: #230
Approved by: dlrobertson
2018-06-07 05:08:11 +08:00
Dan Robertson 938fd55763 Fix the ipv6 option structure
The IPv6 Option representation layer structure includes the type value
as the raw u8. This should be stored as the Type enum.

Closes: #229
Approved by: whitequark
2018-06-06 07:42:35 +08:00
Dan Robertson 42a1da4d72 Improve IPv6 options parsing
- Do not require the packet structure of the header have the same
    lifetime as the underlying bytes or the parsed representation.
  - Add the bytes of the contained options to the parsed representation
    structure.
  - Add the IPv6OptionsIterator structure to make iterating over the
    contained options easier.

Closes: #212
Approved by: whitequark
2018-05-27 16:14:29 +08:00
Dan Robertson 435292cc35 wire: Add the FailureType for IPv6 ext hdr options
Add the FailureType enumeration that can be acquired from a IPv6
extension header option which determines the required action if the
extension header option type is not known or is not supported.

Closes: #204
Approved by: whitequark
2018-05-09 20:58:50 +08:00
Dan Robertson 1097ba3110 Documentation updates
- Update documentation about current support in the wire module
 - Ensure the possible panic is documented for Ipv6Option::data_mut
 - Add a Repr structure for Ethernet II headers
2018-02-14 18:00:19 +00:00
Herman J. Radtke III 4e88b1f82f Implement IPv6 Extension Headers Pad1 and PadN. 2018-01-30 19:45:25 +00:00