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
data/lib/pio/features/format.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'bindata'
|
4
|
-
require 'pio/type/open_flow'
|
5
|
-
|
6
|
-
module Pio
|
7
|
-
class Features
|
8
|
-
# OpenFlow 1.0 Features message format.
|
9
|
-
class Format < BinData::Record
|
10
|
-
extend Type::OpenFlow
|
11
|
-
|
12
|
-
endian :big
|
13
|
-
|
14
|
-
openflow_header
|
15
|
-
string :body, read_length: -> { message_length - 8 }
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/lib/pio/features/message.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module Pio
|
4
|
-
class Features
|
5
|
-
# Base class of Features request and reply.
|
6
|
-
class Message
|
7
|
-
def self.create_from(features)
|
8
|
-
message = allocate
|
9
|
-
message.instance_variable_set :@features, features
|
10
|
-
message
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/lib/pio/type/open_flow.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'bindata'
|
4
|
-
|
5
|
-
module Pio
|
6
|
-
module Type
|
7
|
-
# OpenFlow 1.0 format.
|
8
|
-
module OpenFlow
|
9
|
-
def openflow_header
|
10
|
-
class_eval do
|
11
|
-
uint8 :ofp_version, value: 1
|
12
|
-
uint8 :message_type
|
13
|
-
uint16 :message_length, initial_value: -> { 8 + body.length }
|
14
|
-
uint32 :transaction_id, initial_value: 0
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# Description of a physical port
|
19
|
-
class PhyPort < BinData::Record
|
20
|
-
endian :big
|
21
|
-
|
22
|
-
uint16 :port_no
|
23
|
-
uint8 :hw_addr
|
24
|
-
stringz :name, read_length: 16
|
25
|
-
uint32 :config
|
26
|
-
uint32 :state
|
27
|
-
uint32 :curr
|
28
|
-
uint32 :advertised
|
29
|
-
uint32 :supported
|
30
|
-
uint32 :peer
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|