pub enum TransportProtocol {
Tcp {
src_port: u16,
dst_port: u16,
syn: bool,
ack: bool,
fin: bool,
rst: bool,
payload_offset: usize,
},
Udp {
src_port: u16,
dst_port: u16,
payload_offset: usize,
},
Icmp {
icmp_type: u8,
code: u8,
},
Icmpv6 {
icmp_type: u8,
code: u8,
},
Other {
protocol_number: u8,
},
}Expand description
Transport layer protocol extracted from an IP packet.
Variants§
Tcp
TCP segment with source/destination ports and flags.
Udp
UDP datagram with source/destination ports.
Icmp
ICMP message with type and code.
Icmpv6
ICMPv6 message.
Other
Any other protocol (GRE, ESP, etc).
Implementations§
Source§impl TransportProtocol
impl TransportProtocol
Sourcepub fn protocol_number(&self) -> u8
pub fn protocol_number(&self) -> u8
Returns the protocol number (6=TCP, 17=UDP, 1=ICMP, 58=ICMPv6).
Trait Implementations§
Source§impl Clone for TransportProtocol
impl Clone for TransportProtocol
Source§fn clone(&self) -> TransportProtocol
fn clone(&self) -> TransportProtocol
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransportProtocol
impl Debug for TransportProtocol
Source§impl PartialEq for TransportProtocol
impl PartialEq for TransportProtocol
impl StructuralPartialEq for TransportProtocol
Auto Trait Implementations§
impl Freeze for TransportProtocol
impl RefUnwindSafe for TransportProtocol
impl Send for TransportProtocol
impl Sync for TransportProtocol
impl Unpin for TransportProtocol
impl UnsafeUnpin for TransportProtocol
impl UnwindSafe for TransportProtocol
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more