Skip to content

Commit

Permalink
Add NiciraRegLoad action
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Nov 11, 2015
1 parent 6ff3161 commit ad8f74d
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 99 deletions.
56 changes: 56 additions & 0 deletions features/open_flow13/nicira_reg_load.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
@open_flow13
Feature: Pio::NiciraRegLoad

Scenario: new(0xdeadbeef, :reg0)
When I try to create an OpenFlow action with:
"""
Pio::NiciraRegLoad.new(0xdeadbeef, :reg0)
"""
Then it should finish successfully
And the action has the following fields and values:
| field | value |
| action_type.to_hex | 0xffff |
| action_length | 24 |
| experimenter_id.to_hex | 0x2320 |
| experimenter_type | 7 |
| offset | 0 |
| n_bits | 32 |
| destination | :reg0 |
| destination_internal | 65540 |
| value.to_hex | 0xdeadbeef |

Scenario: new(0xdeadbeef, :metadata)
When I try to create an OpenFlow action with:
"""
Pio::NiciraRegLoad.new(0xdeadbeef, :metadata)
"""
Then it should finish successfully
And the action has the following fields and values:
| field | value |
| action_type.to_hex | 0xffff |
| action_length | 24 |
| experimenter_id.to_hex | 0x2320 |
| experimenter_type | 7 |
| offset | 0 |
| n_bits | 64 |
| destination | :metadata |
| destination_internal | 2147484680 |
| value.to_hex | 0xdeadbeef |

Scenario: new(0xdeadbeef, :metadata, offset: 32, n_bits: 32)
When I try to create an OpenFlow action with:
"""
Pio::NiciraRegLoad.new(0xdeadbeef, :metadata, offset: 32, n_bits: 32)
"""
Then it should finish successfully
And the action has the following fields and values:
| field | value |
| action_type.to_hex | 0xffff |
| action_length | 24 |
| experimenter_id.to_hex | 0x2320 |
| experimenter_type | 7 |
| offset | 32 |
| n_bits | 32 |
| destination | :metadata |
| destination_internal | 2147484680 |
| value.to_hex | 0xdeadbeef |
2 changes: 1 addition & 1 deletion lib/pio/open_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.switch_version(version)
:FlowStats, :DescriptionStats, :AggregateStats, :TableStats, :PortStats,
:QueueStats, :Error, :NiciraResubmit, :SetArpOperation,
:SetArpSenderProtocolAddress, :SetArpSenderHardwareAddress,
:NiciraResubmitTable, :NiciraRegMove].each do |each|
:NiciraResubmitTable, :NiciraRegMove, :NiciraRegLoad].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 @@ -13,6 +13,7 @@
require 'pio/open_flow13/stats_request'

# Actions
require 'pio/open_flow13/nicira_reg_load'
require 'pio/open_flow13/nicira_reg_move'
require 'pio/open_flow13/send_out_port'
require 'pio/open_flow13/set_arp_operation'
Expand Down
Loading

0 comments on commit ad8f74d

Please sign in to comment.