pio 0.27.0 → 0.27.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ac567d11a76df3274344c3e5ddb963879f8381a
4
- data.tar.gz: 08fdbed8c63e7abf6a75079bdca6f497977e505e
3
+ metadata.gz: cd270820e4430bee21347b008f91d1724d02ef47
4
+ data.tar.gz: e223abe2cc4eecc229f81696781e970093f658f1
5
5
  SHA512:
6
- metadata.gz: c15052c6d83a106474ef2df7495a583f00e8bbf19a64cea87b743362853dec11da2ee13d87b6cf282626ff215924f9c81179e11dbfa924097d73138c6ef65e26
7
- data.tar.gz: 13039d0174785fecc8e0bb1f9ccd1e16390a91b397e021a624a49d1e743b8859f8194fe074b2a994fa78d90ef357e04f50ffc1dd4e384a193907bc7e7597f5ac
6
+ metadata.gz: 22047d4b49373c9a0b1d8aec4ac7bebc353ef161831c466c4928b043bbe9caae19584540a64cd1c7cad6523a954f76e195e388038f600b61809085b502c35de2
7
+ data.tar.gz: 1fb20370716136a85aa396e56549cb84c7d81d7e8c53165df7999447e60af9ba8901f4cd46d82c53ee53946d5135ea82f60f50e4e51525c362de170e29d3f5b7
@@ -3,6 +3,11 @@
3
3
  ## develop (unreleased)
4
4
 
5
5
 
6
+ ## 0.27.1 (9/28/2015)
7
+ ### Bugs fixed
8
+ * [#238](https://github.com/trema/pio/issues/238): `Features::Reply#datapath_id` doesn't return an Integer.
9
+
10
+
6
11
  ## 0.27.0 (9/16/2015)
7
12
  ### New features
8
13
  * [#203](https://github.com/trema/pio/pull/203): Add new classes `Pio::OpenFlow10::DescriptionStats::Request`, `Pio::OpenFlow10::DescriptionStats::Reply`, `Pio::OpenFlow10::FlowStats::Request`, `Pio::OpenFlow10::FlowStats::Reply`, `Pio::OpenFlow10::AggregateStats::Request`, `Pio::OpenFlow10::AggregateStats::Reply`.
@@ -10,7 +10,7 @@ Feature: Pio::Barrier::Reply
10
10
  | field | value |
11
11
  | ofp_version | 1 |
12
12
  | message_type | 19 |
13
- | length | 8 |
13
+ | length | 8 |
14
14
  | transaction_id | 0 |
15
15
  | xid | 0 |
16
16
  | body | |
@@ -25,7 +25,7 @@ Feature: Pio::Barrier::Reply
25
25
  | field | value |
26
26
  | ofp_version | 1 |
27
27
  | message_type | 19 |
28
- | length | 8 |
28
+ | length | 8 |
29
29
  | transaction_id | 123 |
30
30
  | xid | 123 |
31
31
  | body | |
@@ -40,7 +40,7 @@ Feature: Pio::Barrier::Reply
40
40
  | field | value |
41
41
  | ofp_version | 1 |
42
42
  | message_type | 19 |
43
- | length | 8 |
43
+ | length | 8 |
44
44
  | transaction_id | 123 |
45
45
  | xid | 123 |
46
46
  | body | |
@@ -52,7 +52,7 @@ Feature: Pio::Barrier::Reply
52
52
  | field | value |
53
53
  | ofp_version | 1 |
54
54
  | message_type | 19 |
55
- | length | 8 |
55
+ | length | 8 |
56
56
  | transaction_id | 0 |
57
57
  | xid | 0 |
58
58
  | body | |
@@ -16,8 +16,6 @@ Feature: Pio::OpenFlow.read
16
16
  | open_flow10/features_request.raw | Pio::OpenFlow10::Features::Request |
17
17
  | open_flow10/flow_mod_add.raw | Pio::OpenFlow10::FlowMod |
18
18
  | open_flow10/flow_stats_reply.raw | Pio::OpenFlow10::FlowStats::Reply |
19
- | open_flow10/flow_stats_reply.raw | Pio::OpenFlow10::FlowStats::Reply |
20
- | open_flow10/flow_stats_request.raw | Pio::OpenFlow10::FlowStats::Request |
21
19
  | open_flow10/flow_stats_request.raw | Pio::OpenFlow10::FlowStats::Request |
22
20
  | open_flow10/hello.raw | Pio::OpenFlow10::Hello |
23
21
  | open_flow10/hello_failed.raw | Pio::OpenFlow10::Error::HelloFailed |
@@ -1,110 +1,2 @@
1
- require 'pio/open_flow'
2
- require 'pio/open_flow10/phy_port16'
3
-
4
- module Pio
5
- module OpenFlow10
6
- # Features Request and Reply message.
7
- class Features
8
- # Features Request message.
9
- class Request < OpenFlow::Message
10
- # Features Request message format.
11
- class Format < BinData::Record
12
- extend OpenFlow::Format
13
-
14
- header version: 1, message_type: 5
15
- string :body, value: ''
16
-
17
- def user_data
18
- body
19
- end
20
- end
21
- end
22
-
23
- # OpenFlow 1.0 Features Reply message.
24
- class Reply < OpenFlow::Message
25
- # Message body of features reply.
26
- class Body < BinData::Record
27
- extend OpenFlow::Flags
28
-
29
- # enum ofp_capabilities
30
- flags_32bit :capabilities,
31
- [:flow_stats,
32
- :table_stats,
33
- :port_stats,
34
- :stp,
35
- :reserved,
36
- :ip_reasm,
37
- :queue_stats,
38
- :arp_match_ip]
39
-
40
- # enum ofp_action_type
41
- flags_32bit :actions_flag,
42
- [:output,
43
- :set_vlan_vid,
44
- :set_vlan_pcp,
45
- :strip_vlan,
46
- :set_ether_source_address,
47
- :set_ether_destination_address,
48
- :set_ip_source_address,
49
- :set_ip_destination_address,
50
- :set_ip_tos,
51
- :set_transport_source_port,
52
- :set_transport_destination_port,
53
- :enqueue]
54
-
55
- endian :big
56
-
57
- datapath_id :datapath_id
58
- uint32 :n_buffers
59
- uint8 :n_tables
60
- uint24 :padding
61
- hide :padding
62
- capabilities :capabilities
63
- actions_flag :actions
64
- array :ports, type: :phy_port16, read_until: :eof
65
-
66
- def dpid
67
- datapath_id
68
- end
69
-
70
- def empty?
71
- false
72
- end
73
-
74
- def length
75
- 24 + ports.to_binary_s.length
76
- end
77
- end
78
-
79
- # OpenFlow 1.0 Features Reply message
80
- class Format < BinData::Record
81
- extend OpenFlow::Format
82
-
83
- header version: 1, message_type: 6
84
- body :body
85
-
86
- def ports
87
- body.snapshot.ports.map do |each|
88
- each.instance_variable_set :@datapath_id, datapath_id
89
- each
90
- end
91
- end
92
-
93
- def physical_ports
94
- ports.select do |each|
95
- each.port_no <= Port16::MAX
96
- end
97
- end
98
- end
99
-
100
- body_option :dpid
101
- body_option :datapath_id
102
- body_option :n_buffers
103
- body_option :n_tables
104
- body_option :capabilities
105
- body_option :actions
106
- body_option :ports
107
- end
108
- end
109
- end
110
- end
1
+ require 'pio/open_flow10/features/reply'
2
+ require 'pio/open_flow10/features/request'
@@ -0,0 +1,96 @@
1
+ require 'pio/open_flow'
2
+ require 'pio/open_flow10/phy_port16'
3
+
4
+ module Pio
5
+ module OpenFlow10
6
+ # Features Request and Reply message.
7
+ class Features
8
+ # OpenFlow 1.0 Features Reply message.
9
+ class Reply < OpenFlow::Message
10
+ # Message body of features reply.
11
+ class Body < BinData::Record
12
+ extend OpenFlow::Flags
13
+
14
+ # enum ofp_capabilities
15
+ flags_32bit :capabilities,
16
+ [:flow_stats,
17
+ :table_stats,
18
+ :port_stats,
19
+ :stp,
20
+ :reserved,
21
+ :ip_reasm,
22
+ :queue_stats,
23
+ :arp_match_ip]
24
+
25
+ # enum ofp_action_type
26
+ flags_32bit :actions_flag,
27
+ [:output,
28
+ :set_vlan_vid,
29
+ :set_vlan_pcp,
30
+ :strip_vlan,
31
+ :set_ether_source_address,
32
+ :set_ether_destination_address,
33
+ :set_ip_source_address,
34
+ :set_ip_destination_address,
35
+ :set_ip_tos,
36
+ :set_transport_source_port,
37
+ :set_transport_destination_port,
38
+ :enqueue]
39
+
40
+ endian :big
41
+
42
+ datapath_id :datapath_id
43
+ uint32 :n_buffers
44
+ uint8 :n_tables
45
+ uint24 :padding
46
+ hide :padding
47
+ capabilities :capabilities
48
+ actions_flag :actions
49
+ array :ports, type: :phy_port16, read_until: :eof
50
+
51
+ def empty?
52
+ false
53
+ end
54
+
55
+ def length
56
+ 24 + ports.to_binary_s.length
57
+ end
58
+ end
59
+
60
+ # OpenFlow 1.0 Features Reply message
61
+ class Format < BinData::Record
62
+ extend OpenFlow::Format
63
+
64
+ header version: 1, message_type: 6
65
+ body :body
66
+
67
+ def ports
68
+ body.snapshot.ports.map do |each|
69
+ each.instance_variable_set :@datapath_id, datapath_id
70
+ each
71
+ end
72
+ end
73
+
74
+ def physical_ports
75
+ ports.select do |each|
76
+ each.port_no <= Port16::MAX
77
+ end
78
+ end
79
+
80
+ def datapath_id
81
+ body.datapath_id.to_i
82
+ end
83
+ alias_method :dpid, :datapath_id
84
+ end
85
+
86
+ body_option :dpid
87
+ body_option :datapath_id
88
+ body_option :n_buffers
89
+ body_option :n_tables
90
+ body_option :capabilities
91
+ body_option :actions
92
+ body_option :ports
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,23 @@
1
+ require 'pio/open_flow'
2
+
3
+ module Pio
4
+ module OpenFlow10
5
+ # Features Request and Reply message.
6
+ class Features
7
+ # Features Request message.
8
+ class Request < OpenFlow::Message
9
+ # Features Request message format.
10
+ class Format < BinData::Record
11
+ extend OpenFlow::Format
12
+
13
+ header version: 1, message_type: 5
14
+ string :body, value: ''
15
+
16
+ def user_data
17
+ body
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -3,8 +3,7 @@ require 'pio/open_flow13/echo'
3
3
  require 'pio/open_flow13/error'
4
4
  require 'pio/open_flow13/error/bad_request'
5
5
  require 'pio/open_flow13/error/hello_failed'
6
- require 'pio/open_flow13/features_reply'
7
- require 'pio/open_flow13/features_request'
6
+ require 'pio/open_flow13/features'
8
7
  require 'pio/open_flow13/flow_mod'
9
8
  require 'pio/open_flow13/goto_table'
10
9
  require 'pio/open_flow13/hello'
@@ -0,0 +1,2 @@
1
+ require 'pio/open_flow13/features/reply'
2
+ require 'pio/open_flow13/features/request'
@@ -0,0 +1,63 @@
1
+ require 'pio/open_flow'
2
+
3
+ # Base module.
4
+ module Pio
5
+ # OpenFlow 1.3 messages
6
+ module OpenFlow13
7
+ # Features Request and Reply message.
8
+ class Features
9
+ # Features Reply message.
10
+ class Reply < OpenFlow::Message
11
+ # Features Reply message body.
12
+ class Body < BinData::Record
13
+ extend OpenFlow::Flags
14
+
15
+ flags_32bit(:capabilities,
16
+ [:flow_stats,
17
+ :table_stats,
18
+ :port_stats,
19
+ :group_stats,
20
+ :NOT_USED,
21
+ :ip_reasm,
22
+ :queue_stats,
23
+ :NOT_USED,
24
+ :port_blocked])
25
+
26
+ endian :big
27
+
28
+ datapath_id :datapath_id
29
+ uint32 :n_buffers
30
+ uint8 :n_tables
31
+ uint8 :auxiliary_id
32
+ uint16 :padding
33
+ hide :padding
34
+ capabilities :capabilities
35
+ uint32 :reserved
36
+
37
+ def length
38
+ 24
39
+ end
40
+ end
41
+
42
+ # Features Reply message format.
43
+ class Format < BinData::Record
44
+ extend OpenFlow::Format
45
+
46
+ header version: 4, message_type: 6
47
+ body :body
48
+
49
+ def datapath_id
50
+ body.datapath_id.to_i
51
+ end
52
+ alias_method :dpid, :datapath_id
53
+ end
54
+
55
+ body_option :dpid
56
+ body_option :datapath_id
57
+ body_option :n_buffers
58
+ body_option :n_tables
59
+ body_option :capabilities
60
+ end
61
+ end
62
+ end
63
+ end
@@ -1,5 +1,5 @@
1
1
  # Base module.
2
2
  module Pio
3
3
  # gem version.
4
- VERSION = '0.27.0'.freeze
4
+ VERSION = '0.27.1'.freeze
5
5
  end
@@ -1,4 +1,4 @@
1
- require 'pio/open_flow10/features'
1
+ require 'pio/open_flow10/features/reply'
2
2
 
3
3
  describe Pio::OpenFlow10::Features::Reply do
4
4
  describe '.new' do
@@ -1,4 +1,4 @@
1
- require 'pio/open_flow10/features'
1
+ require 'pio/open_flow10/features/request.rb'
2
2
 
3
3
  describe Pio::OpenFlow10::Features::Request do
4
4
  describe '.new' do
@@ -1,4 +1,4 @@
1
- require 'pio/open_flow13/features_reply'
1
+ require 'pio/open_flow13/features/reply'
2
2
 
3
3
  describe Pio::OpenFlow13::Features::Reply do
4
4
  describe '.new' do
@@ -1,4 +1,4 @@
1
- require 'pio/open_flow13/features_request'
1
+ require 'pio/open_flow13/features/request'
2
2
 
3
3
  describe Pio::OpenFlow13::Features::Request do
4
4
  describe '.new' do
@@ -71,11 +71,13 @@ shared_examples 'an OpenFlow message with Datapath ID' do |klass|
71
71
  context 'with { datapath_id: 0 }' do
72
72
  Given(:options) { { datapath_id: 0 } }
73
73
  Then { message.datapath_id == 0 }
74
+ And { message.datapath_id.is_a? Integer }
74
75
  end
75
76
 
76
77
  context 'with { datapath_id: 2**64 - 1 }' do
77
78
  Given(:options) { { datapath_id: 2**64 - 1 } }
78
79
  Then { message.datapath_id == 2**64 - 1 }
80
+ And { message.datapath_id.is_a? Integer }
79
81
  end
80
82
 
81
83
  context 'with { datapath_id: 2**64 }' do
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.27.0
4
+ version: 0.27.1
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-09-16 00:00:00.000000000 Z
11
+ date: 2015-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
@@ -700,6 +700,8 @@ files:
700
700
  - lib/pio/open_flow10/error/hello_failed.rb
701
701
  - lib/pio/open_flow10/exact_match.rb
702
702
  - lib/pio/open_flow10/features.rb
703
+ - lib/pio/open_flow10/features/reply.rb
704
+ - lib/pio/open_flow10/features/request.rb
703
705
  - lib/pio/open_flow10/flow_mod.rb
704
706
  - lib/pio/open_flow10/flow_stats_reply.rb
705
707
  - lib/pio/open_flow10/flow_stats_request.rb
@@ -732,8 +734,9 @@ files:
732
734
  - lib/pio/open_flow13/error/bad_request.rb
733
735
  - lib/pio/open_flow13/error/error_type13.rb
734
736
  - lib/pio/open_flow13/error/hello_failed.rb
735
- - lib/pio/open_flow13/features_reply.rb
736
- - lib/pio/open_flow13/features_request.rb
737
+ - lib/pio/open_flow13/features.rb
738
+ - lib/pio/open_flow13/features/reply.rb
739
+ - lib/pio/open_flow13/features/request.rb
737
740
  - lib/pio/open_flow13/flow_mod.rb
738
741
  - lib/pio/open_flow13/goto_table.rb
739
742
  - lib/pio/open_flow13/hello.rb
@@ -777,8 +780,8 @@ files:
777
780
  - spec/pio/open_flow10/echo_request_spec.rb
778
781
  - spec/pio/open_flow10/enqueue_spec.rb
779
782
  - spec/pio/open_flow10/error/hello_failed_spec.rb
780
- - spec/pio/open_flow10/features_reply_spec.rb
781
- - spec/pio/open_flow10/features_request_spec.rb
783
+ - spec/pio/open_flow10/features/reply_spec.rb
784
+ - spec/pio/open_flow10/features/request_spec.rb
782
785
  - spec/pio/open_flow10/flow_mod_spec.rb
783
786
  - spec/pio/open_flow10/flow_stats_reply_spec.rb
784
787
  - spec/pio/open_flow10/flow_stats_request_spec.rb
@@ -803,8 +806,8 @@ files:
803
806
  - spec/pio/open_flow13/echo_request_spec.rb
804
807
  - spec/pio/open_flow13/error/bad_request_spec.rb
805
808
  - spec/pio/open_flow13/error/hello_failed_spec.rb
806
- - spec/pio/open_flow13/features_reply_spec.rb
807
- - spec/pio/open_flow13/features_request_spec.rb
809
+ - spec/pio/open_flow13/features/reply_spec.rb
810
+ - spec/pio/open_flow13/features/request_spec.rb
808
811
  - spec/pio/open_flow13/goto_table_spec.rb
809
812
  - spec/pio/open_flow13/hello_spec.rb
810
813
  - spec/pio/open_flow13/match_spec.rb
@@ -860,8 +863,8 @@ test_files:
860
863
  - spec/pio/open_flow10/echo_request_spec.rb
861
864
  - spec/pio/open_flow10/enqueue_spec.rb
862
865
  - spec/pio/open_flow10/error/hello_failed_spec.rb
863
- - spec/pio/open_flow10/features_reply_spec.rb
864
- - spec/pio/open_flow10/features_request_spec.rb
866
+ - spec/pio/open_flow10/features/reply_spec.rb
867
+ - spec/pio/open_flow10/features/request_spec.rb
865
868
  - spec/pio/open_flow10/flow_mod_spec.rb
866
869
  - spec/pio/open_flow10/flow_stats_reply_spec.rb
867
870
  - spec/pio/open_flow10/flow_stats_request_spec.rb
@@ -886,8 +889,8 @@ test_files:
886
889
  - spec/pio/open_flow13/echo_request_spec.rb
887
890
  - spec/pio/open_flow13/error/bad_request_spec.rb
888
891
  - spec/pio/open_flow13/error/hello_failed_spec.rb
889
- - spec/pio/open_flow13/features_reply_spec.rb
890
- - spec/pio/open_flow13/features_request_spec.rb
892
+ - spec/pio/open_flow13/features/reply_spec.rb
893
+ - spec/pio/open_flow13/features/request_spec.rb
891
894
  - spec/pio/open_flow13/goto_table_spec.rb
892
895
  - spec/pio/open_flow13/hello_spec.rb
893
896
  - spec/pio/open_flow13/match_spec.rb
@@ -1,62 +0,0 @@
1
- require 'pio/open_flow'
2
-
3
- # Base module.
4
- module Pio
5
- # OpenFlow 1.3 messages
6
- module OpenFlow13
7
- # Features Request and Reply message.
8
- class Features
9
- # Features Reply message.
10
- class Reply < OpenFlow::Message
11
- # Features Reply message format.
12
- class Format < BinData::Record
13
- # Features Reply message body.
14
- class Body < BinData::Record
15
- extend OpenFlow::Flags
16
-
17
- flags_32bit(:capabilities,
18
- [:flow_stats,
19
- :table_stats,
20
- :port_stats,
21
- :group_stats,
22
- :NOT_USED,
23
- :ip_reasm,
24
- :queue_stats,
25
- :NOT_USED,
26
- :port_blocked])
27
-
28
- endian :big
29
-
30
- datapath_id :datapath_id
31
- uint32 :n_buffers
32
- uint8 :n_tables
33
- uint8 :auxiliary_id
34
- uint16 :padding
35
- hide :padding
36
- capabilities :capabilities
37
- uint32 :reserved
38
-
39
- def dpid
40
- datapath_id
41
- end
42
-
43
- def length
44
- 24
45
- end
46
- end
47
-
48
- extend OpenFlow::Format
49
-
50
- header version: 4, message_type: 6
51
- body :body
52
- end
53
-
54
- body_option :dpid
55
- body_option :datapath_id
56
- body_option :n_buffers
57
- body_option :n_tables
58
- body_option :capabilities
59
- end
60
- end
61
- end
62
- end