Update Rust crate etherparse to 0.19 #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.16→0.19Release Notes
JulianSchmid/etherparse (etherparse)
v0.19.0: Add basic ICMPv6 Neighbor Discovery SupportCompare Source
What's Changed
New Contributors
Full Changelog: JulianSchmid/etherparse@v0.18.2...v0.19.0
v0.18.2: Add core::error::Error implementation to non_std buildCompare Source
What's Changed
New Contributors
Full Changelog: JulianSchmid/etherparse@v0.18.1...v0.18.2
v0.18.1: Add LaxPacketHeader:: from_linux_sllCompare Source
What's Changed
New Contributors
Full Changelog: JulianSchmid/etherparse@v0.18.0...v0.18.1
v0.18.0: MACsec Support & ECN+DSCP Support for IPv6Compare Source
What are the major changes?
vlanfield inSlicedPacket,LaxSlicedPacket,PacketHeaders,LaxPacketHeadershas been replaced withlink_exts.Ipv4Ecn&Ipv4Dscphave been replaced byIpEcn&IpDscp.Ipv6Header&Ipv6HeaderSlicenow supports the reading & setting ofIpEcn&IpDscp(thanks to @baxterjo)LaxEtherPayloadSlicehas been introduced &len_sourceadded toEtherPayloadSlice.source_addr()&destination_addr()methods ofIpSlice,Ipv4HeaderSlice,Ipv6Header,Ipv6HeaderSlice,LaxIpSliceare now available in non-std mode (thanks to @Dominaezzz)What is MACsec (IEEE 802.1AE)?
MACsec is a protocol that allows the signing and/or encryption of packet contents from the link layer downwards. The main difference between MACsec and IPSec is that IPSec is located after the IP header while MACsec is located above the IP header and can also encrypt the contents of the IP header itself while IPSSec does not encrypt the IP header. As such MACsec is usually used to secure local networks, while IPSec is more commonly used for VPNs and alike that leave the local network.
Changes needed for MACsec Support
Adding MACsec support required some breaking changes, specifically on how VLAN headers are handled. The MACsec SECTAG is a header that can be present in the same locations as "VLAN" headers. It has no fixed position and can be located before or after VLAN headers or after the Ethernet 2 header without a VLAN header being present at all. This invalidates the assumption
etherparsehad in previous versions that VLAN headers are always directly located after the Ethernet2 header and that if there are multiple VLAN headers that they are directly located after each other. Now there could be a MACsec header present in between VLAN headers.To support the different combinations of MACSec & VLAN headers the
vlanfield inSlicedPacket,PacketHeaders,LaxSlicedPacket&LaxPacketHeadershas been replaced with alink_extsfield that can contain up to three "link extensions":pub struct SlicedPacket<'a> { /// Ethernet II header if present. pub link: Option<LinkSlice<'a>>, - /// Single or double vlan headers if present. - pub vlan: Option<VlanSlice<'a>>, + /// Link extensions (VLAN & MAC Sec headers). + pub link_exts: ArrayVec<LinkExtSlice<'a>, { SlicedPacket::LINK_EXTS_CAP }>, /// IPv4 or IPv6 header, IP extension headers & payload if present. pub net: Option<NetSlice<'a>>, /// TCP or UDP header & payload if present. pub transport: Option<TransportSlice<'a>>, } impl<'a> SlicedPacket<'a> { + /// Maximum supported number of link extensions. + pub const LINK_EXTS_CAP: usize = 3;LinkExtSlice,LinkExtHeader&LaxLinkExtSliceare enums that can either contain a MACsec or VLAN header:LINK_EXTS_CAPis currently set to3. This means that up to three MACsec & VLAN headers can be parsed by etherparse.New Methods to access VLAN related data:
In case you don't care about MACsec and only care about VLAN a new
vlan()method has been added toSlicedPacket,PacketHeaders,LaxSlicedPacket&LaxPacketHeadersthat behave the same as the oldvlanfield:If you only care about the VLAN ids you can also use the new
vlan_ids()method inSlicedPacket,PacketHeaders,LaxSlicedPacket&LaxPacketHeaders:New
LaxEtherPayloadSlice&EtherPayloadSliceAs MACsec has an optional length field new
LaxEtherPayloadSlice&EtherPayloadSlicestructs have been introduced that can be used to keep track where the original length of the payload came from.MacsecPayloadSliceAs MACsec can be "encrypted", "unencrypted without payload modification" and "unencrypted with payload modifications" a new payload enum has been introduced:
In the unmodified case the next ether_type value can be read from the
EtherPayloadSlice. In the encrypted or modified case this is not possible as there are no informations available on how to decrypt the packet or how the payload was modified.What does the MACSec implementation not support?
Currently the ICV present at the end of an MACsec packet is not separated. The current implementation relies on the length fields of the lower layers (IP header, UDP or other transport length fields) to make sure it is not interpreted as data from a lower layer. The implementation is also missing any support for encrypting/decrypting payload data or verifying signatures. It is purely a "parse the parsable header fields" implementation.
Pull Requests
core::netoverstd::netby @Dominaezzz in #120New Contributors
Thanks for your contributions.
Full Changelog: JulianSchmid/etherparse@v0.17.0...v0.18.0
v0.17.0: Add ARP supportCompare Source
What's Changed
New Contributors
Full Changelog: JulianSchmid/etherparse@v0.16.0...v0.17.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.