pio 0.7.0 → 0.8.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/pio/echo/message.rb +1 -1
- data/lib/pio/features/reply.rb +1 -1
- data/lib/pio/features/request.rb +1 -1
- data/lib/pio/hello.rb +1 -1
- data/lib/pio/hello/format.rb +1 -1
- data/lib/pio/options.rb +6 -6
- data/lib/pio/type/open_flow.rb +1 -1
- data/lib/pio/version.rb +1 -1
- data/spec/pio/dhcp_spec.rb +161 -161
- data/spec/pio/echo/reply_spec.rb +5 -5
- data/spec/pio/echo/request_spec.rb +5 -5
- data/spec/pio/echo_spec.rb +2 -2
- data/spec/pio/features/reply_spec.rb +1 -1
- data/spec/pio/features/request_spec.rb +4 -4
- data/spec/pio/features_spec.rb +2 -2
- data/spec/pio/hello_spec.rb +5 -5
- data/spec/pio/icmp/reply_spec.rb +38 -38
- data/spec/pio/icmp/request_spec.rb +38 -38
- data/spec/pio/icmp_spec.rb +37 -37
- data/spec/pio/lldp_spec.rb +44 -44
- metadata +32 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce75fa3db348633f7c767002243b3622afbad27f
|
4
|
+
data.tar.gz: 73ba0196a66d912c3b009e2aef354ef10c30bdbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e84a310f0f938dab183fa099e027a50f9f0642454fd1ed2d260b9185b3222ff0e3b28e59b7123526cfbfa74e3fd2c9f9b54691be30a1574c4096015d485dd5d3
|
7
|
+
data.tar.gz: ceb22cf2e33db9a1dcc9183ccb73721a4052dc08d17a3191b3a000ed6ddfd1bf2a73567f4dc7f648db8c125236f2ca2f010b19caf8d277ff4f490e921ba3a80c
|
data/CHANGELOG.md
CHANGED
data/lib/pio/echo/message.rb
CHANGED
data/lib/pio/features/reply.rb
CHANGED
data/lib/pio/features/request.rb
CHANGED
@@ -10,7 +10,7 @@ module Pio
|
|
10
10
|
class Request < Message
|
11
11
|
extend Forwardable
|
12
12
|
|
13
|
-
def_delegators :@features, :
|
13
|
+
def_delegators :@features, :ofp_version
|
14
14
|
def_delegators :@features, :message_type
|
15
15
|
def_delegators :@features, :message_length
|
16
16
|
def_delegators :@features, :transaction_id
|
data/lib/pio/hello.rb
CHANGED
data/lib/pio/hello/format.rb
CHANGED
data/lib/pio/options.rb
CHANGED
@@ -4,10 +4,11 @@ module Pio
|
|
4
4
|
# User options utility.
|
5
5
|
class Options
|
6
6
|
def self.mandatory_option(name)
|
7
|
-
|
8
|
-
|
7
|
+
if const_defined?(:MANDATORY_OPTIONS)
|
8
|
+
const_get(:MANDATORY_OPTIONS) << name
|
9
|
+
else
|
10
|
+
const_set(:MANDATORY_OPTIONS, [name])
|
9
11
|
end
|
10
|
-
const_get(:MANDATORY_OPTIONS) << name
|
11
12
|
end
|
12
13
|
|
13
14
|
def self.option(name)
|
@@ -57,9 +58,8 @@ module Pio
|
|
57
58
|
value = user_options.fetch(key) do |missing_key|
|
58
59
|
fail ArgumentError, "The #{missing_key} option should be passed."
|
59
60
|
end
|
60
|
-
|
61
|
-
|
62
|
-
end
|
61
|
+
return if value
|
62
|
+
fail(ArgumentError, "The #{key} option shouldn't be #{value.inspect}.")
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
data/lib/pio/type/open_flow.rb
CHANGED
data/lib/pio/version.rb
CHANGED
data/spec/pio/dhcp_spec.rb
CHANGED
@@ -12,67 +12,67 @@ describe Pio::Dhcp, '.read' do
|
|
12
12
|
context 'with DHCP Discover frame' do
|
13
13
|
let(:data) do
|
14
14
|
[
|
15
|
-
|
15
|
+
# Destination MAC Address
|
16
16
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
17
|
-
|
17
|
+
# Source MAC Address
|
18
18
|
0x24, 0xdb, 0xac, 0x41, 0xe5, 0x5b,
|
19
|
-
|
19
|
+
# Ethernet Type
|
20
20
|
0x08, 0x00,
|
21
|
-
|
21
|
+
# IP version and IP Header Length
|
22
22
|
0x45,
|
23
|
-
|
23
|
+
# DSCP
|
24
24
|
0x00,
|
25
|
-
|
25
|
+
# IP Total Length
|
26
26
|
0x01, 0x48,
|
27
|
-
|
27
|
+
# IP Identifier
|
28
28
|
0x00, 0x00,
|
29
|
-
|
29
|
+
# IP Flags and IP Fragmentation
|
30
30
|
0x00, 0x00,
|
31
|
-
|
31
|
+
# IP TTL
|
32
32
|
0x80,
|
33
|
-
|
33
|
+
# IP Protocol
|
34
34
|
0x11,
|
35
|
-
|
35
|
+
# IP Header Checksum
|
36
36
|
0x39, 0xa6,
|
37
|
-
|
37
|
+
# IP Source Address
|
38
38
|
0x00, 0x00, 0x00, 0x00,
|
39
|
-
|
39
|
+
# IP Destination Address
|
40
40
|
0xff, 0xff, 0xff, 0xff,
|
41
|
-
|
41
|
+
# UDP Source Port
|
42
42
|
0x00, 0x44,
|
43
|
-
|
43
|
+
# UDP Destination Port
|
44
44
|
0x00, 0x43,
|
45
|
-
|
45
|
+
# UDP Total Length
|
46
46
|
0x01, 0x34,
|
47
|
-
|
47
|
+
# UDP Header Checksum
|
48
48
|
0x88, 0x14,
|
49
|
-
|
49
|
+
# Bootp Msg Type
|
50
50
|
0x01,
|
51
|
-
|
51
|
+
# Hw Type
|
52
52
|
0x01,
|
53
|
-
|
53
|
+
# Hw Address Length
|
54
54
|
0x06,
|
55
|
-
|
55
|
+
# Hops
|
56
56
|
0x00,
|
57
|
-
|
57
|
+
# Transaction ID
|
58
58
|
0xde, 0xad, 0xbe, 0xef,
|
59
|
-
|
59
|
+
# Seconds
|
60
60
|
0x00, 0x00,
|
61
|
-
|
61
|
+
# Bootp Flags
|
62
62
|
0x00, 0x00,
|
63
|
-
|
63
|
+
# Client IP Address
|
64
64
|
0x00, 0x00, 0x00, 0x00,
|
65
|
-
|
65
|
+
# Your IP Address
|
66
66
|
0x00, 0x00, 0x00, 0x00,
|
67
|
-
|
67
|
+
# Next Server IP Address
|
68
68
|
0x00, 0x00, 0x00, 0x00,
|
69
|
-
|
69
|
+
# Relay Agent IP Address
|
70
70
|
0x00, 0x00, 0x00, 0x00,
|
71
|
-
|
71
|
+
# Client MAC Address
|
72
72
|
0x24, 0xdb, 0xac, 0x41, 0xe5, 0x5b,
|
73
|
-
|
73
|
+
# Client Hw Address Padding
|
74
74
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
75
|
-
|
75
|
+
# Server Host Name
|
76
76
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
77
77
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
78
78
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -81,7 +81,7 @@ describe Pio::Dhcp, '.read' do
|
|
81
81
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
82
82
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
83
83
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
84
|
-
|
84
|
+
# Boot File Name
|
85
85
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
86
86
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
87
87
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -98,19 +98,19 @@ describe Pio::Dhcp, '.read' do
|
|
98
98
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
99
99
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
100
100
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
101
|
-
|
101
|
+
# Magic Cookie
|
102
102
|
0x63, 0x82, 0x53, 0x63,
|
103
|
-
|
103
|
+
# DHCP Msg Type
|
104
104
|
0x35, 0x01, 0x01,
|
105
|
-
|
105
|
+
# Client Identifier
|
106
106
|
0x3d, 0x07, 0x01, 0x24, 0xdb, 0xac, 0x41, 0xe5, 0x5b,
|
107
|
-
|
107
|
+
# Requested IP Address
|
108
108
|
0x32, 0x04, 0x00, 0x00, 0x00, 0x00,
|
109
|
-
|
109
|
+
# Parameter Lists
|
110
110
|
0x37, 0x04, 0x01, 0x03, 0x06, 0x2a,
|
111
|
-
|
111
|
+
# End Option
|
112
112
|
0xff,
|
113
|
-
|
113
|
+
# Padding Field
|
114
114
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
115
115
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
116
116
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -158,67 +158,67 @@ describe Pio::Dhcp, '.read' do
|
|
158
158
|
context 'with DHCP offer frame' do
|
159
159
|
let(:data) do
|
160
160
|
[
|
161
|
-
|
161
|
+
# Destination MAC Address
|
162
162
|
0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
|
163
|
-
|
163
|
+
# Source MAC Address
|
164
164
|
0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
|
165
|
-
|
165
|
+
# Ethernet Type
|
166
166
|
0x08, 0x00,
|
167
|
-
|
167
|
+
# IP version and IP Header Length
|
168
168
|
0x45,
|
169
|
-
|
169
|
+
# DSCP
|
170
170
|
0x00,
|
171
|
-
|
171
|
+
# IP Total Length
|
172
172
|
0x01, 0x48,
|
173
|
-
|
173
|
+
# IP Identifier
|
174
174
|
0x00, 0x00,
|
175
|
-
|
175
|
+
# IP Flags and IP Fragmentation
|
176
176
|
0x00, 0x00,
|
177
|
-
|
177
|
+
# IP TTL
|
178
178
|
0x80,
|
179
|
-
|
179
|
+
# IP Protocol
|
180
180
|
0x11,
|
181
|
-
|
181
|
+
# IP Header Checksum
|
182
182
|
0xb8, 0x49,
|
183
|
-
|
183
|
+
# IP Source Address
|
184
184
|
0xc0, 0xa8, 0x00, 0x0a,
|
185
|
-
|
185
|
+
# IP Destination Address
|
186
186
|
0xc0, 0xa8, 0x00, 0x01,
|
187
|
-
|
187
|
+
# UDP Source Port
|
188
188
|
0x00, 0x43,
|
189
|
-
|
189
|
+
# UDP Destination Port
|
190
190
|
0x00, 0x44,
|
191
|
-
|
191
|
+
# UDP Total Length
|
192
192
|
0x01, 0x34,
|
193
|
-
|
193
|
+
# UDP Header Checksum
|
194
194
|
0x1e, 0x64,
|
195
|
-
|
195
|
+
# Bootp Msg Type
|
196
196
|
0x02,
|
197
|
-
|
197
|
+
# Hw Type
|
198
198
|
0x01,
|
199
|
-
|
199
|
+
# Hw Address Length
|
200
200
|
0x06,
|
201
|
-
|
201
|
+
# Hops
|
202
202
|
0x00,
|
203
|
-
|
203
|
+
# Transaction ID
|
204
204
|
0xde, 0xad, 0xbe, 0xef,
|
205
|
-
|
205
|
+
# Seconds
|
206
206
|
0x00, 0x00,
|
207
|
-
|
207
|
+
# Bootp Flags
|
208
208
|
0x00, 0x00,
|
209
|
-
|
209
|
+
# Client IP Address
|
210
210
|
0x00, 0x00, 0x00, 0x00,
|
211
|
-
|
211
|
+
# Your IP Address
|
212
212
|
0xc0, 0xa8, 0x00, 0x01,
|
213
|
-
|
213
|
+
# Next Server IP Address
|
214
214
|
0x00, 0x00, 0x00, 0x00,
|
215
|
-
|
215
|
+
# Relay Agent IP Address
|
216
216
|
0x00, 0x00, 0x00, 0x00,
|
217
|
-
|
217
|
+
# Client MAC Address
|
218
218
|
0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
|
219
|
-
|
219
|
+
# Client Hw Address Padding
|
220
220
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
221
|
-
|
221
|
+
# Server Host Name
|
222
222
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
223
223
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
224
224
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -227,7 +227,7 @@ describe Pio::Dhcp, '.read' do
|
|
227
227
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
228
228
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
229
229
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
230
|
-
|
230
|
+
# Boot File Name
|
231
231
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
232
232
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
233
233
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -244,23 +244,23 @@ describe Pio::Dhcp, '.read' do
|
|
244
244
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
245
245
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
246
246
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
247
|
-
|
247
|
+
# Magic Cookie
|
248
248
|
0x63, 0x82, 0x53, 0x63,
|
249
|
-
|
249
|
+
# DHCP Msg Type
|
250
250
|
0x35, 0x01, 0x02,
|
251
|
-
|
251
|
+
# Renewal Time Value
|
252
252
|
0x3a, 0x04, 0xde, 0xad, 0xbe, 0xef,
|
253
|
-
|
253
|
+
# Rebinding Time Value
|
254
254
|
0x3b, 0x04, 0xde, 0xad, 0xbe, 0xef,
|
255
|
-
|
255
|
+
# IP Address Lease Time Value
|
256
256
|
0x33, 0x04, 0xde, 0xad, 0xbe, 0xef,
|
257
|
-
|
257
|
+
# DHCP Server Identifier
|
258
258
|
0x36, 0x04, 0xc0, 0xa8, 0x00, 0x0a,
|
259
|
-
|
259
|
+
# Subnet Mask
|
260
260
|
0x01, 0x04, 0xff, 0xff, 0xff, 0x00,
|
261
|
-
|
261
|
+
# End Option
|
262
262
|
0xff,
|
263
|
-
|
263
|
+
# Padding Field
|
264
264
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
265
265
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
266
266
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -310,67 +310,67 @@ describe Pio::Dhcp, '.read' do
|
|
310
310
|
context 'with DHCP Request frame' do
|
311
311
|
let(:data) do
|
312
312
|
[
|
313
|
-
|
313
|
+
# Destination MAC Address
|
314
314
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
315
|
-
|
315
|
+
# Source MAC Address
|
316
316
|
0x24, 0xdb, 0xac, 0x41, 0xe5, 0x5b,
|
317
|
-
|
317
|
+
# Ethernet Type
|
318
318
|
0x08, 0x00,
|
319
|
-
|
319
|
+
# IP version and IP Header Length
|
320
320
|
0x45,
|
321
|
-
|
321
|
+
# DSCP
|
322
322
|
0x00,
|
323
|
-
|
323
|
+
# IP Total Length
|
324
324
|
0x01, 0x48,
|
325
|
-
|
325
|
+
# IP Identifier
|
326
326
|
0x00, 0x00,
|
327
|
-
|
327
|
+
# IP Flags and IP Fragmentation
|
328
328
|
0x00, 0x00,
|
329
|
-
|
329
|
+
# IP TTL
|
330
330
|
0x80,
|
331
|
-
|
331
|
+
# IP Protocol
|
332
332
|
0x11,
|
333
|
-
|
333
|
+
# IP Header Checksum
|
334
334
|
0x39, 0xa6,
|
335
|
-
|
335
|
+
# IP Source Address
|
336
336
|
0x00, 0x00, 0x00, 0x00,
|
337
|
-
|
337
|
+
# IP Destination Address
|
338
338
|
0xff, 0xff, 0xff, 0xff,
|
339
|
-
|
339
|
+
# UDP Source Port
|
340
340
|
0x00, 0x44,
|
341
|
-
|
341
|
+
# UDP Destination Port
|
342
342
|
0x00, 0x43,
|
343
|
-
|
343
|
+
# UDP Total Length
|
344
344
|
0x01, 0x34,
|
345
|
-
|
345
|
+
# UDP Header Checksum
|
346
346
|
0xce, 0xb3,
|
347
|
-
|
347
|
+
# Bootp Msg Type
|
348
348
|
0x01,
|
349
|
-
|
349
|
+
# Hw Type
|
350
350
|
0x01,
|
351
|
-
|
351
|
+
# Hw Address Length
|
352
352
|
0x06,
|
353
|
-
|
353
|
+
# Hops
|
354
354
|
0x00,
|
355
|
-
|
355
|
+
# Transaction ID
|
356
356
|
0xde, 0xad, 0xbe, 0xef,
|
357
|
-
|
357
|
+
# Seconds
|
358
358
|
0x00, 0x00,
|
359
|
-
|
359
|
+
# Bootp Flags
|
360
360
|
0x00, 0x00,
|
361
|
-
|
361
|
+
# Client IP Address
|
362
362
|
0x00, 0x00, 0x00, 0x00,
|
363
|
-
|
363
|
+
# Your IP Address
|
364
364
|
0x00, 0x00, 0x00, 0x00,
|
365
|
-
|
365
|
+
# Next Server IP Address
|
366
366
|
0x00, 0x00, 0x00, 0x00,
|
367
|
-
|
367
|
+
# Relay Agent IP Address
|
368
368
|
0x00, 0x00, 0x00, 0x00,
|
369
|
-
|
369
|
+
# Client MAC Address
|
370
370
|
0x24, 0xdb, 0xac, 0x41, 0xe5, 0x5b,
|
371
|
-
|
371
|
+
# Client Hw Address Padding
|
372
372
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
373
|
-
|
373
|
+
# Server Host Name
|
374
374
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
375
375
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
376
376
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -379,7 +379,7 @@ describe Pio::Dhcp, '.read' do
|
|
379
379
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
380
380
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
381
381
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
382
|
-
|
382
|
+
# Boot File Name
|
383
383
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
384
384
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
385
385
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -396,21 +396,21 @@ describe Pio::Dhcp, '.read' do
|
|
396
396
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
397
397
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
398
398
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
399
|
-
|
399
|
+
# Magic Cookie
|
400
400
|
0x63, 0x82, 0x53, 0x63,
|
401
|
-
|
401
|
+
# DHCP Msg Type
|
402
402
|
0x35, 0x01, 0x03,
|
403
|
-
|
403
|
+
# Client Identifier
|
404
404
|
0x3d, 0x07, 0x01, 0x24, 0xdb, 0xac, 0x41, 0xe5, 0x5b,
|
405
|
-
|
405
|
+
# Requested IP Address
|
406
406
|
0x32, 0x04, 0xc0, 0xa8, 0x00, 0x0a,
|
407
|
-
|
407
|
+
# Parameter Lists
|
408
408
|
0x37, 0x04, 0x01, 0x03, 0x06, 0x2a,
|
409
|
-
|
409
|
+
# DHCP Server Identifier
|
410
410
|
0x36, 0x04, 0xc0, 0xa8, 0x00, 0x01,
|
411
|
-
|
411
|
+
# End Option
|
412
412
|
0xff,
|
413
|
-
|
413
|
+
# Padding Field
|
414
414
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
415
415
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
416
416
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -458,67 +458,67 @@ describe Pio::Dhcp, '.read' do
|
|
458
458
|
context 'with DHCP ACK frame' do
|
459
459
|
let(:data) do
|
460
460
|
[
|
461
|
-
|
461
|
+
# Destination MAC Address
|
462
462
|
0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
|
463
|
-
|
463
|
+
# Source MAC Address
|
464
464
|
0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
|
465
|
-
|
465
|
+
# Ethernet Type
|
466
466
|
0x08, 0x00,
|
467
|
-
|
467
|
+
# IP version and IP Header Length
|
468
468
|
0x45,
|
469
|
-
|
469
|
+
# DSCP
|
470
470
|
0x00,
|
471
|
-
|
471
|
+
# IP Total Length
|
472
472
|
0x01, 0x48,
|
473
|
-
|
473
|
+
# IP Identifier
|
474
474
|
0x00, 0x00,
|
475
|
-
|
475
|
+
# IP Flags and IP Fragmentation
|
476
476
|
0x00, 0x00,
|
477
|
-
|
477
|
+
# IP TTL
|
478
478
|
0x80,
|
479
|
-
|
479
|
+
# IP Protocol
|
480
480
|
0x11,
|
481
|
-
|
481
|
+
# IP Header Checksum
|
482
482
|
0xb8, 0x49,
|
483
|
-
|
483
|
+
# IP Source Address
|
484
484
|
0xc0, 0xa8, 0x00, 0x0a,
|
485
|
-
|
485
|
+
# IP Destination Address
|
486
486
|
0xc0, 0xa8, 0x00, 0x01,
|
487
|
-
|
487
|
+
# UDP Source Port
|
488
488
|
0x00, 0x43,
|
489
|
-
|
489
|
+
# UDP Destination Port
|
490
490
|
0x00, 0x44,
|
491
|
-
|
491
|
+
# UDP Total Length
|
492
492
|
0x01, 0x34,
|
493
|
-
|
493
|
+
# UDP Header Checksum
|
494
494
|
0x1b, 0x64,
|
495
|
-
|
495
|
+
# Bootp Msg Type
|
496
496
|
0x02,
|
497
|
-
|
497
|
+
# Hw Type
|
498
498
|
0x01,
|
499
|
-
|
499
|
+
# Hw Address Length
|
500
500
|
0x06,
|
501
|
-
|
501
|
+
# Hops
|
502
502
|
0x00,
|
503
|
-
|
503
|
+
# Transaction ID
|
504
504
|
0xde, 0xad, 0xbe, 0xef,
|
505
|
-
|
505
|
+
# Seconds
|
506
506
|
0x00, 0x00,
|
507
|
-
|
507
|
+
# Bootp Flags
|
508
508
|
0x00, 0x00,
|
509
|
-
|
509
|
+
# Client IP Address
|
510
510
|
0x00, 0x00, 0x00, 0x00,
|
511
|
-
|
511
|
+
# Your IP Address
|
512
512
|
0xc0, 0xa8, 0x00, 0x01,
|
513
|
-
|
513
|
+
# Next Server IP Address
|
514
514
|
0x00, 0x00, 0x00, 0x00,
|
515
|
-
|
515
|
+
# Relay Agent IP Address
|
516
516
|
0x00, 0x00, 0x00, 0x00,
|
517
|
-
|
517
|
+
# Client MAC Address
|
518
518
|
0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
|
519
|
-
|
519
|
+
# Client Hw Address Padding
|
520
520
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
521
|
-
|
521
|
+
# Server Host Name
|
522
522
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
523
523
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
524
524
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -527,7 +527,7 @@ describe Pio::Dhcp, '.read' do
|
|
527
527
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
528
528
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
529
529
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
530
|
-
|
530
|
+
# Boot File Name
|
531
531
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
532
532
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
533
533
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
@@ -544,23 +544,23 @@ describe Pio::Dhcp, '.read' do
|
|
544
544
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
545
545
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
546
546
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
547
|
-
|
547
|
+
# Magic Cookie
|
548
548
|
0x63, 0x82, 0x53, 0x63,
|
549
|
-
|
549
|
+
# DHCP Msg Type
|
550
550
|
0x35, 0x01, 0x05,
|
551
|
-
|
551
|
+
# Renewal Time Value
|
552
552
|
0x3a, 0x04, 0xde, 0xad, 0xbe, 0xef,
|
553
|
-
|
553
|
+
# Rebinding Time Value
|
554
554
|
0x3b, 0x04, 0xde, 0xad, 0xbe, 0xef,
|
555
|
-
|
555
|
+
# IP Address Lease Time Value
|
556
556
|
0x33, 0x04, 0xde, 0xad, 0xbe, 0xef,
|
557
|
-
|
557
|
+
# DHCP Server Identifier
|
558
558
|
0x36, 0x04, 0xc0, 0xa8, 0x00, 0x0a,
|
559
|
-
|
559
|
+
# Subnet Mask
|
560
560
|
0x01, 0x04, 0xff, 0xff, 0xff, 0x00,
|
561
|
-
|
561
|
+
# End Option
|
562
562
|
0xff,
|
563
|
-
|
563
|
+
# Padding Field
|
564
564
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
565
565
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
566
566
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|