pio 0.19.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +20 -18
- data/features/{packet_data/arp-storm.pcap → arp-storm.pcap} +0 -0
- data/features/arp.feature +1 -1
- data/features/{packet_data/arp.pcap → arp.pcap} +0 -0
- data/features/dhcp.feature +210 -3
- data/features/{packet_data/dhcp.pcap → dhcp.pcap} +0 -0
- data/features/icmp.feature +1 -1
- data/features/{packet_data/icmp.pcap → icmp.pcap} +0 -0
- data/features/{packet_data/lldp.detailed.pcap → lldp.detailed.pcap} +0 -0
- data/features/lldp.feature +5 -5
- data/features/{packet_data/lldp.minimal.pcap → lldp.minimal.pcap} +0 -0
- data/features/{packet_data → open_flow10}/aggregate_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/aggregate_stats_request.raw +0 -0
- data/features/{packet_data → open_flow10}/barrier_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/barrier_request.raw +0 -0
- data/features/{packet_data → open_flow10}/desc_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/desc_stats_request.raw +0 -0
- data/features/open_flow10/echo_reply.feature +10 -10
- data/features/{packet_data → open_flow10}/echo_reply.raw +0 -0
- data/features/open_flow10/echo_request.feature +10 -10
- data/features/{packet_data → open_flow10}/echo_request.raw +0 -0
- data/features/{packet_data → open_flow10}/error.raw +0 -0
- data/features/open_flow10/exact_match.feature +33 -33
- data/features/open_flow10/features_reply.feature +71 -71
- data/features/{packet_data → open_flow10}/features_reply.raw +0 -0
- data/features/open_flow10/features_request.feature +9 -9
- data/features/{packet_data → open_flow10}/features_request.raw +0 -0
- data/features/open_flow10/flow_mod.feature +167 -167
- data/features/{packet_data → open_flow10}/flow_mod_add.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_mod_delete.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_mod_delete_strict.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_mod_modify.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_mod_modify_strict.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_removed.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_stats_request.raw +0 -0
- data/features/{packet_data → open_flow10}/get_config_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/get_config_request.raw +0 -0
- data/features/open_flow10/hello.feature +9 -9
- data/features/{packet_data → open_flow10}/hello.raw +0 -0
- data/features/open_flow10/packet_in.feature +4 -4
- data/features/{packet_data → open_flow10}/packet_in_arp_request.raw +0 -0
- data/features/{packet_data → open_flow10}/packet_in_cbench.raw +0 -0
- data/features/open_flow10/packet_out.feature +3 -3
- data/features/{packet_data → open_flow10}/packet_out.raw +0 -0
- data/features/{packet_data → open_flow10}/port_mod.raw +0 -0
- data/features/{packet_data → open_flow10}/port_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/port_stats_request.raw +0 -0
- data/features/open_flow10/port_status.feature +3 -3
- data/features/{packet_data → open_flow10}/port_status.raw +0 -0
- data/features/{packet_data → open_flow10}/queue_get_config_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/queue_get_config_request.raw +0 -0
- data/features/{packet_data → open_flow10}/set_config.raw +0 -0
- data/features/{packet_data → open_flow10}/table_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/table_stats_request.raw +0 -0
- data/features/{packet_data → open_flow10}/vendor.raw +0 -0
- data/features/{packet_data → open_flow10}/vendor_stats_request.raw +0 -0
- data/features/open_flow13/echo_reply.feature +64 -61
- data/features/{packet_data/echo13_reply_body.raw → open_flow13/echo_reply_body.raw} +0 -0
- data/features/{packet_data/echo13_reply_no_body.raw → open_flow13/echo_reply_no_body.raw} +0 -0
- data/features/open_flow13/echo_request.feature +64 -61
- data/features/{packet_data/echo13_request_body.raw → open_flow13/echo_request_body.raw} +0 -0
- data/features/{packet_data/echo13_request_no_body.raw → open_flow13/echo_request_no_body.raw} +0 -0
- data/features/open_flow13/features_reply.feature +53 -0
- data/features/open_flow13/features_reply.raw +0 -0
- data/features/open_flow13/features_request.feature +89 -0
- data/features/open_flow13/features_request.raw +0 -0
- data/features/open_flow13/hello.feature +26 -23
- data/features/{packet_data/hello13_no_version_bitmap.raw → open_flow13/hello_no_version_bitmap.raw} +0 -0
- data/features/{packet_data/hello13_version_bitmap.raw → open_flow13/hello_version_bitmap.raw} +0 -0
- data/features/step_definitions/open_flow_steps.rb +3 -0
- data/features/step_definitions/packet_data_steps.rb +9 -9
- data/features/udp.feature +3 -3
- data/features/{packet_data/udp_no_payload.raw → udp_no_payload.raw} +0 -0
- data/features/{packet_data/udp_with_payload.raw → udp_with_payload.raw} +0 -0
- data/lib/pio.rb +1 -9
- data/lib/pio/open_flow/actions.rb +8 -8
- data/lib/pio/open_flow/open_flow_header.rb +10 -0
- data/lib/pio/open_flow10.rb +15 -0
- data/lib/pio/open_flow10/echo.rb +15 -0
- data/lib/pio/open_flow10/exact_match.rb +51 -0
- data/lib/pio/{features.rb → open_flow10/features.rb} +8 -7
- data/lib/pio/{flow_mod.rb → open_flow10/flow_mod.rb} +1 -1
- data/lib/pio/{hello.rb → open_flow10/hello.rb} +0 -0
- data/lib/pio/{match.rb → open_flow10/match.rb} +46 -43
- data/lib/pio/{packet_in.rb → open_flow10/packet_in.rb} +0 -0
- data/lib/pio/{packet_out.rb → open_flow10/packet_out.rb} +0 -0
- data/lib/pio/{port_status.rb → open_flow10/port_status.rb} +0 -0
- data/lib/pio/open_flow13.rb +12 -0
- data/lib/pio/{echo.rb → open_flow13/echo.rb} +9 -13
- data/lib/pio/open_flow13/features_reply.rb +91 -0
- data/lib/pio/open_flow13/features_request.rb +54 -0
- data/lib/pio/{hello13.rb → open_flow13/hello.rb} +4 -1
- data/lib/pio/{set_eth_addr.rb → set_ether_address.rb} +7 -7
- data/lib/pio/{set_ip_addr.rb → set_ip_address.rb} +7 -7
- data/lib/pio/set_ip_tos.rb +1 -1
- data/lib/pio/set_transport_port.rb +2 -2
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +2 -2
- data/spec/pio/flow_mod_spec.rb +45 -45
- data/spec/pio/match_spec.rb +122 -120
- data/spec/pio/{hello13_spec.rb → open_flow13/hello_spec.rb} +11 -11
- data/spec/pio/packet_out_spec.rb +19 -19
- data/spec/pio/set_ether_destination_address_spec.rb +28 -0
- data/spec/pio/set_ether_source_address_spec.rb +28 -0
- data/spec/pio/set_ip_destination_address_spec.rb +27 -0
- data/spec/pio/set_ip_source_address_spec.rb +25 -0
- data/spec/pio/set_transport_destination_port_spec.rb +44 -0
- data/spec/pio/set_transport_source_port_spec.rb +44 -0
- data/spec/pio/wildcards_spec.rb +23 -21
- metadata +179 -165
- data/bin/byebug +0 -16
- data/lib/pio/exact_match.rb +0 -51
- data/spec/pio/set_eth_dst_addr_spec.rb +0 -28
- data/spec/pio/set_eth_src_addr_spec.rb +0 -28
- data/spec/pio/set_ip_dst_addr_spec.rb +0 -25
- data/spec/pio/set_ip_src_addr_spec.rb +0 -25
- data/spec/pio/set_transport_dst_port_spec.rb +0 -42
- data/spec/pio/set_transport_src_port_spec.rb +0 -42
data/lib/pio/set_ip_tos.rb
CHANGED
@@ -30,7 +30,7 @@ module Pio
|
|
30
30
|
def_delegator :@format, :to_binary_s, :to_binary
|
31
31
|
|
32
32
|
def initialize(type_of_service)
|
33
|
-
#
|
33
|
+
# ip_tos (IP ToS) value consists of 8 bits, of which only the 6
|
34
34
|
# high-order bits belong to DSCP, the 2 low-order bits must be
|
35
35
|
# zero.
|
36
36
|
unless type_of_service.unsigned_8bit? && type_of_service % 4 == 0
|
@@ -47,12 +47,12 @@ module Pio
|
|
47
47
|
end
|
48
48
|
|
49
49
|
# An action to modify the source TCP/UDP port of a packet.
|
50
|
-
class
|
50
|
+
class SetTransportSourcePort < SetTransportPort
|
51
51
|
def_format 9
|
52
52
|
end
|
53
53
|
|
54
54
|
# An action to modify the source TCP/UDP port of a packet.
|
55
|
-
class
|
55
|
+
class SetTransportDestinationPort < SetTransportPort
|
56
56
|
def_format 10
|
57
57
|
end
|
58
58
|
end
|
data/lib/pio/version.rb
CHANGED
data/pio.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |gem|
|
|
31
31
|
gem.add_dependency 'bindata', '~> 2.1.0'
|
32
32
|
|
33
33
|
gem.add_development_dependency 'rake'
|
34
|
-
gem.add_development_dependency 'bundler', '~> 1.9.
|
34
|
+
gem.add_development_dependency 'bundler', '~> 1.9.4'
|
35
35
|
gem.add_development_dependency 'pry', '~> 0.10.1'
|
36
36
|
|
37
37
|
# Guard
|
@@ -56,7 +56,7 @@ Gem::Specification.new do |gem|
|
|
56
56
|
gem.add_development_dependency 'cucumber', '~> 2.0.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', '~> 2.0
|
59
|
+
gem.add_development_dependency 'reek', '~> 2.1.0'
|
60
60
|
gem.add_development_dependency 'rspec', '~> 3.2.0'
|
61
61
|
gem.add_development_dependency 'rspec-given', '~> 3.7.0'
|
62
62
|
gem.add_development_dependency 'rubocop', '~> 0.30.0'
|
data/spec/pio/flow_mod_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'pio/flow_mod'
|
1
|
+
require 'pio/open_flow10/flow_mod'
|
2
2
|
|
3
3
|
describe Pio::FlowMod do
|
4
4
|
Given(:dump) do
|
@@ -39,31 +39,31 @@ describe Pio::FlowMod do
|
|
39
39
|
Then { !flow_mod.body.empty? }
|
40
40
|
Then do
|
41
41
|
flow_mod.match.wildcards.keys == [
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
42
|
+
:vlan_vid,
|
43
|
+
:ether_source_address,
|
44
|
+
:ether_destination_address,
|
45
|
+
:ether_type,
|
46
|
+
:ip_protocol,
|
47
|
+
:transport_source_port,
|
48
|
+
:transport_destination_port,
|
49
|
+
:ip_source_address_all,
|
50
|
+
:ip_destination_address_all,
|
51
|
+
:vlan_priority,
|
52
|
+
:ip_tos
|
53
53
|
]
|
54
54
|
end
|
55
55
|
Then { flow_mod.match.in_port == 1 }
|
56
|
-
Then { flow_mod.match.
|
57
|
-
Then { flow_mod.match.
|
58
|
-
Then { flow_mod.match.
|
59
|
-
Then { flow_mod.match.
|
60
|
-
Then { flow_mod.match.
|
61
|
-
Then { flow_mod.match.
|
62
|
-
Then { flow_mod.match.
|
63
|
-
Then { flow_mod.match.
|
64
|
-
Then { flow_mod.match.
|
65
|
-
Then { flow_mod.match.
|
66
|
-
Then { flow_mod.match.
|
56
|
+
Then { flow_mod.match.ether_source_address == '00:00:00:00:00:00' }
|
57
|
+
Then { flow_mod.match.ether_destination_address == '00:00:00:00:00:00' }
|
58
|
+
Then { flow_mod.match.vlan_vid == 0 }
|
59
|
+
Then { flow_mod.match.vlan_priority == 0 }
|
60
|
+
Then { flow_mod.match.ether_type == 0 }
|
61
|
+
Then { flow_mod.match.ip_tos == 0 }
|
62
|
+
Then { flow_mod.match.ip_protocol == 0 }
|
63
|
+
Then { flow_mod.match.ip_source_address == '0.0.0.0' }
|
64
|
+
Then { flow_mod.match.ip_destination_address == '0.0.0.0' }
|
65
|
+
Then { flow_mod.match.transport_source_port == 0 }
|
66
|
+
Then { flow_mod.match.transport_destination_port == 0 }
|
67
67
|
Then { flow_mod.cookie == 1 }
|
68
68
|
Then { flow_mod.command == :add }
|
69
69
|
Then { flow_mod.idle_timeout == 0 }
|
@@ -104,31 +104,31 @@ describe Pio::FlowMod do
|
|
104
104
|
Then { !flow_mod.body.empty? }
|
105
105
|
Then do
|
106
106
|
flow_mod.match.wildcards.keys == [
|
107
|
-
:
|
108
|
-
:
|
109
|
-
:
|
110
|
-
:
|
111
|
-
:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
107
|
+
:vlan_vid,
|
108
|
+
:ether_source_address,
|
109
|
+
:ether_destination_address,
|
110
|
+
:ether_type,
|
111
|
+
:ip_protocol,
|
112
|
+
:transport_source_port,
|
113
|
+
:transport_destination_port,
|
114
|
+
:ip_source_address_all,
|
115
|
+
:ip_destination_address_all,
|
116
|
+
:vlan_priority,
|
117
|
+
:ip_tos
|
118
118
|
]
|
119
119
|
end
|
120
120
|
Then { flow_mod.match.in_port == 1 }
|
121
|
-
Then { flow_mod.match.
|
122
|
-
Then { flow_mod.match.
|
123
|
-
Then { flow_mod.match.
|
124
|
-
Then { flow_mod.match.
|
125
|
-
Then { flow_mod.match.
|
126
|
-
Then { flow_mod.match.
|
127
|
-
Then { flow_mod.match.
|
128
|
-
Then { flow_mod.match.
|
129
|
-
Then { flow_mod.match.
|
130
|
-
Then { flow_mod.match.
|
131
|
-
Then { flow_mod.match.
|
121
|
+
Then { flow_mod.match.ether_source_address == '00:00:00:00:00:00' }
|
122
|
+
Then { flow_mod.match.ether_destination_address == '00:00:00:00:00:00' }
|
123
|
+
Then { flow_mod.match.vlan_vid == 0 }
|
124
|
+
Then { flow_mod.match.vlan_priority == 0 }
|
125
|
+
Then { flow_mod.match.ether_type == 0 }
|
126
|
+
Then { flow_mod.match.ip_tos == 0 }
|
127
|
+
Then { flow_mod.match.ip_protocol == 0 }
|
128
|
+
Then { flow_mod.match.ip_source_address == '0.0.0.0' }
|
129
|
+
Then { flow_mod.match.ip_destination_address == '0.0.0.0' }
|
130
|
+
Then { flow_mod.match.transport_source_port == 0 }
|
131
|
+
Then { flow_mod.match.transport_destination_port == 0 }
|
132
132
|
Then { flow_mod.cookie == 1 }
|
133
133
|
Then { flow_mod.command == :add }
|
134
134
|
Then { flow_mod.idle_timeout == 0 }
|
data/spec/pio/match_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'pio/match'
|
1
|
+
require 'pio/open_flow10/match'
|
2
2
|
|
3
3
|
describe Pio::Match do
|
4
4
|
describe '.read' do
|
@@ -27,66 +27,68 @@ describe Pio::Match do
|
|
27
27
|
|
28
28
|
Then do
|
29
29
|
match.wildcards.keys == [
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
30
|
+
:vlan_vid,
|
31
|
+
:ether_source_address,
|
32
|
+
:ether_destination_address,
|
33
|
+
:ether_type,
|
34
|
+
:ip_protocol,
|
35
|
+
:transport_source_port,
|
36
|
+
:transport_destination_port,
|
37
|
+
:ip_source_address_all,
|
38
|
+
:ip_destination_address_all,
|
39
|
+
:vlan_priority,
|
40
|
+
:ip_tos
|
41
41
|
]
|
42
42
|
end
|
43
43
|
Then { match.in_port == 1 }
|
44
|
-
Then { match.
|
45
|
-
Then { match.
|
46
|
-
Then { match.
|
47
|
-
Then { match.
|
48
|
-
Then { match.
|
49
|
-
Then { match.
|
50
|
-
Then { match.
|
51
|
-
Then { match.
|
52
|
-
Then { match.
|
53
|
-
Then { match.
|
54
|
-
Then { match.
|
44
|
+
Then { match.ether_source_address == '00:00:00:00:00:00' }
|
45
|
+
Then { match.ether_destination_address == '00:00:00:00:00:00' }
|
46
|
+
Then { match.vlan_vid == 0 }
|
47
|
+
Then { match.vlan_priority == 0 }
|
48
|
+
Then { match.ether_type == 0 }
|
49
|
+
Then { match.ip_tos == 0 }
|
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' }
|
53
|
+
Then { match.transport_source_port == 0 }
|
54
|
+
Then { match.transport_destination_port == 0 }
|
55
55
|
end
|
56
56
|
|
57
57
|
context 'with a Match binary generated with Pio::Match.new' do
|
58
|
-
Given(:binary)
|
58
|
+
Given(:binary) do
|
59
|
+
Pio::Match.new(ip_source_address: '192.168.1.0/24').to_binary_s
|
60
|
+
end
|
59
61
|
|
60
62
|
Then do
|
61
63
|
match.wildcards.keys == [
|
62
64
|
:in_port,
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
66
|
-
:
|
67
|
-
:
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
65
|
+
:vlan_vid,
|
66
|
+
:ether_source_address,
|
67
|
+
:ether_destination_address,
|
68
|
+
:ether_type,
|
69
|
+
:ip_protocol,
|
70
|
+
:transport_source_port,
|
71
|
+
:transport_destination_port,
|
72
|
+
:ip_source_address,
|
73
|
+
:ip_destination_address_all,
|
74
|
+
:vlan_priority,
|
75
|
+
:ip_tos
|
74
76
|
]
|
75
77
|
end
|
76
|
-
And { match.wildcards[:
|
78
|
+
And { match.wildcards[:ip_source_address] = 12 }
|
77
79
|
Then { match.in_port == 0 }
|
78
|
-
Then { match.
|
79
|
-
Then { match.
|
80
|
-
Then { match.
|
81
|
-
Then { match.
|
82
|
-
Then { match.
|
83
|
-
Then { match.
|
84
|
-
Then { match.
|
85
|
-
Then { match.
|
86
|
-
Then { match.
|
87
|
-
Then { match.
|
88
|
-
Then { match.
|
89
|
-
Then { match.
|
80
|
+
Then { match.ether_source_address == '00:00:00:00:00:00' }
|
81
|
+
Then { match.ether_destination_address == '00:00:00:00:00:00' }
|
82
|
+
Then { match.vlan_vid == 0 }
|
83
|
+
Then { match.vlan_priority == 0 }
|
84
|
+
Then { match.ether_type == 0 }
|
85
|
+
Then { match.ip_tos == 0 }
|
86
|
+
Then { match.ip_protocol == 0 }
|
87
|
+
Then { match.ip_source_address == '192.168.1.0' }
|
88
|
+
Then { match.ip_source_address.prefixlen == 24 }
|
89
|
+
Then { match.ip_destination_address == '0.0.0.0' }
|
90
|
+
Then { match.transport_source_port == 0 }
|
91
|
+
Then { match.transport_destination_port == 0 }
|
90
92
|
end
|
91
93
|
end
|
92
94
|
|
@@ -97,31 +99,31 @@ describe Pio::Match do
|
|
97
99
|
Given(:options) { { in_port: 1 } }
|
98
100
|
Then do
|
99
101
|
match.wildcards.keys == [
|
100
|
-
:
|
101
|
-
:
|
102
|
-
:
|
103
|
-
:
|
104
|
-
:
|
105
|
-
:
|
106
|
-
:
|
107
|
-
:
|
108
|
-
:
|
109
|
-
:
|
110
|
-
:
|
102
|
+
:vlan_vid,
|
103
|
+
:ether_source_address,
|
104
|
+
:ether_destination_address,
|
105
|
+
:ether_type,
|
106
|
+
:ip_protocol,
|
107
|
+
:transport_source_port,
|
108
|
+
:transport_destination_port,
|
109
|
+
:ip_source_address_all,
|
110
|
+
:ip_destination_address_all,
|
111
|
+
:vlan_priority,
|
112
|
+
:ip_tos
|
111
113
|
]
|
112
114
|
end
|
113
115
|
Then { match.in_port == 1 }
|
114
|
-
Then { match.
|
115
|
-
Then { match.
|
116
|
-
Then { match.
|
117
|
-
Then { match.
|
118
|
-
Then { match.
|
119
|
-
Then { match.
|
120
|
-
Then { match.
|
121
|
-
Then { match.
|
122
|
-
Then { match.
|
123
|
-
Then { match.
|
124
|
-
Then { match.
|
116
|
+
Then { match.ether_source_address == '00:00:00:00:00:00' }
|
117
|
+
Then { match.ether_destination_address == '00:00:00:00:00:00' }
|
118
|
+
Then { match.vlan_vid == 0 }
|
119
|
+
Then { match.vlan_priority == 0 }
|
120
|
+
Then { match.ether_type == 0 }
|
121
|
+
Then { match.ip_tos == 0 }
|
122
|
+
Then { match.ip_protocol == 0 }
|
123
|
+
Then { match.ip_source_address == '0.0.0.0' }
|
124
|
+
Then { match.ip_destination_address == '0.0.0.0' }
|
125
|
+
Then { match.transport_source_port == 0 }
|
126
|
+
Then { match.transport_destination_port == 0 }
|
125
127
|
|
126
128
|
describe '#==' do
|
127
129
|
When(:result) { match == other }
|
@@ -133,70 +135,70 @@ describe Pio::Match do
|
|
133
135
|
end
|
134
136
|
end
|
135
137
|
|
136
|
-
context "with
|
137
|
-
Given(:options) { {
|
138
|
+
context "with ip_source_address: '192.168.1.0/24'" do
|
139
|
+
Given(:options) { { ip_source_address: '192.168.1.0/24' } }
|
138
140
|
Then do
|
139
141
|
match.wildcards.keys == [
|
140
142
|
:in_port,
|
141
|
-
:
|
142
|
-
:
|
143
|
-
:
|
144
|
-
:
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
149
|
-
:
|
150
|
-
:
|
151
|
-
:
|
143
|
+
:vlan_vid,
|
144
|
+
:ether_source_address,
|
145
|
+
:ether_destination_address,
|
146
|
+
:ether_type,
|
147
|
+
:ip_protocol,
|
148
|
+
:transport_source_port,
|
149
|
+
:transport_destination_port,
|
150
|
+
:ip_source_address,
|
151
|
+
:ip_destination_address_all,
|
152
|
+
:vlan_priority,
|
153
|
+
:ip_tos
|
152
154
|
]
|
153
155
|
end
|
154
|
-
Then { match.wildcards.fetch(:
|
156
|
+
Then { match.wildcards.fetch(:ip_source_address) == 8 }
|
155
157
|
Then { match.in_port == 0 }
|
156
|
-
Then { match.
|
157
|
-
Then { match.
|
158
|
-
Then { match.
|
159
|
-
Then { match.
|
160
|
-
Then { match.
|
161
|
-
Then { match.
|
162
|
-
Then { match.
|
163
|
-
Then { match.
|
164
|
-
Then { match.
|
165
|
-
Then { match.
|
166
|
-
Then { match.
|
158
|
+
Then { match.ether_source_address == '00:00:00:00:00:00' }
|
159
|
+
Then { match.ether_destination_address == '00:00:00:00:00:00' }
|
160
|
+
Then { match.vlan_vid == 0 }
|
161
|
+
Then { match.vlan_priority == 0 }
|
162
|
+
Then { match.ether_type == 0 }
|
163
|
+
Then { match.ip_tos == 0 }
|
164
|
+
Then { match.ip_protocol == 0 }
|
165
|
+
Then { match.ip_source_address == '192.168.1.0/24' }
|
166
|
+
Then { match.ip_destination_address == '0.0.0.0' }
|
167
|
+
Then { match.transport_source_port == 0 }
|
168
|
+
Then { match.transport_destination_port == 0 }
|
167
169
|
end
|
168
170
|
|
169
|
-
context "with
|
170
|
-
Given(:options) { {
|
171
|
+
context "with ip_destination_address: '192.168.1.0/24'" do
|
172
|
+
Given(:options) { { ip_destination_address: '192.168.1.0/24' } }
|
171
173
|
Then do
|
172
174
|
match.wildcards.keys == [
|
173
175
|
:in_port,
|
174
|
-
:
|
175
|
-
:
|
176
|
-
:
|
177
|
-
:
|
178
|
-
:
|
179
|
-
:
|
180
|
-
:
|
181
|
-
:
|
182
|
-
:
|
183
|
-
:
|
184
|
-
:
|
176
|
+
:vlan_vid,
|
177
|
+
:ether_source_address,
|
178
|
+
:ether_destination_address,
|
179
|
+
:ether_type,
|
180
|
+
:ip_protocol,
|
181
|
+
:transport_source_port,
|
182
|
+
:transport_destination_port,
|
183
|
+
:ip_source_address_all,
|
184
|
+
:ip_destination_address,
|
185
|
+
:vlan_priority,
|
186
|
+
:ip_tos
|
185
187
|
]
|
186
188
|
end
|
187
|
-
Then { match.wildcards.fetch(:
|
189
|
+
Then { match.wildcards.fetch(:ip_destination_address) == 8 }
|
188
190
|
Then { match.in_port == 0 }
|
189
|
-
Then { match.
|
190
|
-
Then { match.
|
191
|
-
Then { match.
|
192
|
-
Then { match.
|
193
|
-
Then { match.
|
194
|
-
Then { match.
|
195
|
-
Then { match.
|
196
|
-
Then { match.
|
197
|
-
Then { match.
|
198
|
-
Then { match.
|
199
|
-
Then { match.
|
191
|
+
Then { match.ether_source_address == '00:00:00:00:00:00' }
|
192
|
+
Then { match.ether_destination_address == '00:00:00:00:00:00' }
|
193
|
+
Then { match.vlan_vid == 0 }
|
194
|
+
Then { match.vlan_priority == 0 }
|
195
|
+
Then { match.ether_type == 0 }
|
196
|
+
Then { match.ip_tos == 0 }
|
197
|
+
Then { match.ip_protocol == 0 }
|
198
|
+
Then { match.ip_source_address == '0.0.0.0' }
|
199
|
+
Then { match.ip_destination_address == '192.168.1.0/24' }
|
200
|
+
Then { match.transport_source_port == 0 }
|
201
|
+
Then { match.transport_destination_port == 0 }
|
200
202
|
end
|
201
203
|
end
|
202
204
|
end
|