pio 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +20 -18
  4. data/features/{packet_data/arp-storm.pcap → arp-storm.pcap} +0 -0
  5. data/features/arp.feature +1 -1
  6. data/features/{packet_data/arp.pcap → arp.pcap} +0 -0
  7. data/features/dhcp.feature +210 -3
  8. data/features/{packet_data/dhcp.pcap → dhcp.pcap} +0 -0
  9. data/features/icmp.feature +1 -1
  10. data/features/{packet_data/icmp.pcap → icmp.pcap} +0 -0
  11. data/features/{packet_data/lldp.detailed.pcap → lldp.detailed.pcap} +0 -0
  12. data/features/lldp.feature +5 -5
  13. data/features/{packet_data/lldp.minimal.pcap → lldp.minimal.pcap} +0 -0
  14. data/features/{packet_data → open_flow10}/aggregate_stats_reply.raw +0 -0
  15. data/features/{packet_data → open_flow10}/aggregate_stats_request.raw +0 -0
  16. data/features/{packet_data → open_flow10}/barrier_reply.raw +0 -0
  17. data/features/{packet_data → open_flow10}/barrier_request.raw +0 -0
  18. data/features/{packet_data → open_flow10}/desc_stats_reply.raw +0 -0
  19. data/features/{packet_data → open_flow10}/desc_stats_request.raw +0 -0
  20. data/features/open_flow10/echo_reply.feature +10 -10
  21. data/features/{packet_data → open_flow10}/echo_reply.raw +0 -0
  22. data/features/open_flow10/echo_request.feature +10 -10
  23. data/features/{packet_data → open_flow10}/echo_request.raw +0 -0
  24. data/features/{packet_data → open_flow10}/error.raw +0 -0
  25. data/features/open_flow10/exact_match.feature +33 -33
  26. data/features/open_flow10/features_reply.feature +71 -71
  27. data/features/{packet_data → open_flow10}/features_reply.raw +0 -0
  28. data/features/open_flow10/features_request.feature +9 -9
  29. data/features/{packet_data → open_flow10}/features_request.raw +0 -0
  30. data/features/open_flow10/flow_mod.feature +167 -167
  31. data/features/{packet_data → open_flow10}/flow_mod_add.raw +0 -0
  32. data/features/{packet_data → open_flow10}/flow_mod_delete.raw +0 -0
  33. data/features/{packet_data → open_flow10}/flow_mod_delete_strict.raw +0 -0
  34. data/features/{packet_data → open_flow10}/flow_mod_modify.raw +0 -0
  35. data/features/{packet_data → open_flow10}/flow_mod_modify_strict.raw +0 -0
  36. data/features/{packet_data → open_flow10}/flow_removed.raw +0 -0
  37. data/features/{packet_data → open_flow10}/flow_stats_reply.raw +0 -0
  38. data/features/{packet_data → open_flow10}/flow_stats_request.raw +0 -0
  39. data/features/{packet_data → open_flow10}/get_config_reply.raw +0 -0
  40. data/features/{packet_data → open_flow10}/get_config_request.raw +0 -0
  41. data/features/open_flow10/hello.feature +9 -9
  42. data/features/{packet_data → open_flow10}/hello.raw +0 -0
  43. data/features/open_flow10/packet_in.feature +4 -4
  44. data/features/{packet_data → open_flow10}/packet_in_arp_request.raw +0 -0
  45. data/features/{packet_data → open_flow10}/packet_in_cbench.raw +0 -0
  46. data/features/open_flow10/packet_out.feature +3 -3
  47. data/features/{packet_data → open_flow10}/packet_out.raw +0 -0
  48. data/features/{packet_data → open_flow10}/port_mod.raw +0 -0
  49. data/features/{packet_data → open_flow10}/port_stats_reply.raw +0 -0
  50. data/features/{packet_data → open_flow10}/port_stats_request.raw +0 -0
  51. data/features/open_flow10/port_status.feature +3 -3
  52. data/features/{packet_data → open_flow10}/port_status.raw +0 -0
  53. data/features/{packet_data → open_flow10}/queue_get_config_reply.raw +0 -0
  54. data/features/{packet_data → open_flow10}/queue_get_config_request.raw +0 -0
  55. data/features/{packet_data → open_flow10}/set_config.raw +0 -0
  56. data/features/{packet_data → open_flow10}/table_stats_reply.raw +0 -0
  57. data/features/{packet_data → open_flow10}/table_stats_request.raw +0 -0
  58. data/features/{packet_data → open_flow10}/vendor.raw +0 -0
  59. data/features/{packet_data → open_flow10}/vendor_stats_request.raw +0 -0
  60. data/features/open_flow13/echo_reply.feature +64 -61
  61. data/features/{packet_data/echo13_reply_body.raw → open_flow13/echo_reply_body.raw} +0 -0
  62. data/features/{packet_data/echo13_reply_no_body.raw → open_flow13/echo_reply_no_body.raw} +0 -0
  63. data/features/open_flow13/echo_request.feature +64 -61
  64. data/features/{packet_data/echo13_request_body.raw → open_flow13/echo_request_body.raw} +0 -0
  65. data/features/{packet_data/echo13_request_no_body.raw → open_flow13/echo_request_no_body.raw} +0 -0
  66. data/features/open_flow13/features_reply.feature +53 -0
  67. data/features/open_flow13/features_reply.raw +0 -0
  68. data/features/open_flow13/features_request.feature +89 -0
  69. data/features/open_flow13/features_request.raw +0 -0
  70. data/features/open_flow13/hello.feature +26 -23
  71. data/features/{packet_data/hello13_no_version_bitmap.raw → open_flow13/hello_no_version_bitmap.raw} +0 -0
  72. data/features/{packet_data/hello13_version_bitmap.raw → open_flow13/hello_version_bitmap.raw} +0 -0
  73. data/features/step_definitions/open_flow_steps.rb +3 -0
  74. data/features/step_definitions/packet_data_steps.rb +9 -9
  75. data/features/udp.feature +3 -3
  76. data/features/{packet_data/udp_no_payload.raw → udp_no_payload.raw} +0 -0
  77. data/features/{packet_data/udp_with_payload.raw → udp_with_payload.raw} +0 -0
  78. data/lib/pio.rb +1 -9
  79. data/lib/pio/open_flow/actions.rb +8 -8
  80. data/lib/pio/open_flow/open_flow_header.rb +10 -0
  81. data/lib/pio/open_flow10.rb +15 -0
  82. data/lib/pio/open_flow10/echo.rb +15 -0
  83. data/lib/pio/open_flow10/exact_match.rb +51 -0
  84. data/lib/pio/{features.rb → open_flow10/features.rb} +8 -7
  85. data/lib/pio/{flow_mod.rb → open_flow10/flow_mod.rb} +1 -1
  86. data/lib/pio/{hello.rb → open_flow10/hello.rb} +0 -0
  87. data/lib/pio/{match.rb → open_flow10/match.rb} +46 -43
  88. data/lib/pio/{packet_in.rb → open_flow10/packet_in.rb} +0 -0
  89. data/lib/pio/{packet_out.rb → open_flow10/packet_out.rb} +0 -0
  90. data/lib/pio/{port_status.rb → open_flow10/port_status.rb} +0 -0
  91. data/lib/pio/open_flow13.rb +12 -0
  92. data/lib/pio/{echo.rb → open_flow13/echo.rb} +9 -13
  93. data/lib/pio/open_flow13/features_reply.rb +91 -0
  94. data/lib/pio/open_flow13/features_request.rb +54 -0
  95. data/lib/pio/{hello13.rb → open_flow13/hello.rb} +4 -1
  96. data/lib/pio/{set_eth_addr.rb → set_ether_address.rb} +7 -7
  97. data/lib/pio/{set_ip_addr.rb → set_ip_address.rb} +7 -7
  98. data/lib/pio/set_ip_tos.rb +1 -1
  99. data/lib/pio/set_transport_port.rb +2 -2
  100. data/lib/pio/version.rb +1 -1
  101. data/pio.gemspec +2 -2
  102. data/spec/pio/flow_mod_spec.rb +45 -45
  103. data/spec/pio/match_spec.rb +122 -120
  104. data/spec/pio/{hello13_spec.rb → open_flow13/hello_spec.rb} +11 -11
  105. data/spec/pio/packet_out_spec.rb +19 -19
  106. data/spec/pio/set_ether_destination_address_spec.rb +28 -0
  107. data/spec/pio/set_ether_source_address_spec.rb +28 -0
  108. data/spec/pio/set_ip_destination_address_spec.rb +27 -0
  109. data/spec/pio/set_ip_source_address_spec.rb +25 -0
  110. data/spec/pio/set_transport_destination_port_spec.rb +44 -0
  111. data/spec/pio/set_transport_source_port_spec.rb +44 -0
  112. data/spec/pio/wildcards_spec.rb +23 -21
  113. metadata +179 -165
  114. data/bin/byebug +0 -16
  115. data/lib/pio/exact_match.rb +0 -51
  116. data/spec/pio/set_eth_dst_addr_spec.rb +0 -28
  117. data/spec/pio/set_eth_src_addr_spec.rb +0 -28
  118. data/spec/pio/set_ip_dst_addr_spec.rb +0 -25
  119. data/spec/pio/set_ip_src_addr_spec.rb +0 -25
  120. data/spec/pio/set_transport_dst_port_spec.rb +0 -42
  121. data/spec/pio/set_transport_src_port_spec.rb +0 -42
@@ -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
- # nw_tos (IP ToS) value consists of 8 bits, of which only the 6
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 SetTransportSrcPort < SetTransportPort
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 SetTransportDstPort < SetTransportPort
55
+ class SetTransportDestinationPort < SetTransportPort
56
56
  def_format 10
57
57
  end
58
58
  end
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.19.0'.freeze
4
+ VERSION = '0.20.0'.freeze
5
5
  end
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.2'
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.4'
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'
@@ -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
- :dl_vlan,
43
- :dl_src,
44
- :dl_dst,
45
- :dl_type,
46
- :nw_proto,
47
- :tp_src,
48
- :tp_dst,
49
- :nw_src_all,
50
- :nw_dst_all,
51
- :dl_vlan_pcp,
52
- :nw_tos
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.dl_src == '00:00:00:00:00:00' }
57
- Then { flow_mod.match.dl_dst == '00:00:00:00:00:00' }
58
- Then { flow_mod.match.dl_vlan == 0 }
59
- Then { flow_mod.match.dl_vlan_pcp == 0 }
60
- Then { flow_mod.match.dl_type == 0 }
61
- Then { flow_mod.match.nw_tos == 0 }
62
- Then { flow_mod.match.nw_proto == 0 }
63
- Then { flow_mod.match.nw_src == '0.0.0.0' }
64
- Then { flow_mod.match.nw_dst == '0.0.0.0' }
65
- Then { flow_mod.match.tp_src == 0 }
66
- Then { flow_mod.match.tp_dst == 0 }
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
- :dl_vlan,
108
- :dl_src,
109
- :dl_dst,
110
- :dl_type,
111
- :nw_proto,
112
- :tp_src,
113
- :tp_dst,
114
- :nw_src_all,
115
- :nw_dst_all,
116
- :dl_vlan_pcp,
117
- :nw_tos
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.dl_src == '00:00:00:00:00:00' }
122
- Then { flow_mod.match.dl_dst == '00:00:00:00:00:00' }
123
- Then { flow_mod.match.dl_vlan == 0 }
124
- Then { flow_mod.match.dl_vlan_pcp == 0 }
125
- Then { flow_mod.match.dl_type == 0 }
126
- Then { flow_mod.match.nw_tos == 0 }
127
- Then { flow_mod.match.nw_proto == 0 }
128
- Then { flow_mod.match.nw_src == '0.0.0.0' }
129
- Then { flow_mod.match.nw_dst == '0.0.0.0' }
130
- Then { flow_mod.match.tp_src == 0 }
131
- Then { flow_mod.match.tp_dst == 0 }
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 }
@@ -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
- :dl_vlan,
31
- :dl_src,
32
- :dl_dst,
33
- :dl_type,
34
- :nw_proto,
35
- :tp_src,
36
- :tp_dst,
37
- :nw_src_all,
38
- :nw_dst_all,
39
- :dl_vlan_pcp,
40
- :nw_tos
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.dl_src == '00:00:00:00:00:00' }
45
- Then { match.dl_dst == '00:00:00:00:00:00' }
46
- Then { match.dl_vlan == 0 }
47
- Then { match.dl_vlan_pcp == 0 }
48
- Then { match.dl_type == 0 }
49
- Then { match.nw_tos == 0 }
50
- Then { match.nw_proto == 0 }
51
- Then { match.nw_src == '0.0.0.0' }
52
- Then { match.nw_dst == '0.0.0.0' }
53
- Then { match.tp_src == 0 }
54
- Then { match.tp_dst == 0 }
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) { Pio::Match.new(nw_src: '192.168.1.0/24').to_binary_s }
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
- :dl_vlan,
64
- :dl_src,
65
- :dl_dst,
66
- :dl_type,
67
- :nw_proto,
68
- :tp_src,
69
- :tp_dst,
70
- :nw_src,
71
- :nw_dst_all,
72
- :dl_vlan_pcp,
73
- :nw_tos
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[:nw_src] = 12 }
78
+ And { match.wildcards[:ip_source_address] = 12 }
77
79
  Then { match.in_port == 0 }
78
- Then { match.dl_src == '00:00:00:00:00:00' }
79
- Then { match.dl_dst == '00:00:00:00:00:00' }
80
- Then { match.dl_vlan == 0 }
81
- Then { match.dl_vlan_pcp == 0 }
82
- Then { match.dl_type == 0 }
83
- Then { match.nw_tos == 0 }
84
- Then { match.nw_proto == 0 }
85
- Then { match.nw_src == '192.168.1.0' }
86
- Then { match.nw_src.prefixlen == 24 }
87
- Then { match.nw_dst == '0.0.0.0' }
88
- Then { match.tp_src == 0 }
89
- Then { match.tp_dst == 0 }
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
- :dl_vlan,
101
- :dl_src,
102
- :dl_dst,
103
- :dl_type,
104
- :nw_proto,
105
- :tp_src,
106
- :tp_dst,
107
- :nw_src_all,
108
- :nw_dst_all,
109
- :dl_vlan_pcp,
110
- :nw_tos
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.dl_src == '00:00:00:00:00:00' }
115
- Then { match.dl_dst == '00:00:00:00:00:00' }
116
- Then { match.dl_vlan == 0 }
117
- Then { match.dl_vlan_pcp == 0 }
118
- Then { match.dl_type == 0 }
119
- Then { match.nw_tos == 0 }
120
- Then { match.nw_proto == 0 }
121
- Then { match.nw_src == '0.0.0.0' }
122
- Then { match.nw_dst == '0.0.0.0' }
123
- Then { match.tp_src == 0 }
124
- Then { match.tp_dst == 0 }
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 nw_src: '192.168.1.0/24'" do
137
- Given(:options) { { nw_src: '192.168.1.0/24' } }
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
- :dl_vlan,
142
- :dl_src,
143
- :dl_dst,
144
- :dl_type,
145
- :nw_proto,
146
- :tp_src,
147
- :tp_dst,
148
- :nw_src,
149
- :nw_dst_all,
150
- :dl_vlan_pcp,
151
- :nw_tos
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(:nw_src) == 8 }
156
+ Then { match.wildcards.fetch(:ip_source_address) == 8 }
155
157
  Then { match.in_port == 0 }
156
- Then { match.dl_src == '00:00:00:00:00:00' }
157
- Then { match.dl_dst == '00:00:00:00:00:00' }
158
- Then { match.dl_vlan == 0 }
159
- Then { match.dl_vlan_pcp == 0 }
160
- Then { match.dl_type == 0 }
161
- Then { match.nw_tos == 0 }
162
- Then { match.nw_proto == 0 }
163
- Then { match.nw_src == '192.168.1.0/24' }
164
- Then { match.nw_dst == '0.0.0.0' }
165
- Then { match.tp_src == 0 }
166
- Then { match.tp_dst == 0 }
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 nw_dst: '192.168.1.0/24'" do
170
- Given(:options) { { nw_dst: '192.168.1.0/24' } }
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
- :dl_vlan,
175
- :dl_src,
176
- :dl_dst,
177
- :dl_type,
178
- :nw_proto,
179
- :tp_src,
180
- :tp_dst,
181
- :nw_src_all,
182
- :nw_dst,
183
- :dl_vlan_pcp,
184
- :nw_tos
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(:nw_dst) == 8 }
189
+ Then { match.wildcards.fetch(:ip_destination_address) == 8 }
188
190
  Then { match.in_port == 0 }
189
- Then { match.dl_src == '00:00:00:00:00:00' }
190
- Then { match.dl_dst == '00:00:00:00:00:00' }
191
- Then { match.dl_vlan == 0 }
192
- Then { match.dl_vlan_pcp == 0 }
193
- Then { match.dl_type == 0 }
194
- Then { match.nw_tos == 0 }
195
- Then { match.nw_proto == 0 }
196
- Then { match.nw_src == '0.0.0.0' }
197
- Then { match.nw_dst == '192.168.1.0/24' }
198
- Then { match.tp_src == 0 }
199
- Then { match.tp_dst == 0 }
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