Class: SetNwTTLAction

Inherits:
Action
  • Object
show all
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

#order

Instance Method Summary collapse

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.

Raises:

  • (ArgumentError)


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_hashObject

: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