pio 0.18.2 → 0.19.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 +3 -0
- data/README.md +40 -344
- data/Rakefile +32 -0
- data/bin/_guard-core +16 -0
- data/bin/byebug +16 -0
- data/bin/cc-tddium-post-worker +16 -0
- data/bin/cdiff +16 -0
- data/bin/coderay +16 -0
- data/bin/colortab +16 -0
- data/bin/coveralls +16 -0
- data/bin/cucumber +16 -0
- data/bin/decolor +16 -0
- data/bin/flay +16 -0
- data/bin/flog +16 -0
- data/bin/guard +16 -0
- data/bin/htmldiff +16 -0
- data/bin/inch +16 -0
- data/bin/ldiff +16 -0
- data/bin/listen +16 -0
- data/bin/minitar +16 -0
- data/bin/pry +16 -0
- data/bin/rake +16 -0
- data/bin/reek +16 -0
- data/bin/relish +16 -0
- data/bin/restclient +16 -0
- data/bin/rspec +16 -0
- data/bin/rubocop +16 -0
- data/bin/ruby-parse +16 -0
- data/bin/ruby-rewrite +16 -0
- data/bin/ruby_parse +16 -0
- data/bin/ruby_parse_extract_error +16 -0
- data/bin/sparkr +16 -0
- data/bin/term_display +16 -0
- data/bin/term_mandel +16 -0
- data/bin/thor +16 -0
- data/bin/unparser +16 -0
- data/bin/yard +16 -0
- data/bin/yardoc +16 -0
- data/bin/yri +16 -0
- data/features/arp.feature +61 -0
- data/features/dhcp.feature +4 -0
- data/features/icmp.feature +130 -0
- data/features/lldp.feature +47 -0
- data/features/open_flow10/echo_reply.feature +95 -0
- data/features/open_flow10/echo_request.feature +95 -0
- data/features/open_flow10/exact_match.feature +36 -0
- data/features/{features_read.feature → open_flow10/features_reply.feature} +54 -17
- data/features/open_flow10/features_request.feature +79 -0
- data/features/{flow_mod_read.feature → open_flow10/flow_mod.feature} +16 -21
- data/features/open_flow10/hello.feature +79 -0
- data/features/open_flow10/packet_in.feature +58 -0
- data/features/{packet_out_read.feature → open_flow10/packet_out.feature} +4 -5
- data/features/open_flow10/port_status.feature +23 -0
- data/features/open_flow13/echo_reply.feature +115 -0
- data/features/open_flow13/echo_request.feature +115 -0
- data/features/open_flow13/hello.feature +74 -0
- data/features/packet_data/echo13_reply_body.raw +0 -0
- data/features/packet_data/echo13_reply_no_body.raw +0 -0
- data/features/packet_data/echo13_request_body.raw +0 -0
- data/features/packet_data/echo13_request_no_body.raw +0 -0
- data/features/packet_data/hello13_no_version_bitmap.raw +0 -0
- data/features/packet_data/hello13_version_bitmap.raw +0 -0
- data/features/packet_data/udp_no_payload.raw +0 -0
- data/features/packet_data/udp_with_payload.raw +0 -0
- data/features/step_definitions/packet_data_steps.rb +49 -29
- data/features/support/env.rb +3 -0
- data/features/{udp_read.feature → udp.feature} +3 -4
- data/lib/pio.rb +1 -0
- data/lib/pio/echo.rb +67 -0
- data/lib/pio/hello13.rb +111 -0
- data/lib/pio/open_flow/message.rb +2 -1
- data/lib/pio/open_flow/open_flow_header.rb +21 -38
- data/lib/pio/open_flow/transaction_id.rb +25 -0
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +9 -14
- data/spec/pio/flow_mod_spec.rb +1 -1
- data/spec/pio/hello13_spec.rb +114 -0
- metadata +182 -138
- data/examples/arp_new.rb +0 -16
- data/examples/arp_read.rb +0 -4
- data/examples/dhcp_new.rb +0 -34
- data/examples/dhcp_read.rb +0 -4
- data/examples/echo_new.rb +0 -9
- data/examples/echo_read.rb +0 -4
- data/examples/features_new.rb +0 -28
- data/examples/features_read.rb +0 -4
- data/examples/flow_mod_new.rb +0 -13
- data/examples/flow_mod_read.rb +0 -6
- data/examples/hello_new.rb +0 -4
- data/examples/hello_read.rb +0 -4
- data/examples/icmp_new.rb +0 -21
- data/examples/icmp_read.rb +0 -4
- data/examples/lldp_new.rb +0 -4
- data/examples/lldp_read.rb +0 -4
- data/examples/packet_in_new.rb +0 -17
- data/examples/packet_in_read.rb +0 -5
- data/examples/packet_out_new.rb +0 -18
- data/examples/packet_out_read.rb +0 -6
- data/features/arp_read.feature +0 -10
- data/features/dhcp_read.feature +0 -6
- data/features/echo_read.feature +0 -29
- data/features/exact_match.feature +0 -38
- data/features/hello_read.feature +0 -14
- data/features/icmp_read.feature +0 -55
- data/features/lldp_read.feature +0 -26
- data/features/packet_in_read.feature +0 -22
- data/features/port_status_read.feature +0 -24
- data/features/step_definitions/pending_steps.rb +0 -3
- data/spec/pio/echo/reply_spec.rb +0 -135
- data/spec/pio/echo/request_spec.rb +0 -137
- data/spec/pio/features/reply_spec.rb +0 -137
- data/spec/pio/features/request_spec.rb +0 -112
- data/spec/pio/hello_spec.rb +0 -106
- data/spec/pio/lldp_spec.rb +0 -244
- data/spec/pio/packet_in_spec.rb +0 -146
data/bin/ruby-rewrite
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'ruby-rewrite' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('parser', 'ruby-rewrite')
|
data/bin/ruby_parse
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'ruby_parse' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('ruby_parser', 'ruby_parse')
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'ruby_parse_extract_error' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('ruby_parser', 'ruby_parse_extract_error')
|
data/bin/sparkr
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'sparkr' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('sparkr', 'sparkr')
|
data/bin/term_display
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'term_display' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('term-ansicolor', 'term_display')
|
data/bin/term_mandel
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'term_mandel' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('term-ansicolor', 'term_mandel')
|
data/bin/thor
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'thor' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('thor', 'thor')
|
data/bin/unparser
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'unparser' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('unparser', 'unparser')
|
data/bin/yard
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'yard' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('yard', 'yard')
|
data/bin/yardoc
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'yardoc' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('yard', 'yardoc')
|
data/bin/yri
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# This file was generated by Bundler.
|
|
4
|
+
#
|
|
5
|
+
# The application 'yri' is installed as part of a gem, and
|
|
6
|
+
# this file is here to facilitate running it.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
require 'pathname'
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
|
11
|
+
Pathname.new(__FILE__).realpath)
|
|
12
|
+
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'bundler/setup'
|
|
15
|
+
|
|
16
|
+
load Gem.bin_path('yard', 'yri')
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Feature: ARP
|
|
2
|
+
Scenario: create an ARP request
|
|
3
|
+
When I try to create a packet with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Arp::Request.new(
|
|
6
|
+
source_mac: '00:26:82:eb:ea:d1',
|
|
7
|
+
sender_protocol_address: '192.168.83.3',
|
|
8
|
+
target_protocol_address: '192.168.83.254'
|
|
9
|
+
)
|
|
10
|
+
"""
|
|
11
|
+
Then it should finish successfully
|
|
12
|
+
And the packet have the following fields and values:
|
|
13
|
+
| field | value |
|
|
14
|
+
| class | Pio::Arp::Request |
|
|
15
|
+
| destination_mac | ff:ff:ff:ff:ff:ff |
|
|
16
|
+
| source_mac | 00:26:82:eb:ea:d1 |
|
|
17
|
+
| ether_type | 2054 |
|
|
18
|
+
| hardware_type | 1 |
|
|
19
|
+
| protocol_type | 2048 |
|
|
20
|
+
| hardware_length | 6 |
|
|
21
|
+
| protocol_length | 4 |
|
|
22
|
+
| operation | 1 |
|
|
23
|
+
| sender_hardware_address | 00:26:82:eb:ea:d1 |
|
|
24
|
+
| sender_protocol_address | 192.168.83.3 |
|
|
25
|
+
| target_hardware_address | 00:00:00:00:00:00 |
|
|
26
|
+
| target_protocol_address | 192.168.83.254 |
|
|
27
|
+
|
|
28
|
+
Scenario: create an ARP reply
|
|
29
|
+
When I try to create a packet with:
|
|
30
|
+
"""
|
|
31
|
+
Pio::Arp::Reply.new(
|
|
32
|
+
source_mac: '00:16:9d:1d:9c:c4',
|
|
33
|
+
destination_mac: '00:26:82:eb:ea:d1',
|
|
34
|
+
sender_protocol_address: '192.168.83.254',
|
|
35
|
+
target_protocol_address: '192.168.83.3'
|
|
36
|
+
)
|
|
37
|
+
"""
|
|
38
|
+
Then it should finish successfully
|
|
39
|
+
And the packet have the following fields and values:
|
|
40
|
+
| field | value |
|
|
41
|
+
| class | Pio::Arp::Reply |
|
|
42
|
+
| destination_mac | 00:26:82:eb:ea:d1 |
|
|
43
|
+
| source_mac | 00:16:9d:1d:9c:c4 |
|
|
44
|
+
| ether_type | 2054 |
|
|
45
|
+
| hardware_type | 1 |
|
|
46
|
+
| protocol_type | 2048 |
|
|
47
|
+
| hardware_length | 6 |
|
|
48
|
+
| protocol_length | 4 |
|
|
49
|
+
| operation | 2 |
|
|
50
|
+
| sender_hardware_address | 00:16:9d:1d:9c:c4 |
|
|
51
|
+
| sender_protocol_address | 192.168.83.254 |
|
|
52
|
+
| target_hardware_address | 00:26:82:eb:ea:d1 |
|
|
53
|
+
| target_protocol_address | 192.168.83.3 |
|
|
54
|
+
|
|
55
|
+
Scenario: parse arp.pcap
|
|
56
|
+
When I try to parse a file named "arp.pcap" with "Pio::Arp" class
|
|
57
|
+
Then it should finish successfully
|
|
58
|
+
|
|
59
|
+
Scenario: parse arp-storm.pcap
|
|
60
|
+
When I try to parse a file named "arp-storm.pcap" with "Pio::Arp" class
|
|
61
|
+
Then it should finish successfully
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Feature: ICMP
|
|
2
|
+
Scenario: create an ICMP request
|
|
3
|
+
When I try to create a packet with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Icmp::Request.new(
|
|
6
|
+
source_mac: '00:16:9d:1d:9c:c4',
|
|
7
|
+
destination_mac: '00:26:82:eb:ea:d1',
|
|
8
|
+
ip_source_address: '192.168.83.3',
|
|
9
|
+
ip_destination_address: '192.168.83.254'
|
|
10
|
+
)
|
|
11
|
+
"""
|
|
12
|
+
Then it should finish successfully
|
|
13
|
+
And the packet have the following fields and values:
|
|
14
|
+
| field | value |
|
|
15
|
+
| class | Pio::Icmp::Request |
|
|
16
|
+
| destination_mac | 00:26:82:eb:ea:d1 |
|
|
17
|
+
| source_mac | 00:16:9d:1d:9c:c4 |
|
|
18
|
+
| ether_type | 2048 |
|
|
19
|
+
| ip_version | 4 |
|
|
20
|
+
| ip_header_length | 5 |
|
|
21
|
+
| ip_type_of_service | 0 |
|
|
22
|
+
| ip_total_length | 50 |
|
|
23
|
+
| ip_identifier | 0 |
|
|
24
|
+
| ip_flag | 0 |
|
|
25
|
+
| ip_fragment | 0 |
|
|
26
|
+
| ip_ttl | 128 |
|
|
27
|
+
| ip_protocol | 1 |
|
|
28
|
+
| ip_header_checksum | 4729 |
|
|
29
|
+
| ip_source_address | 192.168.83.3 |
|
|
30
|
+
| ip_destination_address | 192.168.83.254 |
|
|
31
|
+
| ip_option | |
|
|
32
|
+
| icmp_type | 8 |
|
|
33
|
+
| icmp_code | 0 |
|
|
34
|
+
| icmp_checksum | 63231 |
|
|
35
|
+
| icmp_identifier | 256 |
|
|
36
|
+
| icmp_sequence_number | 0 |
|
|
37
|
+
| echo_data | |
|
|
38
|
+
|
|
39
|
+
Scenario: create an ICMP reply
|
|
40
|
+
When I try to create a packet with:
|
|
41
|
+
"""
|
|
42
|
+
Pio::Icmp::Reply.new(
|
|
43
|
+
source_mac: '00:26:82:eb:ea:d1',
|
|
44
|
+
destination_mac: '00:16:9d:1d:9c:c4',
|
|
45
|
+
ip_source_address: '192.168.83.254',
|
|
46
|
+
ip_destination_address: '192.168.83.3',
|
|
47
|
+
identifier: 256,
|
|
48
|
+
sequence_number: 0
|
|
49
|
+
)
|
|
50
|
+
"""
|
|
51
|
+
Then it should finish successfully
|
|
52
|
+
And the packet have the following fields and values:
|
|
53
|
+
| field | value |
|
|
54
|
+
| class | Pio::Icmp::Reply |
|
|
55
|
+
| destination_mac | 00:16:9d:1d:9c:c4 |
|
|
56
|
+
| source_mac | 00:26:82:eb:ea:d1 |
|
|
57
|
+
| ether_type | 2048 |
|
|
58
|
+
| ip_version | 4 |
|
|
59
|
+
| ip_header_length | 5 |
|
|
60
|
+
| ip_type_of_service | 0 |
|
|
61
|
+
| ip_total_length | 50 |
|
|
62
|
+
| ip_identifier | 0 |
|
|
63
|
+
| ip_flag | 0 |
|
|
64
|
+
| ip_fragment | 0 |
|
|
65
|
+
| ip_ttl | 128 |
|
|
66
|
+
| ip_protocol | 1 |
|
|
67
|
+
| ip_header_checksum | 4729 |
|
|
68
|
+
| ip_source_address | 192.168.83.254 |
|
|
69
|
+
| ip_destination_address | 192.168.83.3 |
|
|
70
|
+
| ip_option | |
|
|
71
|
+
| icmp_type | 0 |
|
|
72
|
+
| icmp_code | 0 |
|
|
73
|
+
| icmp_checksum | 65279 |
|
|
74
|
+
| icmp_identifier | 256 |
|
|
75
|
+
| icmp_sequence_number | 0 |
|
|
76
|
+
| echo_data | |
|
|
77
|
+
|
|
78
|
+
Scenario: parse icmp.pcap
|
|
79
|
+
When I try to parse a file named "icmp.pcap" with "Pio::Icmp" class
|
|
80
|
+
Then it should finish successfully
|
|
81
|
+
And the message #1 have the following fields and values:
|
|
82
|
+
| field | value |
|
|
83
|
+
| class | Pio::Icmp::Request |
|
|
84
|
+
| destination_mac | 00:13:46:0b:22:ba |
|
|
85
|
+
| source_mac | 00:16:ce:6e:8b:24 |
|
|
86
|
+
| ether_type | 2048 |
|
|
87
|
+
| ip_version | 4 |
|
|
88
|
+
| ip_header_length | 5 |
|
|
89
|
+
| ip_type_of_service | 0 |
|
|
90
|
+
| ip_total_length | 60 |
|
|
91
|
+
| ip_identifier | 36507 |
|
|
92
|
+
| ip_flag | 0 |
|
|
93
|
+
| ip_fragment | 0 |
|
|
94
|
+
| ip_ttl | 128 |
|
|
95
|
+
| ip_protocol | 1 |
|
|
96
|
+
| ip_header_checksum | 10850 |
|
|
97
|
+
| ip_source_address | 192.168.0.114 |
|
|
98
|
+
| ip_destination_address | 192.168.0.1 |
|
|
99
|
+
| ip_option | |
|
|
100
|
+
| icmp_type | 8 |
|
|
101
|
+
| icmp_code | 0 |
|
|
102
|
+
| icmp_checksum | 18780 |
|
|
103
|
+
| icmp_identifier | 768 |
|
|
104
|
+
| icmp_sequence_number | 256 |
|
|
105
|
+
| echo_data | abcdefghijklmnopqrstuvwabcdefghi |
|
|
106
|
+
And the message #2 have the following fields and values:
|
|
107
|
+
| field | value |
|
|
108
|
+
| class | Pio::Icmp::Reply |
|
|
109
|
+
| destination_mac | 00:16:ce:6e:8b:24 |
|
|
110
|
+
| source_mac | 00:13:46:0b:22:ba |
|
|
111
|
+
| ether_type | 2048 |
|
|
112
|
+
| ip_version | 4 |
|
|
113
|
+
| ip_header_length | 5 |
|
|
114
|
+
| ip_type_of_service | 0 |
|
|
115
|
+
| ip_total_length | 60 |
|
|
116
|
+
| ip_identifier | 24150 |
|
|
117
|
+
| ip_flag | 0 |
|
|
118
|
+
| ip_fragment | 0 |
|
|
119
|
+
| ip_ttl | 127 |
|
|
120
|
+
| ip_protocol | 1 |
|
|
121
|
+
| ip_header_checksum | 23463 |
|
|
122
|
+
| ip_source_address | 192.168.0.1 |
|
|
123
|
+
| ip_destination_address | 192.168.0.114 |
|
|
124
|
+
| ip_option | |
|
|
125
|
+
| icmp_type | 0 |
|
|
126
|
+
| icmp_code | 0 |
|
|
127
|
+
| icmp_checksum | 20828 |
|
|
128
|
+
| icmp_identifier | 768 |
|
|
129
|
+
| icmp_sequence_number | 256 |
|
|
130
|
+
| echo_data | abcdefghijklmnopqrstuvwabcdefghi |
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Feature: LLDP
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Lldp.new(dpid: 0x123, port_number: 12, source_mac: '11:22:33:44:55:66')
|
|
6
|
+
"""
|
|
7
|
+
Then it should finish successfully
|
|
8
|
+
And the message have the following fields and values:
|
|
9
|
+
| field | value |
|
|
10
|
+
| class | Pio::Lldp |
|
|
11
|
+
| destination_mac | 01:80:c2:00:00:0e |
|
|
12
|
+
| source_mac | 11:22:33:44:55:66 |
|
|
13
|
+
| ether_type | 35020 |
|
|
14
|
+
| chassis_id | 291 |
|
|
15
|
+
| dpid | 291 |
|
|
16
|
+
| port_id | 12 |
|
|
17
|
+
| ttl | 120 |
|
|
18
|
+
| port_description | |
|
|
19
|
+
| system_name | |
|
|
20
|
+
| system_description | |
|
|
21
|
+
| system_capabilities | |
|
|
22
|
+
| management_address | |
|
|
23
|
+
| organizationally_specific | |
|
|
24
|
+
|
|
25
|
+
Scenario: parse
|
|
26
|
+
When I try to parse a file named "lldp.minimal.pcap" with "Lldp" class
|
|
27
|
+
Then it should finish successfully
|
|
28
|
+
Then the message #1 have the following fields and values:
|
|
29
|
+
| field | value |
|
|
30
|
+
| class | Pio::Lldp |
|
|
31
|
+
| destination_mac | 01:80:c2:00:00:0e |
|
|
32
|
+
| source_mac | 00:04:96:1f:a7:26 |
|
|
33
|
+
| ether_type | 35020 |
|
|
34
|
+
| chassis_id | 19698525990 |
|
|
35
|
+
| dpid | 19698525990 |
|
|
36
|
+
| port_id | 1/3 |
|
|
37
|
+
| ttl | 120 |
|
|
38
|
+
| port_description | |
|
|
39
|
+
| system_name | |
|
|
40
|
+
| system_description | |
|
|
41
|
+
| system_capabilities | |
|
|
42
|
+
| management_address | |
|
|
43
|
+
| organizationally_specific | |
|
|
44
|
+
|
|
45
|
+
Scenario: parse 2
|
|
46
|
+
When I try to parse a file named "lldp.detailed.pcap" with "Lldp" class
|
|
47
|
+
Then it should finish successfully
|