pub struct NetworkPacket {
pub timestamp: DateTime<Utc>,
pub ethernet_layer: EthernetFrame,
pub ip_layer: IPv4Packet,
pub tcp_layer: TCPSegment,
pub application_layer: ApplicationData,
}Fields§
§timestamp: DateTime<Utc>§ethernet_layer: EthernetFrame§ip_layer: IPv4Packet§tcp_layer: TCPSegment§application_layer: ApplicationDataImplementations§
Source§impl NetworkPacket
Implementation for NetworkPacket
impl NetworkPacket
Implementation for NetworkPacket
Sourcepub fn total_size(&self) -> usize
pub fn total_size(&self) -> usize
Calculate the total size of the packet in bytes
Sourcepub fn is_handshake(&self) -> bool
pub fn is_handshake(&self) -> bool
Check if packet is part of a TCP handshake
Sourcepub fn get_protocol_string(&self) -> String
pub fn get_protocol_string(&self) -> String
Get the application protocol as a string
Trait Implementations§
Source§impl Clone for NetworkPacket
impl Clone for NetworkPacket
Source§fn clone(&self) -> NetworkPacket
fn clone(&self) -> NetworkPacket
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 NetworkPacket
impl Debug for NetworkPacket
Source§impl<'de> Deserialize<'de> for NetworkPacket
impl<'de> Deserialize<'de> for NetworkPacket
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NetworkPacket
impl RefUnwindSafe for NetworkPacket
impl Send for NetworkPacket
impl Sync for NetworkPacket
impl Unpin for NetworkPacket
impl UnwindSafe for NetworkPacket
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