trema 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/ruby/trema/send-out-port.rb +16 -18
- data/ruby/trema/set-config.c +5 -7
- data/ruby/trema/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -91,7 +91,7 @@ The following OpenFlow messages can be sent with
|
|
91
91
|
[Trema::Controller#send_message](http://rubydoc.info/github/trema/trema/master/Trema/Controller:send_message)
|
92
92
|
|
93
93
|
* [Trema::FeaturesRequest](http://rubydoc.info/github/trema/trema/master/Trema/FeaturesRequest)
|
94
|
-
* [Trema::
|
94
|
+
* [Trema::SetConfig](http://rubydoc.info/github/trema/trema/master/Trema/SetConfig)
|
95
95
|
* [Trema::GetConfigRequest](http://rubydoc.info/github/trema/trema/master/Trema/GetConfigRequest)
|
96
96
|
* [Trema::QueueGetConfigRequest](http://rubydoc.info/github/trema/trema/master/Trema/QueueGetConfigRequest)
|
97
97
|
* [Trema::DescStatsRequest](http://rubydoc.info/github/trema/trema/master/Trema/DescStatsRequest)
|
data/ruby/trema/send-out-port.rb
CHANGED
@@ -37,19 +37,17 @@ module Trema
|
|
37
37
|
#
|
38
38
|
# @example
|
39
39
|
# SendOutPort.new( 1 )
|
40
|
-
# SendOutPort.new( :port_number => 1, :max_len => 256 )
|
41
40
|
# SendOutPort.new( :port_number => 1 )
|
42
41
|
# SendOutPort.new( :port_number => 1, :max_len => 256 )
|
43
42
|
#
|
44
|
-
# @param [Hash] options
|
45
|
-
# the options hash to create this action class instance with.
|
43
|
+
# @param [Integer|Hash] options
|
44
|
+
# the port number or the options hash to create this action class instance with.
|
46
45
|
#
|
47
46
|
# @option options [Number] :port_number
|
48
47
|
# port number an index into switch's physical port list. There are also
|
49
48
|
# fake output ports. For example a port number set to +OFPP_FLOOD+ would
|
50
49
|
# output packets to all physical ports except input port and ports
|
51
50
|
# disabled by STP.
|
52
|
-
#
|
53
51
|
# @option options [Number] :max_len
|
54
52
|
# the maximum number of bytes from a packet to send to controller when port
|
55
53
|
# is set to +OFPP_CONTROLLER+. A zero length means no bytes of the packet
|
@@ -72,27 +70,27 @@ module Trema
|
|
72
70
|
check_port_number
|
73
71
|
check_max_len
|
74
72
|
end
|
75
|
-
end
|
76
73
|
|
77
74
|
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
##############################################################################
|
76
|
+
private
|
77
|
+
##############################################################################
|
81
78
|
|
82
79
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
80
|
+
def check_port_number
|
81
|
+
if @port_number.nil?
|
82
|
+
raise ArgumentError, "Port number is a mandatory option"
|
83
|
+
end
|
84
|
+
if not @port_number.unsigned_16bit?
|
85
|
+
raise ArgumentError, "Port number must be an unsigned 16-bit integer"
|
86
|
+
end
|
89
87
|
end
|
90
|
-
end
|
91
88
|
|
92
89
|
|
93
|
-
|
94
|
-
|
95
|
-
|
90
|
+
def check_max_len
|
91
|
+
if not @max_len.unsigned_16bit?
|
92
|
+
raise ArgumentError, "Max length must be an unsigned 16-bit integer"
|
93
|
+
end
|
96
94
|
end
|
97
95
|
end
|
98
96
|
|
data/ruby/trema/set-config.c
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
/*
|
2
|
-
* Author: Nick Karanatsios <nickkaranatsios@gmail.com>
|
3
|
-
*
|
4
2
|
* Copyright (C) 2008-2012 NEC Corporation
|
5
3
|
*
|
6
4
|
* This program is free software; you can redistribute it and/or modify
|
@@ -41,12 +39,12 @@ set_config_alloc( VALUE klass ) {
|
|
41
39
|
* @overload initialize(options={})
|
42
40
|
*
|
43
41
|
* @example
|
44
|
-
*
|
45
|
-
*
|
42
|
+
* SetConfig.new
|
43
|
+
* SetConfig.new(
|
46
44
|
* :flags => OFPC_FRAG_DROP,
|
47
45
|
* :miss_send_len => 256
|
48
46
|
* )
|
49
|
-
*
|
47
|
+
* SetConfig.new(
|
50
48
|
* :flags => OFPC_FRAG_DROP,
|
51
49
|
* :miss_send_len => 256,
|
52
50
|
* :transaction_id => 123
|
@@ -68,7 +66,7 @@ set_config_alloc( VALUE klass ) {
|
|
68
66
|
*
|
69
67
|
* @return [SetConfig]
|
70
68
|
* an object that encapsulates the +OFPT_SET_CONFIG+ OpenFlow message.
|
71
|
-
*/
|
69
|
+
*/
|
72
70
|
static VALUE
|
73
71
|
set_config_init( int argc, VALUE *argv, VALUE self ) {
|
74
72
|
buffer *set_config;
|
@@ -120,7 +118,7 @@ set_config_transaction_id( VALUE self ) {
|
|
120
118
|
|
121
119
|
/*
|
122
120
|
* A 2-bit value that can be set to indicate no special handling, drop or reassemble
|
123
|
-
* IP fragments.
|
121
|
+
* IP fragments.
|
124
122
|
*
|
125
123
|
* @return [Number] the value of flags.
|
126
124
|
*/
|
data/ruby/trema/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 5
|
10
|
+
version: 0.2.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Yasuhito Takamiya
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: .
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-08-01 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|