A Discrete-Event Network Simulator
API
ns3::ofi Namespace Reference

Classes

struct  Action
 Class for handling flow table actions. More...
 
class  Controller
 An interface for a Controller of OpenFlowSwitchNetDevices. More...
 
class  DropController
 Demonstration of a Drop controller. More...
 
struct  EricssonAction
 Class for handling Ericsson Vendor-defined actions. More...
 
class  LearningController
 Demonstration of a Learning controller. More...
 
struct  Port
 Port and its metadata. More...
 
class  Stats
 OpenFlow statistics. More...
 
struct  StatsDumpCallback
 Callback for a stats dump request. More...
 
struct  SwitchPacketMetadata
 Packet Metadata, allows us to track the packet's metadata as it passes through the switch. More...
 
struct  VPortAction
 Class for handling virtual port table actions. More...
 

Functions

void ExecuteActions (Ptr< OpenFlowSwitchNetDevice > swtch, uint64_t packet_uid, ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *actions, size_t actions_len, int ignore_no_fwd)
 Executes a list of flow table actions. More...
 
void ExecuteVendor (ofpbuf *buffer, const sw_flow_key *key, const ofp_action_header *ah)
 Executes a vendor-defined action. More...
 
void ExecuteVPortActions (Ptr< OpenFlowSwitchNetDevice > swtch, uint64_t packet_uid, ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *actions, size_t actions_len)
 Executes a list of virtual port table entry actions. More...
 
int Stats_AggregateDumpCallback (sw_flow *flow, void *state)
 
int Stats_FlowDumpCallback (sw_flow *flow, void *state)
 
uint16_t ValidateActions (const sw_flow_key *key, const ofp_action_header *actions, size_t actions_len)
 Validates a list of flow table actions. More...
 
uint16_t ValidateVendor (const sw_flow_key *key, const ofp_action_header *ah, uint16_t len)
 Validates a vendor-defined action. More...
 
uint16_t ValidateVPortActions (const ofp_action_header *actions, size_t actions_len)
 Validates a list of virtual port table entry actions. More...
 

Function Documentation

◆ ExecuteActions()

void ns3::ofi::ExecuteActions ( Ptr< OpenFlowSwitchNetDevice swtch,
uint64_t  packet_uid,
ofpbuf *  buffer,
sw_flow_key *  key,
const ofp_action_header *  actions,
size_t  actions_len,
int  ignore_no_fwd 
)

Executes a list of flow table actions.

Parameters
swtchOpenFlowSwitchNetDevice these actions are being executed on.
packet_uidPacket UID; used to fetch the packet and its metadata.
bufferThe Packet OpenFlow buffer.
keyThe matching key for the flow tied to this list of actions.
actionsA buffer of actions.
actions_lenLength of actions buffer.
ignore_no_fwdIf true, during port forwarding actions, ports that are set to not forward are forced to forward.

Definition at line 950 of file openflow-interface.cc.

References ns3::ofi::Action::Execute(), ExecuteVendor(), ns3::ofi::Action::IsValidType(), NS_LOG_FUNCTION_NOARGS, NS_LOG_INFO, openflow-switch::swtch, and check-style-clang-format::type.

Referenced by ns3::OpenFlowSwitchNetDevice::AddFlow(), ns3::OpenFlowSwitchNetDevice::FlowTableLookup(), ns3::OpenFlowSwitchNetDevice::ModFlow(), and ns3::OpenFlowSwitchNetDevice::ReceivePacketOut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExecuteVendor()

void ns3::ofi::ExecuteVendor ( ofpbuf *  buffer,
const sw_flow_key *  key,
const ofp_action_header *  ah 
)

Executes a vendor-defined action.

Parameters
bufferThe Packet OpenFlow buffer.
keyThe matching key for the flow tied to this list of actions.
ahHeader of the action.

Definition at line 1178 of file openflow-interface.cc.

References ns3::ofi::EricssonAction::Execute(), and NS_LOG_INFO.

Referenced by ExecuteActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExecuteVPortActions()

void ns3::ofi::ExecuteVPortActions ( Ptr< OpenFlowSwitchNetDevice swtch,
uint64_t  packet_uid,
ofpbuf *  buffer,
sw_flow_key *  key,
const ofp_action_header *  actions,
size_t  actions_len 
)

Executes a list of virtual port table entry actions.

Parameters
swtchOpenFlowSwitchNetDevice these actions are being executed on.
packet_uidPacket UID; used to fetch the packet and its metadata.
bufferThe Packet OpenFlow buffer.
keyThe matching key for the flow tied to this list of actions.
actionsA buffer of actions.
actions_lenLength of actions buffer.

Definition at line 1077 of file openflow-interface.cc.

References ns3::ofi::VPortAction::Execute(), openflow-switch::swtch, and check-style-clang-format::type.

Referenced by ns3::OpenFlowSwitchNetDevice::RunThroughVPortTable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Stats_AggregateDumpCallback()

int ns3::ofi::Stats_AggregateDumpCallback ( sw_flow *  flow,
void *  state 
)

Definition at line 242 of file openflow-interface.cc.

◆ Stats_FlowDumpCallback()

int ns3::ofi::Stats_FlowDumpCallback ( sw_flow *  flow,
void *  state 
)

Definition at line 171 of file openflow-interface.cc.

References MAX_FLOW_STATS_BYTES.

◆ ValidateActions()

uint16_t ns3::ofi::ValidateActions ( const sw_flow_key *  key,
const ofp_action_header *  actions,
size_t  actions_len 
)

Validates a list of flow table actions.

Parameters
keyThe matching key for the flow tied to this list of actions.
actionsA buffer of actions.
actions_lenLength of actions buffer.
Returns
If the action list validates, ACT_VALIDATION_OK is returned. Otherwise, a code for the OFPET_BAD_ACTION error type is returned.

Definition at line 1023 of file openflow-interface.cc.

References ns3::ofi::Action::IsValidType(), check-style-clang-format::type, ns3::ofi::Action::Validate(), and ValidateVendor().

Referenced by ns3::OpenFlowSwitchNetDevice::AddFlow(), ns3::OpenFlowSwitchNetDevice::ModFlow(), and ns3::OpenFlowSwitchNetDevice::ReceivePacketOut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateVendor()

uint16_t ns3::ofi::ValidateVendor ( const sw_flow_key *  key,
const ofp_action_header *  ah,
uint16_t  len 
)

Validates a vendor-defined action.

Parameters
keyThe matching key for the flow tied to this list of actions.
ahHeader of the action.
lenLength of the action.
Returns
If the action list validates, ACT_VALIDATION_OK is returned. Otherwise, a code for the OFPET_BAD_ACTION error type is returned.

Definition at line 1200 of file openflow-interface.cc.

References ns3::ofi::EricssonAction::Validate().

Referenced by ValidateActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateVPortActions()

uint16_t ns3::ofi::ValidateVPortActions ( const ofp_action_header *  actions,
size_t  actions_len 
)

Validates a list of virtual port table entry actions.

Parameters
actionsA buffer of actions.
actions_lenLength of actions buffer.
Returns
If the action list validates, ACT_VALIDATION_OK is returned. Otherwise, a code for the OFPET_BAD_ACTION error type is returned.

Definition at line 1131 of file openflow-interface.cc.

References ns3::ofi::VPortAction::IsValidType(), check-style-clang-format::type, and ns3::ofi::VPortAction::Validate().

Referenced by ns3::OpenFlowSwitchNetDevice::AddVPort().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: