pio 0.27.2 → 0.28.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,18 +1,23 @@
1
- require 'pio/open_flow10/set_vlan'
1
+ require 'pio/open_flow/action'
2
2
 
3
3
  module Pio
4
- # An action to modify the VLAN priority of a packet.
5
- class SetVlanPriority < SetVlan
6
- def_format :vlan_priority, 2
4
+ module OpenFlow10
5
+ # An action to modify the VLAN priority of a packet.
6
+ class SetVlanPriority < OpenFlow::Action
7
+ action_header action_type: 2, action_length: 8
8
+ uint16 :vlan_priority
9
+ string :padding, length: 2
10
+ hide :padding
7
11
 
8
- def initialize(number)
9
- priority = number.to_i
10
- if priority < 0 || priority > 7
11
- fail ArgumentError, 'VLAN priority must be between 0 and 7 inclusive'
12
+ def initialize(number)
13
+ priority = number.to_i
14
+ if priority < 0 || priority > 7
15
+ fail ArgumentError, 'VLAN priority must be between 0 and 7 inclusive'
16
+ end
17
+ super(vlan_priority: priority)
18
+ rescue NoMethodError
19
+ raise TypeError, 'VLAN priority must be an Integer.'
12
20
  end
13
- @format = Format.new(vlan_priority: priority)
14
- rescue NoMethodError
15
- raise TypeError, 'VLAN priority must be an Integer.'
16
21
  end
17
22
  end
18
23
  end
@@ -1,18 +1,23 @@
1
- require 'pio/open_flow10/set_vlan'
1
+ require 'pio/open_flow/action'
2
2
 
3
3
  module Pio
4
- # An action to modify the VLAN ID of a packet.
5
- class SetVlanVid < SetVlan
6
- def_format :vlan_id, 1
4
+ module OpenFlow10
5
+ # An action to modify the VLAN ID of a packet.
6
+ class SetVlanVid < OpenFlow::Action
7
+ action_header action_type: 1, action_length: 8
8
+ uint16 :vlan_id
9
+ string :padding, length: 2
10
+ hide :padding
7
11
 
8
- def initialize(number)
9
- vlan_id = number.to_i
10
- unless vlan_id >= 1 && vlan_id <= 4095
11
- fail ArgumentError, 'VLAN ID must be between 1 and 4095 inclusive'
12
+ def initialize(number)
13
+ vlan_id = number.to_i
14
+ unless vlan_id >= 1 && vlan_id <= 4095
15
+ fail ArgumentError, 'VLAN ID must be between 1 and 4095 inclusive'
16
+ end
17
+ super(vlan_id: vlan_id)
18
+ rescue NoMethodError
19
+ raise TypeError, 'VLAN ID must be an Integer.'
12
20
  end
13
- @format = Format.new(vlan_id: vlan_id)
14
- rescue NoMethodError
15
- raise TypeError, 'VLAN ID must be an Integer.'
16
21
  end
17
22
  end
18
23
  end
@@ -1,3 +1,5 @@
1
+ require 'pio/open_flow10/table_stats/request'
2
+ require 'pio/open_flow10/port_stats/request'
1
3
  require 'pio/open_flow/message'
2
4
 
3
5
  module Pio
@@ -8,7 +10,9 @@ module Pio
8
10
  TYPES = {
9
11
  description: OpenFlow10::DescriptionStats::Request,
10
12
  flow: OpenFlow10::FlowStats::Request,
11
- aggregate: OpenFlow10::AggregateStats::Request
13
+ aggregate: OpenFlow10::AggregateStats::Request,
14
+ table: OpenFlow10::TableStats::Request,
15
+ port: OpenFlow10::PortStats::Request
12
16
  }
13
17
 
14
18
  # Stats request format.
@@ -1,33 +1,16 @@
1
- require 'bindata'
2
- require 'forwardable'
1
+ require 'pio/open_flow/action'
3
2
 
4
3
  module Pio
5
- # An action to strip the 802.1q header.
6
- class StripVlanHeader
7
- # OpenFlow 1.0 OFPAT_STRIP_VLAN action format.
8
- class Format < BinData::Record
9
- endian :big
10
-
11
- uint16 :action_type, value: 3
12
- uint16 :action_length, value: 8
13
- uint32 :padding
4
+ module OpenFlow10
5
+ # An action to strip the 802.1q header.
6
+ class StripVlanHeader < OpenFlow::Action
7
+ action_header action_type: 3, action_length: 8
8
+ string :padding, length: 4
14
9
  hide :padding
15
- end
16
10
 
17
- def self.read(raw_data)
18
- allocate.tap do |strip_vlan|
19
- strip_vlan.instance_variable_set :@format, Format.read(raw_data)
11
+ def initialize
12
+ super({})
20
13
  end
21
14
  end
22
-
23
- extend Forwardable
24
-
25
- def_delegators :@format, :action_type
26
- def_delegator :@format, :action_length, :length
27
- def_delegator :@format, :to_binary_s, :to_binary
28
-
29
- def initialize
30
- @format = Format.new
31
- end
32
15
  end
33
16
  end
@@ -0,0 +1,19 @@
1
+ require 'pio/open_flow10/stats_type'
2
+ require 'pio/open_flow/message'
3
+
4
+ module Pio
5
+ module OpenFlow10
6
+ # OpenFlow 1.0 Table Stats messages
7
+ module TableStats
8
+ # OpenFlow 1.0 Table Stats Request message
9
+ class Request < OpenFlow::Message
10
+ open_flow_header version: 1,
11
+ message_type: 16,
12
+ message_length: 12
13
+ stats_type :stats_type, value: -> { :table }
14
+ uint16 :flags
15
+ string :body, value: ''
16
+ end
17
+ end
18
+ end
19
+ end
@@ -32,7 +32,7 @@ module Pio
32
32
  else
33
33
  UnsupportedAction.read(tmp)
34
34
  end
35
- tmp = tmp[action.length..-1]
35
+ tmp = tmp[action.action_length..-1]
36
36
  actions << action
37
37
  end
38
38
  actions
@@ -54,12 +54,12 @@ module Pio
54
54
  end
55
55
 
56
56
  # The value of OXM_OF_ETH_DST match field.
57
- class EtherDestinationAddress < BinData::Record
57
+ class DestinationMacAddress < BinData::Record
58
58
  OXM_FIELD = 3
59
59
 
60
60
  endian :big
61
61
 
62
- mac_address :ether_destination_address
62
+ mac_address :destination_mac_address
63
63
 
64
64
  def length
65
65
  6
@@ -67,12 +67,12 @@ module Pio
67
67
  end
68
68
 
69
69
  # The value of OXM_OF_ETH_SRC match field.
70
- class EtherSourceAddress < BinData::Record
70
+ class SourceMacAddress < BinData::Record
71
71
  OXM_FIELD = 4
72
72
 
73
73
  endian :big
74
74
 
75
- mac_address :ether_source_address
75
+ mac_address :source_mac_address
76
76
 
77
77
  def length
78
78
  6
@@ -80,11 +80,11 @@ module Pio
80
80
  end
81
81
 
82
82
  # Masked OXM_OF_ETH_DST match field.
83
- class MaskedEtherDestinationAddress < BinData::Record
83
+ class MaskedDestinationMacAddress < BinData::Record
84
84
  endian :big
85
85
 
86
- mac_address :ether_destination_address
87
- mac_address :ether_destination_address_mask
86
+ mac_address :destination_mac_address
87
+ mac_address :destination_mac_address_mask
88
88
 
89
89
  def length
90
90
  12
@@ -92,11 +92,11 @@ module Pio
92
92
  end
93
93
 
94
94
  # Masked OXM_OF_ETH_SRC match field.
95
- class MaskedEtherSourceAddress < BinData::Record
95
+ class MaskedSourceMacAddress < BinData::Record
96
96
  endian :big
97
97
 
98
- mac_address :ether_source_address
99
- mac_address :ether_source_address_mask
98
+ mac_address :source_mac_address
99
+ mac_address :source_mac_address_mask
100
100
 
101
101
  def length
102
102
  12
@@ -577,10 +577,10 @@ module Pio
577
577
  in_port InPort
578
578
  metadata Metadata
579
579
  masked_metadata MaskedMetadata
580
- ether_destination_address EtherDestinationAddress
581
- masked_ether_destination_address MaskedEtherDestinationAddress
582
- ether_source_address EtherSourceAddress
583
- masked_ether_source_address MaskedEtherSourceAddress
580
+ destination_mac_address DestinationMacAddress
581
+ masked_destination_mac_address MaskedDestinationMacAddress
582
+ source_mac_address SourceMacAddress
583
+ masked_source_mac_address MaskedSourceMacAddress
584
584
  ether_type EtherType
585
585
  vlan_vid VlanVid
586
586
  vlan_pcp VlanPcp
@@ -640,10 +640,10 @@ module Pio
640
640
  InPort
641
641
  when Metadata::OXM_FIELD
642
642
  masked? ? MaskedMetadata : Metadata
643
- when EtherDestinationAddress::OXM_FIELD
644
- masked? ? MaskedEtherDestinationAddress : EtherDestinationAddress
645
- when EtherSourceAddress::OXM_FIELD
646
- masked? ? MaskedEtherSourceAddress : EtherSourceAddress
643
+ when DestinationMacAddress::OXM_FIELD
644
+ masked? ? MaskedDestinationMacAddress : DestinationMacAddress
645
+ when SourceMacAddress::OXM_FIELD
646
+ masked? ? MaskedSourceMacAddress : SourceMacAddress
647
647
  when EtherType::OXM_FIELD
648
648
  EtherType
649
649
  when VlanVid::OXM_FIELD
@@ -827,7 +827,7 @@ module Pio
827
827
  tlv_value: { each => user_attrs.fetch(each) } } }
828
828
  end
829
829
 
830
- [:metadata, :ether_destination_address, :ether_source_address,
830
+ [:metadata, :destination_mac_address, :source_mac_address,
831
831
  :ipv4_source_address, :ipv4_destination_address,
832
832
  :arp_sender_protocol_address, :arp_target_protocol_address,
833
833
  :arp_sender_hardware_address, :arp_target_hardware_address,
@@ -1,44 +1,25 @@
1
- require 'forwardable'
1
+ require 'pio/open_flow/action'
2
2
  require 'pio/open_flow13/port32'
3
3
 
4
4
  # Base module.
5
5
  module Pio
6
6
  module OpenFlow13
7
7
  # Output to switch port.
8
- class SendOutPort
9
- # OpenFlow 1.3.4 OFPAT_OUTPUT action format.
10
- class Format < BinData::Record
11
- NO_BUFFER = 0xffff
8
+ class SendOutPort < OpenFlow::Action
9
+ NO_BUFFER = 0xffff
12
10
 
13
- endian :big
14
-
15
- uint16 :action_type, value: 0
16
- uint16 :action_length, value: 16
17
- port32 :port
18
- uint16 :max_length, initial_value: NO_BUFFER
19
- uint48 :padding
20
- end
21
-
22
- def self.read(raw_data)
23
- allocate.tap do |send_out_port|
24
- send_out_port.instance_variable_set :@format, Format.read(raw_data)
25
- end
26
- end
27
-
28
- extend Forwardable
29
-
30
- def_delegators :@format, :action_type
31
- def_delegator :@format, :action_length, :length
32
- def_delegators :@format, :port
33
- def_delegator :@format, :to_binary_s, :to_binary
11
+ action_header action_type: 0, action_length: 16
12
+ port32 :port
13
+ uint16 :max_length, initial_value: NO_BUFFER
14
+ uint48 :padding
34
15
 
35
16
  def initialize(port)
36
- @format = Format.new(port: port)
17
+ super(port: port)
37
18
  end
38
19
 
39
20
  def max_length
40
21
  case @format.max_length
41
- when Format::NO_BUFFER
22
+ when NO_BUFFER
42
23
  :no_buffer
43
24
  else
44
25
  @format.max_length
@@ -8,8 +8,8 @@ module Pio
8
8
  # Pseudo UDP header
9
9
  class PseudoUdpHeader < BinData::Record
10
10
  endian :big
11
- ip_address :ip_source_address
12
- ip_address :ip_destination_address
11
+ ip_address :source_ip_address
12
+ ip_address :destination_ip_address
13
13
  uint8 :padding
14
14
  uint8 :ip_protocol, value: IPv4Header::ProtocolNumber::UDP
15
15
  uint16 :udp_length
@@ -44,8 +44,8 @@ module Pio
44
44
  end
45
45
 
46
46
  def pseudo_udp_header
47
- PseudoUdpHeader.new(ip_source_address: ip_source_address,
48
- ip_destination_address: ip_destination_address,
47
+ PseudoUdpHeader.new(source_ip_address: source_ip_address,
48
+ destination_ip_address: destination_ip_address,
49
49
  udp_length: udp_length).to_binary_s
50
50
  end
51
51
 
@@ -1,5 +1,5 @@
1
1
  # Base module.
2
2
  module Pio
3
3
  # gem version.
4
- VERSION = '0.27.2'.freeze
4
+ VERSION = '0.28.0'.freeze
5
5
  end
@@ -30,9 +30,10 @@ Gem::Specification.new do |gem|
30
30
 
31
31
  gem.add_dependency 'bindata', '~> 2.1.0'
32
32
 
33
- gem.add_development_dependency 'rake'
34
33
  gem.add_development_dependency 'bundler', '~> 1.10.6'
34
+ gem.add_development_dependency 'byebug', '~> 7.0.0'
35
35
  gem.add_development_dependency 'pry', '~> 0.10.3'
36
+ gem.add_development_dependency 'rake'
36
37
 
37
38
  # Guard
38
39
  gem.add_development_dependency 'guard', '~> 2.13.0'
@@ -56,7 +57,7 @@ Gem::Specification.new do |gem|
56
57
  gem.add_development_dependency 'cucumber', '~> 2.1.0'
57
58
  gem.add_development_dependency 'flay', '~> 2.6.1'
58
59
  gem.add_development_dependency 'flog', '~> 4.3.2'
59
- gem.add_development_dependency 'reek', '~> 3.5.0'
60
+ gem.add_development_dependency 'reek', '~> 3.6.0'
60
61
  gem.add_development_dependency 'rspec', '~> 3.3.0'
61
62
  gem.add_development_dependency 'rspec-given', '~> 3.7.1'
62
63
  gem.add_development_dependency 'rubocop', '~> 0.34.2'
@@ -10,8 +10,8 @@ describe Pio::Dhcp::Ack, '.new' do
10
10
  Pio::Dhcp::Ack.new(
11
11
  source_mac: source_mac,
12
12
  destination_mac: destination_mac,
13
- ip_source_address: ip_source_address,
14
- ip_destination_address: ip_destination_address,
13
+ source_ip_address: source_ip_address,
14
+ destination_ip_address: destination_ip_address,
15
15
  transaction_id: 0xdeadbeef,
16
16
  renewal_time_value: 0xdeadbeef,
17
17
  rebinding_time_value: 0xdeadbeef,
@@ -134,8 +134,8 @@ describe Pio::Dhcp::Ack, '.new' do
134
134
  context 'with Pio::MAC Address and Pio::IPv4Address Address' do
135
135
  let(:source_mac) { Pio::Mac.new('aa:bb:cc:dd:ee:ff') }
136
136
  let(:destination_mac) { Pio::Mac.new('11:22:33:44:55:66') }
137
- let(:ip_source_address) { Pio::IPv4Address.new('192.168.0.10') }
138
- let(:ip_destination_address) { Pio::IPv4Address.new('192.168.0.1') }
137
+ let(:source_ip_address) { Pio::IPv4Address.new('192.168.0.10') }
138
+ let(:destination_ip_address) { Pio::IPv4Address.new('192.168.0.1') }
139
139
  let(:subnet_mask) { Pio::IPv4Address.new('255.255.255.0') }
140
140
 
141
141
  context '#to_binary' do
@@ -152,8 +152,8 @@ describe Pio::Dhcp::Ack, '.new' do
152
152
  context 'with String MAC Address' do
153
153
  let(:source_mac) { 'aa:bb:cc:dd:ee:ff' }
154
154
  let(:destination_mac) { '11:22:33:44:55:66' }
155
- let(:ip_source_address) { '192.168.0.10' }
156
- let(:ip_destination_address) { '192.168.0.1' }
155
+ let(:source_ip_address) { '192.168.0.10' }
156
+ let(:destination_ip_address) { '192.168.0.1' }
157
157
  let(:subnet_mask) { '255.255.255.0' }
158
158
 
159
159
  context '#to_binary' do
@@ -173,8 +173,8 @@ describe Pio::Dhcp::Ack, '.new' do
173
173
  Pio::Dhcp::Ack.new(
174
174
  source_mac: 'aa:bb:cc:dd:ee:ff',
175
175
  destination_mac: '11:22:33:44:55:66',
176
- ip_source_address: '192.168.0.10',
177
- ip_destination_address: '192.168.0.1'
176
+ source_ip_address: '192.168.0.10',
177
+ destination_ip_address: '192.168.0.1'
178
178
  )
179
179
  end
180
180
 
@@ -10,8 +10,8 @@ describe Pio::Dhcp::Offer, '.new' do
10
10
  Pio::Dhcp::Offer.new(
11
11
  source_mac: source_mac,
12
12
  destination_mac: destination_mac,
13
- ip_source_address: ip_source_address,
14
- ip_destination_address: ip_destination_address,
13
+ source_ip_address: source_ip_address,
14
+ destination_ip_address: destination_ip_address,
15
15
  transaction_id: 0xdeadbeef,
16
16
  renewal_time_value: 0xdeadbeef,
17
17
  rebinding_time_value: 0xdeadbeef,
@@ -134,8 +134,8 @@ describe Pio::Dhcp::Offer, '.new' do
134
134
  context 'with Pio::MAC Address and Pio::IPv4Address Address' do
135
135
  let(:source_mac) { Pio::Mac.new('aa:bb:cc:dd:ee:ff') }
136
136
  let(:destination_mac) { Pio::Mac.new('11:22:33:44:55:66') }
137
- let(:ip_source_address) { Pio::IPv4Address.new('192.168.0.10') }
138
- let(:ip_destination_address) { Pio::IPv4Address.new('192.168.0.1') }
137
+ let(:source_ip_address) { Pio::IPv4Address.new('192.168.0.10') }
138
+ let(:destination_ip_address) { Pio::IPv4Address.new('192.168.0.1') }
139
139
  let(:subnet_mask) { Pio::IPv4Address.new('255.255.255.0') }
140
140
 
141
141
  context '#to_binary' do
@@ -152,8 +152,8 @@ describe Pio::Dhcp::Offer, '.new' do
152
152
  context 'with String MAC Address' do
153
153
  let(:source_mac) { 'aa:bb:cc:dd:ee:ff' }
154
154
  let(:destination_mac) { '11:22:33:44:55:66' }
155
- let(:ip_source_address) { '192.168.0.10' }
156
- let(:ip_destination_address) { '192.168.0.1' }
155
+ let(:source_ip_address) { '192.168.0.10' }
156
+ let(:destination_ip_address) { '192.168.0.1' }
157
157
  let(:subnet_mask) { '255.255.255.0' }
158
158
 
159
159
  context '#to_binary' do
@@ -173,8 +173,8 @@ describe Pio::Dhcp::Offer, '.new' do
173
173
  Pio::Dhcp::Offer.new(
174
174
  source_mac: 'aa:bb:cc:dd:ee:ff',
175
175
  destination_mac: '11:22:33:44:55:66',
176
- ip_source_address: '192.168.0.10',
177
- ip_destination_address: '192.168.0.1'
176
+ source_ip_address: '192.168.0.10',
177
+ destination_ip_address: '192.168.0.1'
178
178
  )
179
179
  end
180
180