Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CopyTtlOutwards action #292

Merged
merged 1 commit into from
Nov 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
14 changes: 14 additions & 0 deletions features/open_flow13/copy_ttl_outwards.feature
Original file line number Diff line number Diff line change
@@ -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 |
3 changes: 2 additions & 1 deletion lib/pio/open_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/pio/open_flow13.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 15 additions & 0 deletions lib/pio/open_flow13/copy_ttl_outwards.rb
Original file line number Diff line number Diff line change
@@ -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