-
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 SetArpSenderProtocolAddress action
- Loading branch information
Showing
5 changed files
with
40 additions
and
2 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
14 changes: 14 additions & 0 deletions
14
features/open_flow13/set_arp_sender_protocol_address.feature
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::SetArpSenderProtocolAddress | ||
|
||
Scenario: new('192.168.1.1') | ||
When I try to create an OpenFlow action with: | ||
""" | ||
Pio::SetArpSenderProtocolAddress.new('192.168.1.1') | ||
""" | ||
Then it should finish successfully | ||
And the action has the following fields and values: | ||
| field | value | | ||
| action_type | 25 | | ||
| action_length | 16 | | ||
| ip_address | 192.168.1.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
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 ARP sender protocol address field | ||
class SetArpSenderProtocolAddress < OpenFlow::Action | ||
action_header action_type: 25, action_length: 16 | ||
|
||
uint16 :oxm_class, value: Match::OXM_CLASS_OPENFLOW_BASIC | ||
bit7 :oxm_field, value: Match::ArpSenderProtocolAddress::OXM_FIELD | ||
bit1 :oxm_hasmask, value: 0 | ||
uint8 :oxm_length, value: 4 | ||
ip_address :ip_address | ||
string :padding, length: 4 | ||
hide :padding | ||
|
||
def initialize(ip_address) | ||
super ip_address: ip_address | ||
end | ||
end | ||
end | ||
end |