pub enum LayerEnum {
Show 20 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),
Raw(RawLayer),
}Expand description
Enum dispatch for protocol layers.
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)
Raw(RawLayer)
Implementations§
Source§impl LayerEnum
impl LayerEnum
pub fn kind(&self) -> LayerKind
pub fn index(&self) -> &LayerIndex
pub fn summary(&self, buf: &[u8]) -> String
pub fn hashret(&self, buf: &[u8]) -> Vec<u8> ⓘ
pub fn header_len(&self, buf: &[u8]) -> usize
Sourcepub fn show_fields(&self, buf: &[u8]) -> Vec<(&'static str, String)>
pub fn show_fields(&self, buf: &[u8]) -> Vec<(&'static str, String)>
Returns a detailed field-by-field representation for show() output. Format: Vec<(field_name, field_value)>
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>>
Get a field value by name from this layer. Returns None if the field doesn’t exist in this layer type.
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>>
Set a field value by name in this layer. Returns None if the field doesn’t exist in this layer type.
Sourcepub fn field_names(&self) -> &'static [&'static str]
pub fn field_names(&self) -> &'static [&'static str]
Get the list of field names for this layer type.
Trait Implementations§
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
Mutably borrows from an owned value. Read more