pub struct ActionList { /* private fields */ }Expand description
A list of actions.
Implementations§
Source§impl ActionList
impl ActionList
Sourcepub fn output(self, port: impl Into<OutputPort>) -> Self
pub fn output(self, port: impl Into<OutputPort>) -> Self
Output to a port.
Sourcepub fn controller(self, max_len: u16) -> Self
pub fn controller(self, max_len: u16) -> Self
Send to controller.
Sourcepub fn set_eth_dst(self, mac: [u8; 6]) -> Self
pub fn set_eth_dst(self, mac: [u8; 6]) -> Self
Set destination MAC.
Sourcepub fn set_eth_src(self, mac: [u8; 6]) -> Self
pub fn set_eth_src(self, mac: [u8; 6]) -> Self
Set source MAC.
Sourcepub fn set_vlan_vid(self, vid: u16) -> Self
pub fn set_vlan_vid(self, vid: u16) -> Self
Set VLAN ID.
Sourcepub fn goto_table(self, table: u8) -> Self
pub fn goto_table(self, table: u8) -> Self
Go to another table.
Sourcepub fn set_tunnel_id(self, tunnel_id: u64) -> Self
pub fn set_tunnel_id(self, tunnel_id: u64) -> Self
Set tunnel ID (Nicira extension).
Sourcepub fn resubmit(self, port: Option<u16>, table: Option<u8>) -> Self
pub fn resubmit(self, port: Option<u16>, table: Option<u8>) -> Self
Resubmit to another table (Nicira extension).
port: Input port to use (None = current input port)table: Table to resubmit to (None = current table)
Sourcepub fn resubmit_table(self, table: u8) -> Self
pub fn resubmit_table(self, table: u8) -> Self
Resubmit to a specific table (Nicira extension).
Convenience method for resubmit(None, Some(table)).
Sourcepub fn ct(self, flags: u16, zone: u16, table: Option<u8>) -> Self
pub fn ct(self, flags: u16, zone: u16, table: Option<u8>) -> Self
Connection tracking action (Nicira extension).
flags: CT flags (commit, force, etc.)zone: CT zone IDtable: Table to recirculate to after CT (None = no recirc)
Sourcepub fn ct_commit(self, zone: u16) -> Self
pub fn ct_commit(self, zone: u16) -> Self
Connection tracking with commit (Nicira extension).
Commits the connection to the connection tracking table.
Sourcepub fn ct_nat(
self,
flags: u16,
zone: u16,
table: Option<u8>,
nat: NatConfig,
) -> Self
pub fn ct_nat( self, flags: u16, zone: u16, table: Option<u8>, nat: NatConfig, ) -> Self
Connection tracking with NAT (Nicira extension).
Performs connection tracking with Network Address Translation.
§Arguments
flags: CT flags (commit, force, etc.)zone: CT zone IDtable: Table to recirculate to after CT (None = no recirc)nat: NAT configuration (SNAT or DNAT)
§Example
use rovs_openflow::{ActionList, NatConfig, CT_COMMIT};
use std::net::Ipv4Addr;
// SNAT to 10.0.0.1
ActionList::new().ct_nat(
CT_COMMIT,
1,
Some(2),
NatConfig::snat(Ipv4Addr::new(10, 0, 0, 1)),
)Sourcepub fn learn(self, learn: NxLearn) -> Self
pub fn learn(self, learn: NxLearn) -> Self
Learn action (Nicira extension).
Creates flows dynamically based on packet content.
Sourcepub fn move_field(
self,
src_field: u32,
dst_field: u32,
n_bits: u16,
src_ofs: u16,
dst_ofs: u16,
) -> Self
pub fn move_field( self, src_field: u32, dst_field: u32, n_bits: u16, src_ofs: u16, dst_ofs: u16, ) -> Self
Sourcepub fn set_arp_op(self, opcode: u16) -> Self
pub fn set_arp_op(self, opcode: u16) -> Self
Set ARP opcode (Nicira extension).
Common values: 1 = request, 2 = reply
Sourcepub fn set_arp_spa(self, ip: u32) -> Self
pub fn set_arp_spa(self, ip: u32) -> Self
Set ARP source protocol address (sender IP).
Sourcepub fn set_arp_tpa(self, ip: u32) -> Self
pub fn set_arp_tpa(self, ip: u32) -> Self
Set ARP target protocol address (target IP).
Sourcepub fn set_arp_sha(self, mac: u64) -> Self
pub fn set_arp_sha(self, mac: u64) -> Self
Set ARP source hardware address (sender MAC).
Note: MAC is passed as a u64 with the MAC in the lower 48 bits.
Sourcepub fn set_arp_tha(self, mac: u64) -> Self
pub fn set_arp_tha(self, mac: u64) -> Self
Set ARP target hardware address (target MAC).
Note: MAC is passed as a u64 with the MAC in the lower 48 bits.
Trait Implementations§
Source§impl Clone for ActionList
impl Clone for ActionList
Source§fn clone(&self) -> ActionList
fn clone(&self) -> ActionList
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more