trema 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 +9 -0
- data/README.md +1 -0
- data/features/handlers/packet_in.feature +28 -11
- data/lib/trema/controller.rb +1 -1
- data/lib/trema/version.rb +1 -1
- data/trema.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56491c2c957c65072af879859d60774d095dd184
|
4
|
+
data.tar.gz: 79183b30e186b9210a257f32aaff467fde077de9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f7844e283019157acd6aa1f6053d86c855cce5d11e350270f3952022db612370c917d89370f071c734a24fd3a754f231538c908ea4410a3d9ca439a237b15a2
|
7
|
+
data.tar.gz: 292b789f6e2e8199baee54627e430daff018ba10c35d640f17eb924f2ebd873ff665c0e257f1c00059789242187b3422681e91b150e35eed58f1d08d7bf44f47
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -42,6 +42,7 @@ OpenFlow controller using Trema Ruby API.
|
|
42
42
|
* [trema/cbench](https://github.com/trema/cbench)
|
43
43
|
* [trema/learning_switch](https://github.com/trema/learning_switch)
|
44
44
|
* [trema/switch_monitor](https://github.com/trema/switch_monitor)
|
45
|
+
* [trema/simple_router](https://github.com/trema/simple_router)
|
45
46
|
* [trema/topology](https://github.com/trema/topology)
|
46
47
|
* [trema/routing_switch](https://github.com/trema/routing_switch)
|
47
48
|
|
@@ -1,14 +1,6 @@
|
|
1
1
|
Feature: packet_in handler
|
2
2
|
Background:
|
3
|
-
Given a file named "
|
4
|
-
"""ruby
|
5
|
-
class PacketInController < Trema::Controller
|
6
|
-
def packet_in(dpid, message)
|
7
|
-
logger.info "new packet_in (dpid = #{dpid.to_hex})"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
"""
|
11
|
-
And a file named "trema.conf" with:
|
3
|
+
Given a file named "trema.conf" with:
|
12
4
|
"""ruby
|
13
5
|
vswitch { datapath_id 0xabc }
|
14
6
|
vhost('host1') { ip '192.168.0.1' }
|
@@ -19,14 +11,39 @@ Feature: packet_in handler
|
|
19
11
|
|
20
12
|
@sudo
|
21
13
|
Scenario: invoke packet_in handler
|
22
|
-
Given
|
14
|
+
Given a file named "packet_in_controller.rb" with:
|
15
|
+
"""ruby
|
16
|
+
class PacketInController < Trema::Controller
|
17
|
+
def packet_in(dpid, message)
|
18
|
+
logger.info "new packet_in (dpid = #{dpid.to_hex})"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
"""
|
22
|
+
|
23
|
+
And I successfully run `trema run packet_in_controller.rb -c trema.conf -d`
|
23
24
|
And I successfully run `sleep 3`
|
24
25
|
When I successfully run `trema send_packets --source host1 --dest host2`
|
25
26
|
Then the file "PacketInController.log" should contain "new packet_in (dpid = 0xabc)"
|
26
27
|
|
27
28
|
@sudo
|
28
29
|
Scenario: invoke packet_in handler (OpenFlow 1.3)
|
29
|
-
Given
|
30
|
+
Given a file named "packet_in_controller.rb" with:
|
31
|
+
"""ruby
|
32
|
+
class PacketInController < Trema::Controller
|
33
|
+
def switch_ready(dpid)
|
34
|
+
send_flow_mod_add(
|
35
|
+
dpid,
|
36
|
+
match: Match.new,
|
37
|
+
instructions: Apply.new(SendOutPort.new(:controller))
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
def packet_in(dpid, message)
|
42
|
+
logger.info "new packet_in (dpid = #{dpid.to_hex})"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
"""
|
46
|
+
And I successfully run `trema run packet_in_controller.rb -c trema.conf --openflow13 -d`
|
30
47
|
And I successfully run `sleep 3`
|
31
48
|
When I successfully run `trema send_packets --source host1 --dest host2`
|
32
49
|
Then the file "PacketInController.log" should contain "new packet_in (dpid = 0xabc)"
|
data/lib/trema/controller.rb
CHANGED
@@ -74,7 +74,7 @@ module Trema
|
|
74
74
|
transaction_id: rand(0xffffffff),
|
75
75
|
buffer_id: @user_options[:buffer_id] || 0xffffffff,
|
76
76
|
match: @user_options.fetch(:match),
|
77
|
-
out_port: @user_options[:out_port] ||
|
77
|
+
out_port: @user_options[:out_port] || 0xffffffff
|
78
78
|
}
|
79
79
|
end
|
80
80
|
end
|
data/lib/trema/version.rb
CHANGED
data/trema.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |gem|
|
|
23
23
|
|
24
24
|
gem.add_dependency 'bundler', '~> 1.10.6'
|
25
25
|
gem.add_dependency 'gli', '~> 2.13.2'
|
26
|
-
gem.add_dependency 'phut', '~> 0.7.
|
27
|
-
gem.add_dependency 'pio', '~> 0.
|
26
|
+
gem.add_dependency 'phut', '~> 0.7.2'
|
27
|
+
gem.add_dependency 'pio', '~> 0.29.0'
|
28
28
|
|
29
29
|
# Docs
|
30
30
|
gem.add_development_dependency 'relish', '~> 0.7.1'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.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-11-
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.7.
|
47
|
+
version: 0.7.2
|
48
48
|
type: :runtime
|
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: 0.7.
|
54
|
+
version: 0.7.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pio
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.29.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.29.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: relish
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|