Skip to main content

Module layer

Module layer 

Source
Expand description

Layer definitions and enum dispatch for protocol handling.

This module implements the “Lazy Zero-Copy View” architecture where layers are represented as lightweight views into a raw packet buffer.

Re-exports§

pub use arp::ArpBuilder;
pub use arp::ArpLayer;
pub use bindings::LAYER_BINDINGS;
pub use bindings::LayerBinding;
pub use ethernet::Dot3Builder;
pub use ethernet::Dot3Layer;
pub use ethernet::EthernetBuilder;
pub use ethernet::EthernetLayer;
pub use field::BytesField;
pub use field::Field;
pub use field::FieldDesc;
pub use field::FieldError;
pub use field::FieldType;
pub use field::FieldValue;
pub use field::MacAddress;
pub use http::HTTP_FIELD_NAMES;
pub use http::HttpLayer;
pub use http::HttpRequestBuilder;
pub use http::HttpResponseBuilder;
pub use http2::HTTP2_FIELD_NAMES;
pub use http2::Http2Builder;
pub use http2::Http2FrameBuilder;
pub use http2::Http2Layer;
pub use icmp::ICMP_MIN_HEADER_LEN;
pub use icmp::IcmpBuilder;
pub use icmp::IcmpLayer;
pub use icmp::icmp_checksum;
pub use icmp::verify_icmp_checksum;
pub use icmpv6::ICMPV6_MIN_HEADER_LEN;
pub use icmpv6::Icmpv6Builder;
pub use icmpv6::Icmpv6Layer;
pub use icmpv6::icmpv6_checksum;
pub use icmpv6::verify_icmpv6_checksum;
pub use ipv4::Ipv4Builder;
pub use ipv4::Ipv4Flags;
pub use ipv4::Ipv4Layer;
pub use ipv4::Ipv4Options;
pub use ipv4::Ipv4Route;
pub use ipv6::IPV6_HEADER_LEN;
pub use ipv6::Ipv6Builder;
pub use ipv6::Ipv6Layer;
pub use l2tp::L2TP_FIELD_NAMES;
pub use l2tp::L2TP_MIN_HEADER_LEN;
pub use l2tp::L2TP_PORT;
pub use l2tp::L2tpBuilder;
pub use l2tp::L2tpLayer;
pub use neighbor::NeighborCache;
pub use neighbor::NeighborResolver;
pub use raw::RAW_FIELDS;
pub use raw::RawBuilder;
pub use raw::RawLayer;
pub use ssh::SSH_BINARY_HEADER_LEN;
pub use ssh::SSH_PORT;
pub use ssh::SshBuilder;
pub use ssh::SshLayer;
pub use stack::IntoLayerStackEntry;
pub use stack::LayerStack;
pub use stack::LayerStackEntry;
pub use tcp::TCP_FIELDS;
pub use tcp::TCP_MAX_HEADER_LEN;
pub use tcp::TCP_MIN_HEADER_LEN;
pub use tcp::TCP_SERVICES;
pub use tcp::TcpAoValue;
pub use tcp::TcpBuilder;
pub use tcp::TcpFlags;
pub use tcp::TcpLayer;
pub use tcp::TcpOption;
pub use tcp::TcpOptionKind;
pub use tcp::TcpOptions;
pub use tcp::TcpOptionsBuilder;
pub use tcp::TcpSackBlock;
pub use tcp::TcpTimestamp;
pub use tcp::service_name;
pub use tcp::service_port;
pub use tcp::tcp_checksum;
pub use tcp::tcp_checksum_ipv4;
pub use tcp::verify_tcp_checksum;
pub use tls::TLS_FIELDS;
pub use tls::TLS_PORT;
pub use tls::TLS_RECORD_HEADER_LEN;
pub use tls::TlsAlertBuilder;
pub use tls::TlsCcsBuilder;
pub use tls::TlsContentType;
pub use tls::TlsLayer;
pub use tls::TlsRecordBuilder;
pub use tls::TlsVersion;
pub use udp::UDP_HEADER_LEN;
pub use udp::UdpBuilder;
pub use udp::UdpLayer;
pub use udp::udp_checksum_ipv4;
pub use udp::udp_checksum_ipv6;
pub use udp::verify_udp_checksum_ipv4;
pub use udp::verify_udp_checksum_ipv6;
pub use dns::DnsLayer;

Modules§

arp
bindings
Layer binding system for automatic field setting when stacking layers.
dns
DNS protocol layer implementation (RFC 1035).
dot11
IEEE 802.11 (WiFi / Dot11) protocol layer implementation.
dot15d4
IEEE 802.15.4 (Zigbee / Dot15d4) protocol layer implementation.
ethernet
Ethernet II frame layer implementation.
ethertype
EtherType constants
field
Field trait and implementations for zero-copy field access.
field_ext
Extended field types for complex protocol fields.
generic
Generic / custom protocol layer for user-defined protocols.
http
HTTP/1.x layer implementation.
http2
HTTP/2 protocol layer (RFC 7540).
icmp
ICMP (Internet Control Message Protocol) layer implementation.
icmpv6
ICMPv6 (Internet Control Message Protocol for IPv6) layer implementation.
ip_protocol
IP protocol numbers
ipv4
IPv4 layer module.
ipv6
IPv6 layer implementation.
l2tp
L2TP (Layer 2 Tunneling Protocol) layer implementation.
neighbor
Neighbor resolution system for automatic MAC address lookup.
quic
QUIC protocol layer implementation (RFC 9000).
raw
Raw Layer Implementation
ssh
SSH (Secure Shell) protocol layer.
stack
Layer stacking support for packet composition.
tcp
TCP (Transmission Control Protocol) layer module.
tls
TLS (Transport Layer Security) protocol layer.
udp
UDP (User Datagram Protocol) layer implementation.

Structs§

LayerIndex
Index information for a layer within a packet buffer.

Enums§

LayerEnum
Enum dispatch for protocol layers.
LayerKind
Identifies the type of network protocol layer.

Traits§

Layer
Trait for types that can act as a network protocol layer.