trema 0.1.3.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,12 +112,13 @@ describe "packet-out" do
112
112
  0xabc,
113
113
  :data => data,
114
114
  :actions => Trema::ActionOutput.new( :port => 1 )
115
- )
115
+ )
116
116
  sleep 2
117
117
  vhost( "host2" ).rx_stats.n_pkts.should == 1
118
118
  }
119
119
  end
120
120
  end
121
+
121
122
  end
122
123
 
123
124
 
@@ -38,7 +38,7 @@ describe QueueGetConfigRequest, ".new( VALID OPTIONS )" do
38
38
 
39
39
  context "when #queue_get_config_request is sent" do
40
40
  it "should #queue_get_config_reply" do
41
- pending "#queue_get_config_reply is not implemented in #{Trema::Vendor::openvswitch}"
41
+ pending "#queue_get_config_reply is not implemented in #{Trema.vendor_openvswitch}"
42
42
  class QueueGetConfigController < Controller; end
43
43
  network {
44
44
  vswitch { datapath_id 0xabc }
data/src/lib/ipv4.h CHANGED
@@ -28,7 +28,24 @@
28
28
  #include "buffer.h"
29
29
 
30
30
 
31
- typedef struct iphdr ipv4_header_t;
31
+ typedef struct {
32
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
33
+ unsigned int ihl:4;
34
+ unsigned int version:4;
35
+ #elif __BYTE_ORDER == __BIG_ENDIAN
36
+ unsigned int version:4;
37
+ unsigned int ihl:4;
38
+ #endif
39
+ u_int8_t tos;
40
+ u_int16_t tot_len;
41
+ u_int16_t id;
42
+ u_int16_t frag_off;
43
+ u_int8_t ttl;
44
+ u_int8_t protocol;
45
+ u_int16_t csum;
46
+ u_int32_t saddr;
47
+ u_int32_t daddr;
48
+ } ipv4_header_t;
32
49
 
33
50
 
34
51
  #define IPV4_ADDRLEN 4
@@ -137,7 +137,7 @@ typedef struct {
137
137
 
138
138
  uint8_t igmp_type;
139
139
  uint8_t igmp_code;
140
- uint16_t igmp_cksum;
140
+ uint16_t igmp_checksum;
141
141
  uint32_t igmp_group;
142
142
 
143
143
  uint16_t tcp_src_port;
@@ -185,7 +185,7 @@ parse_ipv4( buffer *buf ) {
185
185
  packet_info->ipv4_frag_off = ntohs( ipv4_header->frag_off );
186
186
  packet_info->ipv4_ttl = ipv4_header->ttl;
187
187
  packet_info->ipv4_protocol = ipv4_header->protocol;
188
- packet_info->ipv4_checksum = ntohs( ipv4_header->check );
188
+ packet_info->ipv4_checksum = ntohs( ipv4_header->csum );
189
189
  packet_info->ipv4_saddr = ntohl( ipv4_header->saddr );
190
190
  packet_info->ipv4_daddr = ntohl( ipv4_header->daddr );
191
191
 
@@ -369,7 +369,7 @@ parse_igmp( buffer *buf ) {
369
369
  igmp_header_t *igmp = ptr;
370
370
  packet_info->igmp_type = igmp->type;
371
371
  packet_info->igmp_code = igmp->code;
372
- packet_info->igmp_cksum = ntohs( igmp->csum );
372
+ packet_info->igmp_checksum = ntohs( igmp->csum );
373
373
  packet_info->igmp_group = ntohl( igmp->group );
374
374
 
375
375
  packet_info->format |= NW_IGMP;
data/trema CHANGED
@@ -22,7 +22,6 @@
22
22
 
23
23
 
24
24
  $LOAD_PATH.unshift File.expand_path( File.join File.dirname( __FILE__ ), "ruby" )
25
- $LOAD_PATH.unshift File.expand_path( File.join File.dirname( __FILE__ ), "vendor", "ruby-ifconfig-1.2", "lib" )
26
25
 
27
26
 
28
27
  require "English"
@@ -61,9 +60,9 @@ def method_for command
61
60
  end
62
61
 
63
62
 
64
- FileUtils.mkdir_p Trema.log_directory
65
- FileUtils.mkdir_p Trema.pid_directory
66
- FileUtils.mkdir_p Trema.sock_directory
63
+ FileUtils.mkdir_p Trema.log
64
+ FileUtils.mkdir_p Trema.pid
65
+ FileUtils.mkdir_p Trema.sock
67
66
 
68
67
  command = ARGV.shift
69
68
  if method_for( command )
data/trema.gemspec CHANGED
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "trema"
8
- s.version = "0.1.3.2"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Yasuhito Takamiya"]
12
12
  s.bindir = ["."]
13
- s.date = "2012-02-23"
13
+ s.date = "2012-02-29"
14
14
  s.description = "Trema is a full-stack, easy-to-use framework for developing OpenFlow controllers in Ruby/C"
15
15
  s.email = "yasuhito@gmail.com"
16
16
  s.executables = ["trema", "trema-config"]
@@ -172,6 +172,7 @@ Gem::Specification.new do |s|
172
172
  "ruby/trema/monkey-patch/integer/base-conversions.rb",
173
173
  "ruby/trema/monkey-patch/integer/ranges.rb",
174
174
  "ruby/trema/monkey-patch/module.rb",
175
+ "ruby/trema/monkey-patch/module/class-method.rb",
175
176
  "ruby/trema/monkey-patch/module/deprecation.rb",
176
177
  "ruby/trema/monkey-patch/string.rb",
177
178
  "ruby/trema/monkey-patch/string/inflectors.rb",
@@ -5072,7 +5072,7 @@ setup_ipv4_packet( size_t length, uint16_t type ) {
5072
5072
  ipv4->tos = 0;
5073
5073
  ipv4->tot_len = htons( sizeof( ipv4_header_t ) );
5074
5074
  ipv4->ttl = 0;
5075
- ipv4->check = 0;
5075
+ ipv4->csum = 0;
5076
5076
  ipv4->saddr = htonl( 0xC0A80067 );
5077
5077
  ipv4->daddr = htonl( 0xC0A80036 );
5078
5078
  ipv4->frag_off = htons( 0 );
@@ -565,7 +565,7 @@ test_parse_packet_igmp_query_v2_succeeds() {
565
565
 
566
566
  assert_int_equal( packet_info->igmp_type, IGMP_MEMBERSHIP_QUERY );
567
567
  assert_int_equal( packet_info->igmp_code, 100 );
568
- assert_int_equal( packet_info->igmp_cksum, 0xee9b );
568
+ assert_int_equal( packet_info->igmp_checksum, 0xee9b );
569
569
  assert_int_equal( packet_info->igmp_group, 0 );
570
570
 
571
571
  assert_true( packet_type_igmp_membership_query( buffer ) );
@@ -529,7 +529,7 @@ test_get_checksum_udp_packet() {
529
529
  ipv4_header.frag_off = htons( 0 );
530
530
  ipv4_header.ttl = 0x80;
531
531
  ipv4_header.protocol = 0x11;
532
- ipv4_header.check = 0;
532
+ ipv4_header.csum = 0;
533
533
  ipv4_header.saddr = htonl( 0x0a3835af );
534
534
  ipv4_header.daddr = htonl( 0x0a3837ff );
535
535
 
@@ -553,7 +553,7 @@ test_get_checksum_icmp_packet() {
553
553
  ipv4_header.frag_off = htons( 0 );
554
554
  ipv4_header.ttl = 0x40;
555
555
  ipv4_header.protocol = 0x01;
556
- ipv4_header.check = 0;
556
+ ipv4_header.csum = 0;
557
557
  ipv4_header.saddr = htonl( 0xc0a8642b );
558
558
  ipv4_header.daddr = htonl( 0xc0a8642c );
559
559
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trema
3
3
  version: !ruby/object:Gem::Version
4
- hash: 79
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 3
10
8
  - 2
11
- version: 0.1.3.2
9
+ - 0
10
+ version: 0.2.0
12
11
  platform: ruby
13
12
  authors:
14
13
  - Yasuhito Takamiya
@@ -17,7 +16,7 @@ bindir:
17
16
  - .
18
17
  cert_chain: []
19
18
 
20
- date: 2012-02-23 00:00:00 Z
19
+ date: 2012-02-29 00:00:00 Z
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
22
  name: bundler
@@ -389,6 +388,7 @@ files:
389
388
  - ruby/trema/monkey-patch/integer/base-conversions.rb
390
389
  - ruby/trema/monkey-patch/integer/ranges.rb
391
390
  - ruby/trema/monkey-patch/module.rb
391
+ - ruby/trema/monkey-patch/module/class-method.rb
392
392
  - ruby/trema/monkey-patch/module/deprecation.rb
393
393
  - ruby/trema/monkey-patch/string.rb
394
394
  - ruby/trema/monkey-patch/string/inflectors.rb