Skip to main content

Crate wireforge_packet

Crate wireforge_packet 

Source
Expand description

WireForge Packet — unified packet enum and protocol dispatch.

This crate provides a single Packet enum that can represent any supported protocol layer, plus helper functions to automatically dispatch from raw bytes to the correct protocol parser.

Structs§

PacketSizeVisitor
Visitor that computes the total byte size of a packet and its payload.
ProtocolStackVisitor
Visitor that collects the protocol stack as a Vec of human-readable names (e.g. ["Ethernet", "IPv4", "TCP"]).

Enums§

Packet
Unified packet enum covering all supported L2–L4 protocols.

Traits§

PacketVisitor
Visitor for type-safe dispatch across all Packet variants.

Functions§

collect_protocol_stack
Walk the full protocol stack recursively, collecting names at each layer.
parse_ethernet_frame
Parse an Ethernet frame and dispatch the encapsulated protocol.
parse_ipv4_payload
Dispatch the payload of an IPv4 packet to the correct transport-layer parser.
parse_ipv6_payload
Dispatch the payload of an IPv6 packet (skipping extension headers).