#[repr(C, packed(1))]pub struct StaticFilter {
pub adapter_handle: u64,
pub direction_flags: DirectionFlags,
pub filter_action: u32,
pub valid_fields: FilterLayerFlags,
pub last_reset: u32,
pub packets_in: u64,
pub bytes_in: u64,
pub packets_out: u64,
pub bytes_out: u64,
pub data_link_filter: DataLinkLayerFilter,
pub network_filter: NetworkLayerFilter,
pub transport_filter: TransportLayerFilter,
}Expand description
This structure is used to define a single static filter rule for packet filtering. Each rule can specify filtering criteria at the data link, network, and transport layers. The structure also includes counters for incoming and outgoing packets and bytes that match the filter rule.
- Rust equivalent for _STATIC_FILTER
Fields§
§adapter_handle: u64Adapter handle extended to 64 bit size for structure compatibility across x64 and x86 architectures
direction_flags: DirectionFlagsPACKET_FLAG_ON_SEND or/and PACKET_FLAG_ON_RECEIVE to specify the direction of packets to match
filter_action: u32FILTER_PACKET_XXX to define the action to take when a packet matches the filter
valid_fields: FilterLayerFlagsSpecifies which of the fields below contain valid values and should be matched against the packet
last_reset: u32Time of the last counters reset (in seconds passed since 1 Jan 1980)
packets_in: u64Incoming packets passed through this filter
bytes_in: u64Incoming bytes passed through this filter
packets_out: u64Outgoing packets passed through this filter
bytes_out: u64Outgoing bytes passed through this filter
data_link_filter: DataLinkLayerFilterFilter criteria for the data link layer (e.g., Ethernet)
network_filter: NetworkLayerFilterFilter criteria for the network layer (e.g., IPv4, IPv6)
transport_filter: TransportLayerFilterFilter criteria for the transport layer (e.g., TCP, UDP, ICMP)
Implementations§
Source§impl StaticFilter
Creates a new StaticFilter instance.
impl StaticFilter
Creates a new StaticFilter instance.
§Arguments
adapter_handle- Adapter handle extended to 64 bit size for structure compatibility across x64 and x86 architectures.direction_flags- PACKET_FLAG_ON_SEND or/and PACKET_FLAG_ON_RECEIVE to specify the direction of packets to match.filter_action- FILTER_PACKET_XXX to define the action to take when a packet matches the filter.valid_fields- Specifies which of the fields below contain valid values and should be matched against the packet.data_link_filter- Filter criteria for the data link layer (e.g., Ethernet).network_filter- Filter criteria for the network layer (e.g., IPv4, IPv6).transport_filter- Filter criteria for the transport layer (e.g., TCP, UDP, ICMP).
§Returns
- A new
StaticFilterinstance.
pub fn new( adapter_handle: u64, direction_flags: DirectionFlags, filter_action: u32, valid_fields: FilterLayerFlags, data_link_filter: DataLinkLayerFilter, network_filter: NetworkLayerFilter, transport_filter: TransportLayerFilter, ) -> Self
Trait Implementations§
Source§impl Clone for StaticFilter
impl Clone for StaticFilter
Source§fn clone(&self) -> StaticFilter
fn clone(&self) -> StaticFilter
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for StaticFilter
impl Default for StaticFilter
Source§fn default() -> StaticFilter
fn default() -> StaticFilter
impl Copy for StaticFilter
Auto Trait Implementations§
impl Freeze for StaticFilter
impl RefUnwindSafe for StaticFilter
impl Send for StaticFilter
impl Sync for StaticFilter
impl Unpin for StaticFilter
impl UnwindSafe for StaticFilter
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)