pub struct WinDivertPacket<'a, L: WinDivertLayerTrait> {
pub address: WinDivertAddress<L>,
pub data: Cow<'a, [u8]>,
}Expand description
Raw captured packet
Fields§
§address: WinDivertAddress<L>Address data
data: Cow<'a, [u8]>Raw captured data
Implementations§
Source§impl<'a> WinDivertPacket<'a, NetworkLayer>
impl<'a> WinDivertPacket<'a, NetworkLayer>
Sourcepub unsafe fn new(data: Vec<u8>) -> Self
pub unsafe fn new(data: Vec<u8>) -> Self
Create a new network packet from a raw buffer
§Safety
address is zeroed, user must fill it with correct data before sending.
Sourcepub fn recalculate_checksums(
&mut self,
flags: ChecksumFlags,
) -> Result<(), WinDivertError>
pub fn recalculate_checksums( &mut self, flags: ChecksumFlags, ) -> Result<(), WinDivertError>
Recalculate the checksums of the packet This is a noop if the packet is not owned.
Source§impl<'a> WinDivertPacket<'a, ForwardLayer>
impl<'a> WinDivertPacket<'a, ForwardLayer>
Sourcepub unsafe fn new(data: Vec<u8>) -> Self
pub unsafe fn new(data: Vec<u8>) -> Self
Create a new network forward packet from a raw buffer
§Safety
address is zeroed, user must fill it with correct data before sending.
Sourcepub fn recalculate_checksums(
&mut self,
flags: ChecksumFlags,
) -> Result<(), WinDivertError>
pub fn recalculate_checksums( &mut self, flags: ChecksumFlags, ) -> Result<(), WinDivertError>
Recalculate the checksums of the packet This is a noop if the packet is not owned.
Source§impl<'a, L: WinDivertLayerTrait> WinDivertPacket<'a, L>
impl<'a, L: WinDivertLayerTrait> WinDivertPacket<'a, L>
Sourcepub fn into_owned(self) -> WinDivertPacket<'static, L>
pub fn into_owned(self) -> WinDivertPacket<'static, L>
Create an owned packet from a borrowed packet
Trait Implementations§
Source§impl<'a, L: Clone + WinDivertLayerTrait> Clone for WinDivertPacket<'a, L>
impl<'a, L: Clone + WinDivertLayerTrait> Clone for WinDivertPacket<'a, L>
Source§fn clone(&self) -> WinDivertPacket<'a, L>
fn clone(&self) -> WinDivertPacket<'a, L>
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 moreAuto Trait Implementations§
impl<'a, L> Freeze for WinDivertPacket<'a, L>
impl<'a, L> RefUnwindSafe for WinDivertPacket<'a, L>where
L: RefUnwindSafe,
impl<'a, L> Send for WinDivertPacket<'a, L>where
L: Send,
impl<'a, L> Sync for WinDivertPacket<'a, L>where
L: Sync,
impl<'a, L> Unpin for WinDivertPacket<'a, L>where
L: Unpin,
impl<'a, L> UnwindSafe for WinDivertPacket<'a, L>where
L: UnwindSafe,
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