pub enum LayerEnum {
Show 30 variants
Ethernet(EthernetLayer),
Dot3(Dot3Layer),
Arp(ArpLayer),
Ipv4(Ipv4Layer),
Ipv6(Ipv6Layer),
Icmp(IcmpLayer),
Icmpv6(Icmpv6Layer),
Tcp(TcpLayer),
Udp(UdpLayer),
Dns(DnsLayer),
Ssh(SshLayer),
Tls(TlsLayer),
Dot15d4(Dot15d4Layer),
Dot15d4Fcs(Dot15d4FcsLayer),
Dot11(Dot11Layer),
Http(HttpLayer),
Http2(Http2Layer),
Quic(QuicLayer),
L2tp(L2tpLayer),
Mqtt(MqttLayer),
MqttSn(MqttSnLayer),
Modbus(ModbusLayer),
ZWave(ZWaveLayer),
Ftp(FtpLayer),
Tftp(TftpLayer),
Smtp(SmtpLayer),
Pop3(Pop3Layer),
Imap(ImapLayer),
Dhcp(DhcpLayer),
Raw(RawLayer),
}Expand description
Enum dispatch for protocol layers.
The LayerDispatch trait is auto-implemented by enum_dispatch,
eliminating manual match arms and enabling better inlining.
Variants§
Ethernet(EthernetLayer)
Dot3(Dot3Layer)
Arp(ArpLayer)
Ipv4(Ipv4Layer)
Ipv6(Ipv6Layer)
Icmp(IcmpLayer)
Icmpv6(Icmpv6Layer)
Tcp(TcpLayer)
Udp(UdpLayer)
Dns(DnsLayer)
Ssh(SshLayer)
Tls(TlsLayer)
Dot15d4(Dot15d4Layer)
Dot15d4Fcs(Dot15d4FcsLayer)
Dot11(Dot11Layer)
Http(HttpLayer)
Http2(Http2Layer)
Quic(QuicLayer)
L2tp(L2tpLayer)
Mqtt(MqttLayer)
MqttSn(MqttSnLayer)
Modbus(ModbusLayer)
ZWave(ZWaveLayer)
Ftp(FtpLayer)
Tftp(TftpLayer)
Smtp(SmtpLayer)
Pop3(Pop3Layer)
Imap(ImapLayer)
Dhcp(DhcpLayer)
Raw(RawLayer)
Implementations§
Source§impl LayerEnum
impl LayerEnum
Sourcepub fn kind(&self) -> LayerKind
pub fn kind(&self) -> LayerKind
Delegate to LayerDispatch::dispatch_kind (auto-generated by enum_dispatch).
Sourcepub fn index(&self) -> &LayerIndex
pub fn index(&self) -> &LayerIndex
Delegate to LayerDispatch::dispatch_index.
Sourcepub fn header_len(&self, buf: &[u8]) -> usize
pub fn header_len(&self, buf: &[u8]) -> usize
Delegate to LayerDispatch::dispatch_header_len.
Sourcepub fn show_fields(&self, buf: &[u8]) -> Vec<(&'static str, String)>
pub fn show_fields(&self, buf: &[u8]) -> Vec<(&'static str, String)>
Delegate to LayerDispatch::dispatch_show_fields.
Sourcepub fn get_field(
&self,
buf: &[u8],
name: &str,
) -> Option<Result<FieldValue, FieldError>>
pub fn get_field( &self, buf: &[u8], name: &str, ) -> Option<Result<FieldValue, FieldError>>
Delegate to LayerDispatch::dispatch_get_field.
Sourcepub fn set_field(
&self,
buf: &mut [u8],
name: &str,
value: FieldValue,
) -> Option<Result<(), FieldError>>
pub fn set_field( &self, buf: &mut [u8], name: &str, value: FieldValue, ) -> Option<Result<(), FieldError>>
Delegate to LayerDispatch::dispatch_set_field.
Sourcepub fn field_names(&self) -> &'static [&'static str]
pub fn field_names(&self) -> &'static [&'static str]
Delegate to LayerDispatch::dispatch_field_names.
Trait Implementations§
Source§impl From<Dot11Layer> for LayerEnum
impl From<Dot11Layer> for LayerEnum
Source§fn from(v: Dot11Layer) -> LayerEnum
fn from(v: Dot11Layer) -> LayerEnum
Source§impl From<Dot15d4FcsLayer> for LayerEnum
impl From<Dot15d4FcsLayer> for LayerEnum
Source§fn from(v: Dot15d4FcsLayer) -> LayerEnum
fn from(v: Dot15d4FcsLayer) -> LayerEnum
Source§impl From<Dot15d4Layer> for LayerEnum
impl From<Dot15d4Layer> for LayerEnum
Source§fn from(v: Dot15d4Layer) -> LayerEnum
fn from(v: Dot15d4Layer) -> LayerEnum
Source§impl From<EthernetLayer> for LayerEnum
impl From<EthernetLayer> for LayerEnum
Source§fn from(v: EthernetLayer) -> LayerEnum
fn from(v: EthernetLayer) -> LayerEnum
Source§impl From<Http2Layer> for LayerEnum
impl From<Http2Layer> for LayerEnum
Source§fn from(v: Http2Layer) -> LayerEnum
fn from(v: Http2Layer) -> LayerEnum
Source§impl From<Icmpv6Layer> for LayerEnum
impl From<Icmpv6Layer> for LayerEnum
Source§fn from(v: Icmpv6Layer) -> LayerEnum
fn from(v: Icmpv6Layer) -> LayerEnum
Source§impl From<ModbusLayer> for LayerEnum
impl From<ModbusLayer> for LayerEnum
Source§fn from(v: ModbusLayer) -> LayerEnum
fn from(v: ModbusLayer) -> LayerEnum
Source§impl From<MqttSnLayer> for LayerEnum
impl From<MqttSnLayer> for LayerEnum
Source§fn from(v: MqttSnLayer) -> LayerEnum
fn from(v: MqttSnLayer) -> LayerEnum
Source§impl From<ZWaveLayer> for LayerEnum
impl From<ZWaveLayer> for LayerEnum
Source§fn from(v: ZWaveLayer) -> LayerEnum
fn from(v: ZWaveLayer) -> LayerEnum
Source§impl LayerDispatch for LayerEnum
impl LayerDispatch for LayerEnum
Source§fn dispatch_kind(&self) -> LayerKind
fn dispatch_kind(&self) -> LayerKind
Get the kind of this layer.
Source§fn dispatch_index(&self) -> &LayerIndex
fn dispatch_index(&self) -> &LayerIndex
Get the layer index (start/end offsets).
Source§fn dispatch_summary(&self, __enum_dispatch_arg_0: &[u8]) -> String
fn dispatch_summary(&self, __enum_dispatch_arg_0: &[u8]) -> String
Get a human-readable summary.
Source§fn dispatch_header_len(&self, __enum_dispatch_arg_0: &[u8]) -> usize
fn dispatch_header_len(&self, __enum_dispatch_arg_0: &[u8]) -> usize
Get the header length in bytes.
Source§fn dispatch_hashret(&self, __enum_dispatch_arg_0: &[u8]) -> Vec<u8> ⓘ
fn dispatch_hashret(&self, __enum_dispatch_arg_0: &[u8]) -> Vec<u8> ⓘ
Compute a hash for packet matching.
Source§fn dispatch_field_names(&self) -> &'static [&'static str]
fn dispatch_field_names(&self) -> &'static [&'static str]
Get field names for this layer type.
Source§fn dispatch_get_field(
&self,
__enum_dispatch_arg_0: &[u8],
__enum_dispatch_arg_1: &str,
) -> Option<Result<FieldValue, FieldError>>
fn dispatch_get_field( &self, __enum_dispatch_arg_0: &[u8], __enum_dispatch_arg_1: &str, ) -> Option<Result<FieldValue, FieldError>>
Get a field value by name.
Source§fn dispatch_set_field(
&self,
__enum_dispatch_arg_0: &mut [u8],
__enum_dispatch_arg_1: &str,
__enum_dispatch_arg_2: FieldValue,
) -> Option<Result<(), FieldError>>
fn dispatch_set_field( &self, __enum_dispatch_arg_0: &mut [u8], __enum_dispatch_arg_1: &str, __enum_dispatch_arg_2: FieldValue, ) -> Option<Result<(), FieldError>>
Set a field value by name.
Source§impl TryInto<Dot11Layer> for LayerEnum
impl TryInto<Dot11Layer> for LayerEnum
Source§impl TryInto<Dot15d4FcsLayer> for LayerEnum
impl TryInto<Dot15d4FcsLayer> for LayerEnum
Source§impl TryInto<Dot15d4Layer> for LayerEnum
impl TryInto<Dot15d4Layer> for LayerEnum
Source§impl TryInto<EthernetLayer> for LayerEnum
impl TryInto<EthernetLayer> for LayerEnum
Source§impl TryInto<Http2Layer> for LayerEnum
impl TryInto<Http2Layer> for LayerEnum
Source§impl TryInto<Icmpv6Layer> for LayerEnum
impl TryInto<Icmpv6Layer> for LayerEnum
Source§impl TryInto<ModbusLayer> for LayerEnum
impl TryInto<ModbusLayer> for LayerEnum
Source§impl TryInto<MqttSnLayer> for LayerEnum
impl TryInto<MqttSnLayer> for LayerEnum
Auto Trait Implementations§
impl Freeze for LayerEnum
impl RefUnwindSafe for LayerEnum
impl Send for LayerEnum
impl Sync for LayerEnum
impl Unpin for LayerEnum
impl UnsafeUnpin for LayerEnum
impl UnwindSafe for LayerEnum
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more