Class: SetTpDstAction

Inherits:
Action
  • Object
show all
Defined in:
lib/openflowdev/actions/set_tp_dst_action.rb

Overview

Class used to define OpenFlow action to set the TCP Destination port

Instance Attribute Summary

Attributes inherited from Action

#order

Instance Method Summary collapse

Constructor Details

#initialize(order: nil, port: nil) ⇒ SetTpDstAction

Parameters

  • order

    integer : The order of the action relative to other actions in Instruction.

  • port

    integer : The destination TCP port to set.

Raises:

  • (ArgumentError)


37
38
39
40
41
# File 'lib/openflowdev/actions/set_tp_dst_action.rb', line 37

def initialize(order: nil, port: nil)
  super(order: order)
  raise ArgumentError, "Port (port) required" unless port
  @port = port
end

Instance Method Details

#to_hashObject

:nodoc:



43
44
45
# File 'lib/openflowdev/actions/set_tp_dst_action.rb', line 43

def to_hash #:nodoc:
  {:order => order, 'set-tp-dst-action' => {:port => @port}}
end