pub enum Header<'a> {
Show 27 variants
Ethernet(EtherHeaderVlan<'a>),
Sll(&'a SllHeader),
Sllv2(&'a Sllv2Header),
Null(&'a NullHeader),
Ipv4(Ipv4HeaderOpt<'a>),
Ipv6(Ipv6HeaderExt<'a>),
Arp(ArpHeaderFull<'a>),
Tcp(TcpHeaderOpt<'a>),
Udp(&'a UdpHeader),
Sctp(&'a SctpHeader),
Icmp(&'a IcmpHeader),
Icmp6(&'a Icmp6Header),
Vxlan(&'a VxlanHeader),
Geneve(GeneveHeaderOpt<'a>),
Gre(GreHeaderOpt<'a>),
Mpls(MplsLabelStack<'a>),
Teredo(Box<TeredoPacket<'a>>),
Gtpv1(Gtpv1HeaderOpt<'a>),
Gtpv2(Gtpv2HeaderOpt<'a>),
L2tpv2(L2tpv2HeaderOpt<'a>),
L2tpv3(L2tpv3SessionHeaderCookie<'a>),
Nvgre(&'a NvgreHeader),
Pbb(PbbHeader<'a>),
Stt(SttPacket<'a>),
Pptp(PptpGreHeaderOpt<'a>),
Ipip(IpipTunnel<'a>),
Unknown {
proto: UnknownProto,
data: &'a [u8],
},
}Expand description
Enum wrapper for all supported packet headers
This enum provides a unified way to handle different protocol headers when iterating through a packet’s protocol stack.
Variants§
Ethernet(EtherHeaderVlan<'a>)
Ethernet II header (possibly with VLAN tags)
Sll(&'a SllHeader)
Linux cooked capture v1 header
Sllv2(&'a Sllv2Header)
Linux cooked capture v2 header
Null(&'a NullHeader)
BSD Null/Loopback header
Ipv4(Ipv4HeaderOpt<'a>)
IPv4 header with options
Ipv6(Ipv6HeaderExt<'a>)
IPv6 header with extension headers
Arp(ArpHeaderFull<'a>)
ARP header with addresses
Tcp(TcpHeaderOpt<'a>)
TCP header with options
Udp(&'a UdpHeader)
UDP header
Sctp(&'a SctpHeader)
SCTP header
Icmp(&'a IcmpHeader)
ICMPv4 header
Icmp6(&'a Icmp6Header)
ICMPv6 header
Vxlan(&'a VxlanHeader)
VXLAN tunnel header
Geneve(GeneveHeaderOpt<'a>)
Geneve tunnel header with options
Gre(GreHeaderOpt<'a>)
GRE tunnel header with options
Mpls(MplsLabelStack<'a>)
MPLS label stack
Teredo(Box<TeredoPacket<'a>>)
Teredo tunnel (parsed packet includes auth/origin indicators) Boxed to reduce Header enum size (TeredoPacket is 96 bytes)
Gtpv1(Gtpv1HeaderOpt<'a>)
GTPv1 header with options
Gtpv2(Gtpv2HeaderOpt<'a>)
GTPv2 header with options
L2tpv2(L2tpv2HeaderOpt<'a>)
L2TPv2 header with options
L2tpv3(L2tpv3SessionHeaderCookie<'a>)
L2TPv3 session header with cookie
Nvgre(&'a NvgreHeader)
NVGRE header (Network Virtualization using GRE)
Pbb(PbbHeader<'a>)
PBB header (Provider Backbone Bridge / MAC-in-MAC)
Stt(SttPacket<'a>)
STT packet (Stateless Transport Tunneling)
Pptp(PptpGreHeaderOpt<'a>)
PPTP GRE header with options
Ipip(IpipTunnel<'a>)
IP-in-IP tunnel (IPIP, SIT, IP4in6, IP6Tnl)
Unknown
Unknown/unsupported protocol
Contains the protocol identifier and the remaining unparsed data.
Fields
proto: UnknownProtoThe protocol that couldn’t be parsed
Implementations§
Source§impl<'a> Header<'a>
impl<'a> Header<'a>
Sourcepub fn is_link_layer(&self) -> bool
pub fn is_link_layer(&self) -> bool
Returns true if this is a link layer header
Sourcepub fn is_network_layer(&self) -> bool
pub fn is_network_layer(&self) -> bool
Returns true if this is a network layer header
Sourcepub fn is_transport_layer(&self) -> bool
pub fn is_transport_layer(&self) -> bool
Returns true if this is a transport layer header
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if this is an unknown protocol