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 NiciraRegLoad action #281

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
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