openflow-protocol 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/structs/match.rb +12 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a19143ce03f0af527db9a988be729723b124a44c
4
- data.tar.gz: d0340f2fae625e2af33eaebc6b8388d5e52aa091
3
+ metadata.gz: 28435d32c26d648a016d60341a62edf94bf8f8ec
4
+ data.tar.gz: 0429c85f80b866858be757db79de732cd6782106
5
5
  SHA512:
6
- metadata.gz: 68412b48f8dcbadf3156096447c6ce19b4239527bbb21c776fadc990d46c9b7c7d2d5e5ef49070659de58cc0805e10c525b4b1fea0c7702fcf94a48f70c397c8
7
- data.tar.gz: f7cb57d0d333ddba4b0010c5e7949689b9ae3535645e4429140f0b08d914579d9bfd17dcdf6c2c0861e3343ade89244463b52634c8ba344f1bd24ca6018187fd
6
+ metadata.gz: f3161c4bbdd5a4d19838636d169bc71f79e28ab414bbbfdb324c45bda0099939806cf140a2a677cb2f33b67fea34b8e0404f54c8cb76f3623b48973cf19988da
7
+ data.tar.gz: d4a109d1b849be78cc8f076d1f2b683cd79e2389992add739ac76198add198a6372390e212e70554611e211f38ce20d5712b72b4fb3c3e76565fc8cd923a806b
@@ -61,6 +61,18 @@ class OFMatch < BinData::Record
61
61
  end
62
62
  end
63
63
 
64
+ def self.create(options = {})
65
+ unless options[:wildcards]
66
+ options[:wildcards] = {}
67
+ %i(in_port vlan_id mac_source mac_destination mac_protocol ip_protocol source_port destination_port ip_source ip_destination vlan_pcp ip_tos).each do |flag|
68
+ wild_flag = flag
69
+ wild_flag = "#{flag}_all".to_sym if %i(ip_source ip_destination).include? flag
70
+ options[:wildcards][wild_flag] = true unless options[flag]
71
+ end
72
+ end
73
+ self.new options
74
+ end
75
+
64
76
  endian :big
65
77
  wildcards :wildcards
66
78
  of_port_number :in_port, initial_value: 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openflow-protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémy Pagé