Skip to content

Commit

Permalink
Add DecrementIpTtl action
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Nov 24, 2015
1 parent 5184287 commit f1603a1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
12 changes: 12 additions & 0 deletions features/open_flow13/decrement_ip_ttl.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@open_flow13
Feature: Pio::DecrementIpTtl

Scenario: new
When I try to create an OpenFlow action with:
"""
Pio::DecrementIpTtl.new
"""
Then it should finish successfully
And the action has the following fields and values:
| field | value |
| action_type | 24 |
2 changes: 1 addition & 1 deletion lib/pio/open_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.switch_version(version)
:QueueStats, :Error, :SetArpOperation, :SetArpSenderProtocolAddress,
:SetArpSenderHardwareAddress, :NiciraRegMove, :SetMetadata,
:NiciraRegLoad, :NiciraSendOutPort, :NiciraStackPush,
:NiciraStackPop].each do |each|
:NiciraStackPop, :DecrementIpTtl].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/decrement_ip_ttl'
require 'pio/open_flow13/nicira_reg_load'
require 'pio/open_flow13/nicira_reg_move'
require 'pio/open_flow13/nicira_send_out_port'
Expand Down
15 changes: 15 additions & 0 deletions lib/pio/open_flow13/decrement_ip_ttl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'pio/open_flow/action'

module Pio
module OpenFlow13
# Decrements IP TTL
class DecrementIpTtl < OpenFlow::Action
action_header action_type: 24, action_length: 8
string :padding, length: 4

def initialize
super({})
end
end
end
end

0 comments on commit f1603a1

Please sign in to comment.