pio 0.27.2 → 0.28.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 +17 -0
- data/Rakefile +1 -1
- data/bin/{code_metrics → terminal-notifier} +2 -2
- data/features/dhcp.feature +12 -12
- data/features/icmp.feature +12 -12
- data/features/open_flow10/aggregate_stats_request.feature +10 -10
- data/features/open_flow10/enqueue.feature +7 -7
- data/features/open_flow10/exact_match.feature +15 -15
- data/features/open_flow10/features_reply.feature +40 -40
- data/features/open_flow10/flow_mod.feature +49 -49
- data/features/open_flow10/flow_removed.feature +34 -0
- data/features/open_flow10/flow_stats_reply.feature +14 -14
- data/features/open_flow10/flow_stats_request.feature +15 -15
- data/features/open_flow10/nicira_resubmit.feature +30 -0
- data/features/open_flow10/nicira_resubmit_table.feature +32 -0
- data/features/open_flow10/port_stats_request.feature +48 -0
- data/features/open_flow10/port_stats_request.raw +0 -0
- data/features/open_flow10/queue_stats_request.feature +51 -0
- data/features/open_flow10/queue_stats_request.raw +0 -0
- data/features/open_flow10/send_out_port.feature +40 -40
- data/features/open_flow10/set_destination_mac_address.feature +16 -0
- data/features/open_flow10/set_ip_destination_address.feature +6 -6
- data/features/open_flow10/set_source_ip_address.feature +16 -0
- data/features/open_flow10/set_source_mac_address.feature +16 -0
- data/features/open_flow10/{set_ip_tos.feature → set_tos.feature} +3 -3
- data/features/open_flow10/set_transport_destination_port.feature +6 -6
- data/features/open_flow10/set_transport_source_port.feature +6 -6
- data/features/open_flow10/set_vlan_priority.feature +3 -3
- data/features/open_flow10/set_vlan_vid.feature +6 -6
- data/features/open_flow10/strip_vlan_header.feature +5 -5
- data/features/open_flow10/table_stats_request.feature +31 -0
- data/features/open_flow13/match.feature +33 -33
- data/features/open_flow13/send_out_port.feature +45 -45
- data/features/udp.feature +2 -2
- data/lib/pio/arp/format.rb +5 -5
- data/lib/pio/dhcp/boot_reply_options.rb +6 -6
- data/lib/pio/dhcp/boot_request_options.rb +2 -2
- data/lib/pio/dhcp/common_options.rb +5 -5
- data/lib/pio/dhcp/message.rb +2 -2
- data/lib/pio/icmp/options.rb +2 -2
- data/lib/pio/icmp/reply.rb +6 -6
- data/lib/pio/icmp/request.rb +6 -6
- data/lib/pio/ipv4_header.rb +11 -11
- data/lib/pio/open_flow.rb +5 -2
- data/lib/pio/open_flow/action.rb +41 -0
- data/lib/pio/open_flow/nicira_action.rb +17 -0
- data/lib/pio/open_flow10.rb +12 -1
- data/lib/pio/open_flow10/actions.rb +17 -15
- data/lib/pio/open_flow10/enqueue.rb +27 -46
- data/lib/pio/open_flow10/features/reply.rb +5 -5
- data/lib/pio/open_flow10/flow_removed.rb +40 -0
- data/lib/pio/open_flow10/match.rb +33 -33
- data/lib/pio/open_flow10/nicira_resubmit.rb +20 -0
- data/lib/pio/open_flow10/nicira_resubmit_table.rb +17 -0
- data/lib/pio/open_flow10/port_stats/request.rb +25 -0
- data/lib/pio/open_flow10/queue_stats/request.rb +22 -0
- data/lib/pio/open_flow10/send_out_port.rb +6 -27
- data/lib/pio/open_flow10/set_destination_ip_address.rb +16 -0
- data/lib/pio/open_flow10/set_destination_mac_address.rb +18 -0
- data/lib/pio/open_flow10/set_source_ip_address.rb +16 -0
- data/lib/pio/open_flow10/set_source_mac_address.rb +18 -0
- data/lib/pio/open_flow10/set_tos.rb +24 -0
- data/lib/pio/open_flow10/set_transport_port.rb +32 -48
- data/lib/pio/open_flow10/set_vlan_priority.rb +16 -11
- data/lib/pio/open_flow10/set_vlan_vid.rb +16 -11
- data/lib/pio/open_flow10/stats_request.rb +5 -1
- data/lib/pio/open_flow10/strip_vlan_header.rb +8 -25
- data/lib/pio/open_flow10/table_stats/request.rb +19 -0
- data/lib/pio/open_flow13/actions.rb +1 -1
- data/lib/pio/open_flow13/match.rb +19 -19
- data/lib/pio/open_flow13/send_out_port.rb +9 -28
- data/lib/pio/udp_header.rb +4 -4
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +3 -2
- data/spec/pio/dhcp/ack_spec.rb +8 -8
- data/spec/pio/dhcp/offer_spec.rb +8 -8
- data/spec/pio/dhcp_spec.rb +16 -16
- data/spec/pio/icmp/reply_spec.rb +4 -4
- data/spec/pio/icmp/request_spec.rb +6 -6
- data/spec/pio/icmp_spec.rb +4 -4
- data/spec/pio/open_flow10/enqueue_spec.rb +13 -11
- data/spec/pio/open_flow10/flow_mod_spec.rb +20 -20
- data/spec/pio/open_flow10/flow_stats_request_spec.rb +4 -4
- data/spec/pio/open_flow10/match_spec.rb +59 -59
- data/spec/pio/open_flow10/packet_out_spec.rb +31 -29
- data/spec/pio/open_flow10/set_destination_ip_address_spec.rb +27 -0
- data/spec/pio/open_flow10/set_destination_mac_address_spec.rb +28 -0
- data/spec/pio/open_flow10/set_source_ip_address_spec.rb +27 -0
- data/spec/pio/open_flow10/set_source_mac_address_spec.rb +28 -0
- data/spec/pio/open_flow10/set_tos_spec.rb +30 -0
- data/spec/pio/open_flow10/set_transport_destination_port_spec.rb +4 -4
- data/spec/pio/open_flow10/set_transport_source_port_spec.rb +4 -4
- data/spec/pio/open_flow10/set_vlan_priority_spec.rb +4 -4
- data/spec/pio/open_flow10/set_vlan_vid_spec.rb +4 -4
- data/spec/pio/open_flow10/strip_vlan_header_spec.rb +5 -5
- data/spec/pio/open_flow10/wildcards_spec.rb +18 -18
- data/spec/pio/open_flow13/match_spec.rb +20 -20
- metadata +73 -37
- data/bin/code_metrics-profile +0 -16
- data/features/open_flow10/set_ether_destination_address.feature +0 -16
- data/features/open_flow10/set_ether_source_address.feature +0 -16
- data/features/open_flow10/set_ip_source_address.feature +0 -16
- data/lib/pio/open_flow10/set_ether_address.rb +0 -53
- data/lib/pio/open_flow10/set_ip_address.rb +0 -49
- data/lib/pio/open_flow10/set_ip_tos.rb +0 -42
- data/lib/pio/open_flow10/set_vlan.rb +0 -37
- data/spec/pio/open_flow10/set_ether_destination_address_spec.rb +0 -28
- data/spec/pio/open_flow10/set_ether_source_address_spec.rb +0 -28
- data/spec/pio/open_flow10/set_ip_destination_address_spec.rb +0 -27
- data/spec/pio/open_flow10/set_ip_source_address_spec.rb +0 -25
- data/spec/pio/open_flow10/set_ip_tos_spec.rb +0 -30
@@ -1,18 +1,23 @@
|
|
1
|
-
require 'pio/
|
1
|
+
require 'pio/open_flow/action'
|
2
2
|
|
3
3
|
module Pio
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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/
|
1
|
+
require 'pio/open_flow/action'
|
2
2
|
|
3
3
|
module Pio
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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 '
|
2
|
-
require 'forwardable'
|
1
|
+
require 'pio/open_flow/action'
|
3
2
|
|
4
3
|
module Pio
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
-
|
18
|
-
|
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
|
@@ -54,12 +54,12 @@ module Pio
|
|
54
54
|
end
|
55
55
|
|
56
56
|
# The value of OXM_OF_ETH_DST match field.
|
57
|
-
class
|
57
|
+
class DestinationMacAddress < BinData::Record
|
58
58
|
OXM_FIELD = 3
|
59
59
|
|
60
60
|
endian :big
|
61
61
|
|
62
|
-
mac_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
|
70
|
+
class SourceMacAddress < BinData::Record
|
71
71
|
OXM_FIELD = 4
|
72
72
|
|
73
73
|
endian :big
|
74
74
|
|
75
|
-
mac_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
|
83
|
+
class MaskedDestinationMacAddress < BinData::Record
|
84
84
|
endian :big
|
85
85
|
|
86
|
-
mac_address :
|
87
|
-
mac_address :
|
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
|
95
|
+
class MaskedSourceMacAddress < BinData::Record
|
96
96
|
endian :big
|
97
97
|
|
98
|
-
mac_address :
|
99
|
-
mac_address :
|
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
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
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
|
644
|
-
masked? ?
|
645
|
-
when
|
646
|
-
masked? ?
|
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, :
|
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 '
|
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
|
-
|
10
|
-
class Format < BinData::Record
|
11
|
-
NO_BUFFER = 0xffff
|
8
|
+
class SendOutPort < OpenFlow::Action
|
9
|
+
NO_BUFFER = 0xffff
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
17
|
+
super(port: port)
|
37
18
|
end
|
38
19
|
|
39
20
|
def max_length
|
40
21
|
case @format.max_length
|
41
|
-
when
|
22
|
+
when NO_BUFFER
|
42
23
|
:no_buffer
|
43
24
|
else
|
44
25
|
@format.max_length
|
data/lib/pio/udp_header.rb
CHANGED
@@ -8,8 +8,8 @@ module Pio
|
|
8
8
|
# Pseudo UDP header
|
9
9
|
class PseudoUdpHeader < BinData::Record
|
10
10
|
endian :big
|
11
|
-
ip_address :
|
12
|
-
ip_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(
|
48
|
-
|
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
|
|
data/lib/pio/version.rb
CHANGED
data/pio.gemspec
CHANGED
@@ -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.
|
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'
|
data/spec/pio/dhcp/ack_spec.rb
CHANGED
@@ -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
|
-
|
14
|
-
|
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(:
|
138
|
-
let(:
|
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(:
|
156
|
-
let(:
|
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
|
-
|
177
|
-
|
176
|
+
source_ip_address: '192.168.0.10',
|
177
|
+
destination_ip_address: '192.168.0.1'
|
178
178
|
)
|
179
179
|
end
|
180
180
|
|
data/spec/pio/dhcp/offer_spec.rb
CHANGED
@@ -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
|
-
|
14
|
-
|
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(:
|
138
|
-
let(:
|
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(:
|
156
|
-
let(:
|
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
|
-
|
177
|
-
|
176
|
+
source_ip_address: '192.168.0.10',
|
177
|
+
destination_ip_address: '192.168.0.1'
|
178
178
|
)
|
179
179
|
end
|
180
180
|
|