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
This commit is contained in:
parent
6ee9516697
commit
1097ba3110
19
src/lib.rs
19
src/lib.rs
|
@ -49,8 +49,7 @@
|
||||||
//! The wire layer APIs also provide _tcpdump_-like pretty printing.
|
//! The wire layer APIs also provide _tcpdump_-like pretty printing.
|
||||||
//!
|
//!
|
||||||
//! ## The representation layer
|
//! ## The representation layer
|
||||||
//! The representation layer APIs are provided in the module [wire](wire/index.html); currently,
|
//! The representation layer APIs are provided in the module [wire].
|
||||||
//! Ethernet, ARP, generic IP, IPv4, ICMPv4, TCP and UDP packet representations are provided.
|
|
||||||
//!
|
//!
|
||||||
//! The representation layer exists to reduce the state space of raw packets. Raw packets
|
//! The representation layer exists to reduce the state space of raw packets. Raw packets
|
||||||
//! may be nonsensical in a multitude of ways: invalid checksums, impossible combinations of flags,
|
//! may be nonsensical in a multitude of ways: invalid checksums, impossible combinations of flags,
|
||||||
|
@ -58,8 +57,7 @@
|
||||||
//! as well as any features not supported by _smoltcp_.
|
//! as well as any features not supported by _smoltcp_.
|
||||||
//!
|
//!
|
||||||
//! ## The packet layer
|
//! ## The packet layer
|
||||||
//! The packet layer APIs are also provided in the module [wire](wire/index.html); currently,
|
//! The packet layer APIs are also provided in the module [wire].
|
||||||
//! Ethernet, ARP, IPv4, ICMPv4, TCP and UDP packet representations are provided.
|
|
||||||
//!
|
//!
|
||||||
//! The packet layer exists to provide a more structured way to work with packets than
|
//! The packet layer exists to provide a more structured way to work with packets than
|
||||||
//! treating them as sequences of octets. It makes no judgement as to content of the packets,
|
//! treating them as sequences of octets. It makes no judgement as to content of the packets,
|
||||||
|
@ -67,6 +65,19 @@
|
||||||
//! feature ever defined, to ensure that, when the representation layer is unable to make sense
|
//! feature ever defined, to ensure that, when the representation layer is unable to make sense
|
||||||
//! of a packet, it is still logged correctly and in full.
|
//! of a packet, it is still logged correctly and in full.
|
||||||
//!
|
//!
|
||||||
|
//! ## Packet and representation layer support
|
||||||
|
//! | Protocol | Packet | Representation |
|
||||||
|
//! |----------|--------|----------------|
|
||||||
|
//! | Ethernet | Yes | No |
|
||||||
|
//! | ARP | Yes | Yes |
|
||||||
|
//! | IPv4 | Yes | Yes |
|
||||||
|
//! | ICMPv4 | Yes | Yes |
|
||||||
|
//! | IPv6 | Yes | Yes |
|
||||||
|
//! | ICMPv6 | Yes | Yes |
|
||||||
|
//! | TCP | Yes | Yes |
|
||||||
|
//! | UDP | Yes | Yes |
|
||||||
|
//!
|
||||||
|
//! [wire]: wire/index.html
|
||||||
//! [osi]: https://en.wikipedia.org/wiki/OSI_model
|
//! [osi]: https://en.wikipedia.org/wiki/OSI_model
|
||||||
//! [berk]: https://en.wikipedia.org/wiki/Berkeley_sockets
|
//! [berk]: https://en.wikipedia.org/wiki/Berkeley_sockets
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,9 @@ impl<T: AsRef<[u8]> + AsMut<[u8]>> Ipv6Option<T> {
|
||||||
|
|
||||||
impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Ipv6Option<&'a mut T> {
|
impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Ipv6Option<&'a mut T> {
|
||||||
/// Return a mutable pointer to the option data.
|
/// Return a mutable pointer to the option data.
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
/// This function panics if this is an 1-byte padding option.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn data_mut(&mut self) -> &mut [u8] {
|
pub fn data_mut(&mut self) -> &mut [u8] {
|
||||||
let len = self.data_len();
|
let len = self.data_len();
|
||||||
|
|
Loading…
Reference in New Issue