#[repr(C, packed(1))]pub struct IpV4Filter {
pub valid_fields: IpV4FilterFlags,
pub src_address: IpAddressV4,
pub dest_address: IpAddressV4,
pub protocol: u8,
pub padding: [u8; 3],
}
Expand description
Represents an IPv4 filter used by the packet filtering mechanism.
A Rust equivalent for _IP_V4_FILTER.
The valid_fields
field specifies which fields in the filter structure are used for filtering.
The src_address
field contains the source IPv4 address information.
The dest_address
field contains the destination IPv4 address information.
The protocol
field represents the IP protocol number.
The padding
field is used for alignment purposes.
Fields§
§valid_fields: IpV4FilterFlags
§src_address: IpAddressV4
§dest_address: IpAddressV4
§protocol: u8
§padding: [u8; 3]
Implementations§
Source§impl IpV4Filter
Creates a new IpV4Filter
instance.
impl IpV4Filter
Creates a new IpV4Filter
instance.
§Arguments
valid_fields
- Specifies which fields in the filter structure are used for filtering.src_address
- Contains the source IPv4 address information.dest_address
- Contains the destination IPv4 address information.protocol
- Represents the IP protocol number.
§Returns
- A new
IpV4Filter
instance.
pub fn new( valid_fields: IpV4FilterFlags, src_address: IpAddressV4, dest_address: IpAddressV4, protocol: u8, ) -> Self
Trait Implementations§
Source§impl Clone for IpV4Filter
impl Clone for IpV4Filter
Source§fn clone(&self) -> IpV4Filter
fn clone(&self) -> IpV4Filter
Returns a copy 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 Default for IpV4Filter
impl Default for IpV4Filter
Source§fn default() -> IpV4Filter
fn default() -> IpV4Filter
Returns the “default value” for a type. Read more
impl Copy for IpV4Filter
Auto Trait Implementations§
impl Freeze for IpV4Filter
impl RefUnwindSafe for IpV4Filter
impl Send for IpV4Filter
impl Sync for IpV4Filter
impl Unpin for IpV4Filter
impl UnwindSafe for IpV4Filter
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