Skip to main content

NxLearn

Struct NxLearn 

Source
pub struct NxLearn {
    pub idle_timeout: u16,
    pub hard_timeout: u16,
    pub priority: u16,
    pub cookie: u64,
    pub flags: u16,
    pub table_id: u8,
    pub fin_idle_timeout: u16,
    pub fin_hard_timeout: u16,
    pub specs: Vec<LearnSpec>,
}
Expand description

NxLearn action (Nicira extension).

The learn action creates flows dynamically based on packet content. This is commonly used for MAC learning in OVS.

Fields§

§idle_timeout: u16

Idle timeout for learned flows (0 = no timeout)

§hard_timeout: u16

Hard timeout for learned flows (0 = no timeout)

§priority: u16

Priority of learned flows

§cookie: u64

Cookie for learned flows

§flags: u16

Learn flags

§table_id: u8

Table to install learned flows

§fin_idle_timeout: u16

Idle timeout when FIN received

§fin_hard_timeout: u16

Hard timeout when FIN received

§specs: Vec<LearnSpec>

Flow modification specs (match and action specifications)

Implementations§

Source§

impl NxLearn

Source

pub fn new() -> Self

Create a new learn action with defaults.

Source

pub fn idle_timeout(self, timeout: u16) -> Self

Set idle timeout for learned flows.

Source

pub fn hard_timeout(self, timeout: u16) -> Self

Set hard timeout for learned flows.

Source

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

Set priority for learned flows.

Source

pub fn cookie(self, cookie: u64) -> Self

Set cookie for learned flows.

Source

pub fn table(self, table_id: u8) -> Self

Set table for learned flows.

Source

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

Set flags.

Source

pub fn match_field(self, src_field: u32, dst_field: u32, n_bits: u16) -> Self

Add a spec to match a field from the packet.

Source

pub fn match_immediate( self, dst_field: u32, value: Vec<u8>, n_bits: u16, ) -> Self

Add a spec to match an immediate value.

Source

pub fn load_field(self, src_field: u32, dst_field: u32, n_bits: u16) -> Self

Add a spec to load a field from packet into action.

Source

pub fn load_immediate(self, dst_field: u32, value: Vec<u8>, n_bits: u16) -> Self

Add a spec to load an immediate value into action.

Source

pub fn output_field(self, src_field: u32, n_bits: u16) -> Self

Add a spec to output to port from field.

Trait Implementations§

Source§

impl Clone for NxLearn

Source§

fn clone(&self) -> NxLearn

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NxLearn

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NxLearn

Source§

fn default() -> NxLearn

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.