EtherType

Struct EtherType 

Source
pub struct EtherType(pub u16);
Expand description

The EtherType field in an Ethernet header, as specified in IEEE 802.

Tuple Fields§

§0: u16

Implementations§

Source§

impl EtherType

Common EtherTypes

The EtherTypes are taken from the following sources:

Source

pub const IPV4: Self

Internet Protocol Version 4 (IPv4)

Source

pub const ARP: Self

Address Resolution Protocol (ARP)

Source

pub const FR_ARP: Self

Frame Relay ARP

Source

pub const TRILL: Self

TRILL

Source

pub const L2ISIS: Self

L2-IS-IS

Source

pub const RARP: Self

Reverse Address Resolution Protocol (RARP)

Source

pub const IPV6: Self

Internet Protocol Version 6 (IPv6)

Source

pub const PPP: Self

Point-to-Point Protocol (PPP)

Source

pub const GSMP: Self

General Switch Management Protocol (GSMP)

Source

pub const MPLS: Self

MPLS

Source

pub const MPLS_MC: Self

MPLS with upstream-assigned label

Source

pub const MCAP: Self

Multicast Channel Allocation Protocol (MCAP)

Source

pub const PPPOE_D: Self

PPP over Ethernet (PPPoE) Discovery Stage

Source

pub const PPPOE_S: Self

PPP over Ethernet (PPPoE) Session Stage

Source

pub const TRILL_FGL: Self

TRILL Fine Grained Labeling (FGL)

Source

pub const TRILL_RBC: Self

TRILL RBridge Channel

Source

pub const C_TAG: Self

IEEE Std 802.1Q - Customer VLAN Tag Type (C-Tag, formerly called the Q-Tag) (initially Wellfleet)

Source

pub const EPON: Self

IEEE Std 802.3 - Ethernet Passive Optical Network (EPON)

Source

pub const PAE: Self

IEEE Std 802.1X - Port-based network access control

Source

pub const S_TAG: Self

IEEE Std 802.1Q - Service VLAN tag identifier (S-Tag)

Source

pub const IEEE802_EXPERIMENTAL1: Self

IEEE Std 802 - Local Experimental Ethertype

Source

pub const IEEE802_EXPERIMENTAL2: Self

IEEE Std 802 - Local Experimental Ethertype

Source

pub const OUI_EXTENDED: Self

IEEE Std 802 - OUI Extended Ethertype

Source

pub const PREAUTH: Self

IEEE Std 802.11 - Pre-Authentication (802.11i)

Source

pub const LLDP: Self

IEEE Std 802.1AB - Link Layer Discovery Protocol (LLDP)

Source

pub const MACSEC: Self

IEEE Std 802.1AE - Media Access Control Security

Source

pub const MVRP: Self

IEEE Std 802.1Q - Multiple VLAN Registration Protocol (MVRP)

Source

pub const MMRP: Self

IEEE Std 802.1Q - Multiple Multicast Registration Protocol (MMRP)

Source

pub const FRRR: Self

IEEE Std 802.11 - Fast Roaming Remote Request (802.11r)

Source

pub const MIH: Self

IEEE Std 802.21 - Media Independent Handover Protocol

Source

pub const MIR: Self

IEEE Std 802.1Qbe - Multiple I-SID Registration Protocol

Source

pub const ECP: Self

IEEE Std 802.1Qbg - ECP Protocol (also used in 802.1BR)

Source

pub const SNA: Self

SNA

Source

pub const OSI_NL: Self

OSI network layer

Source

pub const PUP: Self

PUP

Source

pub const XNS: Self

XNS

Source

pub const CHAOS: Self

Chaos

Source

pub const VINES: Self

VINES

Source

pub const VINES_ECHO: Self

VINES Echo

Source

pub const VINES_LOOPBACK: Self

VINES Loopback

Source

pub const DECNET: Self

DECnet (Phase IV)

Source

pub const TEB: Self

Transparent Ethernet Bridging

Source

pub const RAW_FR: Self

Raw Frame Relay

Source

pub const APOLLO_DOMAIN: Self

Apollo Domain

Source

pub const APPLETALK: Self

Ethertalk (Appletalk)

Source

pub const IPX: Self

Novell IPX

Source

pub const RFC1144: Self

RFC 1144 TCP/IP compression

Source

pub const IP_AUTONOMOUS_SYSTEMS: Self

IP Autonomous Systems

Source

pub const SECURE_DATA: Self

Secure Data

Source

pub const WOL: Self

Wake-on-LAN

Source

pub const MSRP: Self

Stream Reservation Protocol

Source

pub const AVTP: Self

Audio Video Transport Protocol (AVTP)

Source

pub const DEC_MOP_RC: Self

DEC MOP RC

Source

pub const LAT: Self

DEC LAT length and 1 byte padding

Source

pub const AARP: Self

AppleTalk Address Resolution Protocol (AARP)

Source

pub const SLPP: Self

Simple Loop Prevention Protocol (SLPP)

Source

pub const VLACP: Self

Virtual Link Aggregation Control Protocol (VLACP)

Source

pub const QNX_QNET: Self

QNX Qnet

Source

pub const SLOW: Self

Ethernet Slow Protocols such as the Link Aggregation Control Protocol (LACP)

Source

pub const COBRANET: Self

CobraNet

Source

pub const HOMEPLUG: Self

HomePlug 1.0 MME

Source

pub const PROFINET: Self

PROFINET Protocol

Source

pub const HYPERSCSI: Self

HyperSCSI (SCSI over Ethernet)

Source

pub const ATAOE: Self

ATA over Ethernet

Source

pub const ETHERCAT: Self

EtherCAT Protocol

Ethernet Powerlink

Source

pub const GOOSE: Self

GOOSE (Generic Object Oriented Substation event)

Source

pub const GSE: Self

GSE (Generic Substation Events) Management Services

Source

pub const SV: Self

SV (Sampled Value Transmission)

Source

pub const ROMON: Self

MikroTik RoMON (unofficial)

Source

pub const SERCOS: Self

SERCOS III

Source

pub const HOMEPLUG_GREEN: Self

HomePlug Green PHY

Source

pub const MRP: Self

Media Redundancy Protocol (IEC62439-2)

Source

pub const PBB: Self

Provider Backbone Bridges (PBB) (IEEE 802.1ah)

Source

pub const PTP: Self

Precision Time Protocol (PTP) over IEEE 802.3 Ethernet

Source

pub const NCSI: Self

NC-SI

Source

pub const PRP: Self

Parallel Redundancy Protocol (PRP)

Source

pub const CFM: Self

IEEE 802.1ag Connectivity Fault Management (CFM) Protocol / ITU-T Recommendation Y.1731 (OAM)

Source

pub const FCOE: Self

Fibre Channel over Ethernet (FCoE)

Source

pub const FCOE_IP: Self

FCoE Initialization Protocol

Source

pub const ROCE: Self

RDMA over Converged Ethernet (RoCE)

Source

pub const TTE: Self

TTEthernet Protocol Control Frame (TTE)

Source

pub const IEEE1905_1: Self

1905.1 IEEE Protocol

Source

pub const HSR: Self

High-availability Seamless Redundancy (HSR)

Source

pub const LOOPBACK: Self

Ethernet Configuration Testing Protocol

Source

pub const REDUNDANCY_TAG: Self

Redundancy Tag (IEEE 802.1CB Frame Replication and Elimination for Reliability)

Source§

impl EtherType

Source

pub const fn ieee_description(self) -> Option<&'static str>

Available on crate feature ieee only.

A brief textual description of the EtherType sourced from the IEEE Registration Authority.

Source

pub const fn ieee_organization(self) -> Option<&'static str>

Available on crate feature ieee only.

The organization that registered the EtherType sourced from the IEEE Registration Authority.

Source

pub const fn ieee_organization_address(self) -> Option<&'static str>

Available on crate feature ieee only.

The address of the organization that registered the EtherType sourced from the IEEE Registration Authority.

Source§

impl EtherType

Source

pub const fn iana_description(self) -> Option<&'static str>

Available on crate feature iana only.

A brief textual description of the EtherType sourced from IANA.

Source§

impl EtherType

Source

pub const fn description(self) -> Option<&'static str>

Available on crate feature desc only.

A brief textual description of the EtherType if it is an associated constant.

Trait Implementations§

Source§

impl Clone for EtherType

Source§

fn clone(&self) -> EtherType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EtherType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EtherType

Available on crate feature serde only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for EtherType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<EtherType> for u16

Source§

fn from(value: EtherType) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for EtherType

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl FromStr for EtherType

Source§

type Err = ParseEtherTypeError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for EtherType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for EtherType

Source§

fn cmp(&self, other: &EtherType) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for EtherType

Source§

fn eq(&self, other: &EtherType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for EtherType

Source§

fn partial_cmp(&self, other: &EtherType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for EtherType

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for EtherType

Source§

impl Eq for EtherType

Source§

impl StructuralPartialEq for EtherType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,