Class: SetDlSrcAction
- Defined in:
- lib/openflowdev/actions/set_dl_src_action.rb
Overview
Class to define an OpenFlow action to set the Ethernet (data layer) source MAC address
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(order: nil, mac_addr: nil) ⇒ SetDlSrcAction
constructor
- Parameters *
order -
integer : The order of the action relative to other actions in Instruction.
- Parameters *
-
#to_hash ⇒ Object
:nodoc:.
Constructor Details
#initialize(order: nil, mac_addr: nil) ⇒ SetDlSrcAction
Parameters
order-
integer : The order of the action relative to other actions in Instruction.
mac_addr-
string : The MAC address to set in source field of ethernet header.
37 38 39 40 41 |
# File 'lib/openflowdev/actions/set_dl_src_action.rb', line 37 def initialize(order: nil, mac_addr: nil) super(order: order) raise ArgumentError, "MAC Address (mac_addr) required" @mac = mac_addr end |
Instance Method Details
#to_hash ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/openflowdev/actions/set_dl_src_action.rb', line 43 def to_hash #:nodoc: {:order => @order, 'set-dl-src-action' => {:address => @mac}} end |