openflow-protocol 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openflow-protocol/messages/packet_in.rb +1 -1
  3. data/lib/openflow-protocol/version.rb +1 -1
  4. data/spec/actions/action_enqueue_spec.rb +4 -4
  5. data/spec/actions/action_output_spec.rb +4 -4
  6. data/spec/actions/action_set_destination_port_spec.rb +4 -4
  7. data/spec/actions/action_set_ip_destination_spec.rb +4 -4
  8. data/spec/actions/action_set_ip_source_spec.rb +4 -4
  9. data/spec/actions/action_set_ip_tos_spec.rb +4 -4
  10. data/spec/actions/action_set_mac_destination_spec.rb +4 -4
  11. data/spec/actions/action_set_mac_source_spec.rb +4 -4
  12. data/spec/actions/action_set_source_port_spec.rb +4 -4
  13. data/spec/actions/action_set_vlan_id_spec.rb +4 -4
  14. data/spec/actions/action_set_vlan_pcp_spec.rb +4 -4
  15. data/spec/actions/action_strip_vlan_spec.rb +3 -3
  16. data/spec/actions/action_vendor_spec.rb +4 -4
  17. data/spec/actions/actions_spec.rb +6 -6
  18. data/spec/messages/barrier_reply_spec.rb +9 -9
  19. data/spec/messages/barrier_request_spec.rb +9 -9
  20. data/spec/messages/echo_reply_spec.rb +13 -13
  21. data/spec/messages/echo_request_spec.rb +16 -16
  22. data/spec/messages/error_spec.rb +11 -11
  23. data/spec/messages/features_reply_spec.rb +11 -11
  24. data/spec/messages/features_request_spec.rb +9 -9
  25. data/spec/messages/flow_mod_spec.rb +12 -12
  26. data/spec/messages/flow_removed_spec.rb +9 -9
  27. data/spec/messages/get_config_reply_spec.rb +9 -9
  28. data/spec/messages/get_config_request_spec.rb +9 -9
  29. data/spec/messages/hello_spec.rb +9 -9
  30. data/spec/messages/packet_in_spec.rb +9 -9
  31. data/spec/messages/packet_out_spec.rb +10 -10
  32. data/spec/messages/parser_spec.rb +7 -7
  33. data/spec/messages/port_mod_spec.rb +9 -9
  34. data/spec/messages/port_status_spec.rb +10 -10
  35. data/spec/messages/queue_get_config_reply_spec.rb +9 -9
  36. data/spec/messages/queue_get_config_request_spec.rb +9 -9
  37. data/spec/messages/set_config_spec.rb +9 -9
  38. data/spec/messages/statistics/aggregate_statistics_reply_spec.rb +4 -4
  39. data/spec/messages/statistics/aggregate_statistics_request_spec.rb +4 -4
  40. data/spec/messages/statistics/description_statistics_spec.rb +4 -4
  41. data/spec/messages/statistics/flow_statistics_reply_spec.rb +4 -4
  42. data/spec/messages/statistics/flow_statistics_request_spec.rb +4 -4
  43. data/spec/messages/statistics/port_statistics_reply_spec.rb +4 -4
  44. data/spec/messages/statistics/port_statistics_request_spec.rb +4 -4
  45. data/spec/messages/statistics/queue_statistics_reply_spec.rb +4 -4
  46. data/spec/messages/statistics/queue_statistics_request_spec.rb +4 -4
  47. data/spec/messages/statistics/table_statistics_spec.rb +4 -4
  48. data/spec/messages/statistics/vendor_statistics_spec.rb +4 -4
  49. data/spec/messages/statistics_reply_spec.rb +62 -62
  50. data/spec/messages/statistics_request_spec.rb +45 -45
  51. data/spec/messages/vendor_spec.rb +13 -13
  52. data/spec/spec_helper.rb +4 -0
  53. data/spec/structs/match_spec.rb +7 -7
  54. data/spec/structs/packet_queue_spec.rb +5 -5
  55. data/spec/structs/physical_port_spec.rb +16 -16
  56. data/spec/structs/port_number_spec.rb +11 -11
  57. data/spec/structs/queue_properties/queue_properties_spec.rb +5 -5
  58. data/spec/structs/queue_properties/queue_property_min_rate_spec.rb +5 -5
  59. data/spec/structs/queue_properties/queue_property_none_spec.rb +3 -3
  60. metadata +20 -6
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::PhysicalPort do
1
+ describe PhysicalPort do
2
2
  it 'should read binary' do
3
- phy_port = OpenFlow::Protocol::PhysicalPort.read [
3
+ phy_port = PhysicalPort.read [
4
4
  0, 1, # port_number
5
5
  0, 0, 0, 0, 0, 1, # hardware_address
6
6
  112, 111, 114, 116, # name
@@ -19,13 +19,13 @@ describe OpenFlow::Protocol::PhysicalPort do
19
19
  expect(phy_port.name).to eq('port-1')
20
20
  expect(phy_port.config).to eq([:port_down])
21
21
  expect(phy_port.state).to eq([:link_down])
22
- expect(phy_port.current_features).to eq(OpenFlow::Protocol::PhysicalPort::FEATURES)
23
- expect(phy_port.advertised_features).to eq(OpenFlow::Protocol::PhysicalPort::FEATURES)
24
- expect(phy_port.supported_features).to eq(OpenFlow::Protocol::PhysicalPort::FEATURES)
25
- expect(phy_port.peer_features).to eq(OpenFlow::Protocol::PhysicalPort::FEATURES)
22
+ expect(phy_port.current_features).to eq(PhysicalPort::FEATURES)
23
+ expect(phy_port.advertised_features).to eq(PhysicalPort::FEATURES)
24
+ expect(phy_port.supported_features).to eq(PhysicalPort::FEATURES)
25
+ expect(phy_port.peer_features).to eq(PhysicalPort::FEATURES)
26
26
  end
27
27
  it 'should initialize with default values' do
28
- phy_port = OpenFlow::Protocol::PhysicalPort.new
28
+ phy_port = PhysicalPort.new
29
29
  expect(phy_port.port_number).to eq(0)
30
30
  expect(phy_port.hardware_address).to eq('00:00:00:00:00:00')
31
31
  expect(phy_port.name).to eq('')
@@ -37,25 +37,25 @@ describe OpenFlow::Protocol::PhysicalPort do
37
37
  expect(phy_port.peer_features).to be_empty
38
38
  end
39
39
  it 'should initialize with some values' do
40
- phy_port = OpenFlow::Protocol::PhysicalPort.new(
40
+ phy_port = PhysicalPort.new(
41
41
  port_number: 1,
42
42
  hardware_address: '00:00:00:00:00:01',
43
43
  name: 'port-1',
44
44
  config: [:port_down],
45
45
  state: [:link_down],
46
- current_features: OpenFlow::Protocol::PhysicalPort::FEATURES,
47
- advertised_features: OpenFlow::Protocol::PhysicalPort::FEATURES,
48
- supported_features: OpenFlow::Protocol::PhysicalPort::FEATURES,
49
- peer_features: OpenFlow::Protocol::PhysicalPort::FEATURES
46
+ current_features: PhysicalPort::FEATURES,
47
+ advertised_features: PhysicalPort::FEATURES,
48
+ supported_features: PhysicalPort::FEATURES,
49
+ peer_features: PhysicalPort::FEATURES
50
50
  )
51
51
  expect(phy_port.port_number).to eq(1)
52
52
  expect(phy_port.hardware_address).to eq('00:00:00:00:00:01')
53
53
  expect(phy_port.name).to eq('port-1')
54
54
  expect(phy_port.config).to eq([:port_down])
55
55
  expect(phy_port.state).to eq([:link_down])
56
- expect(phy_port.current_features).to eq(OpenFlow::Protocol::PhysicalPort::FEATURES)
57
- expect(phy_port.advertised_features).to eq(OpenFlow::Protocol::PhysicalPort::FEATURES)
58
- expect(phy_port.supported_features).to eq(OpenFlow::Protocol::PhysicalPort::FEATURES)
59
- expect(phy_port.peer_features).to eq(OpenFlow::Protocol::PhysicalPort::FEATURES)
56
+ expect(phy_port.current_features).to eq(PhysicalPort::FEATURES)
57
+ expect(phy_port.advertised_features).to eq(PhysicalPort::FEATURES)
58
+ expect(phy_port.supported_features).to eq(PhysicalPort::FEATURES)
59
+ expect(phy_port.peer_features).to eq(PhysicalPort::FEATURES)
60
60
  end
61
61
  end
@@ -1,36 +1,36 @@
1
- describe OpenFlow::Protocol::PortNumberStrict do
1
+ describe PortNumberStrict do
2
2
  it 'should read binary' do
3
- port_number = OpenFlow::Protocol::PortNumberStrict.read [0, 1].pack('C*')
3
+ port_number = PortNumberStrict.read [0, 1].pack('C*')
4
4
  expect(port_number).to eq(1)
5
5
  end
6
6
  it 'should initialize with default values' do
7
- port_number = OpenFlow::Protocol::PortNumberStrict.new
7
+ port_number = PortNumberStrict.new
8
8
  expect(port_number).to eq(0)
9
9
  end
10
10
  it 'should initialize with some values' do
11
- port_number = OpenFlow::Protocol::PortNumberStrict.new(2)
11
+ port_number = PortNumberStrict.new(2)
12
12
  expect(port_number).to eq(2)
13
13
  end
14
14
  it 'should raise an error if greater than max value' do
15
- expect { OpenFlow::Protocol::PortNumberStrict.new(:none) }.to raise_error(ArgumentError)
16
- expect { OpenFlow::Protocol::PortNumberStrict.new(0xff01) }.to raise_error(ArgumentError)
15
+ expect { PortNumberStrict.new(:none) }.to raise_error(ArgumentError)
16
+ expect { PortNumberStrict.new(0xff01) }.to raise_error(ArgumentError)
17
17
  end
18
18
  end
19
19
 
20
- describe OpenFlow::Protocol::PortNumber do
20
+ describe PortNumber do
21
21
  it 'should read binary' do
22
- port_number = OpenFlow::Protocol::PortNumber.read [0, 1].pack('C*')
22
+ port_number = PortNumber.read [0, 1].pack('C*')
23
23
  expect(port_number).to eq(1)
24
24
  end
25
25
  it 'should initialize with default values' do
26
- port_number = OpenFlow::Protocol::PortNumber.new
26
+ port_number = PortNumber.new
27
27
  expect(port_number).to eq(:none)
28
28
  end
29
29
  it 'should initialize with some values' do
30
- port_number = OpenFlow::Protocol::PortNumber.new(:local)
30
+ port_number = PortNumber.new(:local)
31
31
  expect(port_number).to eq(:local)
32
32
  end
33
33
  it 'should raise an error with invalid port' do
34
- expect { OpenFlow::Protocol::PortNumber.new(0xff01) }.to raise_error(ArgumentError)
34
+ expect { PortNumber.new(0xff01) }.to raise_error(ArgumentError)
35
35
  end
36
36
  end
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::QueueProperties do
1
+ describe QueueProperties do
2
2
  it 'should read binary' do
3
- props = OpenFlow::Protocol::QueueProperties.read [
3
+ props = QueueProperties.read [
4
4
  # none
5
5
  0, 0, 0, 8, 0, 0, 0, 0,
6
6
  # min_rate
@@ -13,12 +13,12 @@ describe OpenFlow::Protocol::QueueProperties do
13
13
  expect(props.last.type).to eq(:min_rate)
14
14
  end
15
15
  it 'should initialize with default values' do
16
- props = OpenFlow::Protocol::QueueProperties.new
16
+ props = QueueProperties.new
17
17
  expect(props).to be_empty
18
18
  end
19
19
  it 'should initialize with some values' do
20
- props = OpenFlow::Protocol::QueueProperties.new([
21
- OpenFlow::Protocol::QueuePropertyMinRate.new(rate: 100)
20
+ props = QueueProperties.new([
21
+ QueuePropertyMinRate.new(rate: 100)
22
22
  ])
23
23
  expect(props.length).to eq(1)
24
24
  expect(props.first.type).to eq(:min_rate)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::QueuePropertyMinRate do
1
+ describe QueuePropertyMinRate do
2
2
  it 'should read binary' do
3
- prop = OpenFlow::Protocol::QueuePropertyMinRate.read [
3
+ prop = QueuePropertyMinRate.read [
4
4
  0, 1, 0, 16, 0, 0, 0, 0, # header
5
5
  0, 100, # rate
6
6
  0, 0, 0, 0, 0, 0 # padding
@@ -10,19 +10,19 @@ describe OpenFlow::Protocol::QueuePropertyMinRate do
10
10
  expect(prop.rate).to eq(100)
11
11
  end
12
12
  it 'should initialize with default values' do
13
- prop = OpenFlow::Protocol::QueuePropertyMinRate.new
13
+ prop = QueuePropertyMinRate.new
14
14
  expect(prop.type).to eq(:min_rate)
15
15
  expect(prop.len).to eq(16)
16
16
  expect(prop.rate).to eq(0)
17
17
  end
18
18
  it 'should initialize with some values' do
19
- prop = OpenFlow::Protocol::QueuePropertyMinRate.new(rate: 100)
19
+ prop = QueuePropertyMinRate.new(rate: 100)
20
20
  expect(prop.type).to eq(:min_rate)
21
21
  expect(prop.len).to eq(16)
22
22
  expect(prop.rate).to eq(100)
23
23
  end
24
24
  it 'should disabled rate when > 1000' do
25
- prop = OpenFlow::Protocol::QueuePropertyMinRate.new(rate: 1001)
25
+ prop = QueuePropertyMinRate.new(rate: 1001)
26
26
  expect(prop.type).to eq(:min_rate)
27
27
  expect(prop.len).to eq(16)
28
28
  expect(prop.rate).to eq(:disabled)
@@ -1,11 +1,11 @@
1
- describe OpenFlow::Protocol::QueuePropertyNone do
1
+ describe QueuePropertyNone do
2
2
  it 'should read binary' do
3
- prop = OpenFlow::Protocol::QueuePropertyNone.read [0, 0, 0, 8, 0, 0, 0, 0].pack('C*')
3
+ prop = QueuePropertyNone.read [0, 0, 0, 8, 0, 0, 0, 0].pack('C*')
4
4
  expect(prop.type).to eq(:none)
5
5
  expect(prop.len).to eq(8)
6
6
  end
7
7
  it 'should initialize with default values' do
8
- prop = OpenFlow::Protocol::QueuePropertyNone.new
8
+ prop = QueuePropertyNone.new
9
9
  expect(prop.type).to eq(:none)
10
10
  expect(prop.len).to eq(8)
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openflow-protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémy Pagé
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-12 00:00:00.000000000 Z
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: packet-protocols
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.4'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.4'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: An OpenFlow Parser/Serializer.
56
70
  email:
57
71
  - contact@jeremypage.me