pio 0.15.1 → 0.15.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 +5 -0
- data/examples/features_new.rb +15 -15
- data/examples/packet_in_new.rb +5 -5
- data/features/features_read.feature +5 -0
- data/lib/pio/dhcp/field_util.rb +1 -1
- data/lib/pio/features.rb +2 -2
- data/lib/pio/lldp/frame.rb +1 -1
- data/lib/pio/open_flow/message.rb +6 -3
- data/lib/pio/open_flow/phy_port.rb +27 -16
- data/lib/pio/packet_in.rb +4 -4
- data/lib/pio/port_status.rb +7 -3
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +6 -6
- data/spec/pio/mac_spec.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f75df3f4f4091dda09de3b77789eea400df989dc
|
4
|
+
data.tar.gz: 1cc6ef0de733c14e84efe1fff569ed7de0943c03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19d72385b493052449cd2de18df8bed3a6385fb452ffc52883f6b9f781b09c9807596869920d59fce09dc812e5f9d9434be249f27389095ce650655b69e1d7e2
|
7
|
+
data.tar.gz: 6862a78e369025dc34d89086a8f10cf4fd7ca19dbdea867de0d583350cb4fd9c937f4cef1bb09117e87912d5d747ec4c5deeb8c9f5bfafccb87c155d079baaa3
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
## develop (unreleased)
|
4
4
|
|
5
5
|
|
6
|
+
## 0.15.2 (2/18/2015)
|
7
|
+
### Changes
|
8
|
+
* [#128](https://github.com/trema/pio/pull/128): Field accessors return Ruby primitives (Fixnum, Symbol, etc.).
|
9
|
+
|
10
|
+
|
6
11
|
## 0.15.1 (2/17/2015)
|
7
12
|
### Bugs fixed
|
8
13
|
* [#127](https://github.com/trema/pio/pull/127): Make OpenFlow classes thread safe.
|
data/examples/features_new.rb
CHANGED
@@ -6,20 +6,20 @@ request.to_binary # => Features Request message in binary format.
|
|
6
6
|
# The Features xid (transaction_id)
|
7
7
|
# should be same as that of the request.
|
8
8
|
reply = Pio::Features::Reply.new(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
24
|
)
|
25
25
|
reply.to_binary # => Features Reply message in binary format.
|
data/examples/packet_in_new.rb
CHANGED
@@ -10,10 +10,10 @@ data_dump = [
|
|
10
10
|
].pack('C*')
|
11
11
|
|
12
12
|
packet_in = Pio::PacketIn.new(
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
transaction_id: 0,
|
14
|
+
buffer_id: 0xffffff00,
|
15
|
+
in_port: 1,
|
16
|
+
reason: :no_match,
|
17
|
+
data: data_dump
|
18
18
|
)
|
19
19
|
packet_in.to_binary # => Packet-In message in binary format.
|
@@ -32,6 +32,7 @@ Feature: Pio::Features.read
|
|
32
32
|
| capabilities | [:flow_stats, :table_stats, :port_stats, :arp_match_ip] |
|
33
33
|
| actions | [:output, :set_vlan_vid, :set_vlan_pcp, :strip_vlan, :set_dl_src, :set_dl_dst, :set_nw_src, :set_nw_dst, :set_nw_tos, :set_tp_src, :set_tp_dst, :enqueue] |
|
34
34
|
| ports.length | 3 |
|
35
|
+
| ports.first.datapath_id | 1 |
|
35
36
|
| ports.first.port_no | 2 |
|
36
37
|
| ports.first.mac_address | 16:7d:a4:37:ba:10 |
|
37
38
|
| ports.first.hardware_address | 16:7d:a4:37:ba:10 |
|
@@ -43,6 +44,7 @@ Feature: Pio::Features.read
|
|
43
44
|
| ports.first.supported | [] |
|
44
45
|
| ports.first.peer | [] |
|
45
46
|
| ports.last.port_no | 1 |
|
47
|
+
| ports.last.number | 1 |
|
46
48
|
| ports.last.mac_address | 62:94:3a:f6:40:db |
|
47
49
|
| ports.last.hardware_address | 62:94:3a:f6:40:db |
|
48
50
|
| ports.last.name | trema1-0 |
|
@@ -52,3 +54,6 @@ Feature: Pio::Features.read
|
|
52
54
|
| ports.last.advertised | [] |
|
53
55
|
| ports.last.supported | [] |
|
54
56
|
| ports.last.peer | [] |
|
57
|
+
| ports.last.up? | true |
|
58
|
+
| ports.last.down? | false |
|
59
|
+
| ports.last.local? | false |
|
data/lib/pio/dhcp/field_util.rb
CHANGED
data/lib/pio/features.rb
CHANGED
data/lib/pio/lldp/frame.rb
CHANGED
@@ -39,19 +39,22 @@ module Pio
|
|
39
39
|
end
|
40
40
|
# rubocop:enable MethodLength
|
41
41
|
|
42
|
+
# rubocop:disable MethodLength
|
42
43
|
def self._define_open_flow_accessors
|
43
44
|
proc do
|
44
|
-
def_delegators :@format, :
|
45
|
+
def_delegators :@format, :snapshot
|
46
|
+
def_delegators :snapshot, :open_flow_header
|
45
47
|
def_delegators :open_flow_header, :ofp_version
|
46
48
|
def_delegators :open_flow_header, :message_type
|
47
49
|
def_delegators :open_flow_header, :message_length
|
48
50
|
def_delegators :open_flow_header, :transaction_id
|
49
51
|
def_delegator :open_flow_header, :transaction_id, :xid
|
50
52
|
|
51
|
-
def_delegators
|
52
|
-
def_delegator
|
53
|
+
def_delegators :snapshot, :body
|
54
|
+
def_delegator :snapshot, :body, :user_data
|
53
55
|
end
|
54
56
|
end
|
57
|
+
# rubocop:enable MethodLength
|
55
58
|
|
56
59
|
def self._define_self_read
|
57
60
|
proc do
|
@@ -52,28 +52,39 @@ module Pio
|
|
52
52
|
port_feature :supported
|
53
53
|
port_feature :peer
|
54
54
|
|
55
|
-
|
56
|
-
|
55
|
+
# rubocop:disable MethodLength
|
56
|
+
def snapshot
|
57
|
+
super.tap do |ss|
|
58
|
+
def ss.datapath_id
|
59
|
+
@datapath_id || fail
|
60
|
+
end
|
57
61
|
|
58
|
-
|
59
|
-
|
60
|
-
|
62
|
+
def ss.dpid
|
63
|
+
@datapath_id || fail
|
64
|
+
end
|
61
65
|
|
62
|
-
|
63
|
-
|
64
|
-
|
66
|
+
def ss.number
|
67
|
+
port_no
|
68
|
+
end
|
65
69
|
|
66
|
-
|
67
|
-
|
68
|
-
|
70
|
+
def ss.mac_address
|
71
|
+
hardware_address
|
72
|
+
end
|
69
73
|
|
70
|
-
|
71
|
-
|
72
|
-
|
74
|
+
def ss.up?
|
75
|
+
!down?
|
76
|
+
end
|
77
|
+
|
78
|
+
def ss.down?
|
79
|
+
config.include?(:port_down) || state.include?(:link_down)
|
80
|
+
end
|
73
81
|
|
74
|
-
|
75
|
-
|
82
|
+
def ss.local?
|
83
|
+
port_no == PortNumber::NUMBERS[:local]
|
84
|
+
end
|
85
|
+
end
|
76
86
|
end
|
87
|
+
# rubocop:enable MethodLength
|
77
88
|
end
|
78
89
|
end
|
79
90
|
end
|
data/lib/pio/packet_in.rb
CHANGED
@@ -91,16 +91,16 @@ module Pio
|
|
91
91
|
end
|
92
92
|
|
93
93
|
OpenFlow::Message.factory(PacketIn, OpenFlow::PACKET_IN) do
|
94
|
-
attr_accessor :datapath_id
|
95
|
-
alias_method :dpid, :datapath_id
|
96
|
-
alias_method :dpid=, :datapath_id=
|
97
|
-
|
98
94
|
def_delegators :body, :buffer_id
|
99
95
|
def_delegators :body, :total_len
|
100
96
|
def_delegators :body, :in_port
|
101
97
|
def_delegators :body, :reason
|
102
98
|
def_delegators :body, :data
|
103
99
|
|
100
|
+
attr_accessor :datapath_id
|
101
|
+
alias_method :dpid, :datapath_id
|
102
|
+
alias_method :dpid=, :datapath_id=
|
103
|
+
|
104
104
|
def parsed_data
|
105
105
|
@parsed_data ||= PacketIn::DataParser.read(data)
|
106
106
|
end
|
data/lib/pio/port_status.rb
CHANGED
@@ -31,10 +31,14 @@ module Pio
|
|
31
31
|
end
|
32
32
|
|
33
33
|
OpenFlow::Message.factory(PortStatus, OpenFlow::PORT_STATUS) do
|
34
|
-
def_delegators :body, :
|
34
|
+
def_delegators :body, :reason
|
35
35
|
|
36
|
-
|
37
|
-
|
36
|
+
attr_writer :datapath_id
|
37
|
+
|
38
|
+
def desc
|
39
|
+
@desc ||= @format.body.desc.snapshot
|
40
|
+
@desc.instance_variable_set :@datapath_id, @datapath_id
|
41
|
+
@desc
|
38
42
|
end
|
39
43
|
end
|
40
44
|
end
|
data/lib/pio/version.rb
CHANGED
data/pio.gemspec
CHANGED
@@ -37,11 +37,11 @@ Gem::Specification.new do |gem|
|
|
37
37
|
gem.add_dependency 'bindata', '~> 2.1.0'
|
38
38
|
|
39
39
|
gem.add_development_dependency 'rake'
|
40
|
-
gem.add_development_dependency 'bundler', '~> 1.8.
|
40
|
+
gem.add_development_dependency 'bundler', '~> 1.8.2'
|
41
41
|
gem.add_development_dependency 'pry', '~> 0.10.1'
|
42
42
|
|
43
43
|
# Guard
|
44
|
-
gem.add_development_dependency 'guard', '~> 2.
|
44
|
+
gem.add_development_dependency 'guard', '~> 2.12.1'
|
45
45
|
gem.add_development_dependency 'guard-bundler', '~> 2.1.0'
|
46
46
|
gem.add_development_dependency 'guard-cucumber', '~> 1.5.3'
|
47
47
|
gem.add_development_dependency 'guard-rspec', '~> 4.5.0'
|
@@ -58,11 +58,11 @@ Gem::Specification.new do |gem|
|
|
58
58
|
# Test
|
59
59
|
gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.4.6'
|
60
60
|
gem.add_development_dependency 'coveralls', '~> 0.7.9'
|
61
|
-
gem.add_development_dependency 'cucumber', '~> 1.3.
|
61
|
+
gem.add_development_dependency 'cucumber', '~> 1.3.19'
|
62
62
|
gem.add_development_dependency 'flay', '~> 2.6.1'
|
63
63
|
gem.add_development_dependency 'flog', '~> 4.3.2'
|
64
|
-
gem.add_development_dependency 'reek', '~>
|
64
|
+
gem.add_development_dependency 'reek', '~> 2.0.0'
|
65
65
|
gem.add_development_dependency 'rspec', '~> 3.2.0'
|
66
|
-
gem.add_development_dependency 'rspec-given', '~> 3.
|
67
|
-
gem.add_development_dependency 'rubocop', '~> 0.
|
66
|
+
gem.add_development_dependency 'rspec-given', '~> 3.7.0'
|
67
|
+
gem.add_development_dependency 'rubocop', '~> 0.29.1'
|
68
68
|
end
|
data/spec/pio/mac_spec.rb
CHANGED
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.15.
|
4
|
+
version: 0.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yasuhito Takamiya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.8.
|
47
|
+
version: 1.8.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.8.
|
54
|
+
version: 1.8.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
75
|
+
version: 2.12.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.
|
82
|
+
version: 2.12.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: guard-bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,14 +254,14 @@ dependencies:
|
|
254
254
|
requirements:
|
255
255
|
- - ~>
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version: 1.3.
|
257
|
+
version: 1.3.19
|
258
258
|
type: :development
|
259
259
|
prerelease: false
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
262
|
- - ~>
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version: 1.3.
|
264
|
+
version: 1.3.19
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: flay
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -296,14 +296,14 @@ dependencies:
|
|
296
296
|
requirements:
|
297
297
|
- - ~>
|
298
298
|
- !ruby/object:Gem::Version
|
299
|
-
version:
|
299
|
+
version: 2.0.0
|
300
300
|
type: :development
|
301
301
|
prerelease: false
|
302
302
|
version_requirements: !ruby/object:Gem::Requirement
|
303
303
|
requirements:
|
304
304
|
- - ~>
|
305
305
|
- !ruby/object:Gem::Version
|
306
|
-
version:
|
306
|
+
version: 2.0.0
|
307
307
|
- !ruby/object:Gem::Dependency
|
308
308
|
name: rspec
|
309
309
|
requirement: !ruby/object:Gem::Requirement
|
@@ -324,28 +324,28 @@ dependencies:
|
|
324
324
|
requirements:
|
325
325
|
- - ~>
|
326
326
|
- !ruby/object:Gem::Version
|
327
|
-
version: 3.
|
327
|
+
version: 3.7.0
|
328
328
|
type: :development
|
329
329
|
prerelease: false
|
330
330
|
version_requirements: !ruby/object:Gem::Requirement
|
331
331
|
requirements:
|
332
332
|
- - ~>
|
333
333
|
- !ruby/object:Gem::Version
|
334
|
-
version: 3.
|
334
|
+
version: 3.7.0
|
335
335
|
- !ruby/object:Gem::Dependency
|
336
336
|
name: rubocop
|
337
337
|
requirement: !ruby/object:Gem::Requirement
|
338
338
|
requirements:
|
339
339
|
- - ~>
|
340
340
|
- !ruby/object:Gem::Version
|
341
|
-
version: 0.
|
341
|
+
version: 0.29.1
|
342
342
|
type: :development
|
343
343
|
prerelease: false
|
344
344
|
version_requirements: !ruby/object:Gem::Requirement
|
345
345
|
requirements:
|
346
346
|
- - ~>
|
347
347
|
- !ruby/object:Gem::Version
|
348
|
-
version: 0.
|
348
|
+
version: 0.29.1
|
349
349
|
description: Pure ruby packet parser and generator.
|
350
350
|
email:
|
351
351
|
- yasuhito@gmail.com
|