Skip to main content

Crate pcap

Crate pcap 

Source
Expand description

Pcapng parser and serializer.

The reference document is the pcapng RFC.

Modules§

compile
Module for compiling pcap filters using libpcap.

Structs§

EnhancedPacketBlockHeader
An Enhanced Packet Block structure for serialization as defined in pcapng RFC Section 4.3.
InterfaceDescriptionBlockHeader
An Interface Description Block structure for serialization as defined in pcapng RFC Section 4.2.
OptionHeader
An option header structure for serialization.
ParsedEnhancedPacket
A parsed Enhanced Packet Block as defined in pcapng RFC Section 4.3.
ParsedInterfaceDescription
A parsed Interface Description Block as defined in pcapng RFC Section 4.2.
ParsedInterfaceDescriptionOptions
Options parsed from an Interface Description Block as defined in pcapng RFC Section 4.2.
ParsedSectionHeader
A parsed Section Header Block as defined in pcapng RFC Section 4.1.
PcapNgPacketIter
An iterator over Enhanced Packet Blocks in a pcapng section as defined in pcapng RFC Section 4.3.
PcapNgSection
A parsed pcapng section.
SectionHeaderBlock
A Section Header Block structure for serialization as defined in pcapng RFC Section 4.1.

Enums§

BlockType
Pcapng block type.
InterfaceDescriptionOption
Interface Description Block options.
InterfaceDescriptionOptionCode
Option codes specific to Interface Description Blocks.
LinkType
Link type of an interface.
ParsingError
Errors that can occur while parsing a pcapng file.

Constants§

BLOCK_LEN_FOOTER_SIZE
The size of the block length footer that appears in all pcapng blocks.
UNSPECIFIED_SECTION_SIZE
According to pcapng RFC Section 4.1:

Traits§

PcapNgBlock
A trait for types that represent a pcapng block.

Functions§

parse_pcapng
Parses a pcapng file from a byte slice.
write_enhanced_packet_block
Writes an Enhanced Packet Block.
write_if_name_option
Writes a single if_name option.
write_interface_description_block
Write an interface description block with an interface name option.
write_prelude
Writes a Section Header Block and an Interface Description Block.