pio 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b5745888688705d7d5a5cf305072b022821e9c2
4
- data.tar.gz: 565161541fb6cf0090bce51b060478c455c3cc2b
3
+ metadata.gz: 83d7de827392e1205ebc738b0f64a580896c1dfe
4
+ data.tar.gz: be008400a4a153f01e08359f6f678e37768b0c5e
5
5
  SHA512:
6
- metadata.gz: 4af67cdf203efe01f2a6c6c1128adc142ca72015bbb2fb5d5d3448c1ea4700bb5eb30fb7ec5329ab3bef2f9bb0b0e678438825c75c6b31f0e0467b21966be9e6
7
- data.tar.gz: 0b12f27bd5eed509ff5471cd4c0ea6d72b193fdfe9a645c979b5bf6b0910d290233988fb2fef0a9aa86dab0e7c9b0540d848ef1e638c8830ffc1ca7abc0dface
6
+ metadata.gz: 130670982b983d7766bcdbc0aa6ed5a414c34b0f104a4e1d4ee0cb7bdef7cd3410a51a65669e29e7db79667c69dd155d881b35c63f2cf610d25df924dceb7253
7
+ data.tar.gz: 280c8072f117262fa5a6865a96f42ce1437cddef488e157d8ab6ea7fe1972591774844b0a9f12d873d11be2611a835f13244fd980b07266055fde676896d3ceb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.1 (1/6/2015)
4
+
5
+ ### Bugs fixed
6
+ * [#104](https://github.com/trema/pio/issues/104): Fix bug when parsing `Pio::PacketOut` with `Pio::StripVlanHeader` action.
7
+
8
+
3
9
  ## 0.10.0 (1/6/2015)
4
10
 
5
11
  ### New features
@@ -51,7 +51,7 @@ module Pio
51
51
  tmp = tmp[action.message_length..-1]
52
52
  actions << action
53
53
  rescue KeyError
54
- raise "action #{type} is not supported." unless ACTION_CLASS[type]
54
+ raise "action type #{type} is not supported."
55
55
  end
56
56
  end
57
57
  actions
@@ -1,19 +1,33 @@
1
1
  require 'bindata'
2
+ require 'forwardable'
2
3
 
3
4
  module Pio
4
5
  # An action to strip the 802.1q header.
5
- class StripVlanHeader < BinData::Record
6
- endian :big
6
+ class StripVlanHeader
7
+ # OpenFlow 1.0 OFPAT_STRIP_VLAN action format.
8
+ class Format < BinData::Record
9
+ endian :big
7
10
 
8
- uint16 :type, value: 3
9
- uint16 :message_length, value: 8
10
- uint32 :padding
11
- hide :padding
11
+ uint16 :type, value: 3
12
+ uint16 :message_length, value: 8
13
+ uint32 :padding
14
+ hide :padding
15
+ end
16
+
17
+ def self.read(raw_data)
18
+ strip_vlan = allocate
19
+ strip_vlan.instance_variable_set :@format, Format.read(raw_data)
20
+ strip_vlan
21
+ end
22
+
23
+ extend Forwardable
12
24
 
13
- alias_method :to_binary, :to_binary_s
25
+ def_delegators :@format, :type
26
+ def_delegators :@format, :message_length
27
+ def_delegator :@format, :to_binary_s, :to_binary
14
28
 
15
- def snapshot
16
- self
29
+ def initialize
30
+ @format = Format.new
17
31
  end
18
32
  end
19
33
  end
data/lib/pio/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Base module.
2
2
  module Pio
3
3
  # gem version.
4
- VERSION = '0.10.0'.freeze
4
+ VERSION = '0.10.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhito Takamiya