pub struct TrafficFilterNewRequest { /* private fields */ }

Implementations§

source§

impl TrafficFilterNewRequest

source

pub async fn execute(self) -> Result<(), Error>

Execute the request

source

pub fn index(self, index: i32) -> Self

Set interface index. Equivalent to dev STRING, dev and block are mutually exlusive.

source

pub fn block(self, block_index: u32) -> Self

Set block index. Equivalent to block BLOCK_INDEX.

source

pub fn parent(self, parent: u32) -> Self

Set parent. Equivalent to [ root | ingress | egress | parent CLASSID ] command args. They are mutually exclusive.

source

pub fn root(self) -> Self

Set parent to root.

source

pub fn ingress(self) -> Self

Set parent to ingress.

source

pub fn egress(self) -> Self

Set parent to egress.

source

pub fn priority(self, priority: u16) -> Self

Set priority. Equivalent to priority PRIO or pref PRIO.

source

pub fn protocol(self, protocol: u16) -> Self

Set protocol. Equivalent to protocol PROT. Default: ETH_P_ALL 0x0003, see llproto_names at iproute2/lib/ll_proto.c.

source

pub fn u32(self, options: &[TcFilterU32Option]) -> Result<Self, Error>

The 32bit filter allows to match arbitrary bitfields in the packet. Equivalent to tc filter ... u32.

source

pub fn redirect(self, dst_index: u32) -> Result<Self, Error>

Use u32 to implement traffic redirect. Equivalent to tc filter add [dev source] [parent ffff:] [protocol all] \ u32 match u8 0 0 action mirred egress redirect dev dest You need to set the parent and protocol before call redirect.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.