-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/nicira_resubmit' into develop
- Loading branch information
Showing
7 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@open_flow10 | ||
Feature: Pio::NiciraResubmit | ||
|
||
Scenario: new(1) | ||
When I try to create an OpenFlow action with: | ||
""" | ||
Pio::NiciraResubmit.new(1) | ||
""" | ||
Then it should finish successfully | ||
And the action has the following fields and values: | ||
| field | value | | ||
| action_type.to_hex | 0xffff | | ||
| action_length | 16 | | ||
| vendor.to_hex | 0x2320 | | ||
| subtype | 1 | | ||
| in_port | 1 | | ||
|
||
Scenario: new(:in_port) | ||
When I try to create an OpenFlow action with: | ||
""" | ||
Pio::NiciraResubmit.new(:in_port) | ||
""" | ||
Then it should finish successfully | ||
And the action has the following fields and values: | ||
| field | value | | ||
| action_type.to_hex | 0xffff | | ||
| action_length | 16 | | ||
| vendor.to_hex | 0x2320 | | ||
| subtype | 1 | | ||
| in_port | :in_port | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@open_flow10 | ||
Feature: Pio::NiciraResubmitTable | ||
|
||
Scenario: new(in_port: 1, table: 1) | ||
When I try to create an OpenFlow action with: | ||
""" | ||
Pio::NiciraResubmitTable.new(in_port: 1, table: 1) | ||
""" | ||
Then it should finish successfully | ||
And the action has the following fields and values: | ||
| field | value | | ||
| action_type.to_hex | 0xffff | | ||
| action_length | 16 | | ||
| vendor.to_hex | 0x2320 | | ||
| subtype | 14 | | ||
| in_port | 1 | | ||
| table | 1 | | ||
|
||
Scenario: new(:in_port) | ||
When I try to create an OpenFlow action with: | ||
""" | ||
Pio::NiciraResubmitTable.new(in_port: 1) | ||
""" | ||
Then it should finish successfully | ||
And the action has the following fields and values: | ||
| field | value | | ||
| action_type.to_hex | 0xffff | | ||
| action_length | 16 | | ||
| vendor.to_hex | 0x2320 | | ||
| subtype | 14 | | ||
| in_port | 1 | | ||
| table.to_hex | 0xff | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'pio/open_flow/action' | ||
|
||
module Pio | ||
module OpenFlow | ||
# NXAST_* actions | ||
class NiciraAction < Action | ||
def self.nicira_action_header(options) | ||
module_eval do | ||
action_header action_type: options.fetch(:action_type), | ||
action_length: options.fetch(:action_length) | ||
uint32 :vendor, value: 0x2320 | ||
uint16 :subtype, value: options.fetch(:subtype) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'pio/open_flow/nicira_action' | ||
require 'pio/open_flow10/port16' | ||
|
||
module Pio | ||
module OpenFlow10 | ||
# NXAST_RESUBMIT action | ||
class NiciraResubmit < OpenFlow::NiciraAction | ||
nicira_action_header action_type: 0xffff, | ||
action_length: 16, | ||
subtype: 1 | ||
port16 :in_port | ||
string :padding, length: 4 | ||
hide :padding | ||
|
||
def initialize(port_number) | ||
super(in_port: port_number) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'pio/open_flow/nicira_action' | ||
require 'pio/open_flow10/port16' | ||
|
||
module Pio | ||
module OpenFlow10 | ||
# NXAST_RESUBMIT_TABLE action | ||
class NiciraResubmitTable < OpenFlow::NiciraAction | ||
nicira_action_header action_type: 0xffff, | ||
action_length: 16, | ||
subtype: 14 | ||
port16 :in_port | ||
uint8 :table, initial_value: 0xff | ||
string :padding, length: 3 | ||
hide :padding | ||
end | ||
end | ||
end |