trema 0.3.20 → 0.3.21
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/.ruby-version +1 -0
- data/Gemfile +8 -7
- data/README.md +5 -1
- data/Rakefile +1 -4
- data/ruby/trema/match.c +6 -3
- data/ruby/trema/version.rb +1 -1
- data/src/switch_manager/switch_manager.c +1 -0
- data/src/tremashark/tremashark.c +7 -4
- data/trema.gemspec +2 -2
- metadata +75 -32
- checksums.yaml +0 -7
- data/.rvmrc +0 -52
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-1.8.7-p371
|
data/Gemfile
CHANGED
@@ -14,15 +14,16 @@ gemspec
|
|
14
14
|
# Include everything needed to run rake, tests, features, etc.
|
15
15
|
group :development do
|
16
16
|
gem "aruba", "~> 0.5.3"
|
17
|
-
gem "cucumber", "~> 1.3.
|
18
|
-
gem "flay", "~> 2.
|
19
|
-
gem "flog", "~> 4.1.
|
17
|
+
gem "cucumber", "~> 1.3.6"
|
18
|
+
gem "flay", "~> 2.4.0"
|
19
|
+
gem "flog", "~> 4.1.1"
|
20
20
|
gem "rcov", "~> 1.0.0"
|
21
|
-
gem "redcarpet", "~> 2.3.0"
|
22
|
-
gem "
|
21
|
+
gem "redcarpet", "~> 2.3.0" if RUBY_VERSION < "1.9.0"
|
22
|
+
gem "redcarpet", "~> 3.0.0" if RUBY_VERSION >= "1.9.0"
|
23
|
+
gem "reek", "~> 1.3.3"
|
23
24
|
gem "relish", "~> 0.7"
|
24
|
-
gem "rspec", "~> 2.
|
25
|
-
gem "yard", "~> 0.8.
|
25
|
+
gem "rspec", "~> 2.14.1"
|
26
|
+
gem "yard", "~> 0.8.7"
|
26
27
|
end
|
27
28
|
|
28
29
|
|
data/README.md
CHANGED
@@ -66,7 +66,11 @@ Getting Started
|
|
66
66
|
|
67
67
|
$ sudo gem install trema
|
68
68
|
|
69
|
-
3.
|
69
|
+
3.Optional: Install Wireshark to diagnose internal data-flows.
|
70
|
+
|
71
|
+
$ sudo apt-get install wireshark
|
72
|
+
|
73
|
+
4.Follow the guidelines to start developing your OpenFlow controller. You may find the following resources handy:
|
70
74
|
|
71
75
|
* The [Getting Started with Trema](https://github.com/trema/trema/wiki/Quick-start).
|
72
76
|
* The [Trema in 10 Minutes Tutorial](http://trema-10min.heroku.com/).
|
data/Rakefile
CHANGED
@@ -37,10 +37,7 @@ task :build_trema => [ Trema.log, Trema.pid, Trema.sock ] do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
|
40
|
-
require "paper-house
|
41
|
-
require "paper-house/ruby-library-task"
|
42
|
-
require "paper-house/shared-library-task"
|
43
|
-
require "paper-house/static-library-task"
|
40
|
+
require "paper-house"
|
44
41
|
require "trema/version"
|
45
42
|
|
46
43
|
|
data/ruby/trema/match.c
CHANGED
@@ -105,8 +105,8 @@ ofp_match *get_match( VALUE self ) {
|
|
105
105
|
static VALUE
|
106
106
|
match_from( int argc, VALUE *argv, VALUE self ) {
|
107
107
|
VALUE message, obj, wildcard_id, options;
|
108
|
-
struct ofp_match *match;
|
109
|
-
packet_in *packet;
|
108
|
+
struct ofp_match *match = NULL;
|
109
|
+
packet_in *packet = NULL;
|
110
110
|
uint32_t wildcards = 0;
|
111
111
|
|
112
112
|
if ( rb_scan_args( argc, argv, "1*", &message, &options ) >= 1 ) {
|
@@ -153,8 +153,11 @@ match_from( int argc, VALUE *argv, VALUE self ) {
|
|
153
153
|
wildcards |= OFPFW_TP_DST;
|
154
154
|
}
|
155
155
|
}
|
156
|
+
set_match_from_packet( match, packet->in_port, wildcards, packet->data );
|
157
|
+
}
|
158
|
+
else {
|
159
|
+
rb_raise( rb_eArgError, "Message is a mandatory option" );
|
156
160
|
}
|
157
|
-
set_match_from_packet( match, packet->in_port, wildcards, packet->data );
|
158
161
|
return obj;
|
159
162
|
}
|
160
163
|
|
data/ruby/trema/version.rb
CHANGED
@@ -341,6 +341,7 @@ parse_argument( struct listener_info *listener_info, int argc, char *argv[] ) {
|
|
341
341
|
const int switch_arg_begin = optind;
|
342
342
|
|
343
343
|
// reorder switch daemon arguments
|
344
|
+
opterr = 0; // disable error messages of trema common options
|
344
345
|
while ( getopt_long( argc, argv, switch_short_options, switch_long_options, NULL ) != -1 );
|
345
346
|
|
346
347
|
// index of first packet_in::..., etc. in argv
|
data/src/tremashark/tremashark.c
CHANGED
@@ -289,20 +289,20 @@ init_pcap() {
|
|
289
289
|
if ( output_to_pcap_file ) {
|
290
290
|
outfile_fd = open( pcap_file_pathname, O_RDWR | O_CREAT | O_TRUNC, mode );
|
291
291
|
if ( outfile_fd < 0 ) {
|
292
|
-
critical( "Failed to open a file (%s).", pcap_file_pathname );
|
292
|
+
critical( "Failed to open a file ( pcap file = %s ).", pcap_file_pathname );
|
293
293
|
assert( 0 );
|
294
294
|
}
|
295
295
|
}
|
296
296
|
else {
|
297
297
|
int ret = mkfifo( fifo_pathname, mode );
|
298
298
|
if ( ret < 0 ) {
|
299
|
-
critical( "Failed to create a named pipe." );
|
299
|
+
critical( "Failed to create a named pipe ( named pipe = %s ).", fifo_pathname );
|
300
300
|
assert( 0 );
|
301
301
|
}
|
302
302
|
|
303
303
|
outfile_fd = open( fifo_pathname, O_RDWR | O_APPEND | O_NONBLOCK );
|
304
304
|
if ( outfile_fd < 0 ) {
|
305
|
-
critical( "Failed to open a named pipe." );
|
305
|
+
critical( "Failed to open a named pipe ( named pipe = %s ).", fifo_pathname );
|
306
306
|
assert( 0 );
|
307
307
|
}
|
308
308
|
}
|
@@ -310,7 +310,7 @@ init_pcap() {
|
|
310
310
|
ssize_t ret = write( outfile_fd, &header, sizeof( struct pcap_file_header ) );
|
311
311
|
|
312
312
|
if ( ret != sizeof( struct pcap_file_header ) ) {
|
313
|
-
critical( "Failed to write a pcap header." );
|
313
|
+
critical( "Failed to write a pcap header ( pcap file = %s ).", pcap_file_pathname );
|
314
314
|
assert( 0 );
|
315
315
|
}
|
316
316
|
|
@@ -383,10 +383,13 @@ start_wireshark() {
|
|
383
383
|
if ( pid == 0 ) {
|
384
384
|
if ( launch_wireshark ) {
|
385
385
|
execlp( WIRESHARK, "wireshark", "-k", "-i", fifo_pathname, NULL );
|
386
|
+
error( "can't execute wireshark ( errno = %s [%d] ).", strerror( errno ), errno );
|
386
387
|
}
|
387
388
|
else if ( launch_tshark ) {
|
388
389
|
execlp( TSHARK, "tshark", "-V", "-i", fifo_pathname, NULL );
|
390
|
+
error( "can't execute tshark ( errno = %s [%d] ).", strerror( errno ), errno );
|
389
391
|
}
|
392
|
+
exit( EXIT_FAILURE );
|
390
393
|
}
|
391
394
|
}
|
392
395
|
|
data/trema.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do | gem |
|
|
27
27
|
gem.test_files = `git ls-files -- {spec,features}/*`.split( "\n" )
|
28
28
|
|
29
29
|
gem.add_dependency "bundler"
|
30
|
-
gem.add_dependency "gli", "~> 2.
|
31
|
-
gem.add_dependency "paper-house", "~> 0.1
|
30
|
+
gem.add_dependency "gli", "~> 2.7.0"
|
31
|
+
gem.add_dependency "paper-house", "~> 0.3.1"
|
32
32
|
gem.add_dependency "rake", "~> 10.1.0"
|
33
33
|
gem.add_dependency "rdoc", "~> 4.0.1"
|
34
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 57
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 21
|
10
|
+
version: 0.3.21
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Yasuhito Takamiya
|
@@ -9,59 +15,86 @@ autorequire:
|
|
9
15
|
bindir: .
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2013-
|
18
|
+
date: 2013-09-05 00:00:00 Z
|
13
19
|
dependencies:
|
14
20
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
16
|
-
|
17
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
18
23
|
requirements:
|
19
|
-
-
|
20
|
-
- ">="
|
24
|
+
- - ">="
|
21
25
|
- !ruby/object:Gem::Version
|
26
|
+
hash: 3
|
27
|
+
segments:
|
28
|
+
- 0
|
22
29
|
version: "0"
|
30
|
+
name: bundler
|
23
31
|
prerelease: false
|
24
|
-
version_requirements: *id001
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: gli
|
27
32
|
type: :runtime
|
28
|
-
requirement:
|
33
|
+
requirement: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
29
37
|
requirements:
|
30
38
|
- - ~>
|
31
39
|
- !ruby/object:Gem::Version
|
32
|
-
|
40
|
+
hash: 19
|
41
|
+
segments:
|
42
|
+
- 2
|
43
|
+
- 7
|
44
|
+
- 0
|
45
|
+
version: 2.7.0
|
46
|
+
name: gli
|
33
47
|
prerelease: false
|
34
|
-
version_requirements: *id002
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: paper-house
|
37
48
|
type: :runtime
|
38
|
-
requirement:
|
49
|
+
requirement: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
39
53
|
requirements:
|
40
54
|
- - ~>
|
41
55
|
- !ruby/object:Gem::Version
|
42
|
-
|
56
|
+
hash: 17
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
- 3
|
60
|
+
- 1
|
61
|
+
version: 0.3.1
|
62
|
+
name: paper-house
|
43
63
|
prerelease: false
|
44
|
-
version_requirements: *id003
|
45
|
-
- !ruby/object:Gem::Dependency
|
46
|
-
name: rake
|
47
64
|
type: :runtime
|
48
|
-
requirement:
|
65
|
+
requirement: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
49
69
|
requirements:
|
50
70
|
- - ~>
|
51
71
|
- !ruby/object:Gem::Version
|
72
|
+
hash: 75
|
73
|
+
segments:
|
74
|
+
- 10
|
75
|
+
- 1
|
76
|
+
- 0
|
52
77
|
version: 10.1.0
|
78
|
+
name: rake
|
53
79
|
prerelease: false
|
54
|
-
version_requirements: *id004
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rdoc
|
57
80
|
type: :runtime
|
58
|
-
requirement:
|
81
|
+
requirement: *id004
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
59
85
|
requirements:
|
60
86
|
- - ~>
|
61
87
|
- !ruby/object:Gem::Version
|
88
|
+
hash: 61
|
89
|
+
segments:
|
90
|
+
- 4
|
91
|
+
- 0
|
92
|
+
- 1
|
62
93
|
version: 4.0.1
|
94
|
+
name: rdoc
|
63
95
|
prerelease: false
|
64
|
-
|
96
|
+
type: :runtime
|
97
|
+
requirement: *id005
|
65
98
|
description: Trema is a full-stack, easy-to-use framework for developing OpenFlow controllers in Ruby and C.
|
66
99
|
email:
|
67
100
|
- yasuhito@gmail.com
|
@@ -75,7 +108,7 @@ extra_rdoc_files:
|
|
75
108
|
files:
|
76
109
|
- .gitignore
|
77
110
|
- .mono.rant
|
78
|
-
- .
|
111
|
+
- .ruby-version
|
79
112
|
- .travis.yml
|
80
113
|
- .yardopts
|
81
114
|
- Doxyfile
|
@@ -768,27 +801,37 @@ files:
|
|
768
801
|
homepage: http://github.com/trema/trema
|
769
802
|
licenses:
|
770
803
|
- GPL2
|
771
|
-
metadata: {}
|
772
|
-
|
773
804
|
post_install_message:
|
774
805
|
rdoc_options: []
|
775
806
|
|
776
807
|
require_paths:
|
777
808
|
- ruby
|
778
809
|
required_ruby_version: !ruby/object:Gem::Requirement
|
810
|
+
none: false
|
779
811
|
requirements:
|
780
812
|
- - ~>
|
781
813
|
- !ruby/object:Gem::Version
|
814
|
+
hash: 57
|
815
|
+
segments:
|
816
|
+
- 1
|
817
|
+
- 8
|
818
|
+
- 7
|
782
819
|
version: 1.8.7
|
783
820
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
821
|
+
none: false
|
784
822
|
requirements:
|
785
|
-
-
|
823
|
+
- - ">="
|
824
|
+
- !ruby/object:Gem::Version
|
825
|
+
hash: 3
|
826
|
+
segments:
|
827
|
+
- 0
|
828
|
+
version: "0"
|
786
829
|
requirements: []
|
787
830
|
|
788
831
|
rubyforge_project:
|
789
|
-
rubygems_version:
|
832
|
+
rubygems_version: 1.8.25
|
790
833
|
signing_key:
|
791
|
-
specification_version:
|
834
|
+
specification_version: 3
|
792
835
|
summary: Full-stack OpenFlow framework.
|
793
836
|
test_files: []
|
794
837
|
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 16d03309cfb3b65ed463dff0c59990db3f87dc26
|
4
|
-
data.tar.gz: 7e9dbad2ecea2ab026bf0ba0ee3cb79cf2885009
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: be99f19cbba01fd9c25eaaee21389ffc4c334adefc5a5f6b681f8bd89938cef58780cb46bde60997c6d414f124465ef08035a22ed830498d7915c68f55256af5
|
7
|
-
data.tar.gz: 4de20550f57a268e26f419d53510222a5294caee7dc5ce31a472aded241ea7e40b000fbb8a0e235164d64dda1e7664f204e670aa71fa75c0cb38bc4e87c7246a
|
data/.rvmrc
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
-
# development environment upon cd'ing into the directory
|
5
|
-
|
6
|
-
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
-
# Only full ruby name is supported here, for short names use:
|
8
|
-
# echo "rvm use 1.8.7" > .rvmrc
|
9
|
-
environment_id="ruby-1.8.7-p371"
|
10
|
-
|
11
|
-
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
-
# rvmrc_rvm_version="1.18.6 (stable)" # 1.10.1 seams as a safe start
|
13
|
-
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
-
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
-
# return 1
|
16
|
-
# }
|
17
|
-
|
18
|
-
# First we attempt to load the desired environment directly from the environment
|
19
|
-
# file. This is very fast and efficient compared to running through the entire
|
20
|
-
# CLI and selector. If you want feedback on which environment was used then
|
21
|
-
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
-
then
|
25
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
-
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
27
|
-
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
28
|
-
if [[ $- == *i* ]] # check for interactive shells
|
29
|
-
then echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
|
30
|
-
else echo "Using: $GEM_HOME" # don't use colors in non-interactive shells
|
31
|
-
fi
|
32
|
-
else
|
33
|
-
# If the environment file has not yet been created, use the RVM CLI to select.
|
34
|
-
rvm --create use "$environment_id" || {
|
35
|
-
echo "Failed to create RVM environment '${environment_id}'."
|
36
|
-
return 1
|
37
|
-
}
|
38
|
-
fi
|
39
|
-
|
40
|
-
# If you use bundler, this might be useful to you:
|
41
|
-
# if [[ -s Gemfile ]] && {
|
42
|
-
# ! builtin command -v bundle >/dev/null ||
|
43
|
-
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
|
44
|
-
# }
|
45
|
-
# then
|
46
|
-
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
47
|
-
# gem install bundler
|
48
|
-
# fi
|
49
|
-
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
50
|
-
# then
|
51
|
-
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
|
52
|
-
# fi
|