pio 0.28.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Rakefile +1 -1
- data/bin/{terminal-notifier → code_metrics} +2 -2
- data/bin/code_metrics-profile +16 -0
- data/features/open_flow10/vendor_stats_request.raw +0 -0
- data/features/open_flow13/match.feature +8 -8
- data/features/open_flow13/nicira_reg_move.feature +21 -0
- data/features/open_flow13/set_arp_operation.feature +14 -0
- data/features/open_flow13/set_arp_sender_hardware_address.feature +14 -0
- data/features/open_flow13/set_arp_sender_protocol_address.feature +14 -0
- data/features/open_flow13/set_destination_mac_address.feature +14 -0
- data/features/open_flow13/set_source_mac_address.feature +14 -0
- data/lib/pio/open_flow.rb +3 -2
- data/lib/pio/open_flow13.rb +6 -0
- data/lib/pio/open_flow13/actions.rb +5 -0
- data/lib/pio/open_flow13/error.rb +7 -2
- data/lib/pio/open_flow13/match.rb +6 -6
- data/lib/pio/open_flow13/nicira_reg_move.rb +38 -0
- data/lib/pio/open_flow13/set_arp_operation.rb +23 -0
- data/lib/pio/open_flow13/set_arp_sender_hardware_address.rb +23 -0
- data/lib/pio/open_flow13/set_arp_sender_protocol_address.rb +23 -0
- data/lib/pio/open_flow13/set_destination_mac_address.rb +23 -0
- data/lib/pio/open_flow13/set_source_mac_address.rb +23 -0
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +1 -1
- data/spec/pio/open_flow13/match_spec.rb +4 -4
- metadata +36 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0bae1a4e884cc9c53cae04b7ca07d4781cea7b1
|
4
|
+
data.tar.gz: bdce833e9753e814505163d84bb10a59a1511955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7557c2fffccafb3e314d0cb97356eba24b391edc5941ae760dd1c6a9d7fe53e417a1d3706a89def3d2725f5df791f1d1d527e86f50ef5273d53775f2dc9f9bc1
|
7
|
+
data.tar.gz: e1672095ad435143f579135afca3fa08d6f530ff3d9b2b20ebeab600b8e8b0e5205404e2b6cf89333c183601a6cf9256d33955635f8e11c7ce603f241d7e39ae
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@
|
|
3
3
|
## develop (unreleased)
|
4
4
|
|
5
5
|
|
6
|
+
## 0.29.0 (11/11/2015)
|
7
|
+
### New features
|
8
|
+
* [#274](https://github.com/trema/pio/pull/274): Add `SetSourceMacAddress` action.
|
9
|
+
* [#275](https://github.com/trema/pio/pull/275): Add `SetDestinationMacAddress` action.
|
10
|
+
* [#276](https://github.com/trema/pio/pull/276): Add `SetArpOperation` action.
|
11
|
+
* [#277](https://github.com/trema/pio/pull/277): Add `SetArpSenderProtocolAddress` action.
|
12
|
+
* [#278](https://github.com/trema/pio/pull/278): Add `SetArpSenderHardwareAddress` action.
|
13
|
+
* [#280](https://github.com/trema/pio/pull/280): Add `NiciraRegMove` action.
|
14
|
+
|
15
|
+
|
6
16
|
## 0.28.1 (11/5/2015)
|
7
17
|
### Changes
|
8
18
|
* Remove `OpenFlow10` namespace from `Pio::OpenFlow10::SetSourceMacAddress` and `Pio::OpenFlow10::SetDestinationMacAddress`.
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# This file was generated by Bundler.
|
4
4
|
#
|
5
|
-
# The application '
|
5
|
+
# The application 'code_metrics' is installed as part of a gem, and
|
6
6
|
# this file is here to facilitate running it.
|
7
7
|
#
|
8
8
|
|
@@ -13,4 +13,4 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
13
13
|
require 'rubygems'
|
14
14
|
require 'bundler/setup'
|
15
15
|
|
16
|
-
load Gem.bin_path('
|
16
|
+
load Gem.bin_path('code_metrics', 'code_metrics')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'code_metrics-profile' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('code_metrics', 'code_metrics-profile')
|
Binary file
|
@@ -278,16 +278,16 @@ Feature: Pio::Match
|
|
278
278
|
| ip_protocol | 1 |
|
279
279
|
| icmpv4_code | 0 |
|
280
280
|
|
281
|
-
Scenario: new(eth_type: 2054,
|
281
|
+
Scenario: new(eth_type: 2054, arp_operation: 1)
|
282
282
|
When I try to create an OpenFlow message with:
|
283
283
|
"""
|
284
|
-
Pio::Match.new(ether_type: 2054,
|
284
|
+
Pio::Match.new(ether_type: 2054, arp_operation: 1)
|
285
285
|
"""
|
286
286
|
Then it should finish successfully
|
287
287
|
And the message has the following fields and values:
|
288
|
-
| field
|
289
|
-
| ether_type
|
290
|
-
|
|
288
|
+
| field | value |
|
289
|
+
| ether_type | 2054 |
|
290
|
+
| arp_operation | 1 |
|
291
291
|
|
292
292
|
Scenario: new(eth_type: 2054, arp_sender_protocol_address: '1.2.3.4')
|
293
293
|
When I try to create an OpenFlow message with:
|
@@ -655,9 +655,9 @@ Feature: Pio::Match
|
|
655
655
|
When I try to parse a file named "open_flow13/oxm_arp_op_field.raw" with "Pio::Match" class
|
656
656
|
Then it should finish successfully
|
657
657
|
And the message has the following fields and values:
|
658
|
-
| field
|
659
|
-
| ether_type
|
660
|
-
|
|
658
|
+
| field | value |
|
659
|
+
| ether_type | 2054 |
|
660
|
+
| arp_operation | 1 |
|
661
661
|
|
662
662
|
Scenario: read (file: open_flow13/oxm_arp_spa_field.raw)
|
663
663
|
When I try to parse a file named "open_flow13/oxm_arp_spa_field.raw" with "Pio::Match" class
|
@@ -0,0 +1,21 @@
|
|
1
|
+
@open_flow13
|
2
|
+
Feature: Pio::NiciraRegMove
|
3
|
+
|
4
|
+
Scenario: new(from: :arp_sender_hardware_address, to: :arp_target_hardware_address)
|
5
|
+
When I try to create an OpenFlow action with:
|
6
|
+
"""
|
7
|
+
Pio::NiciraRegMove.new(from: :arp_sender_hardware_address, to: :arp_target_hardware_address)
|
8
|
+
"""
|
9
|
+
Then it should finish successfully
|
10
|
+
And the action has the following fields and values:
|
11
|
+
| field | value |
|
12
|
+
| action_type.to_hex | 0xffff |
|
13
|
+
| action_length | 24 |
|
14
|
+
| experimenter_id.to_hex | 0x2320 |
|
15
|
+
| experimenter_type | 6 |
|
16
|
+
| from | :arp_sender_hardware_address |
|
17
|
+
| source_oxm_field | 24 |
|
18
|
+
| source_oxm_length | 6 |
|
19
|
+
| to | :arp_target_hardware_address |
|
20
|
+
| destination_oxm_field | 25 |
|
21
|
+
| destination_oxm_length | 6 |
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@open_flow13
|
2
|
+
Feature: Pio::SetArpOperation
|
3
|
+
|
4
|
+
Scenario: new(Pio::Arp::Reply::OPERATION)
|
5
|
+
When I try to create an OpenFlow action with:
|
6
|
+
"""
|
7
|
+
Pio::SetArpOperation.new(Pio::Arp::Reply::OPERATION)
|
8
|
+
"""
|
9
|
+
Then it should finish successfully
|
10
|
+
And the action has the following fields and values:
|
11
|
+
| field | value |
|
12
|
+
| action_type | 25 |
|
13
|
+
| action_length | 16 |
|
14
|
+
| operation | 2 |
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@open_flow13
|
2
|
+
Feature: Pio::SetArpSenderHardwareAddress
|
3
|
+
|
4
|
+
Scenario: new('00:00:de:ad:be:ef')
|
5
|
+
When I try to create an OpenFlow action with:
|
6
|
+
"""
|
7
|
+
Pio::SetArpSenderHardwareAddress.new('00:00:de:ad:be:ef')
|
8
|
+
"""
|
9
|
+
Then it should finish successfully
|
10
|
+
And the action has the following fields and values:
|
11
|
+
| field | value |
|
12
|
+
| action_type | 25 |
|
13
|
+
| action_length | 16 |
|
14
|
+
| mac_address | 00:00:de:ad:be:ef |
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@open_flow13
|
2
|
+
Feature: Pio::SetArpSenderProtocolAddress
|
3
|
+
|
4
|
+
Scenario: new('192.168.1.1')
|
5
|
+
When I try to create an OpenFlow action with:
|
6
|
+
"""
|
7
|
+
Pio::SetArpSenderProtocolAddress.new('192.168.1.1')
|
8
|
+
"""
|
9
|
+
Then it should finish successfully
|
10
|
+
And the action has the following fields and values:
|
11
|
+
| field | value |
|
12
|
+
| action_type | 25 |
|
13
|
+
| action_length | 16 |
|
14
|
+
| ip_address | 192.168.1.1 |
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@open_flow13
|
2
|
+
Feature: Pio::SetDestinationMacAddress
|
3
|
+
|
4
|
+
Scenario: new('11:22:33:44:55:66')
|
5
|
+
When I try to create an OpenFlow action with:
|
6
|
+
"""
|
7
|
+
Pio::SetDestinationMacAddress.new('11:22:33:44:55:66')
|
8
|
+
"""
|
9
|
+
Then it should finish successfully
|
10
|
+
And the action has the following fields and values:
|
11
|
+
| field | value |
|
12
|
+
| action_type | 25 |
|
13
|
+
| action_length | 16 |
|
14
|
+
| mac_address | 11:22:33:44:55:66 |
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@open_flow13
|
2
|
+
Feature: Pio::SetSourceMacAddress
|
3
|
+
|
4
|
+
Scenario: new('11:22:33:44:55:66')
|
5
|
+
When I try to create an OpenFlow action with:
|
6
|
+
"""
|
7
|
+
Pio::SetSourceMacAddress.new('11:22:33:44:55:66')
|
8
|
+
"""
|
9
|
+
Then it should finish successfully
|
10
|
+
And the action has the following fields and values:
|
11
|
+
| field | value |
|
12
|
+
| action_type | 25 |
|
13
|
+
| action_length | 16 |
|
14
|
+
| mac_address | 11:22:33:44:55:66 |
|
data/lib/pio/open_flow.rb
CHANGED
@@ -19,8 +19,9 @@ module Pio
|
|
19
19
|
:PacketIn, :FlowRemoved, :PacketOut, :SendOutPort,
|
20
20
|
:SetSourceMacAddress, :SetDestinationMacAddress, :PortStatus, :Stats,
|
21
21
|
:FlowStats, :DescriptionStats, :AggregateStats, :TableStats, :PortStats,
|
22
|
-
:QueueStats, :Error, :NiciraResubmit,
|
23
|
-
:
|
22
|
+
:QueueStats, :Error, :NiciraResubmit, :SetArpOperation,
|
23
|
+
:SetArpSenderProtocolAddress, :SetArpSenderHardwareAddress,
|
24
|
+
:NiciraResubmitTable, :NiciraRegMove].each do |each|
|
24
25
|
set_message_class_name each, version
|
25
26
|
@version = version.to_s
|
26
27
|
end
|
data/lib/pio/open_flow13.rb
CHANGED
@@ -13,7 +13,13 @@ require 'pio/open_flow13/packet_out'
|
|
13
13
|
require 'pio/open_flow13/stats_request'
|
14
14
|
|
15
15
|
# Actions
|
16
|
+
require 'pio/open_flow13/nicira_reg_move'
|
16
17
|
require 'pio/open_flow13/send_out_port'
|
18
|
+
require 'pio/open_flow13/set_arp_operation'
|
19
|
+
require 'pio/open_flow13/set_arp_sender_hardware_address'
|
20
|
+
require 'pio/open_flow13/set_arp_sender_protocol_address'
|
21
|
+
require 'pio/open_flow13/set_destination_mac_address'
|
22
|
+
require 'pio/open_flow13/set_source_mac_address'
|
17
23
|
|
18
24
|
# Instructions
|
19
25
|
require 'pio/open_flow13/apply'
|
@@ -11,18 +11,23 @@ module Pio
|
|
11
11
|
uint16 :error_code
|
12
12
|
end
|
13
13
|
|
14
|
+
# rubocop:disable MethodLength
|
14
15
|
def self.read(binary)
|
15
16
|
body = OpenFlowHeaderParser.read(binary).body
|
16
|
-
|
17
|
+
error = BodyParser.read(body).snapshot
|
18
|
+
klass = case error.error_type
|
17
19
|
when :hello_failed
|
18
20
|
HelloFailed
|
19
21
|
when :bad_request
|
20
22
|
BadRequest
|
21
23
|
else
|
22
|
-
|
24
|
+
# Not implemented yet
|
25
|
+
fail 'Unknown error message '\
|
26
|
+
"(type=#{error.error_type}, code=#{error.error_code})"
|
23
27
|
end
|
24
28
|
klass.read binary
|
25
29
|
end
|
30
|
+
# rubocop:enable MethodLength
|
26
31
|
end
|
27
32
|
end
|
28
33
|
end
|
@@ -350,12 +350,12 @@ module Pio
|
|
350
350
|
end
|
351
351
|
|
352
352
|
# The value of OXM_OF_ARP_OP
|
353
|
-
class
|
353
|
+
class ArpOperation < BinData::Record
|
354
354
|
OXM_FIELD = 21
|
355
355
|
|
356
356
|
endian :big
|
357
357
|
|
358
|
-
uint16 :
|
358
|
+
uint16 :arp_operation
|
359
359
|
|
360
360
|
def length
|
361
361
|
2
|
@@ -597,7 +597,7 @@ module Pio
|
|
597
597
|
udp_destination_port UdpDestinationPort
|
598
598
|
sctp_source_port SctpSourcePort
|
599
599
|
sctp_destination_port SctpDestinationPort
|
600
|
-
|
600
|
+
arp_operation ArpOperation
|
601
601
|
arp_sender_protocol_address ArpSenderProtocolAddress
|
602
602
|
masked_arp_sender_protocol_address MaskedArpSenderProtocolAddress
|
603
603
|
arp_target_protocol_address ArpTargetProtocolAddress
|
@@ -676,8 +676,8 @@ module Pio
|
|
676
676
|
Icmpv4Type
|
677
677
|
when Icmpv4Code::OXM_FIELD
|
678
678
|
Icmpv4Code
|
679
|
-
when
|
680
|
-
|
679
|
+
when ArpOperation::OXM_FIELD
|
680
|
+
ArpOperation
|
681
681
|
when ArpSenderProtocolAddress::OXM_FIELD
|
682
682
|
if masked?
|
683
683
|
MaskedArpSenderProtocolAddress
|
@@ -819,7 +819,7 @@ module Pio
|
|
819
819
|
:ip_dscp, :ip_ecn, :tcp_source_port, :tcp_destination_port,
|
820
820
|
:udp_source_port, :udp_destination_port,
|
821
821
|
:sctp_source_port, :sctp_destination_port,
|
822
|
-
:icmpv4_type, :icmpv4_code, :
|
822
|
+
:icmpv4_type, :icmpv4_code, :arp_operation].each do |each|
|
823
823
|
next unless user_attrs.key?(each)
|
824
824
|
klass = Match.const_get(each.to_s.split('_').map(&:capitalize).join)
|
825
825
|
@match_fields << { class_payload:
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'active_support/core_ext/string/inflections'
|
2
|
+
require 'pio/open_flow/action'
|
3
|
+
|
4
|
+
module Pio
|
5
|
+
module OpenFlow13
|
6
|
+
# NXAST_REG_MOVE action
|
7
|
+
class NiciraRegMove < OpenFlow::Action
|
8
|
+
action_header action_type: 0xffff, action_length: 24
|
9
|
+
uint32 :experimenter_id, value: 0x2320
|
10
|
+
uint16 :experimenter_type, value: 6
|
11
|
+
uint16 :n_bits, initial_value: -> { source_oxm_length * 8 }
|
12
|
+
uint16 :source_offset, value: 0
|
13
|
+
uint16 :destination_offset, value: 0
|
14
|
+
uint16 :source_class, value: Match::OXM_CLASS_OPENFLOW_BASIC
|
15
|
+
bit7 :source_oxm_field
|
16
|
+
bit1 :source_oxm_hasmask, value: 0
|
17
|
+
uint8 :source_oxm_length
|
18
|
+
uint16 :destination_oxm_class, value: Match::OXM_CLASS_OPENFLOW_BASIC
|
19
|
+
bit7 :destination_oxm_field
|
20
|
+
bit1 :destination_oxm_hasmask, value: 0
|
21
|
+
uint8 :destination_oxm_length
|
22
|
+
|
23
|
+
attr_reader :from
|
24
|
+
attr_reader :to
|
25
|
+
|
26
|
+
def initialize(options)
|
27
|
+
@from = options.fetch(:from)
|
28
|
+
@to = options.fetch(:to)
|
29
|
+
from_klass = Match.const_get(@from.to_s.classify)
|
30
|
+
to_klass = Match.const_get(@to.to_s.classify)
|
31
|
+
super(source_oxm_field: from_klass.const_get(:OXM_FIELD),
|
32
|
+
source_oxm_length: from_klass.new.length,
|
33
|
+
destination_oxm_field: to_klass.const_get(:OXM_FIELD),
|
34
|
+
destination_oxm_length: to_klass.new.length)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'pio/open_flow/action'
|
2
|
+
require 'pio/open_flow13/match'
|
3
|
+
|
4
|
+
module Pio
|
5
|
+
module OpenFlow13
|
6
|
+
# Set ARP operation field
|
7
|
+
class SetArpOperation < OpenFlow::Action
|
8
|
+
action_header action_type: 25, action_length: 16
|
9
|
+
|
10
|
+
uint16 :oxm_class, value: Match::OXM_CLASS_OPENFLOW_BASIC
|
11
|
+
bit7 :oxm_field, value: Match::ArpOperation::OXM_FIELD
|
12
|
+
bit1 :oxm_hasmask, value: 0
|
13
|
+
uint8 :oxm_length, value: 2
|
14
|
+
uint16 :operation
|
15
|
+
string :padding, length: 6
|
16
|
+
hide :padding
|
17
|
+
|
18
|
+
def initialize(operation)
|
19
|
+
super operation: operation
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'pio/open_flow/action'
|
2
|
+
require 'pio/open_flow13/match'
|
3
|
+
|
4
|
+
module Pio
|
5
|
+
module OpenFlow13
|
6
|
+
# Set ARP sender hardware address field
|
7
|
+
class SetArpSenderHardwareAddress < OpenFlow::Action
|
8
|
+
action_header action_type: 25, action_length: 16
|
9
|
+
|
10
|
+
uint16 :oxm_class, value: Match::OXM_CLASS_OPENFLOW_BASIC
|
11
|
+
bit7 :oxm_field, value: Match::ArpSenderHardwareAddress::OXM_FIELD
|
12
|
+
bit1 :oxm_hasmask, value: 0
|
13
|
+
uint8 :oxm_length, value: 6
|
14
|
+
mac_address :mac_address
|
15
|
+
string :padding, length: 2
|
16
|
+
hide :padding
|
17
|
+
|
18
|
+
def initialize(mac_address)
|
19
|
+
super mac_address: mac_address
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'pio/open_flow/action'
|
2
|
+
require 'pio/open_flow13/match'
|
3
|
+
|
4
|
+
module Pio
|
5
|
+
module OpenFlow13
|
6
|
+
# Set ARP sender protocol address field
|
7
|
+
class SetArpSenderProtocolAddress < OpenFlow::Action
|
8
|
+
action_header action_type: 25, action_length: 16
|
9
|
+
|
10
|
+
uint16 :oxm_class, value: Match::OXM_CLASS_OPENFLOW_BASIC
|
11
|
+
bit7 :oxm_field, value: Match::ArpSenderProtocolAddress::OXM_FIELD
|
12
|
+
bit1 :oxm_hasmask, value: 0
|
13
|
+
uint8 :oxm_length, value: 4
|
14
|
+
ip_address :ip_address
|
15
|
+
string :padding, length: 4
|
16
|
+
hide :padding
|
17
|
+
|
18
|
+
def initialize(ip_address)
|
19
|
+
super ip_address: ip_address
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'pio/open_flow/action'
|
2
|
+
require 'pio/open_flow13/match'
|
3
|
+
|
4
|
+
module Pio
|
5
|
+
module OpenFlow13
|
6
|
+
# Set a header field.
|
7
|
+
class SetDestinationMacAddress < OpenFlow::Action
|
8
|
+
action_header action_type: 25, action_length: 16
|
9
|
+
|
10
|
+
uint16 :oxm_class, value: Match::OXM_CLASS_OPENFLOW_BASIC
|
11
|
+
bit7 :oxm_field, value: Match::DestinationMacAddress::OXM_FIELD
|
12
|
+
bit1 :oxm_hasmask, value: 0
|
13
|
+
uint8 :oxm_length, value: 6
|
14
|
+
mac_address :mac_address
|
15
|
+
string :padding, length: 2
|
16
|
+
hide :padding
|
17
|
+
|
18
|
+
def initialize(mac_address)
|
19
|
+
super mac_address: mac_address
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'pio/open_flow/action'
|
2
|
+
require 'pio/open_flow13/match'
|
3
|
+
|
4
|
+
module Pio
|
5
|
+
module OpenFlow13
|
6
|
+
# Set a header field.
|
7
|
+
class SetSourceMacAddress < OpenFlow::Action
|
8
|
+
action_header action_type: 25, action_length: 16
|
9
|
+
|
10
|
+
uint16 :oxm_class, value: Match::OXM_CLASS_OPENFLOW_BASIC
|
11
|
+
bit7 :oxm_field, value: Match::SourceMacAddress::OXM_FIELD
|
12
|
+
bit1 :oxm_hasmask, value: 0
|
13
|
+
uint8 :oxm_length, value: 6
|
14
|
+
mac_address :mac_address
|
15
|
+
string :padding, length: 2
|
16
|
+
hide :padding
|
17
|
+
|
18
|
+
def initialize(mac_address)
|
19
|
+
super mac_address: mac_address
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/pio/version.rb
CHANGED
data/pio.gemspec
CHANGED
@@ -29,9 +29,9 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.required_ruby_version = '>= 2.0.0'
|
30
30
|
|
31
31
|
gem.add_dependency 'bindata', '~> 2.1.0'
|
32
|
+
gem.add_dependency 'activesupport', '~> 4.2', '>= 4.2.4'
|
32
33
|
|
33
34
|
gem.add_development_dependency 'bundler', '~> 1.10.6'
|
34
|
-
gem.add_development_dependency 'byebug', '~> 7.0.0'
|
35
35
|
gem.add_development_dependency 'pry', '~> 0.10.3'
|
36
36
|
gem.add_development_dependency 'rake'
|
37
37
|
|
@@ -404,15 +404,15 @@ describe Pio::OpenFlow13::Match do
|
|
404
404
|
And { match.match_fields[2].oxm_length == 1 }
|
405
405
|
end
|
406
406
|
|
407
|
-
context 'with ether_type: 0x0806,
|
407
|
+
context 'with ether_type: 0x0806, arp_operation: 1' do
|
408
408
|
When(:match) do
|
409
409
|
Pio::OpenFlow13::Match.new(
|
410
410
|
ether_type: 0x0806,
|
411
|
-
|
411
|
+
arp_operation: 1
|
412
412
|
)
|
413
413
|
end
|
414
414
|
Then { match.ether_type == 0x0806 }
|
415
|
-
Then { match.
|
415
|
+
Then { match.arp_operation == 1 }
|
416
416
|
And { match.class == Pio::OpenFlow13::Match }
|
417
417
|
And { match.length == 16 }
|
418
418
|
And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
|
@@ -424,7 +424,7 @@ describe Pio::OpenFlow13::Match do
|
|
424
424
|
end
|
425
425
|
And do
|
426
426
|
match.match_fields[1].oxm_field ==
|
427
|
-
Pio::OpenFlow13::Match::
|
427
|
+
Pio::OpenFlow13::Match::ArpOperation::OXM_FIELD
|
428
428
|
end
|
429
429
|
And { match.match_fields[1].masked? == false }
|
430
430
|
And { match.match_fields[1].oxm_length == 2 }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yasuhito Takamiya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -25,33 +25,39 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
|
33
|
+
version: '4.2'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 4.2.4
|
37
|
+
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
43
|
+
version: '4.2'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 4.2.4
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
48
|
+
name: bundler
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
53
|
+
version: 1.10.6
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
60
|
+
version: 1.10.6
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: pry
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -394,6 +400,8 @@ files:
|
|
394
400
|
- bin/byebug
|
395
401
|
- bin/cc-tddium-post-worker
|
396
402
|
- bin/cdiff
|
403
|
+
- bin/code_metrics
|
404
|
+
- bin/code_metrics-profile
|
397
405
|
- bin/coderay
|
398
406
|
- bin/colortab
|
399
407
|
- bin/coveralls
|
@@ -421,7 +429,6 @@ files:
|
|
421
429
|
- bin/sparkr
|
422
430
|
- bin/term_display
|
423
431
|
- bin/term_mandel
|
424
|
-
- bin/terminal-notifier
|
425
432
|
- bin/thor
|
426
433
|
- bin/unparser
|
427
434
|
- bin/yard
|
@@ -570,6 +577,7 @@ files:
|
|
570
577
|
- features/open_flow13/instruction_write_metadata.raw
|
571
578
|
- features/open_flow13/match.feature
|
572
579
|
- features/open_flow13/meter.feature
|
580
|
+
- features/open_flow13/nicira_reg_move.feature
|
573
581
|
- features/open_flow13/oxm_arp_op_field.raw
|
574
582
|
- features/open_flow13/oxm_arp_sha_field.raw
|
575
583
|
- features/open_flow13/oxm_arp_spa_field.raw
|
@@ -621,6 +629,11 @@ files:
|
|
621
629
|
- features/open_flow13/packet_out.raw
|
622
630
|
- features/open_flow13/send_out_port.feature
|
623
631
|
- features/open_flow13/send_out_port.raw
|
632
|
+
- features/open_flow13/set_arp_operation.feature
|
633
|
+
- features/open_flow13/set_arp_sender_hardware_address.feature
|
634
|
+
- features/open_flow13/set_arp_sender_protocol_address.feature
|
635
|
+
- features/open_flow13/set_destination_mac_address.feature
|
636
|
+
- features/open_flow13/set_source_mac_address.feature
|
624
637
|
- features/open_flow13/stats_request.feature
|
625
638
|
- features/open_flow13/table_stats_reply.raw
|
626
639
|
- features/open_flow13/table_stats_request.raw
|
@@ -775,10 +788,16 @@ files:
|
|
775
788
|
- lib/pio/open_flow13/hello.rb
|
776
789
|
- lib/pio/open_flow13/match.rb
|
777
790
|
- lib/pio/open_flow13/meter.rb
|
791
|
+
- lib/pio/open_flow13/nicira_reg_move.rb
|
778
792
|
- lib/pio/open_flow13/packet_in.rb
|
779
793
|
- lib/pio/open_flow13/packet_out.rb
|
780
794
|
- lib/pio/open_flow13/port32.rb
|
781
795
|
- lib/pio/open_flow13/send_out_port.rb
|
796
|
+
- lib/pio/open_flow13/set_arp_operation.rb
|
797
|
+
- lib/pio/open_flow13/set_arp_sender_hardware_address.rb
|
798
|
+
- lib/pio/open_flow13/set_arp_sender_protocol_address.rb
|
799
|
+
- lib/pio/open_flow13/set_destination_mac_address.rb
|
800
|
+
- lib/pio/open_flow13/set_source_mac_address.rb
|
782
801
|
- lib/pio/open_flow13/stats_request.rb
|
783
802
|
- lib/pio/open_flow13/write_metadata.rb
|
784
803
|
- lib/pio/options.rb
|
@@ -871,7 +890,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
871
890
|
version: '0'
|
872
891
|
requirements: []
|
873
892
|
rubyforge_project:
|
874
|
-
rubygems_version: 2.4.
|
893
|
+
rubygems_version: 2.4.8
|
875
894
|
signing_key:
|
876
895
|
specification_version: 4
|
877
896
|
summary: Packet parser and generator.
|
@@ -1077,6 +1096,7 @@ test_files:
|
|
1077
1096
|
- features/open_flow13/instruction_write_metadata.raw
|
1078
1097
|
- features/open_flow13/match.feature
|
1079
1098
|
- features/open_flow13/meter.feature
|
1099
|
+
- features/open_flow13/nicira_reg_move.feature
|
1080
1100
|
- features/open_flow13/oxm_arp_op_field.raw
|
1081
1101
|
- features/open_flow13/oxm_arp_sha_field.raw
|
1082
1102
|
- features/open_flow13/oxm_arp_spa_field.raw
|
@@ -1128,6 +1148,11 @@ test_files:
|
|
1128
1148
|
- features/open_flow13/packet_out.raw
|
1129
1149
|
- features/open_flow13/send_out_port.feature
|
1130
1150
|
- features/open_flow13/send_out_port.raw
|
1151
|
+
- features/open_flow13/set_arp_operation.feature
|
1152
|
+
- features/open_flow13/set_arp_sender_hardware_address.feature
|
1153
|
+
- features/open_flow13/set_arp_sender_protocol_address.feature
|
1154
|
+
- features/open_flow13/set_destination_mac_address.feature
|
1155
|
+
- features/open_flow13/set_source_mac_address.feature
|
1131
1156
|
- features/open_flow13/stats_request.feature
|
1132
1157
|
- features/open_flow13/table_stats_reply.raw
|
1133
1158
|
- features/open_flow13/table_stats_request.raw
|