pub struct ParsedPacket {Show 14 fields
pub protocol: Protocol,
pub local_addr: SocketAddr,
pub remote_addr: SocketAddr,
pub local_addr_kind: AddrKind,
pub remote_addr_kind: AddrKind,
pub remote_is_gateway: bool,
pub vlan_id: Option<u16>,
pub tcp_header: Option<TcpHeaderInfo>,
pub protocol_state: ProtocolState,
pub is_outgoing: bool,
pub packet_len: usize,
pub dpi_result: Option<DpiResult>,
pub process_name: Option<String>,
pub process_id: Option<u32>,
}Expand description
Result of parsing a packet
Fields§
§protocol: Protocol§local_addr: SocketAddr§remote_addr: SocketAddr§local_addr_kind: AddrKindEndpoint address kinds, stamped centrally in PacketParser::parse_packet
(subnet-broadcast detection needs the parser’s interface snapshot).
remote_addr_kind: AddrKind§remote_is_gateway: boolWhether the remote endpoint is a default-gateway address, stamped centrally alongside the address kinds from the parser’s route snapshot.
vlan_id: Option<u16>802.1Q VID present in the captured frame. Some(0) is a
priority tag; None means no tag was observed, including stripped tags.
tcp_header: Option<TcpHeaderInfo>§protocol_state: ProtocolState§is_outgoing: bool§packet_len: usize§dpi_result: Option<DpiResult>§process_name: Option<String>§process_id: Option<u32>Implementations§
Source§impl ParsedPacket
impl ParsedPacket
Sourcepub fn new(
protocol: Protocol,
local_addr: SocketAddr,
remote_addr: SocketAddr,
protocol_state: ProtocolState,
is_outgoing: bool,
packet_len: usize,
process_name: Option<String>,
process_id: Option<u32>,
) -> Self
pub fn new( protocol: Protocol, local_addr: SocketAddr, remote_addr: SocketAddr, protocol_state: ProtocolState, is_outgoing: bool, packet_len: usize, process_name: Option<String>, process_id: Option<u32>, ) -> Self
Packet with the given flow fields and process attribution. The address
kinds and gateway flag start at their unicast/false defaults (they are
overwritten centrally in PacketParser::parse_packet), and
tcp_header/dpi_result start as None for the caller to fill in
where applicable.
Sourcepub fn connection_key(&self) -> ConnectionKey
pub fn connection_key(&self) -> ConnectionKey
The flow identity this packet belongs to, derived from protocol and
addresses. ConnectionKey is Copy, so this costs nothing on the
per-packet path.