Class: SetNwTTLAction
- Defined in:
- lib/openflowdev/actions/set_nw_ttl_action.rb
Overview
Class used to define OpenFlow action to set IP header Time To Live (network layer)
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(order: 0, ip_ttl: nil) ⇒ SetNwTTLAction
constructor
- Parameters *
order -
integer : The order of the action relative to other actions in Instruction.
- Parameters *
-
#to_hash ⇒ Object
:nodoc:.
Constructor Details
#initialize(order: 0, ip_ttl: nil) ⇒ SetNwTTLAction
Parameters
order-
integer : The order of the action relative to other actions in Instruction.
ip_ttl-
integer : The Time To Live to set in the IP header.
37 38 39 40 41 |
# File 'lib/openflowdev/actions/set_nw_ttl_action.rb', line 37 def initialize(order: 0, ip_ttl: nil) super(order: order) raise ArgumentError, "IP TTL (ip_ttl) required" unless ip_ttl @ip_ttl = ip_ttl end |
Instance Method Details
#to_hash ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/openflowdev/actions/set_nw_ttl_action.rb', line 43 def to_hash #:nodoc: {:order => @order, 'set-nw-ttl-action' => {'nw-ttl' => @ip_ttl}} end |