-
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.
Also added parsers and generators for the following instructions and actions. Instructions: - Pio::Apply - Pio::GotoTable - Pio::WriteMetadata - Pio::Meter Actions: - Pio::SendOutPort
- Loading branch information
Showing
60 changed files
with
840 additions
and
41 deletions.
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
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,43 @@ | ||
Feature: Apply-Actions instruction. | ||
Background: | ||
Given I use OpenFlow 1.3 | ||
|
||
Scenario: new() | ||
When I try to create an OpenFlow instruction with: | ||
""" | ||
Pio::Apply.new | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::Apply | | ||
| instruction_type | 4 | | ||
| instruction_length | 8 | | ||
| actions | [] | | ||
|
||
Scenario: new(SendOutPort.new(1)) | ||
When I try to create an OpenFlow instruction with: | ||
""" | ||
Pio::Apply.new(SendOutPort.new(1)) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::Apply | | ||
| instruction_type | 4 | | ||
| instruction_length | 24 | | ||
| actions.size | 1 | | ||
| actions.at(0).class | Pio::SendOutPort | | ||
| actions.at(0).port | 1 | | ||
|
||
Scenario: read | ||
When I try to parse a file named "open_flow13/apply_actions.raw" with "Pio::Apply" class | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::Apply | | ||
| instruction_type | 4 | | ||
| instruction_length | 24 | | ||
| actions.size | 1 | | ||
| actions.at(0).class | Pio::SendOutPort | | ||
| actions.at(0).port | 1 | |
Binary file not shown.
Binary file not shown.
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,146 @@ | ||
Feature: Pio::FlowMod | ||
Background: | ||
Given I use OpenFlow 1.3 | ||
|
||
Scenario: new | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::FlowMod.new | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::FlowMod | | ||
| ofp_version | 4 | | ||
| message_type | 14 | | ||
| message_length | 56 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| cookie | 0 | | ||
| cookie_mask | 0 | | ||
| table_id | 0 | | ||
| command | :add | | ||
| idle_timeout | 0 | | ||
| hard_timeout | 0 | | ||
| priority.to_hex | 0xffff | | ||
| buffer_id | :no_buffer | | ||
| out_port | :any | | ||
| out_group | :any | | ||
| flags | [] | | ||
| match.match_fields | [] | | ||
| instructions | [] | | ||
|
||
Scenario: new(instructions: Pio::Apply.new(SendOutPort.new(1))) | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::FlowMod.new(instructions: Pio::Apply.new(SendOutPort.new(1))) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::FlowMod | | ||
| ofp_version | 4 | | ||
| message_type | 14 | | ||
| message_length | 80 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| cookie | 0 | | ||
| cookie_mask | 0 | | ||
| table_id | 0 | | ||
| command | :add | | ||
| idle_timeout | 0 | | ||
| hard_timeout | 0 | | ||
| priority.to_hex | 0xffff | | ||
| buffer_id | :no_buffer | | ||
| out_port | :any | | ||
| out_group | :any | | ||
| flags | [] | | ||
| match.match_fields | [] | | ||
| instructions.size | 1 | | ||
| instructions.at(0).class | Pio::Apply | | ||
| instructions.at(0).actions.at(0).class | Pio::SendOutPort | | ||
| instructions.at(0).actions.at(0).port | 1 | | ||
|
||
Scenario: new(match: Pio::Match.new(in_port: 1), instructions: Pio::Apply.new(SendOutPort.new(1))) | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::FlowMod.new(match: Pio::Match.new(in_port: 1), instructions: Pio::Apply.new(SendOutPort.new(1))) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::FlowMod | | ||
| ofp_version | 4 | | ||
| message_type | 14 | | ||
| message_length | 88 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| cookie | 0 | | ||
| cookie_mask | 0 | | ||
| table_id | 0 | | ||
| command | :add | | ||
| idle_timeout | 0 | | ||
| hard_timeout | 0 | | ||
| priority.to_hex | 0xffff | | ||
| buffer_id | :no_buffer | | ||
| out_port | :any | | ||
| out_group | :any | | ||
| flags | [] | | ||
| match.in_port | 1 | | ||
| instructions.size | 1 | | ||
| instructions.at(0).class | Pio::Apply | | ||
| instructions.at(0).actions.at(0).class | Pio::SendOutPort | | ||
| instructions.at(0).actions.at(0).port | 1 | | ||
|
||
Scenario: read (no match or instructions) | ||
When I try to parse a file named "open_flow13/flow_mod_no_match_or_instructions.raw" with "Pio::FlowMod" class | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::FlowMod | | ||
| ofp_version | 4 | | ||
| message_type | 14 | | ||
| message_length | 56 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| cookie | 0 | | ||
| cookie_mask | 0 | | ||
| table_id | 0 | | ||
| command | :add | | ||
| idle_timeout | 0 | | ||
| hard_timeout | 0 | | ||
| priority.to_hex | 0xffff | | ||
| buffer_id | :no_buffer | | ||
| out_port | :any | | ||
| out_group | :any | | ||
| flags | [] | | ||
| match.match_fields | [] | | ||
| instructions | [] | | ||
|
||
Scenario: read (instruction = apply, action = SendOutPort(port: 1)) | ||
When I try to parse a file named "open_flow13/flow_mod_add_apply_no_match.raw" with "Pio::FlowMod" class | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::FlowMod | | ||
| ofp_version | 4 | | ||
| message_type | 14 | | ||
| message_length | 80 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| cookie | 0 | | ||
| cookie_mask | 0 | | ||
| table_id | 0 | | ||
| command | :add | | ||
| idle_timeout | 0 | | ||
| hard_timeout | 0 | | ||
| priority.to_hex | 0xffff | | ||
| buffer_id | :no_buffer | | ||
| out_port | :any | | ||
| out_group | :any | | ||
| flags | [] | | ||
| match.match_fields | [] | | ||
| instructions.size | 1 | | ||
| instructions.at(0).class | Pio::Apply | | ||
| instructions.at(0).actions.at(0).class | Pio::SendOutPort | | ||
| instructions.at(0).actions.at(0).port | 1 | |
Binary file not shown.
Binary file not shown.
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,26 @@ | ||
Feature: Pio::GotoTable | ||
Background: | ||
Given I use OpenFlow 1.3 | ||
|
||
Scenario: new(1) | ||
When I try to create an OpenFlow instruction with: | ||
""" | ||
Pio::GotoTable.new(1) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::GotoTable | | ||
| instruction_type | 1 | | ||
| instruction_length | 8 | | ||
| table_id | 1 | | ||
|
||
Scenario: read | ||
When I try to parse a file named "open_flow13/instruction_goto_table.raw" with "Pio::GotoTable" class | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::GotoTable | | ||
| instruction_type | 1 | | ||
| instruction_length | 8 | | ||
| table_id | 1 | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,26 @@ | ||
Feature: Pio::Meter | ||
Background: | ||
Given I use OpenFlow 1.3 | ||
|
||
Scenario: new(1) | ||
When I try to create an OpenFlow instruction with: | ||
""" | ||
Pio::Meter.new(1) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::Meter | | ||
| instruction_type | 6 | | ||
| instruction_length | 8 | | ||
| meter_id | 1 | | ||
|
||
Scenario: read | ||
When I try to parse a file named "open_flow13/instruction_meter.raw" with "Pio::Meter" class | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::Meter | | ||
| instruction_type | 6 | | ||
| instruction_length | 8 | | ||
| meter_id | 1 | |
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,28 @@ | ||
Feature: Pio::SendOutPort | ||
Background: | ||
Given I use OpenFlow 1.3 | ||
|
||
Scenario: new(1) | ||
When I try to create an OpenFlow action with: | ||
""" | ||
Pio::SendOutPort.new(1) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::SendOutPort | | ||
| action_type | 0 | | ||
| action_length | 16 | | ||
| port | 1 | | ||
| max_length | :no_buffer | | ||
|
||
Scenario: read | ||
When I try to parse a file named "open_flow13/send_out_port.raw" with "Pio::SendOutPort" class | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| class | Pio::SendOutPort | | ||
| action_type | 0 | | ||
| action_length | 16 | | ||
| port | 1 | | ||
| max_length | :no_buffer | |
Binary file not shown.
Oops, something went wrong.