Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OpenFlow13::SetDestinationMacAddress class
- Loading branch information
Showing
4 changed files
with
39 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
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,14 @@ | ||
@open_flow13 | ||
Feature: Pio::SetDestinationMacAddress | ||
|
||
Scenario: new('11:22:33:44:55:66') | ||
When I try to create an OpenFlow action with: | ||
""" | ||
Pio::SetDestinationMacAddress.new('11:22:33:44:55:66') | ||
""" | ||
Then it should finish successfully | ||
And the action has the following fields and values: | ||
| field | value | | ||
| action_type | 25 | | ||
| action_length | 16 | | ||
| mac_address | 11:22:33:44:55:66 | |
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,23 @@ | ||
require 'pio/open_flow/action' | ||
require 'pio/open_flow13/match' | ||
|
||
module Pio | ||
module OpenFlow13 | ||
# Set a header field. | ||
class SetDestinationMacAddress < OpenFlow::Action | ||
action_header action_type: 25, action_length: 16 | ||
|
||
uint16 :oxm_class, value: Match::OXM_CLASS_OPENFLOW_BASIC | ||
bit7 :oxm_field, value: Match::DestinationMacAddress::OXM_FIELD | ||
bit1 :oxm_hasmask, value: 0 | ||
uint8 :oxm_length, value: 6 | ||
mac_address :mac_address | ||
string :padding, length: 2 | ||
hide :padding | ||
|
||
def initialize(mac_address) | ||
super mac_address: mac_address | ||
end | ||
end | ||
end | ||
end |