ROFL-pipeline  v0.6.0dev
Modules | Functions | Variables
Software Packet Processing (pp) APIs

APIs used to process packets in software pipelines (software and hybrid software/hardware switches) More...

Modules

 Packet Mangling API
 Packet Mangling API is in charge of packet manipulation and must be implemented by the library users.
 

Functions

static ROFL_BEGIN_DECLS
rofl_result_t 
of_process_packet_pipeline (const unsigned int tid, const of_switch_t *sw, struct datapacket *const pkt)
 Processes a packet through the OpenFlow pipeline. More...
 
void platform_of1x_packet_in (const of1x_switch_t *sw, uint8_t table_id, datapacket_t *pkt, uint16_t send_len, of_packet_in_reason_t reason)
 Packet in event notification. More...
 
static void of1x_process_packet_out_pipeline (const unsigned int tid, const of1x_switch_t *sw, datapacket_t *const pkt, const of1x_action_group_t *apply_actions_group)
 Processes a packet-out through the OpenFlow pipeline. More...
 

Variables

of1x_flow_entry_t *(* of1x_matching_algorithm_functions::find_best_match_hook )(unsigned tid, struct of1x_flow_table *const table, packet_matches_t *const pkt_matches)
 Finds the best match for the packet according the pkt_matches. More...
 

Detailed Description

APIs used to process packets in software pipelines (software and hybrid software/hardware switches)

Only the documented structures and APIs should be used by the user library.

Function Documentation

static void of1x_process_packet_out_pipeline ( const unsigned int  tid,
const of1x_switch_t sw,
datapacket_t *const  pkt,
const of1x_action_group_t apply_actions_group 
)
inlinestatic

Processes a packet-out through the OpenFlow pipeline.

Definition at line 171 of file of1x_pipeline_pp.h.

static ROFL_BEGIN_DECLS rofl_result_t of_process_packet_pipeline ( const unsigned int  tid,
const of_switch_t sw,
struct datapacket *const  pkt 
)
inlinestatic

Processes a packet through the OpenFlow pipeline.

This call may only be used if the platform does not have a hardware accelerated packet matching machinery. Packet matches of the datapacket_t MUST be initialized before calling of_process_packet_pipeline()

The tid is a unique ID between 0 (ROFL_PIPELINE_LOCKED_TID) and ROFL_PIPELINE_MAX_PIPELINE_TIDS-1 which is used to process packets lockless. It is up to the rofl-pipeline user to prevent two threads (or processes/bare metal CPUs sharing memory) to use the same TID.

The special ROFL_PIPELINE_LOCKED_TID is a special ID, which allow at the expense of memory barriers and locking.

Parameters
tidThread ID.
swThe switch which has to process the packet
pktA struct datapacket instance. All the fields must be set to NULL except maybe platform_state
Warning
Packet matches of the datapacket_t MUST be initialized before calling of_process_packet_pipeline()

Definition at line 48 of file of_switch_pp.h.

void platform_of1x_packet_in ( const of1x_switch_t sw,
uint8_t  table_id,
datapacket_t pkt,
uint16_t  send_len,
of_packet_in_reason_t  reason 
)

Packet in event notification.

The implementation of packet_in must either store the buffer (pkt) for later reference by the controller or DROP (release) the buffer (pkt) if there was an error on sending the PKT_IN event or no controller is attached. The packet matches can be obtained by calling fill_packet_matches().

Variable Documentation

of1x_flow_entry_t*(* of1x_matching_algorithm_functions::find_best_match_hook)(unsigned tid, struct of1x_flow_table *const table, packet_matches_t *const pkt_matches)

Finds the best match for the packet according the pkt_matches.

The lookup of the best match may use the algorithm internal representation to speedup the process.

In any case, the lookup MUST comply with the behaviour defined in the OpenFlow specifications for versions 1.0, 1.2 and 1.3.2

Definition at line 179 of file matching_algorithms.h.