-
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.
Add TableStats Request message generator.
- Loading branch information
Showing
5 changed files
with
57 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@open_flow10 | ||
Feature: Pio::TableStats::Request | ||
Scenario: new | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::TableStats::Request.new | ||
""" | ||
Then it should finish successfully | ||
And the message has the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 16 | | ||
| message_length | 12 | | ||
| transaction_id | 0 | | ||
| xid | 0 | | ||
| stats_type | :table | | ||
|
||
Scenario: new(transaction_id: 123) | ||
When I try to create an OpenFlow message with: | ||
""" | ||
Pio::TableStats::Request.new(transaction_id: 123) | ||
""" | ||
Then it should finish successfully | ||
And the message has the following fields and values: | ||
| field | value | | ||
| ofp_version | 1 | | ||
| message_type | 16 | | ||
| message_length | 12 | | ||
| transaction_id | 123 | | ||
| xid | 123 | | ||
| stats_type | :table | |
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,19 @@ | ||
require 'pio/open_flow10/stats_type' | ||
require 'pio/open_flow/message' | ||
|
||
module Pio | ||
module OpenFlow10 | ||
# OpenFlow 1.0 Table Stats messages | ||
module TableStats | ||
# OpenFlow 1.0 Table Stats Request message | ||
class Request < OpenFlow::Message | ||
open_flow_header version: 1, | ||
message_type: 16, | ||
message_length: 12 | ||
stats_type :stats_type, value: -> { :table } | ||
uint16 :flags | ||
string :body, value: '' | ||
end | ||
end | ||
end | ||
end |