pub enum LinuxSllProtocolType {
Ignored(u16),
NetlinkProtocolType(u16),
GenericRoutingEncapsulationProtocolType(u16),
EtherType(EtherType),
LinuxNonstandardEtherType(LinuxNonstandardEtherType),
}Expand description
Represents the “protocol type” field in a Linux Cooked Capture v1 packet. It is represented as an enum due to the meaning of the inner value depending on the associated arp_hardware_id field.
You can convert pairs of ArpHardwareId and its associated u16 value with LinuxSllProtocolType::try_from(), an Err(_) is returned if the relation is
not defined or known.
use etherparse::LinuxNonstandardEtherType;
// Convert to LinuxNonstandardEtherType using the from & into trait
let link_type: LinuxNonstandardEtherType = 0x0001.try_into().unwrap();
assert_eq!(LinuxNonstandardEtherType::N802_3, link_type);
// convert to u16 using the from & into trait
let num: u16 = LinuxNonstandardEtherType::N802_3.try_into().unwrap();
assert_eq!(0x0001, num);Variants§
Ignored(u16)
The protocol type should be ignored
NetlinkProtocolType(u16)
Netlink protocol type of the encapsulated payload
GenericRoutingEncapsulationProtocolType(u16)
Generic Routing Encapsulation protocol type for the encapsulated payload
EtherType(EtherType)
EtherType of the encapsulated payload
LinuxNonstandardEtherType(LinuxNonstandardEtherType)
Non-standard ether types of the encapsulated payload
Implementations§
Source§impl LinuxSllProtocolType
impl LinuxSllProtocolType
pub const SUPPORTED_ARPHWD: [ArpHardwareId; 5]
pub fn change_value(&mut self, value: u16)
Trait Implementations§
Source§impl Clone for LinuxSllProtocolType
impl Clone for LinuxSllProtocolType
Source§fn clone(&self) -> LinuxSllProtocolType
fn clone(&self) -> LinuxSllProtocolType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinuxSllProtocolType
impl Debug for LinuxSllProtocolType
Source§impl From<LinuxSllProtocolType> for u16
impl From<LinuxSllProtocolType> for u16
Source§fn from(value: LinuxSllProtocolType) -> u16
fn from(value: LinuxSllProtocolType) -> u16
Converts to this type from the input type.
Source§impl Hash for LinuxSllProtocolType
impl Hash for LinuxSllProtocolType
Source§impl Ord for LinuxSllProtocolType
impl Ord for LinuxSllProtocolType
Source§fn cmp(&self, other: &LinuxSllProtocolType) -> Ordering
fn cmp(&self, other: &LinuxSllProtocolType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LinuxSllProtocolType
impl PartialEq for LinuxSllProtocolType
Source§impl PartialOrd for LinuxSllProtocolType
impl PartialOrd for LinuxSllProtocolType
Source§impl TryFrom<(ArpHardwareId, u16)> for LinuxSllProtocolType
impl TryFrom<(ArpHardwareId, u16)> for LinuxSllProtocolType
impl Copy for LinuxSllProtocolType
impl Eq for LinuxSllProtocolType
impl StructuralPartialEq for LinuxSllProtocolType
Auto Trait Implementations§
impl Freeze for LinuxSllProtocolType
impl RefUnwindSafe for LinuxSllProtocolType
impl Send for LinuxSllProtocolType
impl Sync for LinuxSllProtocolType
impl Unpin for LinuxSllProtocolType
impl UnwindSafe for LinuxSllProtocolType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more