pio 0.23.1 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +2 -0
- data/Rakefile +1 -1
- data/features/open_flow10/barrier_reply.feature +58 -0
- data/features/open_flow10/barrier_request.feature +58 -0
- data/features/open_flow10/echo_reply.feature +50 -40
- data/features/open_flow10/echo_request.feature +54 -51
- data/features/open_flow10/features_reply.feature +62 -63
- data/features/open_flow10/features_request.feature +2 -19
- data/features/open_flow10/flow_mod.feature +1 -0
- data/features/open_flow10/hello.feature +38 -44
- data/features/open_flow10/packet_in.feature +1 -2
- data/features/open_flow10/packet_in.raw +0 -0
- data/features/open_flow10/packet_out.feature +14 -14
- data/features/open_flow10/port_status.feature +17 -17
- data/features/open_flow13/apply_actions.feature +15 -17
- data/features/open_flow13/echo_reply.feature +58 -58
- data/features/open_flow13/echo_request.feature +58 -58
- data/features/open_flow13/features_reply.feature +2 -6
- data/features/open_flow13/features_request.feature +3 -23
- data/features/open_flow13/flow_mod.feature +86 -93
- data/features/open_flow13/goto_table.feature +4 -4
- data/features/open_flow13/hello.feature +8 -15
- data/features/open_flow13/match.feature +14 -3
- data/features/open_flow13/meter.feature +3 -3
- data/features/open_flow13/oxm_experimenter_stratos_basic_dot11.raw +0 -0
- data/features/open_flow13/oxm_invalid_field.raw +0 -0
- data/features/open_flow13/packet_in.feature +15 -20
- data/features/open_flow13/packet_out.feature +39 -42
- data/features/open_flow13/send_out_port.feature +1 -5
- data/features/open_flow13/write_metadata.feature +3 -3
- data/features/open_flow_read.feature +43 -0
- data/features/open_flow_version.feature +10 -0
- data/features/step_definitions/open_flow_steps.rb +10 -2
- data/features/step_definitions/packet_data_steps.rb +4 -0
- data/features/support/hooks.rb +7 -0
- data/lib/pio.rb +1 -1
- data/lib/pio/monkey_patch/integer/ranges.rb +4 -0
- data/lib/pio/open_flow.rb +54 -16
- data/lib/pio/open_flow/datapath_id.rb +26 -0
- data/lib/pio/open_flow/echo.rb +44 -0
- data/lib/pio/open_flow/format.rb +45 -0
- data/lib/pio/open_flow/message.rb +88 -0
- data/lib/pio/open_flow/open_flow_header.rb +0 -14
- data/lib/pio/open_flow10.rb +3 -8
- data/lib/pio/open_flow10/actions.rb +1 -1
- data/lib/pio/open_flow10/barrier_reply.rb +21 -0
- data/lib/pio/open_flow10/barrier_request.rb +22 -0
- data/lib/pio/open_flow10/echo.rb +15 -11
- data/lib/pio/open_flow10/features.rb +99 -71
- data/lib/pio/open_flow10/flow_mod.rb +73 -66
- data/lib/pio/open_flow10/hello.rb +19 -4
- data/lib/pio/open_flow10/match.rb +133 -131
- data/lib/pio/open_flow10/packet_in.rb +55 -49
- data/lib/pio/open_flow10/packet_out.rb +31 -24
- data/lib/pio/open_flow10/port_status.rb +54 -27
- data/lib/pio/open_flow10/send_out_port.rb +66 -64
- data/lib/pio/open_flow13.rb +0 -15
- data/lib/pio/open_flow13/echo.rb +11 -68
- data/lib/pio/open_flow13/features_reply.rb +48 -77
- data/lib/pio/open_flow13/features_request.rb +16 -45
- data/lib/pio/open_flow13/flow_mod.rb +125 -148
- data/lib/pio/open_flow13/goto_table.rb +1 -0
- data/lib/pio/open_flow13/hello.rb +54 -84
- data/lib/pio/open_flow13/match.rb +69 -11
- data/lib/pio/open_flow13/meter.rb +1 -0
- data/lib/pio/open_flow13/packet_in.rb +38 -50
- data/lib/pio/open_flow13/packet_out.rb +50 -75
- data/lib/pio/open_flow13/send_out_port.rb +34 -34
- data/lib/pio/open_flow13/write_metadata.rb +1 -0
- data/lib/pio/parser.rb +3 -0
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +6 -6
- data/spec/pio/open_flow10/echo_reply_spec.rb +7 -0
- data/spec/pio/open_flow10/echo_request_spec.rb +7 -0
- data/spec/pio/open_flow10/features_reply_spec.rb +8 -0
- data/spec/pio/open_flow10/features_request_spec.rb +13 -0
- data/spec/pio/open_flow10/flow_mod_spec.rb +17 -16
- data/spec/pio/open_flow10/hello_spec.rb +7 -0
- data/spec/pio/open_flow10/match_spec.rb +8 -6
- data/spec/pio/open_flow10/packet_in_spec.rb +14 -0
- data/spec/pio/open_flow10/packet_out_spec.rb +21 -14
- data/spec/pio/open_flow10/send_out_port_spec.rb +4 -4
- data/spec/pio/open_flow10/wildcards_spec.rb +2 -2
- data/spec/pio/open_flow13/echo_reply_spec.rb +7 -0
- data/spec/pio/open_flow13/echo_request_spec.rb +7 -0
- data/spec/pio/open_flow13/features_reply_spec.rb +8 -0
- data/spec/pio/open_flow13/features_request_spec.rb +13 -0
- data/spec/pio/open_flow13/hello_spec.rb +14 -59
- data/spec/pio/open_flow13/packet_in_spec.rb +14 -0
- data/spec/pio/open_flow13/packet_out_spec.rb +7 -0
- data/spec/pio/open_flow_spec.rb +34 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/shared_examples_for_openflow_messages.rb +75 -0
- metadata +215 -170
- data/bin/byebug +0 -16
- data/bin/terminal-notifier +0 -16
- data/lib/pio/open_flow10/message.rb +0 -78
- data/spec/pio/open_flow/type_spec.rb +0 -5
data/bin/byebug
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'byebug' 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('byebug', 'byebug')
|
data/bin/terminal-notifier
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'terminal-notifier' 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('terminal-notifier', 'terminal-notifier')
|
@@ -1,78 +0,0 @@
|
|
1
|
-
require 'English'
|
2
|
-
require 'bindata'
|
3
|
-
require 'forwardable'
|
4
|
-
require 'pio/open_flow/open_flow_header'
|
5
|
-
require 'pio/parse_error'
|
6
|
-
|
7
|
-
module Pio
|
8
|
-
module OpenFlow
|
9
|
-
# Defines shortcuts to OpenFlow header fields.
|
10
|
-
# rubocop:disable MethodLength
|
11
|
-
class Message
|
12
|
-
def self.factory(klass, message_type, &block)
|
13
|
-
klass.extend Forwardable
|
14
|
-
klass.module_eval(&block) if block
|
15
|
-
klass.module_eval <<-EOT, __FILE__, __LINE__
|
16
|
-
class Format < BinData::Record
|
17
|
-
endian :big
|
18
|
-
|
19
|
-
open_flow_header :open_flow_header,
|
20
|
-
ofp_version_value: 1,
|
21
|
-
message_type_value: #{message_type}
|
22
|
-
virtual assert: -> do
|
23
|
-
open_flow_header.message_type == #{message_type}
|
24
|
-
end
|
25
|
-
|
26
|
-
#{klass.const_defined?(:Body) ? 'body' : 'string'} :body
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.format
|
30
|
-
const_get :Format
|
31
|
-
end
|
32
|
-
|
33
|
-
def_delegators :@format, :snapshot
|
34
|
-
def_delegators :snapshot, :open_flow_header
|
35
|
-
def_delegators :open_flow_header, :ofp_version
|
36
|
-
def_delegators :open_flow_header, :message_type
|
37
|
-
def_delegators :open_flow_header, :message_length
|
38
|
-
def_delegators :open_flow_header, :transaction_id
|
39
|
-
def_delegator :open_flow_header, :transaction_id, :xid
|
40
|
-
|
41
|
-
def_delegators :snapshot, :body
|
42
|
-
def_delegator :snapshot, :body, :user_data
|
43
|
-
|
44
|
-
def self.read(raw_data)
|
45
|
-
allocate.tap do |message|
|
46
|
-
message.instance_variable_set(:@format, format.read(raw_data))
|
47
|
-
end
|
48
|
-
rescue BinData::ValidityError
|
49
|
-
message_name = name.split('::')[1..-1].join(' ')
|
50
|
-
raise Pio::ParseError, "Invalid \#{message_name} message."
|
51
|
-
end
|
52
|
-
|
53
|
-
def initialize(user_options = {})
|
54
|
-
header_options = OpenFlowHeader::Options.parse(user_options)
|
55
|
-
body_options = if user_options.respond_to?(:fetch)
|
56
|
-
user_options.delete :transaction_id
|
57
|
-
user_options.delete :xid
|
58
|
-
dpid = user_options[:dpid]
|
59
|
-
user_options[:datapath_id] = dpid if dpid
|
60
|
-
if user_options.keys.size > 1
|
61
|
-
user_options
|
62
|
-
else
|
63
|
-
user_options[:user_data] || ''
|
64
|
-
end
|
65
|
-
else
|
66
|
-
''
|
67
|
-
end
|
68
|
-
@format = self.class.format.new(open_flow_header: header_options,
|
69
|
-
body: body_options)
|
70
|
-
end
|
71
|
-
|
72
|
-
def_delegator :@format, :to_binary_s, :to_binary
|
73
|
-
EOT
|
74
|
-
end
|
75
|
-
# rubocop:enable MethodLength
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|