pub struct NetworkPacketEvent {
pub direction: Option<i32>,
pub interface: Option<String>,
pub length: Option<u32>,
pub uid: Option<u32>,
pub tag: Option<u32>,
pub ip_proto: Option<u32>,
pub tcp_flags: Option<u32>,
pub local_port: Option<u32>,
pub remote_port: Option<u32>,
pub icmp_type: Option<u32>,
pub icmp_code: Option<u32>,
}Expand description
NetworkPacketEvent records the details of a single packet sent or received on the network (in Linux kernel terminology, one sk_buff struct).
Fields§
§direction: Option<i32>The direction traffic is flowing for this event.
interface: Option<String>The name of the interface if available (e.g. ‘rmnet0’).
length: Option<u32>The length of the packet in bytes (wire_size - L2_header_size). Ignored when using NetworkPacketEvent as the ctx in either NetworkPacketBundle or NetworkPacketContext.
uid: Option<u32>The Linux user id associated with the packet’s socket.
tag: Option<u32>The Android network tag associated with the packet’s socket.
ip_proto: Option<u32>The packet’s IP protocol (TCP=6, UDP=17, etc).
tcp_flags: Option<u32>The packet’s TCP flags as a bitmask (FIN=0x1, SYN=0x2, RST=0x4, etc).
local_port: Option<u32>The local udp/tcp port of the packet.
remote_port: Option<u32>The remote udp/tcp port of the packet.
icmp_type: Option<u32>The 1-byte ICMP type identifier.
icmp_code: Option<u32>The 1-byte ICMP code identifier.
Implementations§
Source§impl NetworkPacketEvent
impl NetworkPacketEvent
Sourcepub fn direction(&self) -> TrafficDirection
pub fn direction(&self) -> TrafficDirection
Returns the enum value of direction, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_direction(&mut self, value: TrafficDirection)
pub fn set_direction(&mut self, value: TrafficDirection)
Sets direction to the provided enum value.
Sourcepub fn interface(&self) -> &str
pub fn interface(&self) -> &str
Returns the value of interface, or the default value if interface is unset.
Sourcepub fn length(&self) -> u32
pub fn length(&self) -> u32
Returns the value of length, or the default value if length is unset.
Sourcepub fn ip_proto(&self) -> u32
pub fn ip_proto(&self) -> u32
Returns the value of ip_proto, or the default value if ip_proto is unset.
Sourcepub fn tcp_flags(&self) -> u32
pub fn tcp_flags(&self) -> u32
Returns the value of tcp_flags, or the default value if tcp_flags is unset.
Sourcepub fn local_port(&self) -> u32
pub fn local_port(&self) -> u32
Returns the value of local_port, or the default value if local_port is unset.
Sourcepub fn remote_port(&self) -> u32
pub fn remote_port(&self) -> u32
Returns the value of remote_port, or the default value if remote_port is unset.
Trait Implementations§
Source§impl Clone for NetworkPacketEvent
impl Clone for NetworkPacketEvent
Source§fn clone(&self) -> NetworkPacketEvent
fn clone(&self) -> NetworkPacketEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NetworkPacketEvent
impl Debug for NetworkPacketEvent
Source§impl Default for NetworkPacketEvent
impl Default for NetworkPacketEvent
Source§fn default() -> NetworkPacketEvent
fn default() -> NetworkPacketEvent
Source§impl Message for NetworkPacketEvent
impl Message for NetworkPacketEvent
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for NetworkPacketEvent
impl PartialEq for NetworkPacketEvent
impl StructuralPartialEq for NetworkPacketEvent
Auto Trait Implementations§
impl Freeze for NetworkPacketEvent
impl RefUnwindSafe for NetworkPacketEvent
impl Send for NetworkPacketEvent
impl Sync for NetworkPacketEvent
impl Unpin for NetworkPacketEvent
impl UnwindSafe for NetworkPacketEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].