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
data/spec/pio/icmp_spec.rb
CHANGED
@@ -10,43 +10,43 @@ describe Pio::Icmp, '.read' do
|
|
10
10
|
context 'with an ICMP request frame' do
|
11
11
|
Given(:icmp_request_dump) do
|
12
12
|
[
|
13
|
-
|
13
|
+
# Destination MAC
|
14
14
|
0x24, 0xdb, 0xac, 0x41, 0xe5, 0x5b,
|
15
|
-
|
15
|
+
# Source MAC
|
16
16
|
0x00, 0x26, 0x82, 0xeb, 0xea, 0xd1,
|
17
|
-
|
17
|
+
# EtherType
|
18
18
|
0x08, 0x00,
|
19
|
-
|
19
|
+
# IP Version&IP Header Length
|
20
20
|
0x45,
|
21
|
-
|
21
|
+
# IP Type Of Service
|
22
22
|
0x00,
|
23
|
-
|
23
|
+
# IP Total Length
|
24
24
|
0x00, 0x3c,
|
25
|
-
|
25
|
+
# IP Identifier
|
26
26
|
0x39, 0xd3,
|
27
|
-
|
27
|
+
# IP Flag&IP Fragment
|
28
28
|
0x00, 0x00,
|
29
|
-
|
29
|
+
# IP TTL
|
30
30
|
0x80,
|
31
|
-
|
31
|
+
# IP Protocol
|
32
32
|
0x01,
|
33
|
-
|
33
|
+
# IP Header Checksum
|
34
34
|
0x2e, 0xd0,
|
35
|
-
|
35
|
+
# IP Source Address
|
36
36
|
0xc0, 0xa8, 0x01, 0x66,
|
37
|
-
|
37
|
+
# IP Destination Address
|
38
38
|
0x08, 0x08, 0x08, 0x08,
|
39
|
-
|
39
|
+
# ICMP Type
|
40
40
|
0x08,
|
41
|
-
|
41
|
+
# ICMP Code
|
42
42
|
0x00,
|
43
|
-
|
43
|
+
# ICMP Checksum
|
44
44
|
0x4c, 0x5b,
|
45
|
-
|
45
|
+
# ICMP Identifier
|
46
46
|
0x01, 0x00,
|
47
|
-
|
47
|
+
# ICMP Sequence Number
|
48
48
|
0x00, 0x01,
|
49
|
-
|
49
|
+
# Echo Data
|
50
50
|
0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
|
51
51
|
0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c,
|
52
52
|
0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72,
|
@@ -86,41 +86,41 @@ describe Pio::Icmp, '.read' do
|
|
86
86
|
context 'with an ICMP reply frame' do
|
87
87
|
Given(:icmp_reply_dump) do
|
88
88
|
[
|
89
|
-
|
89
|
+
# Destination MAC
|
90
90
|
0x00, 0x26, 0x82, 0xeb, 0xea, 0xd1,
|
91
|
-
|
91
|
+
# Source MAC
|
92
92
|
0x24, 0xdb, 0xac, 0x41, 0xe5, 0x5b,
|
93
|
-
|
93
|
+
# EtherType
|
94
94
|
0x08, 0x00,
|
95
|
-
|
95
|
+
# IP Version&IP Header Length
|
96
96
|
0x45,
|
97
|
-
|
97
|
+
# IP Type Of Service
|
98
98
|
0x00,
|
99
|
-
|
99
|
+
# IP Total Length
|
100
100
|
0x00, 0x3c,
|
101
|
-
|
101
|
+
# IP Identifier
|
102
102
|
0x00, 0x00,
|
103
|
-
|
103
|
+
# IP Flag&IP Fragment
|
104
104
|
0x00, 0x00,
|
105
|
-
|
105
|
+
# IP TTL
|
106
106
|
0x2d,
|
107
|
-
|
107
|
+
# IP Protocol
|
108
108
|
0x01,
|
109
|
-
|
109
|
+
# IP Header Checksum
|
110
110
|
0xbb, 0xa3,
|
111
|
-
|
111
|
+
# IP Source Address
|
112
112
|
0x08, 0x08, 0x08, 0x08,
|
113
|
-
|
113
|
+
# IP Destination Address
|
114
114
|
0xc0, 0xa8, 0x01, 0x66,
|
115
|
-
|
115
|
+
# ICMP Type
|
116
116
|
0x00,
|
117
|
-
|
117
|
+
# ICMP Code
|
118
118
|
0x00,
|
119
|
-
|
119
|
+
# ICMP Checksum
|
120
120
|
0x54, 0x5b,
|
121
|
-
|
121
|
+
# ICMP Identifier
|
122
122
|
0x01, 0x00,
|
123
|
-
|
123
|
+
# ICMP Sequence Number
|
124
124
|
0x00, 0x01,
|
125
125
|
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a,
|
126
126
|
0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74,
|
data/spec/pio/lldp_spec.rb
CHANGED
@@ -19,21 +19,21 @@ describe Pio::Lldp do
|
|
19
19
|
Then do
|
20
20
|
result ==
|
21
21
|
[
|
22
|
-
|
22
|
+
# Destination MAC
|
23
23
|
0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e,
|
24
|
-
|
24
|
+
# Source MAC
|
25
25
|
0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
|
26
|
-
|
26
|
+
# Ethertype
|
27
27
|
0x88, 0xcc,
|
28
|
-
|
28
|
+
# Chassis ID TLV
|
29
29
|
0x02, 0x09, 0x07, 0x00, 0x00, 0x00, 0x19, 0x2f, 0xa7, 0xb2, 0x8d,
|
30
|
-
|
30
|
+
# Port ID TLV
|
31
31
|
0x04, 0x05, 0x07, 0x00, 0x00, 0x00, 0x01,
|
32
|
-
|
32
|
+
# Time to live TLV
|
33
33
|
0x06, 0x02, 0x00, 0x78,
|
34
|
-
|
34
|
+
# End of LLDPDU TLV
|
35
35
|
0x00, 0x00,
|
36
|
-
|
36
|
+
# Padding
|
37
37
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
38
38
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
39
39
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
@@ -58,21 +58,21 @@ describe Pio::Lldp do
|
|
58
58
|
Then do
|
59
59
|
result ==
|
60
60
|
[
|
61
|
-
|
61
|
+
# Destination MAC
|
62
62
|
0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e,
|
63
|
-
|
63
|
+
# Source MAC
|
64
64
|
0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
|
65
|
-
|
65
|
+
# Ethertype
|
66
66
|
0x88, 0xcc,
|
67
|
-
|
67
|
+
# Chassis ID TLV
|
68
68
|
0x02, 0x09, 0x07, 0x00, 0x00, 0x00, 0x19, 0x2f, 0xa7, 0xb2, 0x8d,
|
69
|
-
|
69
|
+
# Port ID TLV
|
70
70
|
0x04, 0x05, 0x07, 0x00, 0x00, 0x00, 0x01,
|
71
|
-
|
71
|
+
# Time to live TLV
|
72
72
|
0x06, 0x02, 0x00, 0x78,
|
73
|
-
|
73
|
+
# End of LLDPDU TLV
|
74
74
|
0x00, 0x00,
|
75
|
-
|
75
|
+
# Padding
|
76
76
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
77
77
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
78
78
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
@@ -98,21 +98,21 @@ describe Pio::Lldp do
|
|
98
98
|
Then do
|
99
99
|
result ==
|
100
100
|
[
|
101
|
-
|
101
|
+
# Destination MAC
|
102
102
|
0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
|
103
|
-
|
103
|
+
# Source MAC
|
104
104
|
0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
|
105
|
-
|
105
|
+
# Ethertype
|
106
106
|
0x88, 0xcc,
|
107
|
-
|
107
|
+
# Chassis ID TLV
|
108
108
|
0x02, 0x09, 0x07, 0x00, 0x00, 0x00, 0x19, 0x2f, 0xa7, 0xb2, 0x8d,
|
109
|
-
|
109
|
+
# Port ID TLV
|
110
110
|
0x04, 0x05, 0x07, 0x00, 0x00, 0x00, 0x01,
|
111
|
-
|
111
|
+
# Time to live TLV
|
112
112
|
0x06, 0x02, 0x00, 0x78,
|
113
|
-
|
113
|
+
# End of LLDPDU TLV
|
114
114
|
0x00, 0x00,
|
115
|
-
|
115
|
+
# Padding
|
116
116
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
117
117
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
118
118
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
@@ -127,20 +127,20 @@ describe Pio::Lldp do
|
|
127
127
|
context 'with a minimum LLDP frame' do
|
128
128
|
Given(:lldp_dump) do
|
129
129
|
[
|
130
|
-
|
130
|
+
# Destination MAC
|
131
131
|
0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e,
|
132
|
-
|
132
|
+
# Source MAC
|
133
133
|
0x00, 0x19, 0x2f, 0xa7, 0xb2, 0x8d,
|
134
|
-
|
134
|
+
# Ethertype
|
135
135
|
0x88, 0xcc,
|
136
|
-
|
136
|
+
# Chassis ID TLV
|
137
137
|
0x02, 0x07, 0x04, 0x00, 0x19, 0x2f, 0xa7, 0xb2, 0x8d,
|
138
|
-
|
138
|
+
# Port ID TLV
|
139
139
|
0x04, 0x0d, 0x01, 0x55, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x20,
|
140
140
|
0x74, 0x6f, 0x20, 0x53, 0x31,
|
141
|
-
|
141
|
+
# Time to live TLV
|
142
142
|
0x06, 0x02, 0x00, 0x78,
|
143
|
-
|
143
|
+
# End of LLDPDU TLV
|
144
144
|
0x00, 0x00
|
145
145
|
].pack('C*')
|
146
146
|
end
|
@@ -166,27 +166,27 @@ describe Pio::Lldp do
|
|
166
166
|
context 'with a detailed LLDP frame' do
|
167
167
|
Given(:lldp_dump) do
|
168
168
|
[
|
169
|
-
|
169
|
+
# Destination MAC
|
170
170
|
0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e,
|
171
|
-
|
171
|
+
# Source MAC
|
172
172
|
0x00, 0x19, 0x2f, 0xa7, 0xb2, 0x8d,
|
173
|
-
|
173
|
+
# Ethertype
|
174
174
|
0x88, 0xcc,
|
175
|
-
|
175
|
+
# Chassis ID TLV
|
176
176
|
0x02, 0x07, 0x04, 0x00, 0x19, 0x2f, 0xa7, 0xb2, 0x8d,
|
177
|
-
|
177
|
+
# Port ID TLV
|
178
178
|
0x04, 0x0d, 0x01, 0x55, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x20,
|
179
179
|
0x74, 0x6f, 0x20, 0x53, 0x31,
|
180
|
-
|
180
|
+
# Time to live TLV
|
181
181
|
0x06, 0x02, 0x00, 0x78,
|
182
|
-
|
182
|
+
# Port Description
|
183
183
|
0x08, 0x17, 0x53, 0x75, 0x6d, 0x6d, 0x69, 0x74, 0x33, 0x30,
|
184
184
|
0x30, 0x2d, 0x34, 0x38, 0x2d, 0x50, 0x6f, 0x72, 0x74, 0x20,
|
185
185
|
0x31, 0x30, 0x30, 0x31, 0x00,
|
186
|
-
|
186
|
+
# System Name
|
187
187
|
0x0a, 0x0d, 0x53, 0x75, 0x6d, 0x6d, 0x69, 0x74, 0x33, 0x30,
|
188
188
|
0x30, 0x2d, 0x34, 0x38, 0x00,
|
189
|
-
|
189
|
+
# System Description
|
190
190
|
0x0c, 0x4c, 0x53, 0x75, 0x6d, 0x6d, 0x69, 0x74, 0x33, 0x30,
|
191
191
|
0x30, 0x2d, 0x34, 0x38, 0x20, 0x2d, 0x20, 0x56, 0x65, 0x72,
|
192
192
|
0x73, 0x69, 0x6f, 0x6e, 0x20, 0x37, 0x2e, 0x34, 0x65, 0x2e,
|
@@ -195,14 +195,14 @@ describe Pio::Lldp do
|
|
195
195
|
0x73, 0x65, 0x5f, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20,
|
196
196
|
0x30, 0x35, 0x2f, 0x32, 0x37, 0x2f, 0x30, 0x35, 0x20, 0x30,
|
197
197
|
0x34, 0x3a, 0x35, 0x33, 0x3a, 0x31, 0x31, 0x00,
|
198
|
-
|
198
|
+
# System Capabilities
|
199
199
|
0x0e, 0x04, 0x00, 0x14, 0x00, 0x14,
|
200
|
-
|
200
|
+
# Management Address
|
201
201
|
0x10, 0x0e, 0x07, 0x06, 0x00, 0x01, 0x30, 0xf9, 0xad, 0xa0,
|
202
202
|
0x02, 0x00, 0x00, 0x03, 0xe9, 0x00,
|
203
|
-
|
203
|
+
# Organizationally Specific
|
204
204
|
0xfe, 0x07, 0x00, 0x12, 0x0f, 0x02, 0x07, 0x01, 0x00,
|
205
|
-
|
205
|
+
# End of LLDPDU TLV
|
206
206
|
0x00, 0x00
|
207
207
|
].pack('C*')
|
208
208
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yasuhito Takamiya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -209,49 +209,49 @@ signing_key:
|
|
209
209
|
specification_version: 4
|
210
210
|
summary: Packet parser and generator.
|
211
211
|
test_files:
|
212
|
-
- spec/pio/
|
213
|
-
- spec/pio/
|
214
|
-
- spec/pio/
|
215
|
-
- spec/pio/
|
216
|
-
- spec/pio/
|
212
|
+
- spec/pio/features/request_spec.rb
|
213
|
+
- spec/pio/features/reply_spec.rb
|
214
|
+
- spec/pio/ipv4_address_spec.rb
|
215
|
+
- spec/pio/hello_spec.rb
|
216
|
+
- spec/pio/dhcp/request_spec.rb
|
217
|
+
- spec/pio/dhcp/offer_spec.rb
|
217
218
|
- spec/pio/dhcp/ack_spec.rb
|
218
219
|
- spec/pio/dhcp/discover_spec.rb
|
219
|
-
- spec/pio/dhcp/offer_spec.rb
|
220
|
-
- spec/pio/dhcp/request_spec.rb
|
221
|
-
- spec/pio/dhcp_spec.rb
|
222
|
-
- spec/pio/echo/reply_spec.rb
|
223
|
-
- spec/pio/echo/request_spec.rb
|
224
|
-
- spec/pio/echo_spec.rb
|
225
|
-
- spec/pio/features/reply_spec.rb
|
226
|
-
- spec/pio/features/request_spec.rb
|
227
220
|
- spec/pio/features_spec.rb
|
228
|
-
- spec/pio/
|
229
|
-
- spec/pio/
|
221
|
+
- spec/pio/echo_spec.rb
|
222
|
+
- spec/pio/arp/request_spec.rb
|
223
|
+
- spec/pio/arp/reply/options_spec.rb
|
224
|
+
- spec/pio/arp/request/options_spec.rb
|
225
|
+
- spec/pio/arp/reply_spec.rb
|
226
|
+
- spec/pio/lldp/options_spec.rb
|
227
|
+
- spec/pio/mac_spec.rb
|
230
228
|
- spec/pio/icmp/request_spec.rb
|
229
|
+
- spec/pio/icmp/reply_spec.rb
|
231
230
|
- spec/pio/icmp_spec.rb
|
232
|
-
- spec/pio/
|
233
|
-
- spec/pio/lldp/options_spec.rb
|
231
|
+
- spec/pio/dhcp_spec.rb
|
234
232
|
- spec/pio/lldp_spec.rb
|
235
|
-
- spec/pio/
|
233
|
+
- spec/pio/arp_spec.rb
|
234
|
+
- spec/pio/echo/request_spec.rb
|
235
|
+
- spec/pio/echo/reply_spec.rb
|
236
236
|
- spec/spec_helper.rb
|
237
|
-
- features/arp_read.feature
|
238
|
-
- features/dhcp_read.feature
|
239
|
-
- features/echo_read.feature
|
240
|
-
- features/features_read.feature
|
241
237
|
- features/hello_read.feature
|
242
|
-
- features/
|
243
|
-
- features/lldp_read.feature
|
244
|
-
- features/packet_data/arp-storm.pcap
|
245
|
-
- features/packet_data/arp.pcap
|
238
|
+
- features/support/env.rb
|
246
239
|
- features/packet_data/dhcp.pcap
|
247
|
-
- features/packet_data/echo.raw
|
248
240
|
- features/packet_data/features_reply.raw
|
241
|
+
- features/packet_data/arp.pcap
|
249
242
|
- features/packet_data/features_request.raw
|
243
|
+
- features/packet_data/echo.raw
|
244
|
+
- features/packet_data/lldp.minimal.pcap
|
250
245
|
- features/packet_data/hello.raw
|
251
246
|
- features/packet_data/icmp.pcap
|
247
|
+
- features/packet_data/arp-storm.pcap
|
252
248
|
- features/packet_data/lldp.detailed.pcap
|
253
|
-
- features/
|
254
|
-
- features/
|
249
|
+
- features/icmp_read.feature
|
250
|
+
- features/arp_read.feature
|
255
251
|
- features/step_definitions/pending_steps.rb
|
256
|
-
- features/
|
252
|
+
- features/step_definitions/packet_data_steps.rb
|
253
|
+
- features/lldp_read.feature
|
254
|
+
- features/dhcp_read.feature
|
255
|
+
- features/features_read.feature
|
256
|
+
- features/echo_read.feature
|
257
257
|
has_rdoc:
|