Skip to content

Commit

Permalink
Rename ether_destination -> destination_mac
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Nov 5, 2015
1 parent dc3a746 commit db0003d
Show file tree
Hide file tree
Showing 18 changed files with 111 additions and 111 deletions.
4 changes: 2 additions & 2 deletions features/open_flow10/aggregate_stats_request.feature
Expand Up @@ -16,7 +16,7 @@ Feature: Pio::AggregateStats::Request
| stats_type | :aggregate |
| match.in_port | 1 |
| match.wildcards.keys.size | 11 |
| match.wildcards.fetch(:ether_destination_address) | true |
| match.wildcards.fetch(:destination_mac_address) | true |
| match.wildcards.fetch(:source_mac_address) | true |
| match.wildcards.fetch(:ether_type) | true |
| match.wildcards.fetch(:ip_destination_address_all) | true |
Expand All @@ -43,7 +43,7 @@ Feature: Pio::AggregateStats::Request
| xid | 14 |
| stats_type | :aggregate |
| match.wildcards.keys.size | 12 |
| match.wildcards.fetch(:ether_destination_address) | true |
| match.wildcards.fetch(:destination_mac_address) | true |
| match.wildcards.fetch(:source_mac_address) | true |
| match.wildcards.fetch(:ether_type) | true |
| match.wildcards.fetch(:in_port) | true |
Expand Down
6 changes: 3 additions & 3 deletions features/open_flow10/exact_match.feature
Expand Up @@ -6,7 +6,7 @@ Feature: Pio::ExactMatch
| wildcards | {} |
| in_port | 1 |
| source_mac_address | ac:5d:10:31:37:79 |
| ether_destination_address | ff:ff:ff:ff:ff:ff |
| destination_mac_address | ff:ff:ff:ff:ff:ff |
| vlan_vid | 65535 |
| vlan_priority | 0 |
| ether_type | 2054 |
Expand All @@ -24,7 +24,7 @@ Feature: Pio::ExactMatch
| wildcards | {} |
| in_port | 1 |
| source_mac_address | 11:11:11:11:11:11 |
| ether_destination_address | 22:22:22:22:22:22 |
| destination_mac_address | 22:22:22:22:22:22 |
| vlan_vid | 65535 |
| vlan_priority | 0 |
| ether_type | 2054 |
Expand All @@ -42,7 +42,7 @@ Feature: Pio::ExactMatch
| wildcards | {} |
| in_port | 1 |
| source_mac_address | 00:00:00:00:00:01 |
| ether_destination_address | 80:00:00:00:00:01 |
| destination_mac_address | 80:00:00:00:00:01 |
| vlan_vid | 65535 |
| vlan_priority | 0 |
| ether_type | 2048 |
Expand Down
80 changes: 40 additions & 40 deletions features/open_flow10/features_reply.feature

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions features/open_flow10/flow_mod.feature
Expand Up @@ -30,7 +30,7 @@ Feature: Pio::FlowMod
| match.wildcards.key?(:in_port) | true |
| match.wildcards.key?(:vlan_vid) | true |
| match.wildcards.key?(:source_mac_address) | true |
| match.wildcards.key?(:ether_destination_address) | true |
| match.wildcards.key?(:destination_mac_address) | true |
| match.wildcards.key?(:ether_type) | true |
| match.wildcards.key?(:ip_protocol) | true |
| match.wildcards.key?(:transport_source_port) | true |
Expand All @@ -55,7 +55,7 @@ Feature: Pio::FlowMod
| match.wildcards | {:ip_source_address=>24, :ip_destination_address=>24} |
| match.in_port | 1 |
| match.source_mac_address | 00:00:00:00:00:0a |
| match.ether_destination_address | 00:00:00:00:00:14 |
| match.destination_mac_address | 00:00:00:00:00:14 |
| match.vlan_vid | 0 |
| match.vlan_priority | 0 |
| match.ether_type | 2048 |
Expand Down Expand Up @@ -92,7 +92,7 @@ Feature: Pio::FlowMod
| match.wildcards | {:ip_source_address=>24, :ip_destination_address=>24} |
| match.in_port | 1 |
| match.source_mac_address | 00:00:00:00:00:0a |
| match.ether_destination_address | 00:00:00:00:00:14 |
| match.destination_mac_address | 00:00:00:00:00:14 |
| match.vlan_vid | 0 |
| match.vlan_priority | 0 |
| match.ether_type | 2048 |
Expand Down Expand Up @@ -129,7 +129,7 @@ Feature: Pio::FlowMod
| match.wildcards | {:ip_source_address=>24, :ip_destination_address=>24} |
| match.in_port | 1 |
| match.source_mac_address | 00:00:00:00:00:0a |
| match.ether_destination_address | 00:00:00:00:00:14 |
| match.destination_mac_address | 00:00:00:00:00:14 |
| match.vlan_vid | 0 |
| match.vlan_priority | 0 |
| match.ether_type | 2048 |
Expand Down Expand Up @@ -166,7 +166,7 @@ Feature: Pio::FlowMod
| match.wildcards | {:ip_source_address=>24, :ip_destination_address=>24} |
| match.in_port | 1 |
| match.source_mac_address | 00:00:00:00:00:0a |
| match.ether_destination_address | 00:00:00:00:00:00 |
| match.destination_mac_address | 00:00:00:00:00:00 |
| match.vlan_vid | 0 |
| match.vlan_priority | 0 |
| match.ether_type | 2048 |
Expand Down Expand Up @@ -201,7 +201,7 @@ Feature: Pio::FlowMod
| match.wildcards | {:ip_source_address=>24, :ip_destination_address=>24} |
| match.in_port | 1 |
| match.source_mac_address | 00:00:00:00:00:0a |
| match.ether_destination_address | 00:00:00:00:00:14 |
| match.destination_mac_address | 00:00:00:00:00:14 |
| match.vlan_vid | 0 |
| match.vlan_priority | 0 |
| match.ether_type | 2048 |
Expand Down
2 changes: 1 addition & 1 deletion features/open_flow10/flow_removed.feature
Expand Up @@ -13,7 +13,7 @@ Feature: Pio::FlowRemoved
| transaction_id | 0 |
| xid | 0 |
| match.wildcards.keys.size | 11 |
| match.wildcards.fetch(:ether_destination_address) | true |
| match.wildcards.fetch(:destination_mac_address) | true |
| match.wildcards.fetch(:source_mac_address) | true |
| match.wildcards.fetch(:ether_type) | true |
| match.wildcards.fetch(:ip_destination_address_all) | true |
Expand Down
4 changes: 2 additions & 2 deletions features/open_flow10/flow_stats_reply.feature
Expand Up @@ -39,7 +39,7 @@ Feature: Pio::FlowStats::Reply
| stats[0].entry_length | 104 |
| stats[0].table_id | 3 |
| stats[0].match.wildcards.keys.size | 14 |
| stats[0].match.wildcards.fetch(:ether_destination_address) | true |
| stats[0].match.wildcards.fetch(:destination_mac_address) | true |
| stats[0].match.wildcards.fetch(:source_mac_address) | true |
| stats[0].match.wildcards.fetch(:ether_type) | true |
| stats[0].match.wildcards.fetch(:in_port) | true |
Expand Down Expand Up @@ -71,7 +71,7 @@ Feature: Pio::FlowStats::Reply
| stats[1].entry_length | 112 |
| stats[1].table_id | 4 |
| stats[1].match.wildcards.keys.size | 14 |
| stats[1].match.wildcards.fetch(:ether_destination_address) | true |
| stats[1].match.wildcards.fetch(:destination_mac_address) | true |
| stats[1].match.wildcards.fetch(:source_mac_address) | true |
| stats[1].match.wildcards.fetch(:ether_type) | true |
| stats[1].match.wildcards.fetch(:in_port) | true |
Expand Down
6 changes: 3 additions & 3 deletions features/open_flow10/flow_stats_request.feature
Expand Up @@ -15,7 +15,7 @@ Feature: Pio::FlowStats::Request
| xid | 0 |
| stats_type | :flow |
| match.wildcards.keys.size | 12 |
| match.wildcards.fetch(:ether_destination_address) | true |
| match.wildcards.fetch(:destination_mac_address) | true |
| match.wildcards.fetch(:source_mac_address) | true |
| match.wildcards.fetch(:ether_type) | true |
| match.wildcards.fetch(:in_port) | true |
Expand Down Expand Up @@ -46,7 +46,7 @@ Feature: Pio::FlowStats::Request
| stats_type | :flow |
| match.in_port | 1 |
| match.wildcards.keys.size | 11 |
| match.wildcards.fetch(:ether_destination_address) | true |
| match.wildcards.fetch(:destination_mac_address) | true |
| match.wildcards.fetch(:source_mac_address) | true |
| match.wildcards.fetch(:ether_type) | true |
| match.wildcards.fetch(:ip_destination_address_all) | true |
Expand All @@ -73,7 +73,7 @@ Feature: Pio::FlowStats::Request
| xid | 13 |
| stats_type | :flow |
| match.wildcards.keys.size | 12 |
| match.wildcards.fetch(:ether_destination_address) | true |
| match.wildcards.fetch(:destination_mac_address) | true |
| match.wildcards.fetch(:source_mac_address) | true |
| match.wildcards.fetch(:ether_type) | true |
| match.wildcards.fetch(:in_port) | true |
Expand Down
28 changes: 14 additions & 14 deletions features/open_flow13/match.feature
Expand Up @@ -51,15 +51,15 @@ Feature: Pio::Match
| field | value |
| source_mac_address | 01:02:03:04:05:06 |

Scenario: new(ether_destination_address: '01:02:03:04:05:06')
Scenario: new(destination_mac_address: '01:02:03:04:05:06')
When I try to create an OpenFlow message with:
"""
Pio::Match.new(ether_destination_address: '01:02:03:04:05:06')
Pio::Match.new(destination_mac_address: '01:02:03:04:05:06')
"""
Then it should finish successfully
And the message has the following fields and values:
| field | value |
| ether_destination_address | 01:02:03:04:05:06 |
| field | value |
| destination_mac_address | 01:02:03:04:05:06 |

Scenario: new(source_mac_address: '01:02:03:04:05:06', source_mac_address_mask: 'ff:ff:ff:00:00:00')
When I try to create an OpenFlow message with:
Expand All @@ -72,16 +72,16 @@ Feature: Pio::Match
| source_mac_address | 01:02:03:04:05:06 |
| source_mac_address_mask | ff:ff:ff:00:00:00 |

Scenario: new(ether_destination_address: '01:02:03:04:05:06', ether_destination_address_mask: 'ff:ff:ff:00:00:00')
Scenario: new(destination_mac_address: '01:02:03:04:05:06', destination_mac_address_mask: 'ff:ff:ff:00:00:00')
When I try to create an OpenFlow message with:
"""
Pio::Match.new(ether_destination_address: '01:02:03:04:05:06', ether_destination_address_mask: 'ff:ff:ff:00:00:00')
Pio::Match.new(destination_mac_address: '01:02:03:04:05:06', destination_mac_address_mask: 'ff:ff:ff:00:00:00')
"""
Then it should finish successfully
And the message has the following fields and values:
| field | value |
| ether_destination_address | 01:02:03:04:05:06 |
| ether_destination_address_mask | ff:ff:ff:00:00:00 |
| field | value |
| destination_mac_address | 01:02:03:04:05:06 |
| destination_mac_address_mask | ff:ff:ff:00:00:00 |

Scenario: new(ether_type: 0x0800)
When I try to create an OpenFlow message with:
Expand Down Expand Up @@ -481,8 +481,8 @@ Feature: Pio::Match
When I try to parse a file named "open_flow13/oxm_ether_destination_field.raw" with "Pio::Match" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
| ether_destination_address | ff:ff:ff:ff:ff:ff |
| field | value |
| destination_mac_address | ff:ff:ff:ff:ff:ff |

Scenario: read (file: open_flow13/oxm_ether_source_field.raw)
When I try to parse a file named "open_flow13/oxm_ether_source_field.raw" with "Pio::Match" class
Expand All @@ -495,9 +495,9 @@ Feature: Pio::Match
When I try to parse a file named "open_flow13/oxm_masked_ether_destination_field.raw" with "Pio::Match" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
| ether_destination_address | ff:ff:ff:ff:ff:ff |
| ether_destination_address_mask | ff:ff:ff:00:00:00 |
| field | value |
| destination_mac_address | ff:ff:ff:ff:ff:ff |
| destination_mac_address_mask | ff:ff:ff:00:00:00 |

Scenario: read (file: open_flow13/oxm_masked_ether_source_field.raw)
When I try to parse a file named "open_flow13/oxm_masked_ether_source_field.raw" with "Pio::Match" class
Expand Down
2 changes: 1 addition & 1 deletion lib/pio/arp/format.rb
Expand Up @@ -32,7 +32,7 @@ def to_exact_match(in_port)
match_options = {
in_port: in_port,
source_mac_address: source_mac,
ether_destination_address: destination_mac,
destination_mac_address: destination_mac,
vlan_vid: vlan_vid,
vlan_priority: vlan_pcp,
ether_type: ether_type,
Expand Down
2 changes: 1 addition & 1 deletion lib/pio/ipv4_header.rb
Expand Up @@ -38,7 +38,7 @@ def to_exact_match(in_port)
match_options = {
in_port: in_port,
source_mac_address: source_mac,
ether_destination_address: destination_mac,
destination_mac_address: destination_mac,
vlan_vid: vlan_vid,
vlan_priority: vlan_pcp,
ether_type: ether_type,
Expand Down
2 changes: 1 addition & 1 deletion lib/pio/open_flow10/features/reply.rb
Expand Up @@ -28,7 +28,7 @@ class Reply < OpenFlow::Message
:set_vlan_pcp,
:strip_vlan,
:set_source_mac_address,
:set_ether_destination_address,
:set_destination_mac_address,
:set_ip_source_address,
:set_ip_destination_address,
:set_tos,
Expand Down
4 changes: 2 additions & 2 deletions lib/pio/open_flow10/match.rb
Expand Up @@ -13,7 +13,7 @@ class Wildcards < BinData::Primitive
in_port: 1 << 0,
vlan_vid: 1 << 1,
source_mac_address: 1 << 2,
ether_destination_address: 1 << 3,
destination_mac_address: 1 << 3,
ether_type: 1 << 4,
ip_protocol: 1 << 5,
transport_source_port: 1 << 6,
Expand Down Expand Up @@ -107,7 +107,7 @@ class MatchFormat < BinData::Record
wildcards :wildcards
uint16 :in_port
mac_address :source_mac_address
mac_address :ether_destination_address
mac_address :destination_mac_address
uint16 :vlan_vid
uint8 :vlan_priority
uint8 :padding1
Expand Down
20 changes: 10 additions & 10 deletions lib/pio/open_flow13/match.rb
Expand Up @@ -54,12 +54,12 @@ def length
end

# The value of OXM_OF_ETH_DST match field.
class EtherDestinationAddress < BinData::Record
class DestinationMacAddress < BinData::Record
OXM_FIELD = 3

endian :big

mac_address :ether_destination_address
mac_address :destination_mac_address

def length
6
Expand All @@ -80,11 +80,11 @@ def length
end

# Masked OXM_OF_ETH_DST match field.
class MaskedEtherDestinationAddress < BinData::Record
class MaskedDestinationMacAddress < BinData::Record
endian :big

mac_address :ether_destination_address
mac_address :ether_destination_address_mask
mac_address :destination_mac_address
mac_address :destination_mac_address_mask

def length
12
Expand Down Expand Up @@ -577,8 +577,8 @@ class OpenflowBasic < BinData::Record
in_port InPort
metadata Metadata
masked_metadata MaskedMetadata
ether_destination_address EtherDestinationAddress
masked_ether_destination_address MaskedEtherDestinationAddress
destination_mac_address DestinationMacAddress
masked_destination_mac_address MaskedDestinationMacAddress
source_mac_address SourceMacAddress
masked_source_mac_address MaskedSourceMacAddress
ether_type EtherType
Expand Down Expand Up @@ -640,8 +640,8 @@ def choose_tlv_value
InPort
when Metadata::OXM_FIELD
masked? ? MaskedMetadata : Metadata
when EtherDestinationAddress::OXM_FIELD
masked? ? MaskedEtherDestinationAddress : EtherDestinationAddress
when DestinationMacAddress::OXM_FIELD
masked? ? MaskedDestinationMacAddress : DestinationMacAddress
when SourceMacAddress::OXM_FIELD
masked? ? MaskedSourceMacAddress : SourceMacAddress
when EtherType::OXM_FIELD
Expand Down Expand Up @@ -827,7 +827,7 @@ def initialize(user_attrs)
tlv_value: { each => user_attrs.fetch(each) } } }
end

[:metadata, :ether_destination_address, :source_mac_address,
[:metadata, :destination_mac_address, :source_mac_address,
:ipv4_source_address, :ipv4_destination_address,
:arp_sender_protocol_address, :arp_target_protocol_address,
:arp_sender_hardware_address, :arp_target_hardware_address,
Expand Down

0 comments on commit db0003d

Please sign in to comment.