Expand description
Constants for the ethertype values for easy importing (e.g. use ether_type::*;
).
The constants only exist for convenience so you can import them
(use ether_type::*
) without a need to write EtherType::
in front
of every constant.
You can access the underlying u16
value by using .0
and any u16
can be converted to an EtherType
:
use etherparse::{ether_type::IPV4, EtherType};
assert_eq!(IPV4.0, 0x0800);
assert_eq!(IPV4, EtherType(0x0800));
let num: EtherType = 0x0800.into();
assert_eq!(IPV4, num);
Constantsยง
- ARP
- IPV4
- IPV6
- MACSEC
- IEEE Std 802.1AE - Media Access Control Security
- PROVIDER_
BRIDGING - VLAN_
DOUBLE_ TAGGED_ FRAME - VLAN_
TAGGED_ FRAME - WAKE_
ON_ LAN