pio 0.27.2 → 0.28.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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/Rakefile +1 -1
  4. data/bin/{code_metrics → terminal-notifier} +2 -2
  5. data/features/dhcp.feature +12 -12
  6. data/features/icmp.feature +12 -12
  7. data/features/open_flow10/aggregate_stats_request.feature +10 -10
  8. data/features/open_flow10/enqueue.feature +7 -7
  9. data/features/open_flow10/exact_match.feature +15 -15
  10. data/features/open_flow10/features_reply.feature +40 -40
  11. data/features/open_flow10/flow_mod.feature +49 -49
  12. data/features/open_flow10/flow_removed.feature +34 -0
  13. data/features/open_flow10/flow_stats_reply.feature +14 -14
  14. data/features/open_flow10/flow_stats_request.feature +15 -15
  15. data/features/open_flow10/nicira_resubmit.feature +30 -0
  16. data/features/open_flow10/nicira_resubmit_table.feature +32 -0
  17. data/features/open_flow10/port_stats_request.feature +48 -0
  18. data/features/open_flow10/port_stats_request.raw +0 -0
  19. data/features/open_flow10/queue_stats_request.feature +51 -0
  20. data/features/open_flow10/queue_stats_request.raw +0 -0
  21. data/features/open_flow10/send_out_port.feature +40 -40
  22. data/features/open_flow10/set_destination_mac_address.feature +16 -0
  23. data/features/open_flow10/set_ip_destination_address.feature +6 -6
  24. data/features/open_flow10/set_source_ip_address.feature +16 -0
  25. data/features/open_flow10/set_source_mac_address.feature +16 -0
  26. data/features/open_flow10/{set_ip_tos.feature → set_tos.feature} +3 -3
  27. data/features/open_flow10/set_transport_destination_port.feature +6 -6
  28. data/features/open_flow10/set_transport_source_port.feature +6 -6
  29. data/features/open_flow10/set_vlan_priority.feature +3 -3
  30. data/features/open_flow10/set_vlan_vid.feature +6 -6
  31. data/features/open_flow10/strip_vlan_header.feature +5 -5
  32. data/features/open_flow10/table_stats_request.feature +31 -0
  33. data/features/open_flow13/match.feature +33 -33
  34. data/features/open_flow13/send_out_port.feature +45 -45
  35. data/features/udp.feature +2 -2
  36. data/lib/pio/arp/format.rb +5 -5
  37. data/lib/pio/dhcp/boot_reply_options.rb +6 -6
  38. data/lib/pio/dhcp/boot_request_options.rb +2 -2
  39. data/lib/pio/dhcp/common_options.rb +5 -5
  40. data/lib/pio/dhcp/message.rb +2 -2
  41. data/lib/pio/icmp/options.rb +2 -2
  42. data/lib/pio/icmp/reply.rb +6 -6
  43. data/lib/pio/icmp/request.rb +6 -6
  44. data/lib/pio/ipv4_header.rb +11 -11
  45. data/lib/pio/open_flow.rb +5 -2
  46. data/lib/pio/open_flow/action.rb +41 -0
  47. data/lib/pio/open_flow/nicira_action.rb +17 -0
  48. data/lib/pio/open_flow10.rb +12 -1
  49. data/lib/pio/open_flow10/actions.rb +17 -15
  50. data/lib/pio/open_flow10/enqueue.rb +27 -46
  51. data/lib/pio/open_flow10/features/reply.rb +5 -5
  52. data/lib/pio/open_flow10/flow_removed.rb +40 -0
  53. data/lib/pio/open_flow10/match.rb +33 -33
  54. data/lib/pio/open_flow10/nicira_resubmit.rb +20 -0
  55. data/lib/pio/open_flow10/nicira_resubmit_table.rb +17 -0
  56. data/lib/pio/open_flow10/port_stats/request.rb +25 -0
  57. data/lib/pio/open_flow10/queue_stats/request.rb +22 -0
  58. data/lib/pio/open_flow10/send_out_port.rb +6 -27
  59. data/lib/pio/open_flow10/set_destination_ip_address.rb +16 -0
  60. data/lib/pio/open_flow10/set_destination_mac_address.rb +18 -0
  61. data/lib/pio/open_flow10/set_source_ip_address.rb +16 -0
  62. data/lib/pio/open_flow10/set_source_mac_address.rb +18 -0
  63. data/lib/pio/open_flow10/set_tos.rb +24 -0
  64. data/lib/pio/open_flow10/set_transport_port.rb +32 -48
  65. data/lib/pio/open_flow10/set_vlan_priority.rb +16 -11
  66. data/lib/pio/open_flow10/set_vlan_vid.rb +16 -11
  67. data/lib/pio/open_flow10/stats_request.rb +5 -1
  68. data/lib/pio/open_flow10/strip_vlan_header.rb +8 -25
  69. data/lib/pio/open_flow10/table_stats/request.rb +19 -0
  70. data/lib/pio/open_flow13/actions.rb +1 -1
  71. data/lib/pio/open_flow13/match.rb +19 -19
  72. data/lib/pio/open_flow13/send_out_port.rb +9 -28
  73. data/lib/pio/udp_header.rb +4 -4
  74. data/lib/pio/version.rb +1 -1
  75. data/pio.gemspec +3 -2
  76. data/spec/pio/dhcp/ack_spec.rb +8 -8
  77. data/spec/pio/dhcp/offer_spec.rb +8 -8
  78. data/spec/pio/dhcp_spec.rb +16 -16
  79. data/spec/pio/icmp/reply_spec.rb +4 -4
  80. data/spec/pio/icmp/request_spec.rb +6 -6
  81. data/spec/pio/icmp_spec.rb +4 -4
  82. data/spec/pio/open_flow10/enqueue_spec.rb +13 -11
  83. data/spec/pio/open_flow10/flow_mod_spec.rb +20 -20
  84. data/spec/pio/open_flow10/flow_stats_request_spec.rb +4 -4
  85. data/spec/pio/open_flow10/match_spec.rb +59 -59
  86. data/spec/pio/open_flow10/packet_out_spec.rb +31 -29
  87. data/spec/pio/open_flow10/set_destination_ip_address_spec.rb +27 -0
  88. data/spec/pio/open_flow10/set_destination_mac_address_spec.rb +28 -0
  89. data/spec/pio/open_flow10/set_source_ip_address_spec.rb +27 -0
  90. data/spec/pio/open_flow10/set_source_mac_address_spec.rb +28 -0
  91. data/spec/pio/open_flow10/set_tos_spec.rb +30 -0
  92. data/spec/pio/open_flow10/set_transport_destination_port_spec.rb +4 -4
  93. data/spec/pio/open_flow10/set_transport_source_port_spec.rb +4 -4
  94. data/spec/pio/open_flow10/set_vlan_priority_spec.rb +4 -4
  95. data/spec/pio/open_flow10/set_vlan_vid_spec.rb +4 -4
  96. data/spec/pio/open_flow10/strip_vlan_header_spec.rb +5 -5
  97. data/spec/pio/open_flow10/wildcards_spec.rb +18 -18
  98. data/spec/pio/open_flow13/match_spec.rb +20 -20
  99. metadata +73 -37
  100. data/bin/code_metrics-profile +0 -16
  101. data/features/open_flow10/set_ether_destination_address.feature +0 -16
  102. data/features/open_flow10/set_ether_source_address.feature +0 -16
  103. data/features/open_flow10/set_ip_source_address.feature +0 -16
  104. data/lib/pio/open_flow10/set_ether_address.rb +0 -53
  105. data/lib/pio/open_flow10/set_ip_address.rb +0 -49
  106. data/lib/pio/open_flow10/set_ip_tos.rb +0 -42
  107. data/lib/pio/open_flow10/set_vlan.rb +0 -37
  108. data/spec/pio/open_flow10/set_ether_destination_address_spec.rb +0 -28
  109. data/spec/pio/open_flow10/set_ether_source_address_spec.rb +0 -28
  110. data/spec/pio/open_flow10/set_ip_destination_address_spec.rb +0 -27
  111. data/spec/pio/open_flow10/set_ip_source_address_spec.rb +0 -25
  112. data/spec/pio/open_flow10/set_ip_tos_spec.rb +0 -30
@@ -192,16 +192,16 @@ describe Pio::Dhcp, '.read' do
192
192
  it { is_expected.to eq 0x39a6 }
193
193
  end
194
194
 
195
- describe '#ip_source_address' do
196
- subject { super().ip_source_address }
195
+ describe '#source_ip_address' do
196
+ subject { super().source_ip_address }
197
197
  describe '#to_s' do
198
198
  subject { super().to_s }
199
199
  it { is_expected.to eq '0.0.0.0' }
200
200
  end
201
201
  end
202
202
 
203
- describe '#ip_destination_address' do
204
- subject { super().ip_destination_address }
203
+ describe '#destination_ip_address' do
204
+ subject { super().destination_ip_address }
205
205
  describe '#to_s' do
206
206
  subject { super().to_s }
207
207
  it { is_expected.to eq '255.255.255.255' }
@@ -514,16 +514,16 @@ describe Pio::Dhcp, '.read' do
514
514
  it { is_expected.to eq 0xb849 }
515
515
  end
516
516
 
517
- describe '#ip_source_address' do
518
- subject { super().ip_source_address }
517
+ describe '#source_ip_address' do
518
+ subject { super().source_ip_address }
519
519
  describe '#to_s' do
520
520
  subject { super().to_s }
521
521
  it { is_expected.to eq '192.168.0.10' }
522
522
  end
523
523
  end
524
524
 
525
- describe '#ip_destination_address' do
526
- subject { super().ip_destination_address }
525
+ describe '#destination_ip_address' do
526
+ subject { super().destination_ip_address }
527
527
  describe '#to_s' do
528
528
  subject { super().to_s }
529
529
  it { is_expected.to eq '192.168.0.1' }
@@ -844,16 +844,16 @@ describe Pio::Dhcp, '.read' do
844
844
  it { is_expected.to eq 0x39a6 }
845
845
  end
846
846
 
847
- describe '#ip_source_address' do
848
- subject { super().ip_source_address }
847
+ describe '#source_ip_address' do
848
+ subject { super().source_ip_address }
849
849
  describe '#to_s' do
850
850
  subject { super().to_s }
851
851
  it { is_expected.to eq '0.0.0.0' }
852
852
  end
853
853
  end
854
854
 
855
- describe '#ip_destination_address' do
856
- subject { super().ip_destination_address }
855
+ describe '#destination_ip_address' do
856
+ subject { super().destination_ip_address }
857
857
  describe '#to_s' do
858
858
  subject { super().to_s }
859
859
  it { is_expected.to eq '255.255.255.255' }
@@ -1166,16 +1166,16 @@ describe Pio::Dhcp, '.read' do
1166
1166
  it { is_expected.to eq 0xb849 }
1167
1167
  end
1168
1168
 
1169
- describe '#ip_source_address' do
1170
- subject { super().ip_source_address }
1169
+ describe '#source_ip_address' do
1170
+ subject { super().source_ip_address }
1171
1171
  describe '#to_s' do
1172
1172
  subject { super().to_s }
1173
1173
  it { is_expected.to eq '192.168.0.10' }
1174
1174
  end
1175
1175
  end
1176
1176
 
1177
- describe '#ip_destination_address' do
1178
- subject { super().ip_destination_address }
1177
+ describe '#destination_ip_address' do
1178
+ subject { super().destination_ip_address }
1179
1179
  describe '#to_s' do
1180
1180
  subject { super().to_s }
1181
1181
  it { is_expected.to eq '192.168.0.1' }
@@ -10,8 +10,8 @@ describe Pio::Icmp::Reply, '.new' do
10
10
  Pio::Icmp::Reply.new(
11
11
  destination_mac: '00:26:82:eb:ea:d1',
12
12
  source_mac: '24:db:ac:41:e5:5b',
13
- ip_source_address: '8.8.8.8',
14
- ip_destination_address: '192.168.1.102',
13
+ source_ip_address: '8.8.8.8',
14
+ destination_ip_address: '192.168.1.102',
15
15
  identifier: 0x123,
16
16
  sequence_number: 0x321,
17
17
  echo_data: 'abcdefghijklmnopqrstuvwabcdefghi'
@@ -75,8 +75,8 @@ describe Pio::Icmp::Reply, '.new' do
75
75
  Pio::Icmp::Reply.new(
76
76
  destination_mac: '00:26:82:eb:ea:d1',
77
77
  source_mac: '24:db:ac:41:e5:5b',
78
- ip_source_address: '8.8.8.8',
79
- ip_destination_address: '192.168.1.102',
78
+ source_ip_address: '8.8.8.8',
79
+ destination_ip_address: '192.168.1.102',
80
80
  identifier: 0x123,
81
81
  sequence_number: 0x321
82
82
  )
@@ -9,8 +9,8 @@ describe Pio::Icmp do
9
9
  Pio::Icmp::Request.new(
10
10
  destination_mac: '24:db:ac:41:e5:5b',
11
11
  source_mac: '74:e5:0b:2a:18:f8',
12
- ip_source_address: '192.168.1.101',
13
- ip_destination_address: '8.8.8.8',
12
+ source_ip_address: '192.168.1.101',
13
+ destination_ip_address: '8.8.8.8',
14
14
  identifier: 0x123,
15
15
  sequence_number: 0x321,
16
16
  echo_data: 'abcdefghijklmnopqrstuvwabcdefghi'
@@ -29,8 +29,8 @@ describe Pio::Icmp::Request, '.new' do
29
29
  Pio::Icmp::Request.new(
30
30
  destination_mac: '24:db:ac:41:e5:5b',
31
31
  source_mac: '74:e5:0b:2a:18:f8',
32
- ip_source_address: '192.168.1.101',
33
- ip_destination_address: '8.8.8.8',
32
+ source_ip_address: '192.168.1.101',
33
+ destination_ip_address: '8.8.8.8',
34
34
  identifier: 0x123,
35
35
  sequence_number: 0x321,
36
36
  echo_data: 'abcdefghijklmnopqrstuvwabcdefghi'
@@ -95,8 +95,8 @@ describe Pio::Icmp::Request, '.new' do
95
95
  Pio::Icmp::Request.new(
96
96
  destination_mac: '24:db:ac:41:e5:5b',
97
97
  source_mac: '74:e5:0b:2a:18:f8',
98
- ip_source_address: '192.168.1.101',
99
- ip_destination_address: '8.8.8.8',
98
+ source_ip_address: '192.168.1.101',
99
+ destination_ip_address: '8.8.8.8',
100
100
  identifier: 0x123,
101
101
  sequence_number: 0x321
102
102
  )
@@ -71,8 +71,8 @@ describe Pio::Icmp, '.read' do
71
71
  Then { icmp_request.ip_ttl == 128 }
72
72
  Then { icmp_request.ip_protocol == 1 }
73
73
  Then { icmp_request.ip_header_checksum == 0x2ed0 }
74
- Then { icmp_request.ip_source_address.to_s == '192.168.1.102' }
75
- Then { icmp_request.ip_destination_address.to_s == '8.8.8.8' }
74
+ Then { icmp_request.source_ip_address.to_s == '192.168.1.102' }
75
+ Then { icmp_request.destination_ip_address.to_s == '8.8.8.8' }
76
76
  Then { icmp_request.icmp_type == 8 }
77
77
  Then { icmp_request.icmp_code == 0 }
78
78
  Then { icmp_request.icmp_checksum == 0x4c5b }
@@ -144,8 +144,8 @@ describe Pio::Icmp, '.read' do
144
144
  Then { icmp_reply.ip_ttl == 45 }
145
145
  Then { icmp_reply.ip_protocol == 1 }
146
146
  Then { icmp_reply.ip_header_checksum == 0xbba3 }
147
- Then { icmp_reply.ip_source_address.to_s == '8.8.8.8' }
148
- Then { icmp_reply.ip_destination_address.to_s == '192.168.1.102' }
147
+ Then { icmp_reply.source_ip_address.to_s == '8.8.8.8' }
148
+ Then { icmp_reply.destination_ip_address.to_s == '192.168.1.102' }
149
149
  Then { icmp_reply.icmp_type == 0 }
150
150
  Then { icmp_reply.icmp_code == 0 }
151
151
  Then { icmp_reply.icmp_checksum == 0x545b }
@@ -1,9 +1,9 @@
1
1
  require 'pio/open_flow10/enqueue'
2
2
 
3
- describe Pio::Enqueue do
3
+ describe Pio::OpenFlow10::Enqueue do
4
4
  describe '.new' do
5
5
  context 'with port: 1, queue_id: 2' do
6
- When(:enqueue) { Pio::Enqueue.new(port: 1, queue_id: 2) }
6
+ When(:enqueue) { Pio::OpenFlow10::Enqueue.new(port: 1, queue_id: 2) }
7
7
 
8
8
  describe '#port' do
9
9
  Then { enqueue.port == 1 }
@@ -17,8 +17,8 @@ describe Pio::Enqueue do
17
17
  Then { enqueue.action_type == 11 }
18
18
  end
19
19
 
20
- describe '#length' do
21
- Then { enqueue.length == 16 }
20
+ describe '#action_length' do
21
+ Then { enqueue.action_length == 16 }
22
22
  end
23
23
 
24
24
  describe '#to_binary' do
@@ -27,7 +27,9 @@ describe Pio::Enqueue do
27
27
  end
28
28
 
29
29
  context 'with port: :in_port, queue_id: 2' do
30
- When(:enqueue) { Pio::Enqueue.new(port: :in_port, queue_id: 2) }
30
+ When(:enqueue) do
31
+ Pio::OpenFlow10::Enqueue.new(port: :in_port, queue_id: 2)
32
+ end
31
33
 
32
34
  describe '#port' do
33
35
  Then { enqueue.port == :in_port }
@@ -35,32 +37,32 @@ describe Pio::Enqueue do
35
37
  end
36
38
 
37
39
  context 'with port: :local, queue_id: 2' do
38
- When(:enqueue) { Pio::Enqueue.new(port: :local, queue_id: 2) }
40
+ When(:enqueue) { Pio::OpenFlow10::Enqueue.new(port: :local, queue_id: 2) }
39
41
  Then { enqueue == Failure(ArgumentError) }
40
42
  end
41
43
 
42
44
  context 'with port: -1, queue_id: 2' do
43
- When(:enqueue) { Pio::Enqueue.new(port: -1, queue_id: 2) }
45
+ When(:enqueue) { Pio::OpenFlow10::Enqueue.new(port: -1, queue_id: 2) }
44
46
  Then { enqueue == Failure(ArgumentError) }
45
47
  end
46
48
 
47
49
  context 'with port: 0xff00, queue_id: 2' do
48
- When(:enqueue) { Pio::Enqueue.new(port: 0xff00, queue_id: 2) }
50
+ When(:enqueue) { Pio::OpenFlow10::Enqueue.new(port: 0xff00, queue_id: 2) }
49
51
  Then { enqueue == Failure(ArgumentError) }
50
52
  end
51
53
 
52
54
  context 'with port: 1, queue_id: -2' do
53
- When(:enqueue) { Pio::Enqueue.new(port: 1, queue_id: -2) }
55
+ When(:enqueue) { Pio::OpenFlow10::Enqueue.new(port: 1, queue_id: -2) }
54
56
  Then { enqueue == Failure(ArgumentError) }
55
57
  end
56
58
 
57
59
  context 'with port: 1' do
58
- When(:enqueue) { Pio::Enqueue.new(port: 1) }
60
+ When(:enqueue) { Pio::OpenFlow10::Enqueue.new(port: 1) }
59
61
  Then { enqueue == Failure(ArgumentError) }
60
62
  end
61
63
 
62
64
  context 'with queue_id: 2' do
63
- When(:enqueue) { Pio::Enqueue.new(queue_id: 2) }
65
+ When(:enqueue) { Pio::OpenFlow10::Enqueue.new(queue_id: 2) }
64
66
  Then { enqueue == Failure(ArgumentError) }
65
67
  end
66
68
  end
@@ -39,28 +39,28 @@ describe Pio::OpenFlow10::FlowMod do
39
39
  Then do
40
40
  flow_mod.match.wildcards.keys == [
41
41
  :vlan_vid,
42
- :ether_source_address,
43
- :ether_destination_address,
42
+ :source_mac_address,
43
+ :destination_mac_address,
44
44
  :ether_type,
45
45
  :ip_protocol,
46
46
  :transport_source_port,
47
47
  :transport_destination_port,
48
- :ip_source_address_all,
49
- :ip_destination_address_all,
48
+ :source_ip_address_all,
49
+ :destination_ip_address_all,
50
50
  :vlan_priority,
51
- :ip_tos
51
+ :tos
52
52
  ]
53
53
  end
54
54
  Then { flow_mod.match.in_port == 1 }
55
- Then { flow_mod.match.ether_source_address == '00:00:00:00:00:00' }
56
- Then { flow_mod.match.ether_destination_address == '00:00:00:00:00:00' }
55
+ Then { flow_mod.match.source_mac_address == '00:00:00:00:00:00' }
56
+ Then { flow_mod.match.destination_mac_address == '00:00:00:00:00:00' }
57
57
  Then { flow_mod.match.vlan_vid == 0 }
58
58
  Then { flow_mod.match.vlan_priority == 0 }
59
59
  Then { flow_mod.match.ether_type == 0 }
60
- Then { flow_mod.match.ip_tos == 0 }
60
+ Then { flow_mod.match.tos == 0 }
61
61
  Then { flow_mod.match.ip_protocol == 0 }
62
- Then { flow_mod.match.ip_source_address == '0.0.0.0' }
63
- Then { flow_mod.match.ip_destination_address == '0.0.0.0' }
62
+ Then { flow_mod.match.source_ip_address == '0.0.0.0' }
63
+ Then { flow_mod.match.destination_ip_address == '0.0.0.0' }
64
64
  Then { flow_mod.match.transport_source_port == 0 }
65
65
  Then { flow_mod.match.transport_destination_port == 0 }
66
66
  Then { flow_mod.cookie == 1 }
@@ -104,28 +104,28 @@ describe Pio::OpenFlow10::FlowMod do
104
104
  Then do
105
105
  flow_mod.match.wildcards.keys == [
106
106
  :vlan_vid,
107
- :ether_source_address,
108
- :ether_destination_address,
107
+ :source_mac_address,
108
+ :destination_mac_address,
109
109
  :ether_type,
110
110
  :ip_protocol,
111
111
  :transport_source_port,
112
112
  :transport_destination_port,
113
- :ip_source_address_all,
114
- :ip_destination_address_all,
113
+ :source_ip_address_all,
114
+ :destination_ip_address_all,
115
115
  :vlan_priority,
116
- :ip_tos
116
+ :tos
117
117
  ]
118
118
  end
119
119
  Then { flow_mod.match.in_port == 1 }
120
- Then { flow_mod.match.ether_source_address == '00:00:00:00:00:00' }
121
- Then { flow_mod.match.ether_destination_address == '00:00:00:00:00:00' }
120
+ Then { flow_mod.match.source_mac_address == '00:00:00:00:00:00' }
121
+ Then { flow_mod.match.destination_mac_address == '00:00:00:00:00:00' }
122
122
  Then { flow_mod.match.vlan_vid == 0 }
123
123
  Then { flow_mod.match.vlan_priority == 0 }
124
124
  Then { flow_mod.match.ether_type == 0 }
125
- Then { flow_mod.match.ip_tos == 0 }
125
+ Then { flow_mod.match.tos == 0 }
126
126
  Then { flow_mod.match.ip_protocol == 0 }
127
- Then { flow_mod.match.ip_source_address == '0.0.0.0' }
128
- Then { flow_mod.match.ip_destination_address == '0.0.0.0' }
127
+ Then { flow_mod.match.source_ip_address == '0.0.0.0' }
128
+ Then { flow_mod.match.destination_ip_address == '0.0.0.0' }
129
129
  Then { flow_mod.match.transport_source_port == 0 }
130
130
  Then { flow_mod.match.transport_destination_port == 0 }
131
131
  Then { flow_mod.cookie == 1 }
@@ -25,11 +25,11 @@ describe Pio::OpenFlow10::FlowStats::Request do
25
25
  Then { flow_stats_request.stats_type == :flow }
26
26
  Then do
27
27
  flow_stats_request.match.wildcards.keys.sort ==
28
- [:ether_destination_address, :ether_source_address,
29
- :ether_type, :in_port, :ip_destination_address_all,
30
- :ip_protocol, :ip_source_address_all, :ip_tos,
28
+ [:destination_mac_address, :source_mac_address,
29
+ :ether_type, :in_port, :destination_ip_address_all,
30
+ :ip_protocol, :source_ip_address_all, :tos,
31
31
  :transport_destination_port, :transport_source_port,
32
- :vlan_priority, :vlan_vid]
32
+ :vlan_priority, :vlan_vid].sort
33
33
  end
34
34
  Then { flow_stats_request.table_id == 0xff }
35
35
  Then { flow_stats_request.out_port == :none }
@@ -28,28 +28,28 @@ describe Pio::OpenFlow10::Match do
28
28
  Then do
29
29
  match.wildcards.keys == [
30
30
  :vlan_vid,
31
- :ether_source_address,
32
- :ether_destination_address,
31
+ :source_mac_address,
32
+ :destination_mac_address,
33
33
  :ether_type,
34
34
  :ip_protocol,
35
35
  :transport_source_port,
36
36
  :transport_destination_port,
37
- :ip_source_address_all,
38
- :ip_destination_address_all,
37
+ :source_ip_address_all,
38
+ :destination_ip_address_all,
39
39
  :vlan_priority,
40
- :ip_tos
40
+ :tos
41
41
  ]
42
42
  end
43
43
  Then { match.in_port == 1 }
44
- Then { match.ether_source_address == '00:00:00:00:00:00' }
45
- Then { match.ether_destination_address == '00:00:00:00:00:00' }
44
+ Then { match.source_mac_address == '00:00:00:00:00:00' }
45
+ Then { match.destination_mac_address == '00:00:00:00:00:00' }
46
46
  Then { match.vlan_vid == 0 }
47
47
  Then { match.vlan_priority == 0 }
48
48
  Then { match.ether_type == 0 }
49
- Then { match.ip_tos == 0 }
49
+ Then { match.tos == 0 }
50
50
  Then { match.ip_protocol == 0 }
51
- Then { match.ip_source_address == '0.0.0.0' }
52
- Then { match.ip_destination_address == '0.0.0.0' }
51
+ Then { match.source_ip_address == '0.0.0.0' }
52
+ Then { match.destination_ip_address == '0.0.0.0' }
53
53
  Then { match.transport_source_port == 0 }
54
54
  Then { match.transport_destination_port == 0 }
55
55
  end
@@ -57,7 +57,7 @@ describe Pio::OpenFlow10::Match do
57
57
  context 'with a Match binary generated with Pio::OpenFlow10::Match.new' do
58
58
  Given(:binary) do
59
59
  Pio::OpenFlow10::Match
60
- .new(ip_source_address: '192.168.1.0/24')
60
+ .new(source_ip_address: '192.168.1.0/24')
61
61
  .to_binary_s
62
62
  end
63
63
 
@@ -65,30 +65,30 @@ describe Pio::OpenFlow10::Match do
65
65
  match.wildcards.keys == [
66
66
  :in_port,
67
67
  :vlan_vid,
68
- :ether_source_address,
69
- :ether_destination_address,
68
+ :source_mac_address,
69
+ :destination_mac_address,
70
70
  :ether_type,
71
71
  :ip_protocol,
72
72
  :transport_source_port,
73
73
  :transport_destination_port,
74
- :ip_source_address,
75
- :ip_destination_address_all,
74
+ :source_ip_address,
75
+ :destination_ip_address_all,
76
76
  :vlan_priority,
77
- :ip_tos
77
+ :tos
78
78
  ]
79
79
  end
80
- And { match.wildcards[:ip_source_address] = 12 }
80
+ And { match.wildcards[:source_ip_address] = 12 }
81
81
  Then { match.in_port == 0 }
82
- Then { match.ether_source_address == '00:00:00:00:00:00' }
83
- Then { match.ether_destination_address == '00:00:00:00:00:00' }
82
+ Then { match.source_mac_address == '00:00:00:00:00:00' }
83
+ Then { match.destination_mac_address == '00:00:00:00:00:00' }
84
84
  Then { match.vlan_vid == 0 }
85
85
  Then { match.vlan_priority == 0 }
86
86
  Then { match.ether_type == 0 }
87
- Then { match.ip_tos == 0 }
87
+ Then { match.tos == 0 }
88
88
  Then { match.ip_protocol == 0 }
89
- Then { match.ip_source_address == '192.168.1.0' }
90
- Then { match.ip_source_address.prefixlen == 24 }
91
- Then { match.ip_destination_address == '0.0.0.0' }
89
+ Then { match.source_ip_address == '192.168.1.0' }
90
+ Then { match.source_ip_address.prefixlen == 24 }
91
+ Then { match.destination_ip_address == '0.0.0.0' }
92
92
  Then { match.transport_source_port == 0 }
93
93
  Then { match.transport_destination_port == 0 }
94
94
  end
@@ -102,28 +102,28 @@ describe Pio::OpenFlow10::Match do
102
102
  Then do
103
103
  match.wildcards.keys == [
104
104
  :vlan_vid,
105
- :ether_source_address,
106
- :ether_destination_address,
105
+ :source_mac_address,
106
+ :destination_mac_address,
107
107
  :ether_type,
108
108
  :ip_protocol,
109
109
  :transport_source_port,
110
110
  :transport_destination_port,
111
- :ip_source_address_all,
112
- :ip_destination_address_all,
111
+ :source_ip_address_all,
112
+ :destination_ip_address_all,
113
113
  :vlan_priority,
114
- :ip_tos
114
+ :tos
115
115
  ]
116
116
  end
117
117
  Then { match.in_port == 1 }
118
- Then { match.ether_source_address == '00:00:00:00:00:00' }
119
- Then { match.ether_destination_address == '00:00:00:00:00:00' }
118
+ Then { match.source_mac_address == '00:00:00:00:00:00' }
119
+ Then { match.destination_mac_address == '00:00:00:00:00:00' }
120
120
  Then { match.vlan_vid == 0 }
121
121
  Then { match.vlan_priority == 0 }
122
122
  Then { match.ether_type == 0 }
123
- Then { match.ip_tos == 0 }
123
+ Then { match.tos == 0 }
124
124
  Then { match.ip_protocol == 0 }
125
- Then { match.ip_source_address == '0.0.0.0' }
126
- Then { match.ip_destination_address == '0.0.0.0' }
125
+ Then { match.source_ip_address == '0.0.0.0' }
126
+ Then { match.destination_ip_address == '0.0.0.0' }
127
127
  Then { match.transport_source_port == 0 }
128
128
  Then { match.transport_destination_port == 0 }
129
129
 
@@ -137,68 +137,68 @@ describe Pio::OpenFlow10::Match do
137
137
  end
138
138
  end
139
139
 
140
- context "with ip_source_address: '192.168.1.0/24'" do
141
- Given(:options) { { ip_source_address: '192.168.1.0/24' } }
140
+ context "with source_ip_address: '192.168.1.0/24'" do
141
+ Given(:options) { { source_ip_address: '192.168.1.0/24' } }
142
142
  Then do
143
143
  match.wildcards.keys == [
144
144
  :in_port,
145
145
  :vlan_vid,
146
- :ether_source_address,
147
- :ether_destination_address,
146
+ :source_mac_address,
147
+ :destination_mac_address,
148
148
  :ether_type,
149
149
  :ip_protocol,
150
150
  :transport_source_port,
151
151
  :transport_destination_port,
152
- :ip_source_address,
153
- :ip_destination_address_all,
152
+ :source_ip_address,
153
+ :destination_ip_address_all,
154
154
  :vlan_priority,
155
- :ip_tos
155
+ :tos
156
156
  ]
157
157
  end
158
- Then { match.wildcards.fetch(:ip_source_address) == 8 }
158
+ Then { match.wildcards.fetch(:source_ip_address) == 8 }
159
159
  Then { match.in_port == 0 }
160
- Then { match.ether_source_address == '00:00:00:00:00:00' }
161
- Then { match.ether_destination_address == '00:00:00:00:00:00' }
160
+ Then { match.source_mac_address == '00:00:00:00:00:00' }
161
+ Then { match.destination_mac_address == '00:00:00:00:00:00' }
162
162
  Then { match.vlan_vid == 0 }
163
163
  Then { match.vlan_priority == 0 }
164
164
  Then { match.ether_type == 0 }
165
- Then { match.ip_tos == 0 }
165
+ Then { match.tos == 0 }
166
166
  Then { match.ip_protocol == 0 }
167
- Then { match.ip_source_address == '192.168.1.0/24' }
168
- Then { match.ip_destination_address == '0.0.0.0' }
167
+ Then { match.source_ip_address == '192.168.1.0/24' }
168
+ Then { match.destination_ip_address == '0.0.0.0' }
169
169
  Then { match.transport_source_port == 0 }
170
170
  Then { match.transport_destination_port == 0 }
171
171
  end
172
172
 
173
- context "with ip_destination_address: '192.168.1.0/24'" do
174
- Given(:options) { { ip_destination_address: '192.168.1.0/24' } }
173
+ context "with destination_ip_address: '192.168.1.0/24'" do
174
+ Given(:options) { { destination_ip_address: '192.168.1.0/24' } }
175
175
  Then do
176
176
  match.wildcards.keys == [
177
177
  :in_port,
178
178
  :vlan_vid,
179
- :ether_source_address,
180
- :ether_destination_address,
179
+ :source_mac_address,
180
+ :destination_mac_address,
181
181
  :ether_type,
182
182
  :ip_protocol,
183
183
  :transport_source_port,
184
184
  :transport_destination_port,
185
- :ip_source_address_all,
186
- :ip_destination_address,
185
+ :source_ip_address_all,
186
+ :destination_ip_address,
187
187
  :vlan_priority,
188
- :ip_tos
188
+ :tos
189
189
  ]
190
190
  end
191
- Then { match.wildcards.fetch(:ip_destination_address) == 8 }
191
+ Then { match.wildcards.fetch(:destination_ip_address) == 8 }
192
192
  Then { match.in_port == 0 }
193
- Then { match.ether_source_address == '00:00:00:00:00:00' }
194
- Then { match.ether_destination_address == '00:00:00:00:00:00' }
193
+ Then { match.source_mac_address == '00:00:00:00:00:00' }
194
+ Then { match.destination_mac_address == '00:00:00:00:00:00' }
195
195
  Then { match.vlan_vid == 0 }
196
196
  Then { match.vlan_priority == 0 }
197
197
  Then { match.ether_type == 0 }
198
- Then { match.ip_tos == 0 }
198
+ Then { match.tos == 0 }
199
199
  Then { match.ip_protocol == 0 }
200
- Then { match.ip_source_address == '0.0.0.0' }
201
- Then { match.ip_destination_address == '192.168.1.0/24' }
200
+ Then { match.source_ip_address == '0.0.0.0' }
201
+ Then { match.destination_ip_address == '192.168.1.0/24' }
202
202
  Then { match.transport_source_port == 0 }
203
203
  Then { match.transport_destination_port == 0 }
204
204
  end