Trait p4rs::Pipeline

source ·
pub trait Pipeline: Send {
    // Required methods
    fn process_packet<'a>(
        &mut self,
        port: u16,
        pkt: &mut packet_in<'a>
    ) -> Vec<(packet_out<'a>, u16)>;
    fn add_table_entry(
        &mut self,
        table_id: &str,
        action_id: &str,
        keyset_data: &[u8],
        parameter_data: &[u8],
        priority: u32
    );
    fn remove_table_entry(&mut self, table_id: &str, keyset_data: &[u8]);
    fn get_table_entries(&self, table_id: &str) -> Option<Vec<TableEntry>>;
    fn get_table_ids(&self) -> Vec<&str>;
}

Required Methods§

source

fn process_packet<'a>( &mut self, port: u16, pkt: &mut packet_in<'a> ) -> Vec<(packet_out<'a>, u16)>

Process an input packet and produce a set of output packets. Normally there will be a single output packet. However, if the pipeline sets egress_metadata_t.broadcast there may be multiple output packets.

source

fn add_table_entry( &mut self, table_id: &str, action_id: &str, keyset_data: &[u8], parameter_data: &[u8], priority: u32 )

Add an entry to a table identified by table_id.

source

fn remove_table_entry(&mut self, table_id: &str, keyset_data: &[u8])

Remove an entry from a table identified by table_id.

source

fn get_table_entries(&self, table_id: &str) -> Option<Vec<TableEntry>>

Get all the entries in a table.

source

fn get_table_ids(&self) -> Vec<&str>

Get a list of table ids

Implementors§