Class: SetNwSrcAction
- Defined in:
- lib/openflowdev/actions/set_nw_src_action.rb
Overview
Class used to define OpenFlow action for setting the Source IP address (network layer)
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(order: nil, ip_addr: nil) ⇒ SetNwSrcAction
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, ip_addr: nil) ⇒ SetNwSrcAction
Parameters
order-
integer : The order of the action relative to other actions in Instruction.
ip_addr-
string : The IP address to set in source IP
37 38 39 40 41 |
# File 'lib/openflowdev/actions/set_nw_src_action.rb', line 37 def initialize(order: nil, ip_addr: nil) super(order: order) raise ArgumentError, "IP Address (ip_addr) required" unless ip_addr @ip = ip_addr end |
Instance Method Details
#to_hash ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/openflowdev/actions/set_nw_src_action.rb', line 43 def to_hash #:nodoc: {:order => @order, 'set-nw-src-action' => {:address => @ip}} end |