pio 0.27.1 → 0.27.2

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.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/Rakefile +1 -1
  4. data/bin/{terminal-notifier → code_metrics} +2 -2
  5. data/bin/code_metrics-profile +16 -0
  6. data/features/icmpv6.pcap +0 -0
  7. data/features/open_flow10/aggregate_stats_reply.feature +1 -1
  8. data/features/open_flow10/aggregate_stats_request.feature +2 -2
  9. data/features/open_flow10/bad_request.feature +2 -2
  10. data/features/open_flow10/barrier_reply.feature +3 -18
  11. data/features/open_flow10/barrier_request.feature +3 -18
  12. data/features/open_flow10/description_stats_reply.feature +1 -1
  13. data/features/open_flow10/description_stats_request.feature +3 -3
  14. data/features/open_flow10/echo_reply.feature +4 -47
  15. data/features/open_flow10/echo_request.feature +4 -36
  16. data/features/open_flow10/exact_match.feature +20 -2
  17. data/features/open_flow10/features_reply.feature +65 -72
  18. data/features/open_flow10/features_request.feature +3 -22
  19. data/features/open_flow10/flow_mod.feature +5 -5
  20. data/features/open_flow10/flow_stats_reply.feature +2 -2
  21. data/features/open_flow10/flow_stats_request.feature +3 -4
  22. data/features/open_flow10/hello.feature +4 -20
  23. data/features/open_flow10/hello_failed.feature +4 -4
  24. data/features/open_flow10/packet_in.feature +2 -2
  25. data/features/open_flow10/packet_in_arp_reply.raw +0 -0
  26. data/features/open_flow10/packet_out.feature +1 -1
  27. data/features/open_flow10/port_status.feature +1 -1
  28. data/features/open_flow13/bad_request.feature +2 -2
  29. data/features/open_flow13/echo_reply.feature +5 -37
  30. data/features/open_flow13/echo_request.feature +5 -37
  31. data/features/open_flow13/features_reply.feature +3 -7
  32. data/features/open_flow13/features_request.feature +3 -18
  33. data/features/open_flow13/flow_mod.feature +5 -5
  34. data/features/open_flow13/hello.feature +4 -19
  35. data/features/open_flow13/hello_failed.feature +4 -4
  36. data/features/open_flow13/match.feature +4 -4
  37. data/features/open_flow13/packet_in.feature +3 -3
  38. data/features/open_flow13/packet_out.feature +3 -3
  39. data/features/parser.feature +10 -0
  40. data/lib/pio/arp/format.rb +20 -0
  41. data/lib/pio/ipv4_header.rb +20 -0
  42. data/lib/pio/open_flow.rb +0 -1
  43. data/lib/pio/open_flow/message.rb +51 -57
  44. data/lib/pio/open_flow/open_flow_header.rb +6 -10
  45. data/lib/pio/open_flow10.rb +20 -15
  46. data/lib/pio/open_flow10/aggregate_stats/reply.rb +20 -0
  47. data/lib/pio/open_flow10/aggregate_stats/request.rb +25 -0
  48. data/lib/pio/open_flow10/barrier/reply.rb +14 -0
  49. data/lib/pio/open_flow10/barrier/request.rb +14 -0
  50. data/lib/pio/open_flow10/description_stats/reply.rb +21 -0
  51. data/lib/pio/open_flow10/description_stats/request.rb +19 -0
  52. data/lib/pio/open_flow10/echo/reply.rb +16 -0
  53. data/lib/pio/open_flow10/echo/request.rb +16 -0
  54. data/lib/pio/open_flow10/error/bad_request.rb +27 -49
  55. data/lib/pio/open_flow10/error/hello_failed.rb +6 -28
  56. data/lib/pio/open_flow10/exact_match.rb +4 -39
  57. data/lib/pio/open_flow10/features/reply.rb +48 -72
  58. data/lib/pio/open_flow10/features/request.rb +4 -11
  59. data/lib/pio/open_flow10/flow_mod.rb +21 -51
  60. data/lib/pio/open_flow10/{flow_stats_reply.rb → flow_stats/reply.rb} +7 -23
  61. data/lib/pio/open_flow10/flow_stats/request.rb +25 -0
  62. data/lib/pio/open_flow10/hello.rb +3 -13
  63. data/lib/pio/open_flow10/match.rb +0 -18
  64. data/lib/pio/open_flow10/match10.rb +22 -0
  65. data/lib/pio/open_flow10/packet_in.rb +18 -42
  66. data/lib/pio/open_flow10/packet_out.rb +8 -31
  67. data/lib/pio/open_flow10/port_status.rb +11 -39
  68. data/lib/pio/open_flow10/stats_reply.rb +11 -8
  69. data/lib/pio/open_flow10/stats_request.rb +8 -8
  70. data/lib/pio/open_flow13.rb +13 -6
  71. data/lib/pio/open_flow13/echo/reply.rb +15 -0
  72. data/lib/pio/open_flow13/echo/request.rb +15 -0
  73. data/lib/pio/open_flow13/error/bad_request.rb +32 -49
  74. data/lib/pio/open_flow13/error/hello_failed.rb +7 -30
  75. data/lib/pio/open_flow13/features/reply.rb +27 -51
  76. data/lib/pio/open_flow13/features/request.rb +3 -10
  77. data/lib/pio/open_flow13/flow_mod.rb +29 -52
  78. data/lib/pio/open_flow13/hello.rb +18 -22
  79. data/lib/pio/open_flow13/packet_in.rb +26 -44
  80. data/lib/pio/open_flow13/packet_out.rb +16 -35
  81. data/lib/pio/open_flow13/stats_request.rb +5 -21
  82. data/lib/pio/parser.rb +5 -4
  83. data/lib/pio/version.rb +1 -1
  84. data/pio.gemspec +6 -6
  85. data/spec/pio/open_flow10/{echo_reply_spec.rb → echo/reply_spec.rb} +1 -1
  86. data/spec/pio/open_flow10/{echo_request_spec.rb → echo/request_spec.rb} +1 -1
  87. data/spec/pio/open_flow10/error/hello_failed_spec.rb +2 -2
  88. data/spec/pio/open_flow10/features/request_spec.rb +0 -5
  89. data/spec/pio/open_flow10/flow_mod_spec.rb +2 -4
  90. data/spec/pio/open_flow10/flow_stats_reply_spec.rb +1 -1
  91. data/spec/pio/open_flow10/flow_stats_request_spec.rb +2 -2
  92. data/spec/pio/open_flow10/packet_out_spec.rb +15 -18
  93. data/spec/pio/open_flow13/echo_reply_spec.rb +1 -1
  94. data/spec/pio/open_flow13/echo_request_spec.rb +1 -1
  95. data/spec/pio/open_flow13/error/hello_failed_spec.rb +2 -2
  96. data/spec/pio/open_flow13/features/request_spec.rb +5 -3
  97. data/spec/pio/open_flow13/hello_spec.rb +3 -3
  98. data/spec/support/shared_examples_for_openflow_messages.rb +5 -12
  99. metadata +92 -85
  100. data/lib/pio/open_flow/echo.rb +0 -44
  101. data/lib/pio/open_flow/format.rb +0 -46
  102. data/lib/pio/open_flow10/aggregate_stats_reply.rb +0 -38
  103. data/lib/pio/open_flow10/aggregate_stats_request.rb +0 -42
  104. data/lib/pio/open_flow10/barrier_reply.rb +0 -21
  105. data/lib/pio/open_flow10/barrier_request.rb +0 -22
  106. data/lib/pio/open_flow10/description_stats_reply.rb +0 -35
  107. data/lib/pio/open_flow10/description_stats_request.rb +0 -36
  108. data/lib/pio/open_flow10/echo.rb +0 -20
  109. data/lib/pio/open_flow10/flow_stats_request.rb +0 -64
  110. data/lib/pio/open_flow13/echo.rb +0 -20
  111. data/lib/pio/open_flow13/features.rb +0 -2
@@ -1,8 +1,6 @@
1
1
  require 'pio/open_flow'
2
2
 
3
- # Base module.
4
3
  module Pio
5
- # OpenFlow 1.0 messages
6
4
  module OpenFlow13
7
5
  # OpenFlow 1.3 Hello message parser and generator
8
6
  class Hello < OpenFlow::Message
@@ -43,40 +41,38 @@ module Pio
43
41
  end
44
42
  end
45
43
 
46
- # OpenFlow 1.3 Hello message format
47
- class Format < BinData::Record
48
- extend OpenFlow::Format
44
+ open_flow_header version: 4, message_type: 0
45
+ body :body
49
46
 
50
- header version: 4, message_type: 0
51
- body :body
47
+ def elements
48
+ body.elements
49
+ end
52
50
 
53
- def supported_versions
54
- supported_versions_list.map do |each|
55
- "open_flow1#{each - 1}".to_sym
56
- end
51
+ def supported_versions
52
+ supported_versions_list.map do |each|
53
+ "open_flow1#{each - 1}".to_sym
57
54
  end
55
+ end
58
56
 
59
- private
57
+ private
60
58
 
61
- def supported_versions_list
62
- (1..32).each_with_object([]) do |each, result|
63
- result << each if (version_bitmap >> each & 1) == 1
64
- end
59
+ def supported_versions_list
60
+ (1..32).each_with_object([]) do |each, result|
61
+ result << each if (version_bitmap >> each & 1) == 1
65
62
  end
63
+ end
66
64
 
67
- def version_bitmap
68
- bitmap = elements.detect(&:version_bitmap?)
69
- bitmap ? bitmap.element_value : 0
70
- end
65
+ def version_bitmap
66
+ bitmap = elements.detect(&:version_bitmap?)
67
+ bitmap ? bitmap.element_value : 0
71
68
  end
72
69
 
73
70
  def initialize(user_options = {})
74
71
  validate_user_options user_options
75
- header_options = parse_header_options(user_options)
76
72
  body_options = { elements: [{ element_type: VERSION_BITMAP,
77
73
  element_length: 8,
78
74
  element_value: 0b10000 }] }
79
- @format = Format.new(header: header_options, body: body_options)
75
+ @format = Format.new(user_options.merge(body: body_options))
80
76
  end
81
77
  end
82
78
  end
@@ -2,7 +2,6 @@ require 'pio/open_flow'
2
2
  require 'pio/open_flow13/match'
3
3
  require 'pio/parser'
4
4
 
5
- # Base module.
6
5
  module Pio
7
6
  module OpenFlow13
8
7
  # OpenFlow 1.3 PacketIn message parser and generator
@@ -23,53 +22,36 @@ module Pio
23
22
  end
24
23
  end
25
24
 
26
- # OpenFlow 1.3 PacketIn message body
27
- class Body < BinData::Record
28
- endian :big
29
-
30
- uint32 :buffer_id
31
- uint16 :total_len, initial_value: -> { raw_data.length }
32
- reason :reason
33
- uint8 :table_id
34
- uint64 :cookie
35
- oxm :match
36
- string :padding, length: 2
37
- hide :padding
38
- string :raw_data, read_length: :total_len
39
-
40
- def length
41
- 16 + match.length + padding.length + raw_data.length
42
- end
43
-
44
- def data
45
- @data ||= Pio::Parser.read(raw_data)
46
- end
47
-
48
- def in_port
49
- match.in_port
50
- end
51
-
52
- def method_missing(method, *args)
53
- data.__send__(method, *args).snapshot
54
- end
25
+ open_flow_header(version: 4,
26
+ message_type: 10,
27
+ message_length: lambda do
28
+ 24 + match.length + padding.length + raw_data.length
29
+ end)
30
+ uint32 :buffer_id
31
+ uint16 :total_len, initial_value: -> { raw_data.length }
32
+ reason :reason
33
+ uint8 :table_id
34
+ uint64 :cookie
35
+ oxm :match
36
+ string :padding, length: 2
37
+ hide :padding
38
+ string :raw_data, read_length: :total_len
39
+
40
+ attr_accessor :datapath_id
41
+ alias_method :dpid, :datapath_id
42
+ alias_method :dpid=, :datapath_id=
43
+
44
+ def data
45
+ @data ||= Pio::Parser.read(raw_data)
55
46
  end
56
47
 
57
- # OpenFlow 1.3 PacketIn message format
58
- class Format < BinData::Record
59
- extend OpenFlow::Format
60
-
61
- header version: 4, message_type: 10
62
- body :body
63
-
64
- attr_accessor :datapath_id
65
- alias_method :dpid, :datapath_id
66
- alias_method :dpid=, :datapath_id=
48
+ def in_port
49
+ match.in_port
67
50
  end
68
51
 
69
- body_option :buffer_id
70
- body_option :in_port
71
- body_option :reason
72
- body_option :raw_data
52
+ def method_missing(method, *args)
53
+ data.__send__(method, *args).snapshot
54
+ end
73
55
  end
74
56
  end
75
57
  end
@@ -2,7 +2,6 @@ require 'pio/open_flow'
2
2
  require 'pio/open_flow13/actions'
3
3
  require 'pio/open_flow13/buffer_id'
4
4
 
5
- # Base module.
6
5
  module Pio
7
6
  module OpenFlow13
8
7
  # OpenFlow 1.3 PacketOut message parser and generator
@@ -23,43 +22,25 @@ module Pio
23
22
  end
24
23
  end
25
24
 
26
- # OpenFlow 1.3 PacketOut message body
27
- class Body < BinData::Record
28
- endian :big
29
-
30
- buffer_id :buffer_id
31
- in_port :in_port
32
- uint16 :actions_length, initial_value: -> { actions.binary.length }
33
- string :padding, length: 6
34
- actions :actions, length: :actions_length
35
- string :raw_data,
36
- read_length: -> { _length - 24 - actions_length }
37
-
38
- def length
39
- 10 + padding.length + actions_length + raw_data.length
40
- end
41
-
42
- def data
43
- @data ||= Pio::Parser.read(raw_data)
44
- end
45
-
46
- def method_missing(method, *args)
47
- data.__send__(method, *args).snapshot
48
- end
25
+ open_flow_header(version: 4,
26
+ message_type: 13,
27
+ message_length: lambda do
28
+ 24 + actions_length + raw_data.length
29
+ end)
30
+ buffer_id :buffer_id
31
+ in_port :in_port
32
+ uint16 :actions_length, initial_value: -> { actions.binary.length }
33
+ string :padding, length: 6
34
+ actions :actions, length: :actions_length
35
+ string :raw_data, read_length: -> { message_length - 24 - actions_length }
36
+
37
+ def data
38
+ @data ||= Pio::Parser.read(raw_data)
49
39
  end
50
40
 
51
- # OpenFlow 1.3 PacketOut message body
52
- class Format < BinData::Record
53
- extend OpenFlow::Format
54
-
55
- header version: 4, message_type: 13
56
- body :body
41
+ def method_missing(method, *args)
42
+ data.__send__(method, *args).snapshot
57
43
  end
58
-
59
- body_option :buffer_id
60
- body_option :in_port
61
- body_option :actions
62
- body_option :raw_data
63
44
  end
64
45
  end
65
46
  end
@@ -27,27 +27,11 @@ module Pio
27
27
  end
28
28
  end
29
29
 
30
- # OpenFlow 1.3 Stats Request message body
31
- class Body < BinData::Record
32
- endian :big
33
-
34
- stats_type :stats_type
35
- uint16 :stats_flags
36
-
37
- def length
38
- 4
39
- end
40
- end
41
-
42
- # OpenFlow 1.3 Stats Request message format
43
- class Format < BinData::Record
44
- extend OpenFlow::Format
45
-
46
- header version: 4, message_type: 16
47
- body :body
48
- end
49
-
50
- body_option :stats_type
30
+ open_flow_header version: 4,
31
+ message_type: 16,
32
+ message_length: 12
33
+ stats_type :stats_type
34
+ uint16 :stats_flags
51
35
  end
52
36
  end
53
37
  end
data/lib/pio/parser.rb CHANGED
@@ -5,12 +5,13 @@ module Pio
5
5
  # Raw data parser.
6
6
  class Parser
7
7
  # Ethernet header parser
8
- class EtherTypeParser < BinData::Record
8
+ class EthernetFrame < BinData::Record
9
9
  endian :big
10
10
 
11
11
  mac_address :destination_mac
12
12
  mac_address :source_mac
13
13
  uint16 :ether_type
14
+ rest :rest
14
15
  end
15
16
 
16
17
  # IPv4 packet parser
@@ -30,8 +31,8 @@ module Pio
30
31
 
31
32
  # rubocop:disable MethodLength
32
33
  def self.read(raw_data)
33
- ethernet_header = EtherTypeParser.read(raw_data)
34
- case ethernet_header.ether_type
34
+ ethernet_frame = EthernetFrame.read(raw_data)
35
+ case ethernet_frame.ether_type
35
36
  when EthernetHeader::EtherType::IPV4, EthernetHeader::EtherType::VLAN
36
37
  IPv4Packet.read raw_data
37
38
  when EthernetHeader::EtherType::ARP
@@ -39,7 +40,7 @@ module Pio
39
40
  when EthernetHeader::EtherType::LLDP
40
41
  Pio::Lldp.read raw_data
41
42
  else
42
- fail 'Failed to parse packet_in data.'
43
+ ethernet_frame
43
44
  end
44
45
  end
45
46
  # rubocop:enable MethodLength
data/lib/pio/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Base module.
2
2
  module Pio
3
3
  # gem version.
4
- VERSION = '0.27.1'.freeze
4
+ VERSION = '0.27.2'.freeze
5
5
  end
data/pio.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |gem|
32
32
 
33
33
  gem.add_development_dependency 'rake'
34
34
  gem.add_development_dependency 'bundler', '~> 1.10.6'
35
- gem.add_development_dependency 'pry', '~> 0.10.1'
35
+ gem.add_development_dependency 'pry', '~> 0.10.3'
36
36
 
37
37
  # Guard
38
38
  gem.add_development_dependency 'guard', '~> 2.13.0'
@@ -46,18 +46,18 @@ Gem::Specification.new do |gem|
46
46
  gem.add_development_dependency 'terminal-notifier-guard', '~> 1.6.4'
47
47
 
48
48
  # Docs
49
- gem.add_development_dependency 'inch', '~> 0.6.4'
49
+ gem.add_development_dependency 'inch', '~> 0.7.0'
50
50
  gem.add_development_dependency 'relish', '~> 0.7.1'
51
51
  gem.add_development_dependency 'yard', '~> 0.8.7.6'
52
52
 
53
53
  # Test
54
54
  gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.4.8'
55
- gem.add_development_dependency 'coveralls', '~> 0.8.2'
56
- gem.add_development_dependency 'cucumber', '~> 2.0.2'
55
+ gem.add_development_dependency 'coveralls', '~> 0.8.3'
56
+ gem.add_development_dependency 'cucumber', '~> 2.1.0'
57
57
  gem.add_development_dependency 'flay', '~> 2.6.1'
58
58
  gem.add_development_dependency 'flog', '~> 4.3.2'
59
- gem.add_development_dependency 'reek', '~> 3.3.1'
59
+ gem.add_development_dependency 'reek', '~> 3.5.0'
60
60
  gem.add_development_dependency 'rspec', '~> 3.3.0'
61
61
  gem.add_development_dependency 'rspec-given', '~> 3.7.1'
62
- gem.add_development_dependency 'rubocop', '~> 0.34.0'
62
+ gem.add_development_dependency 'rubocop', '~> 0.34.2'
63
63
  end
@@ -1,4 +1,4 @@
1
- require 'pio/open_flow10/echo'
1
+ require 'pio/open_flow10/echo/reply'
2
2
 
3
3
  describe Pio::OpenFlow10::Echo::Reply do
4
4
  describe '.new' do
@@ -1,4 +1,4 @@
1
- require 'pio/open_flow10/echo'
1
+ require 'pio/open_flow10/echo/request'
2
2
 
3
3
  describe Pio::OpenFlow10::Echo::Request do
4
4
  describe '.new' do
@@ -10,7 +10,7 @@ describe Pio::OpenFlow10::Error::HelloFailed do
10
10
  context 'with {}' do
11
11
  Given(:options) { {} }
12
12
 
13
- Then { hello_failed.length == 12 }
13
+ Then { hello_failed.message_length == 12 }
14
14
  Then { hello_failed.error_type == :hello_failed }
15
15
  Then { hello_failed.error_code == :incompatible }
16
16
  Then { hello_failed.description == '' }
@@ -19,7 +19,7 @@ describe Pio::OpenFlow10::Error::HelloFailed do
19
19
  context "with description: 'error description'" do
20
20
  Given(:options) { { description: 'error description' } }
21
21
 
22
- Then { hello_failed.length == 29 }
22
+ Then { hello_failed.message_length == 29 }
23
23
  Then { hello_failed.description == 'error description' }
24
24
  end
25
25
  end
@@ -4,10 +4,5 @@ describe Pio::OpenFlow10::Features::Request do
4
4
  describe '.new' do
5
5
  it_should_behave_like('an OpenFlow message',
6
6
  Pio::OpenFlow10::Features::Request)
7
-
8
- context "with body: 'abcde'" do
9
- When(:message) { Pio::OpenFlow10::Features::Request.new(body: 'abcde') }
10
- Then { message == Failure(RuntimeError, 'Unknown option: body') }
11
- end
12
7
  end
13
8
  end
@@ -32,11 +32,10 @@ describe Pio::OpenFlow10::FlowMod do
32
32
  Then { flow_mod.class == Pio::OpenFlow10::FlowMod }
33
33
  Then { flow_mod.ofp_version == 0x1 }
34
34
  Then { flow_mod.message_type == 0xe }
35
- Then { flow_mod.length == 0x50 }
35
+ Then { flow_mod.message_length == 0x50 }
36
36
  Then { flow_mod.transaction_id == 0x15 }
37
37
  Then { flow_mod.xid == 0x15 }
38
38
 
39
- Then { !flow_mod.body.empty? }
40
39
  Then do
41
40
  flow_mod.match.wildcards.keys == [
42
41
  :vlan_vid,
@@ -98,11 +97,10 @@ describe Pio::OpenFlow10::FlowMod do
98
97
  Then { flow_mod.class == Pio::OpenFlow10::FlowMod }
99
98
  Then { flow_mod.ofp_version == 0x1 }
100
99
  Then { flow_mod.message_type == 0xe }
101
- Then { flow_mod.length == 0x50 }
100
+ Then { flow_mod.message_length == 0x50 }
102
101
  Then { flow_mod.transaction_id == 0x15 }
103
102
  Then { flow_mod.xid == 0x15 }
104
103
 
105
- Then { !flow_mod.body.empty? }
106
104
  Then do
107
105
  flow_mod.match.wildcards.keys == [
108
106
  :vlan_vid,
@@ -1,4 +1,4 @@
1
- require 'pio/open_flow10/flow_stats_reply'
1
+ require 'pio/open_flow10/flow_stats/reply'
2
2
 
3
3
  describe Pio::OpenFlow10::FlowStats::Reply do
4
4
  describe '.read' do
@@ -1,4 +1,4 @@
1
- require 'pio/open_flow10/flow_stats_request'
1
+ require 'pio/open_flow10/flow_stats/request'
2
2
 
3
3
  describe Pio::OpenFlow10::FlowStats::Request do
4
4
  describe '.read' do
@@ -19,7 +19,7 @@ describe Pio::OpenFlow10::FlowStats::Request do
19
19
  Then { flow_stats_request.class == Pio::OpenFlow10::FlowStats::Request }
20
20
  Then { flow_stats_request.ofp_version == 1 }
21
21
  Then { flow_stats_request.message_type == 16 }
22
- Then { flow_stats_request.length == 56 }
22
+ Then { flow_stats_request.message_length == 56 }
23
23
  Then { flow_stats_request.transaction_id == 13 }
24
24
  Then { flow_stats_request.xid == 13 }
25
25
  Then { flow_stats_request.stats_type == :flow }
@@ -41,11 +41,10 @@ describe Pio::OpenFlow10::PacketOut do
41
41
  Then { result.class == Pio::OpenFlow10::PacketOut }
42
42
  Then { result.ofp_version == 0x1 }
43
43
  Then { result.message_type == 0xd }
44
- Then { result.length == 0x58 }
44
+ Then { result.message_length == 0x58 }
45
45
  Then { result.transaction_id == 0x16 }
46
46
  Then { result.xid == 0x16 }
47
47
 
48
- Then { !result.body.empty? }
49
48
  Then { result.buffer_id == 0xffffffff }
50
49
  Then { result.in_port == 0xffff }
51
50
  Then { result.actions_len == 0x8 }
@@ -70,11 +69,10 @@ describe Pio::OpenFlow10::PacketOut do
70
69
  Then { result.class == Pio::OpenFlow10::PacketOut }
71
70
  Then { result.ofp_version == 0x1 }
72
71
  Then { result.message_type == 0xd }
73
- Then { result.length == 0x58 }
72
+ Then { result.message_length == 0x58 }
74
73
  Then { result.transaction_id == 0x16 }
75
74
  Then { result.xid == 0x16 }
76
75
 
77
- Then { !result.body.empty? }
78
76
  Then { result.buffer_id == 0xffffffff }
79
77
  Then { result.in_port == 0xffff }
80
78
  Then { result.actions_len == 0x8 }
@@ -113,11 +111,10 @@ describe Pio::OpenFlow10::PacketOut do
113
111
 
114
112
  Then { result.ofp_version == 0x1 }
115
113
  Then { result.message_type == 0xd }
116
- Then { result.length == 0x58 }
114
+ Then { result.message_length == 0x58 }
117
115
  Then { result.transaction_id == 0x16 }
118
116
  Then { result.xid == 0x16 }
119
117
 
120
- Then { !result.body.empty? }
121
118
  Then { result.buffer_id == 0xffffffff }
122
119
  Then { result.in_port == 0xffff }
123
120
  Then { result.actions_len == 0x8 }
@@ -145,7 +142,7 @@ describe Pio::OpenFlow10::PacketOut do
145
142
  }
146
143
  end
147
144
 
148
- Then { result.length == 0x58 }
145
+ Then { result.message_length == 0x58 }
149
146
  Then { result.actions_len == 0x8 }
150
147
  Then { result.actions.length == 1 }
151
148
  Then { result.actions[0].is_a? Pio::SetVlanVid }
@@ -163,7 +160,7 @@ describe Pio::OpenFlow10::PacketOut do
163
160
  }
164
161
  end
165
162
 
166
- Then { result.length == 0x58 }
163
+ Then { result.message_length == 0x58 }
167
164
  Then { result.actions_len == 0x8 }
168
165
  Then { result.actions.length == 1 }
169
166
  Then { result.actions[0].is_a? Pio::SetVlanPriority }
@@ -181,7 +178,7 @@ describe Pio::OpenFlow10::PacketOut do
181
178
  }
182
179
  end
183
180
 
184
- Then { result.length == 0x58 }
181
+ Then { result.message_length == 0x58 }
185
182
  Then { result.actions_len == 0x8 }
186
183
  Then { result.actions.length == 1 }
187
184
  Then { result.actions[0].is_a? Pio::StripVlanHeader }
@@ -198,7 +195,7 @@ describe Pio::OpenFlow10::PacketOut do
198
195
  }
199
196
  end
200
197
 
201
- Then { result.length == 0x60 }
198
+ Then { result.message_length == 0x60 }
202
199
  Then { result.actions_len == 0x10 }
203
200
  Then { result.actions.length == 1 }
204
201
  Then { result.actions[0].is_a? Pio::SetEtherSourceAddress }
@@ -216,7 +213,7 @@ describe Pio::OpenFlow10::PacketOut do
216
213
  }
217
214
  end
218
215
 
219
- Then { result.length == 0x60 }
216
+ Then { result.message_length == 0x60 }
220
217
  Then { result.actions_len == 0x10 }
221
218
  Then { result.actions.length == 1 }
222
219
  Then { result.actions[0].is_a? Pio::SetEtherDestinationAddress }
@@ -234,7 +231,7 @@ describe Pio::OpenFlow10::PacketOut do
234
231
  }
235
232
  end
236
233
 
237
- Then { result.length == 0x58 }
234
+ Then { result.message_length == 0x58 }
238
235
  Then { result.actions_len == 0x8 }
239
236
  Then { result.actions.length == 1 }
240
237
  Then { result.actions[0].is_a? Pio::SetIpSourceAddress }
@@ -252,7 +249,7 @@ describe Pio::OpenFlow10::PacketOut do
252
249
  }
253
250
  end
254
251
 
255
- Then { result.length == 0x58 }
252
+ Then { result.message_length == 0x58 }
256
253
  Then { result.actions_len == 0x8 }
257
254
  Then { result.actions.length == 1 }
258
255
  Then { result.actions[0].is_a? Pio::SetIpDestinationAddress }
@@ -270,7 +267,7 @@ describe Pio::OpenFlow10::PacketOut do
270
267
  }
271
268
  end
272
269
 
273
- Then { result.length == 0x58 }
270
+ Then { result.message_length == 0x58 }
274
271
  Then { result.actions_len == 0x8 }
275
272
  Then { result.actions.length == 1 }
276
273
  Then { result.actions[0].is_a? Pio::SetIpTos }
@@ -288,7 +285,7 @@ describe Pio::OpenFlow10::PacketOut do
288
285
  }
289
286
  end
290
287
 
291
- Then { result.length == 0x58 }
288
+ Then { result.message_length == 0x58 }
292
289
  Then { result.actions_len == 0x8 }
293
290
  Then { result.actions.length == 1 }
294
291
  Then { result.actions[0].is_a? Pio::SetTransportSourcePort }
@@ -306,7 +303,7 @@ describe Pio::OpenFlow10::PacketOut do
306
303
  }
307
304
  end
308
305
 
309
- Then { result.length == 0x58 }
306
+ Then { result.message_length == 0x58 }
310
307
  Then { result.actions_len == 0x8 }
311
308
  Then { result.actions.length == 1 }
312
309
  Then { result.actions[0].is_a? Pio::SetTransportDestinationPort }
@@ -324,7 +321,7 @@ describe Pio::OpenFlow10::PacketOut do
324
321
  }
325
322
  end
326
323
 
327
- Then { result.length == 0x60 }
324
+ Then { result.message_length == 0x60 }
328
325
  Then { result.actions_len == 0x10 }
329
326
  Then { result.actions.length == 1 }
330
327
  Then { result.actions[0].is_a? Pio::Enqueue }
@@ -344,7 +341,7 @@ describe Pio::OpenFlow10::PacketOut do
344
341
  }
345
342
  end
346
343
 
347
- Then { result.length == 0x60 }
344
+ Then { result.message_length == 0x60 }
348
345
  Then { result.actions_len == 0x10 }
349
346
  Then { result.actions.length == 2 }
350
347
  Then { result.actions[0].is_a? Pio::OpenFlow10::SendOutPort }