diff --git a/Rakefile b/Rakefile index c10b93a9..07441859 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ require 'bundler/gem_tasks' RELISH_PROJECT = 'trema/pio' -FLAY_THRESHOLD = 1410 +FLAY_THRESHOLD = 1450 task default: :travis task test: [:spec, :cucumber] diff --git a/features/open_flow13/copy_ttl_outwards.feature b/features/open_flow13/copy_ttl_outwards.feature new file mode 100644 index 00000000..598080dd --- /dev/null +++ b/features/open_flow13/copy_ttl_outwards.feature @@ -0,0 +1,14 @@ +@open_flow13 +Feature: Pio::CopyTtlOutwards + + Copies TTL "outwards" -- from next-to-outermost to outermost + + Scenario: new + When I try to create an OpenFlow action with: + """ + Pio::CopyTtlOutwards.new + """ + Then it should finish successfully + And the action has the following fields and values: + | field | value | + | action_type | 11 | diff --git a/lib/pio/open_flow.rb b/lib/pio/open_flow.rb index d1b8c3b1..b5cbdbde 100644 --- a/lib/pio/open_flow.rb +++ b/lib/pio/open_flow.rb @@ -23,7 +23,8 @@ def self.switch_version(version) :QueueStats, :Error, :SetArpOperation, :SetArpSenderProtocolAddress, :SetArpSenderHardwareAddress, :NiciraRegMove, :SetMetadata, :NiciraRegLoad, :NiciraSendOutPort, :NiciraStackPush, - :NiciraStackPop, :DecrementIpTtl, :SetIpTtl].each do |each| + :NiciraStackPop, :DecrementIpTtl, :SetIpTtl, + :CopyTtlOutwards].each do |each| set_message_class_name each, version @version = version.to_s end diff --git a/lib/pio/open_flow13.rb b/lib/pio/open_flow13.rb index cfea0330..96387195 100644 --- a/lib/pio/open_flow13.rb +++ b/lib/pio/open_flow13.rb @@ -15,6 +15,7 @@ # Actions require 'pio/open_flow/nicira_resubmit' require 'pio/open_flow/nicira_resubmit_table' +require 'pio/open_flow13/copy_ttl_outwards' require 'pio/open_flow13/decrement_ip_ttl' require 'pio/open_flow13/nicira_reg_load' require 'pio/open_flow13/nicira_reg_move' diff --git a/lib/pio/open_flow13/copy_ttl_outwards.rb b/lib/pio/open_flow13/copy_ttl_outwards.rb new file mode 100644 index 00000000..80fd9efa --- /dev/null +++ b/lib/pio/open_flow13/copy_ttl_outwards.rb @@ -0,0 +1,15 @@ +require 'pio/open_flow/action' + +module Pio + module OpenFlow13 + # Copies TTL "outwards" -- from next-to-outermost to outermost + class CopyTtlOutwards < OpenFlow::Action + action_header action_type: 11, action_length: 8 + string :padding, length: 4 + + def initialize + super({}) + end + end + end +end