-
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 pull request #205 from trema/feature/barrier
Add Barrier Request and Reply.
- Loading branch information
Showing
9 changed files
with
170 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@open_flow10 | ||
Feature: Pio::Barrier::Reply | ||
Scenario: new | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::Barrier::Reply.new | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 19 | | ||
| message_length | 8 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| body | | | ||
|
||
Scenario: new(transaction_id: 123) | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::Barrier::Reply.new(transaction_id: 123) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 19 | | ||
| message_length | 8 | | ||
| transaction_id | 123 | | ||
| xid | 123 | | ||
| body | | | ||
|
||
Scenario: new(xid: 123) | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::Barrier::Reply.new(xid: 123) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 19 | | ||
| message_length | 8 | | ||
| transaction_id | 123 | | ||
| xid | 123 | | ||
| body | | | ||
|
||
Scenario: read | ||
When I try to parse a file named "open_flow10/barrier_reply.raw" with "Barrier::Reply" class | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 19 | | ||
| message_length | 8 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| body | | |
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,58 @@ | ||
@open_flow10 | ||
Feature: Pio::Barrier::Request | ||
Scenario: new | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::Barrier::Request.new | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 18 | | ||
| message_length | 8 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| body | | | ||
|
||
Scenario: new(transaction_id: 123) | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::Barrier::Request.new(transaction_id: 123) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 18 | | ||
| message_length | 8 | | ||
| transaction_id | 123 | | ||
| xid | 123 | | ||
| body | | | ||
|
||
Scenario: new(xid: 123) | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::Barrier::Request.new(xid: 123) | ||
""" | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 18 | | ||
| message_length | 8 | | ||
| transaction_id | 123 | | ||
| xid | 123 | | ||
| body | | | ||
|
||
Scenario: read | ||
When I try to parse a file named "open_flow10/barrier_request.raw" with "Barrier::Request" class | ||
Then it should finish successfully | ||
And the message have the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 18 | | ||
| message_length | 8 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| body | | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'pio/open_flow/format' | ||
require 'pio/open_flow/message' | ||
|
||
module Pio | ||
# OpenFlow 1.0 messages | ||
module OpenFlow10 | ||
# OpenFlow 1.0 Barrier messages | ||
module Barrier | ||
# OpenFlow 1.0 Barrier Request message | ||
class Reply < OpenFlow::Message | ||
# OpenFlow 1.0 Barrier Request message format | ||
class Format < BinData::Record | ||
extend OpenFlow::Format | ||
|
||
header version: 1, message_type: 19 | ||
string :body, value: '' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'pio/open_flow/format' | ||
require 'pio/open_flow/message' | ||
|
||
# Base module. | ||
module Pio | ||
# OpenFlow 1.0 messages | ||
module OpenFlow10 | ||
# OpenFlow 1.0 Barrier messages | ||
module Barrier | ||
# OpenFlow 1.0 Barrier Request message | ||
class Request < OpenFlow::Message | ||
# OpenFlow 1.0 Barrier Request message format | ||
class Format < BinData::Record | ||
extend OpenFlow::Format | ||
|
||
header version: 1, message_type: 18 | ||
string :body, value: '' | ||
end | ||
end | ||
end | ||
end | ||
end |