pio 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +24 -11
- data/Rakefile +0 -2
- data/examples/features_new.rb +17 -6
- data/features/packet_data/aggregate_stats_reply.raw +0 -0
- data/features/packet_data/aggregate_stats_request.raw +0 -0
- data/features/packet_data/barrier_reply.raw +0 -0
- data/features/packet_data/barrier_request.raw +0 -0
- data/features/packet_data/desc_stats_reply.raw +0 -0
- data/features/packet_data/desc_stats_request.raw +0 -0
- data/features/packet_data/echo_reply.raw +0 -0
- data/features/packet_data/echo_request.raw +0 -0
- data/features/packet_data/error.raw +0 -0
- data/features/packet_data/features_reply.raw +0 -0
- data/features/packet_data/flow_mod_add.raw +0 -0
- data/features/packet_data/flow_mod_delete.raw +0 -0
- data/features/packet_data/flow_removed.raw +0 -0
- data/features/packet_data/flow_stats_reply.raw +0 -0
- data/features/packet_data/flow_stats_request.raw +0 -0
- data/features/packet_data/get_config_reply.raw +0 -0
- data/features/packet_data/get_config_request.raw +0 -0
- data/features/packet_data/hello.raw +0 -0
- data/features/packet_data/packet_in.raw +0 -0
- data/features/packet_data/packet_out.raw +0 -0
- data/features/packet_data/port_mod.raw +0 -0
- data/features/packet_data/port_stats_reply.raw +0 -0
- data/features/packet_data/port_stats_request.raw +0 -0
- data/features/packet_data/port_status.raw +0 -0
- data/features/packet_data/queue_get_config_reply.raw +0 -0
- data/features/packet_data/queue_get_config_request.raw +0 -0
- data/features/packet_data/set_config.raw +0 -0
- data/features/packet_data/table_stats_reply.raw +0 -0
- data/features/packet_data/table_stats_request.raw +0 -0
- data/features/packet_data/vendor.raw +0 -0
- data/features/packet_data/vendor_stats_request.raw +0 -0
- data/features/step_definitions/packet_data_steps.rb +0 -2
- data/features/step_definitions/pending_steps.rb +0 -2
- data/features/support/env.rb +0 -2
- data/lib/pio.rb +0 -2
- data/lib/pio/arp.rb +0 -2
- data/lib/pio/arp/format.rb +0 -2
- data/lib/pio/arp/message.rb +14 -22
- data/lib/pio/arp/reply.rb +0 -2
- data/lib/pio/arp/request.rb +0 -2
- data/lib/pio/dhcp.rb +0 -2
- data/lib/pio/dhcp/ack.rb +0 -2
- data/lib/pio/dhcp/boot_reply.rb +0 -2
- data/lib/pio/dhcp/boot_reply_options.rb +0 -2
- data/lib/pio/dhcp/boot_request.rb +0 -2
- data/lib/pio/dhcp/boot_request_options.rb +0 -2
- data/lib/pio/dhcp/client_id.rb +0 -2
- data/lib/pio/dhcp/common_options.rb +0 -2
- data/lib/pio/dhcp/csum_util.rb +0 -2
- data/lib/pio/dhcp/dhcp_field.rb +0 -2
- data/lib/pio/dhcp/dhcp_tlv_options.rb +0 -2
- data/lib/pio/dhcp/discover.rb +0 -2
- data/lib/pio/dhcp/field_util.rb +0 -2
- data/lib/pio/dhcp/frame.rb +0 -2
- data/lib/pio/dhcp/message.rb +0 -2
- data/lib/pio/dhcp/offer.rb +0 -2
- data/lib/pio/dhcp/optional_tlv.rb +0 -2
- data/lib/pio/dhcp/parameter_list.rb +0 -2
- data/lib/pio/dhcp/request.rb +0 -2
- data/lib/pio/echo.rb +3 -6
- data/lib/pio/echo/format.rb +10 -6
- data/lib/pio/echo/message.rb +16 -41
- data/lib/pio/echo/reply.rb +8 -7
- data/lib/pio/echo/request.rb +6 -6
- data/lib/pio/features.rb +15 -9
- data/lib/pio/features/reply.rb +79 -44
- data/lib/pio/features/request.rb +30 -28
- data/lib/pio/hello.rb +17 -29
- data/lib/pio/hello/format.rb +8 -8
- data/lib/pio/icmp.rb +0 -2
- data/lib/pio/icmp/format.rb +0 -2
- data/lib/pio/icmp/message.rb +23 -31
- data/lib/pio/icmp/options.rb +0 -2
- data/lib/pio/icmp/reply.rb +2 -4
- data/lib/pio/icmp/request.rb +0 -2
- data/lib/pio/ipv4_address.rb +1 -5
- data/lib/pio/lldp.rb +0 -2
- data/lib/pio/lldp/chassis_id_tlv.rb +0 -2
- data/lib/pio/lldp/end_of_lldpdu_value.rb +0 -2
- data/lib/pio/lldp/frame.rb +0 -2
- data/lib/pio/lldp/management_address_value.rb +0 -2
- data/lib/pio/lldp/optional_tlv.rb +0 -2
- data/lib/pio/lldp/options.rb +0 -2
- data/lib/pio/lldp/organizationally_specific_value.rb +0 -2
- data/lib/pio/lldp/port_description_value.rb +0 -2
- data/lib/pio/lldp/port_id_tlv.rb +0 -2
- data/lib/pio/lldp/system_capabilities_value.rb +0 -2
- data/lib/pio/lldp/system_description_value.rb +0 -2
- data/lib/pio/lldp/system_name_value.rb +0 -2
- data/lib/pio/lldp/ttl_tlv.rb +0 -2
- data/lib/pio/mac.rb +2 -6
- data/lib/pio/message_type_selector.rb +5 -4
- data/lib/pio/open_flow.rb +5 -0
- data/lib/pio/open_flow/flags.rb +38 -0
- data/lib/pio/open_flow/message.rb +20 -0
- data/lib/pio/open_flow/open_flow_header.rb +18 -0
- data/lib/pio/open_flow/phy_port.rb +74 -0
- data/lib/pio/open_flow/type.rb +12 -0
- data/lib/pio/options.rb +0 -2
- data/lib/pio/parse_error.rb +0 -2
- data/lib/pio/pcap.rb +0 -2
- data/lib/pio/type/ethernet_header.rb +0 -2
- data/lib/pio/type/ip_address.rb +0 -2
- data/lib/pio/type/ipv4_header.rb +2 -2
- data/lib/pio/type/mac_address.rb +6 -3
- data/lib/pio/type/udp_header.rb +0 -2
- data/lib/pio/version.rb +1 -3
- data/pio.gemspec +18 -20
- data/spec/pio/arp/reply/options_spec.rb +0 -2
- data/spec/pio/arp/reply_spec.rb +0 -2
- data/spec/pio/arp/request/options_spec.rb +0 -2
- data/spec/pio/arp/request_spec.rb +0 -2
- data/spec/pio/arp_spec.rb +0 -2
- data/spec/pio/dhcp/ack_spec.rb +0 -2
- data/spec/pio/dhcp/discover_spec.rb +0 -2
- data/spec/pio/dhcp/offer_spec.rb +0 -2
- data/spec/pio/dhcp/request_spec.rb +0 -2
- data/spec/pio/dhcp_spec.rb +0 -2
- data/spec/pio/echo/reply_spec.rb +13 -15
- data/spec/pio/echo/request_spec.rb +15 -15
- data/spec/pio/echo_spec.rb +5 -7
- data/spec/pio/features/reply_spec.rb +47 -17
- data/spec/pio/features/request_spec.rb +6 -11
- data/spec/pio/features_spec.rb +70 -51
- data/spec/pio/hello_spec.rb +1 -3
- data/spec/pio/icmp/reply_spec.rb +0 -2
- data/spec/pio/icmp/request_spec.rb +0 -2
- data/spec/pio/icmp_spec.rb +0 -2
- data/spec/pio/ipv4_address_spec.rb +0 -2
- data/spec/pio/lldp/options_spec.rb +0 -2
- data/spec/pio/lldp_spec.rb +0 -2
- data/spec/pio/mac_spec.rb +0 -1
- data/spec/pio/open_flow/phy_port_spec.rb +25 -0
- data/spec/pio/open_flow/type_spec.rb +5 -0
- data/spec/spec_helper.rb +9 -24
- metadata +105 -40
- data/lib/pio/features/format.rb +0 -18
- data/lib/pio/features/message.rb +0 -14
- data/lib/pio/type/open_flow.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf86d154a2025304879d8c6d252b71a2eda73ef8
|
4
|
+
data.tar.gz: 18e3dda3e1ca8061b51d9ef4d8db29e0ffbde9c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a66499af05e0a468ca0d272237d6fabf489f868407d78d62c43083d30b2c7ee01e3b66cdff45533adb44e6aa11a45027e0074934a0b551de68188a53cd0cad9
|
7
|
+
data.tar.gz: 49e01b280cddef5a2400f46a19ef1d622c0da2eeeb4165c1a53fdc5e86b892b95110b027868c6def6f92127dfd95f395bb86ea51b2f162b66e7014688e90ebcb
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.8.2 (12/18/2014)
|
4
|
+
|
5
|
+
### Bugs fixed
|
6
|
+
* [#100](https://github.com/trema/pio/pull/100): Fix bug when passing `ports:` option to `Pio::Features::Request.new`.
|
7
|
+
|
8
|
+
|
3
9
|
## 0.8.1 (6/5/2014)
|
4
10
|
|
5
11
|
### Misc
|
6
|
-
|
7
12
|
* Updated bundled gems.
|
8
13
|
* Modernized Gemfile and .gemspec.
|
9
14
|
|
data/README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# Pio
|
2
2
|
|
3
|
-
<a href='https://rubygems.org/gems/pio'><img src='http://img.shields.io/gem/v/pio.svg' alt='Gem Version' /></a>
|
4
|
-
<a href='https://travis-ci.org/trema/pio'><img src='http://img.shields.io/travis/trema/pio/develop.svg' alt='Build Status' /></a>
|
5
|
-
<a href='https://codeclimate.com/github/trema/pio'><img src='http://img.shields.io/codeclimate/github/trema/pio.svg' alt='Code Climate' /></a>
|
6
|
-
<a href='https://coveralls.io/r/trema/pio?branch=develop'><img src='http://img.shields.io/coveralls/trema/pio/develop.svg' alt='Coverage Status' /></a>
|
7
|
-
<a href='https://gemnasium.com/trema/pio'><img src='
|
3
|
+
<a href='https://rubygems.org/gems/pio'><img src='http://img.shields.io/gem/v/pio.svg?style=flat' alt='Gem Version' /></a>
|
4
|
+
<a href='https://travis-ci.org/trema/pio'><img src='http://img.shields.io/travis/trema/pio/develop.svg?style=flat' alt='Build Status' /></a>
|
5
|
+
<a href='https://codeclimate.com/github/trema/pio'><img src='http://img.shields.io/codeclimate/github/trema/pio.svg?style=flat' alt='Code Climate' /></a>
|
6
|
+
<a href='https://coveralls.io/r/trema/pio?branch=develop'><img src='http://img.shields.io/coveralls/trema/pio/develop.svg?style=flat' alt='Coverage Status' /></a>
|
7
|
+
<a href='https://gemnasium.com/trema/pio'><img src='http://img.shields.io/gemnasium/trema/pio.svg?style=flat' alt='Dependency Status' /></a>
|
8
|
+
<a href='https://gitter.im/trema/pio'><img src='https://badges.gitter.im/Join Chat.svg?style=flat' alt='Gitter Chat' /></a>
|
8
9
|
<a href="http://inch-pages.github.io/github/trema/pio"><img src="http://inch-pages.github.io/github/trema/pio.svg" alt="Inline docs"></a>
|
9
10
|
|
10
11
|
<a href="http://www.flickr.com/photos/mongogushi/4226014070/" title="pio pencil by mongo gushi, on Flickr"><img src="http://farm5.staticflickr.com/4022/4226014070_cdeb7c1e5d_n.jpg" width="320" height="290" alt="pio pencil"></a>
|
@@ -228,12 +229,23 @@ generate an Features Request/Reply message like below:
|
|
228
229
|
|
229
230
|
# The Features xid (transaction_id)
|
230
231
|
# should be same as that of the request.
|
231
|
-
reply = Pio::Features::Reply.new(
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
232
|
+
reply = Pio::Features::Reply.new(
|
233
|
+
xid: request.xid,
|
234
|
+
dpid: 0x123,
|
235
|
+
n_buffers: 0x100,
|
236
|
+
n_tables: 0xfe,
|
237
|
+
capabilities: [:flow_stats, :table_stats, :port_stats,
|
238
|
+
:queue_stats, :arp_match_ip],
|
239
|
+
actions: [:output, :set_vlan_vid, :set_vlan_pcp, :strip_vlan,
|
240
|
+
:set_dl_src, :set_dl_dst, :set_nw_src, :set_nw_dst,
|
241
|
+
:set_nw_tos, :set_tp_src, :set_tp_dst, :enqueue],
|
242
|
+
ports: [{ port_no: 1,
|
243
|
+
hardware_address: '11:22:33:44:55:66',
|
244
|
+
name: 'port123',
|
245
|
+
config: [:port_down],
|
246
|
+
state: [:link_down],
|
247
|
+
curr: [:port_10gb_fd, :port_copper] }]
|
248
|
+
)
|
237
249
|
reply.to_binary # => Features Reply message in binary format.
|
238
250
|
|
239
251
|
## Installation
|
@@ -269,4 +281,5 @@ and install it by running Bundler:
|
|
269
281
|
## License
|
270
282
|
|
271
283
|
Pio is released under the GNU General Public License version 3.0:
|
284
|
+
|
272
285
|
- <http://www.gnu.org/licenses/gpl.html>
|
data/Rakefile
CHANGED
data/examples/features_new.rb
CHANGED
@@ -5,10 +5,21 @@ request.to_binary # => Features Request message in binary format.
|
|
5
5
|
|
6
6
|
# The Features xid (transaction_id)
|
7
7
|
# should be same as that of the request.
|
8
|
-
reply = Pio::Features::Reply.new(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
reply = Pio::Features::Reply.new(
|
9
|
+
xid: request.xid,
|
10
|
+
dpid: 0x123,
|
11
|
+
n_buffers: 0x100,
|
12
|
+
n_tables: 0xfe,
|
13
|
+
capabilities: [:flow_stats, :table_stats, :port_stats,
|
14
|
+
:queue_stats, :arp_match_ip],
|
15
|
+
actions: [:output, :set_vlan_vid, :set_vlan_pcp, :strip_vlan,
|
16
|
+
:set_dl_src, :set_dl_dst, :set_nw_src, :set_nw_dst,
|
17
|
+
:set_nw_tos, :set_tp_src, :set_tp_dst, :enqueue],
|
18
|
+
ports: [{ port_no: 1,
|
19
|
+
hardware_address: '11:22:33:44:55:66',
|
20
|
+
name: 'port123',
|
21
|
+
config: [:port_down],
|
22
|
+
state: [:link_down],
|
23
|
+
curr: [:port_10gb_fd, :port_copper] }]
|
24
|
+
)
|
14
25
|
reply.to_binary # => Features Reply message in binary format.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/features/support/env.rb
CHANGED
data/lib/pio.rb
CHANGED
data/lib/pio/arp.rb
CHANGED
data/lib/pio/arp/format.rb
CHANGED
data/lib/pio/arp/message.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'forwardable'
|
4
2
|
require 'pio/arp/format'
|
5
3
|
|
@@ -9,31 +7,25 @@ module Pio
|
|
9
7
|
class Message
|
10
8
|
extend Forwardable
|
11
9
|
|
12
|
-
def_delegators :@
|
13
|
-
def_delegators :@
|
14
|
-
def_delegators :@
|
15
|
-
def_delegators :@
|
16
|
-
def_delegators :@
|
17
|
-
def_delegators :@
|
18
|
-
def_delegators :@
|
19
|
-
def_delegators :@
|
20
|
-
def_delegators :@
|
21
|
-
def_delegators :@
|
22
|
-
def_delegators :@
|
23
|
-
def_delegators :@
|
24
|
-
def_delegators :@
|
25
|
-
|
26
|
-
def self.create_from(frame)
|
27
|
-
message = allocate
|
28
|
-
message.instance_variable_set :@frame, frame
|
29
|
-
message
|
30
|
-
end
|
10
|
+
def_delegators :@format, :destination_mac
|
11
|
+
def_delegators :@format, :source_mac
|
12
|
+
def_delegators :@format, :ether_type
|
13
|
+
def_delegators :@format, :hardware_type
|
14
|
+
def_delegators :@format, :protocol_type
|
15
|
+
def_delegators :@format, :hardware_length
|
16
|
+
def_delegators :@format, :protocol_length
|
17
|
+
def_delegators :@format, :operation
|
18
|
+
def_delegators :@format, :sender_hardware_address
|
19
|
+
def_delegators :@format, :sender_protocol_address
|
20
|
+
def_delegators :@format, :target_hardware_address
|
21
|
+
def_delegators :@format, :target_protocol_address
|
22
|
+
def_delegators :@format, :to_binary
|
31
23
|
|
32
24
|
private_class_method :new
|
33
25
|
|
34
26
|
def initialize(user_options)
|
35
27
|
options = self.class.const_get(:Options).new(user_options.dup.freeze)
|
36
|
-
@
|
28
|
+
@format = Arp::Format.new(options.to_hash)
|
37
29
|
end
|
38
30
|
end
|
39
31
|
end
|
data/lib/pio/arp/reply.rb
CHANGED
data/lib/pio/arp/request.rb
CHANGED
data/lib/pio/dhcp.rb
CHANGED
data/lib/pio/dhcp/ack.rb
CHANGED
data/lib/pio/dhcp/boot_reply.rb
CHANGED
data/lib/pio/dhcp/client_id.rb
CHANGED
data/lib/pio/dhcp/csum_util.rb
CHANGED
data/lib/pio/dhcp/dhcp_field.rb
CHANGED
data/lib/pio/dhcp/discover.rb
CHANGED
data/lib/pio/dhcp/field_util.rb
CHANGED
data/lib/pio/dhcp/frame.rb
CHANGED
data/lib/pio/dhcp/message.rb
CHANGED
data/lib/pio/dhcp/offer.rb
CHANGED
data/lib/pio/dhcp/request.rb
CHANGED
data/lib/pio/echo.rb
CHANGED
@@ -1,18 +1,15 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'pio/echo/format'
|
4
2
|
require 'pio/echo/reply'
|
5
3
|
require 'pio/echo/request'
|
6
4
|
require 'pio/message_type_selector'
|
5
|
+
require 'pio/open_flow'
|
7
6
|
|
8
7
|
module Pio
|
9
8
|
# OpenFlow Echo Request and Reply message parser.
|
10
9
|
class Echo
|
11
10
|
extend MessageTypeSelector
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
message_type REQUEST => Request, REPLY => Reply
|
12
|
+
message_type Pio::OpenFlow::Type::ECHO_REQUEST => Request,
|
13
|
+
Pio::OpenFlow::Type::ECHO_REPLY => Reply
|
17
14
|
end
|
18
15
|
end
|
data/lib/pio/echo/format.rb
CHANGED
@@ -1,17 +1,21 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'bindata'
|
4
|
-
require 'pio/
|
2
|
+
require 'pio/open_flow'
|
5
3
|
|
6
4
|
module Pio
|
7
5
|
class Echo
|
8
|
-
# OpenFlow 1.0 Echo message
|
6
|
+
# OpenFlow 1.0 Echo request and reply message parser.
|
9
7
|
class Format < BinData::Record
|
10
|
-
|
8
|
+
include Pio::OpenFlow::Type
|
9
|
+
|
10
|
+
def message_type
|
11
|
+
open_flow_header.message_type
|
12
|
+
end
|
11
13
|
|
12
14
|
endian :big
|
13
15
|
|
14
|
-
|
16
|
+
open_flow_header :open_flow_header
|
17
|
+
virtual assert: -> { [ECHO_REQUEST, ECHO_REPLY].include?(message_type) }
|
18
|
+
|
15
19
|
string :body
|
16
20
|
end
|
17
21
|
end
|