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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b01ffc73397a6ba7679ac349cf7f32d7a9a790f0
4
- data.tar.gz: 51c39851e3ee81bf59879c4dfa76b4260144b2bf
3
+ metadata.gz: 0bd2f141b6dabeda2e35d99495b355ea25968d55
4
+ data.tar.gz: ddb27e44037c42ed814a4697fbd6334d096bc0ab
5
5
  SHA512:
6
- metadata.gz: 51bc3a9d20999dab830ad19ed61a1c76be940eddea2fd11edcfef446f34e8ad3ab5ed8c3eacd9b8569c032527603d245ee6e08d82699e844f157407731e580f5
7
- data.tar.gz: 4395f5da25e3339799305a8d791f84fb842fbbadfb06a5a075bf9fe08b11144e6b48166ce750cee13fa7251bf527f8619129e4120107ffc6b3bf3ad0cfad558b
6
+ metadata.gz: 4c8b7487dcd15935b847a2e9bb120b6f4d17cee7cbb2c3e8cda918c3dcafa32bcf7d95d80badec29995b324fb701a9bb758a4cc4732663e33ede082416b0a50f
7
+ data.tar.gz: 18992f20220e9f3034a7111d711c913d755ee6de92898a36685e4f09490c1b29f01f02fbfd043d7dbd048bcfec8fd2f37370857f921a761a4751381a4c00e9d2
@@ -19,7 +19,7 @@ module OpenFlow
19
19
  end
20
20
 
21
21
  def parsed_data
22
- @parsed_data ||= Ethernet.read(data)
22
+ @parsed_data ||= PacketProtocols::Ethernet.read(data)
23
23
  @parsed_data
24
24
  end
25
25
  end
@@ -1,5 +1,5 @@
1
1
  module OpenFlow
2
2
  module Protocol
3
- VERSION = '0.1.8'
3
+ VERSION = '0.1.9'
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionEnqueue do
1
+ describe ActionEnqueue do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionEnqueue.read [
3
+ action = ActionEnqueue.read [
4
4
  0, 11, 0, 16, # header
5
5
  0, 1, # port
6
6
  0, 0, 0, 0, 0, 0, # padding
@@ -12,14 +12,14 @@ describe OpenFlow::Protocol::ActionEnqueue do
12
12
  expect(action.queue_id).to eq(1)
13
13
  end
14
14
  it 'should initialize with default values' do
15
- action = OpenFlow::Protocol::ActionEnqueue.new
15
+ action = ActionEnqueue.new
16
16
  expect(action.type).to eq(:enqueue)
17
17
  expect(action.len).to eq(16)
18
18
  expect(action.port).to eq(:none)
19
19
  expect(action.queue_id).to eq(0)
20
20
  end
21
21
  it 'should initialize with some values' do
22
- action = OpenFlow::Protocol::ActionEnqueue.new(port: 1, queue_id: 1)
22
+ action = ActionEnqueue.new(port: 1, queue_id: 1)
23
23
  expect(action.type).to eq(:enqueue)
24
24
  expect(action.len).to eq(16)
25
25
  expect(action.port).to eq(1)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionOutput do
1
+ describe ActionOutput do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionOutput.read [
3
+ action = ActionOutput.read [
4
4
  0, 0, 0, 8, # header
5
5
  0, 1, # port
6
6
  0xff, 0xff # max_length
@@ -11,14 +11,14 @@ describe OpenFlow::Protocol::ActionOutput do
11
11
  expect(action.max_length).to eq(0xffff)
12
12
  end
13
13
  it 'should initialize with default values' do
14
- action = OpenFlow::Protocol::ActionOutput.new
14
+ action = ActionOutput.new
15
15
  expect(action.type).to eq(:output)
16
16
  expect(action.len).to eq(8)
17
17
  expect(action.port).to eq(:none)
18
18
  expect(action.max_length).to eq(0xffff)
19
19
  end
20
20
  it 'should initialize with some values' do
21
- action = OpenFlow::Protocol::ActionOutput.new(port: 1)
21
+ action = ActionOutput.new(port: 1)
22
22
  expect(action.type).to eq(:output)
23
23
  expect(action.len).to eq(8)
24
24
  expect(action.port).to eq(1)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetDestinationPort do
1
+ describe ActionSetDestinationPort do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetDestinationPort.read [
3
+ action = ActionSetDestinationPort.read [
4
4
  0, 10, 0, 8, # header
5
5
  0, 1, # port
6
6
  0, 0 # padding
@@ -10,13 +10,13 @@ describe OpenFlow::Protocol::ActionSetDestinationPort do
10
10
  expect(action.port).to eq(1)
11
11
  end
12
12
  it 'should initialize with default values' do
13
- action = OpenFlow::Protocol::ActionSetDestinationPort.new
13
+ action = ActionSetDestinationPort.new
14
14
  expect(action.type).to eq(:set_destination_port)
15
15
  expect(action.len).to eq(8)
16
16
  expect(action.port).to eq(0)
17
17
  end
18
18
  it 'should initialize with some values' do
19
- action = OpenFlow::Protocol::ActionSetDestinationPort.new(port: 1)
19
+ action = ActionSetDestinationPort.new(port: 1)
20
20
  expect(action.type).to eq(:set_destination_port)
21
21
  expect(action.len).to eq(8)
22
22
  expect(action.port).to eq(1)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetIpDestination do
1
+ describe ActionSetIpDestination do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetIpDestination.read [
3
+ action = ActionSetIpDestination.read [
4
4
  0, 7, 0, 8, # header
5
5
  10, 0, 0, 1 # ip_address
6
6
  ].pack('C*')
@@ -9,13 +9,13 @@ describe OpenFlow::Protocol::ActionSetIpDestination do
9
9
  expect(action.ip_address).to eq('10.0.0.1')
10
10
  end
11
11
  it 'should initialize with default values' do
12
- action = OpenFlow::Protocol::ActionSetIpDestination.new
12
+ action = ActionSetIpDestination.new
13
13
  expect(action.type).to eq(:set_ip_destination)
14
14
  expect(action.len).to eq(8)
15
15
  expect(action.ip_address).to eq('0.0.0.0')
16
16
  end
17
17
  it 'should initialize with some values' do
18
- action = OpenFlow::Protocol::ActionSetIpDestination.new(ip_address: '10.0.0.1')
18
+ action = ActionSetIpDestination.new(ip_address: '10.0.0.1')
19
19
  expect(action.type).to eq(:set_ip_destination)
20
20
  expect(action.len).to eq(8)
21
21
  expect(action.ip_address).to eq('10.0.0.1')
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetIpSource do
1
+ describe ActionSetIpSource do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetIpSource.read [
3
+ action = ActionSetIpSource.read [
4
4
  0, 6, 0, 8, # header
5
5
  10, 0, 0, 1 # ip_address
6
6
  ].pack('C*')
@@ -9,13 +9,13 @@ describe OpenFlow::Protocol::ActionSetIpSource do
9
9
  expect(action.ip_address).to eq('10.0.0.1')
10
10
  end
11
11
  it 'should initialize with default values' do
12
- action = OpenFlow::Protocol::ActionSetIpSource.new
12
+ action = ActionSetIpSource.new
13
13
  expect(action.type).to eq(:set_ip_source)
14
14
  expect(action.len).to eq(8)
15
15
  expect(action.ip_address).to eq('0.0.0.0')
16
16
  end
17
17
  it 'should initialize with some values' do
18
- action = OpenFlow::Protocol::ActionSetIpSource.new(ip_address: '10.0.0.1')
18
+ action = ActionSetIpSource.new(ip_address: '10.0.0.1')
19
19
  expect(action.type).to eq(:set_ip_source)
20
20
  expect(action.len).to eq(8)
21
21
  expect(action.ip_address).to eq('10.0.0.1')
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetIpTos do
1
+ describe ActionSetIpTos do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetIpTos.read [
3
+ action = ActionSetIpTos.read [
4
4
  0, 8, 0, 8, # header
5
5
  10, # tos
6
6
  0, 0, 0 # padding
@@ -10,13 +10,13 @@ describe OpenFlow::Protocol::ActionSetIpTos do
10
10
  expect(action.tos).to eq(10)
11
11
  end
12
12
  it 'should initialize with default values' do
13
- action = OpenFlow::Protocol::ActionSetIpTos.new
13
+ action = ActionSetIpTos.new
14
14
  expect(action.type).to eq(:set_ip_tos)
15
15
  expect(action.len).to eq(8)
16
16
  expect(action.tos).to eq(0)
17
17
  end
18
18
  it 'should initialize with some values' do
19
- action = OpenFlow::Protocol::ActionSetIpTos.new(tos: 10)
19
+ action = ActionSetIpTos.new(tos: 10)
20
20
  expect(action.type).to eq(:set_ip_tos)
21
21
  expect(action.len).to eq(8)
22
22
  expect(action.tos).to eq(10)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetMacDestination do
1
+ describe ActionSetMacDestination do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetMacDestination.read [
3
+ action = ActionSetMacDestination.read [
4
4
  0, 5, 0, 16, # header
5
5
  0, 0, 0, 0, 0, 1, # mac_address
6
6
  0, 0, 0, 0, 0, 0 # padding
@@ -10,13 +10,13 @@ describe OpenFlow::Protocol::ActionSetMacDestination do
10
10
  expect(action.mac_address).to eq('00:00:00:00:00:01')
11
11
  end
12
12
  it 'should initialize with default values' do
13
- action = OpenFlow::Protocol::ActionSetMacDestination.new
13
+ action = ActionSetMacDestination.new
14
14
  expect(action.type).to eq(:set_mac_destination)
15
15
  expect(action.len).to eq(16)
16
16
  expect(action.mac_address).to eq('00:00:00:00:00:00')
17
17
  end
18
18
  it 'should initialize with some values' do
19
- action = OpenFlow::Protocol::ActionSetMacDestination.new(mac_address: '00:00:00:00:00:01')
19
+ action = ActionSetMacDestination.new(mac_address: '00:00:00:00:00:01')
20
20
  expect(action.type).to eq(:set_mac_destination)
21
21
  expect(action.len).to eq(16)
22
22
  expect(action.mac_address).to eq('00:00:00:00:00:01')
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetMacSource do
1
+ describe ActionSetMacSource do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetMacSource.read [
3
+ action = ActionSetMacSource.read [
4
4
  0, 4, 0, 16, # header
5
5
  0, 0, 0, 0, 0, 1, # mac_address
6
6
  0, 0, 0, 0, 0, 0 # padding
@@ -10,13 +10,13 @@ describe OpenFlow::Protocol::ActionSetMacSource do
10
10
  expect(action.mac_address).to eq('00:00:00:00:00:01')
11
11
  end
12
12
  it 'should initialize with default values' do
13
- action = OpenFlow::Protocol::ActionSetMacSource.new
13
+ action = ActionSetMacSource.new
14
14
  expect(action.type).to eq(:set_mac_source)
15
15
  expect(action.len).to eq(16)
16
16
  expect(action.mac_address).to eq('00:00:00:00:00:00')
17
17
  end
18
18
  it 'should initialize with some values' do
19
- action = OpenFlow::Protocol::ActionSetMacSource.new(mac_address: '00:00:00:00:00:01')
19
+ action = ActionSetMacSource.new(mac_address: '00:00:00:00:00:01')
20
20
  expect(action.type).to eq(:set_mac_source)
21
21
  expect(action.len).to eq(16)
22
22
  expect(action.mac_address).to eq('00:00:00:00:00:01')
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetSourcePort do
1
+ describe ActionSetSourcePort do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetSourcePort.read [
3
+ action = ActionSetSourcePort.read [
4
4
  0, 9, 0, 8, # header
5
5
  0, 1, # port
6
6
  0, 0 # padding
@@ -10,13 +10,13 @@ describe OpenFlow::Protocol::ActionSetSourcePort do
10
10
  expect(action.port).to eq(1)
11
11
  end
12
12
  it 'should initialize with default values' do
13
- action = OpenFlow::Protocol::ActionSetSourcePort.new
13
+ action = ActionSetSourcePort.new
14
14
  expect(action.type).to eq(:set_source_port)
15
15
  expect(action.len).to eq(8)
16
16
  expect(action.port).to eq(0)
17
17
  end
18
18
  it 'should initialize with some values' do
19
- action = OpenFlow::Protocol::ActionSetSourcePort.new(port: 1)
19
+ action = ActionSetSourcePort.new(port: 1)
20
20
  expect(action.type).to eq(:set_source_port)
21
21
  expect(action.len).to eq(8)
22
22
  expect(action.port).to eq(1)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetVlanId do
1
+ describe ActionSetVlanId do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetVlanId.read [
3
+ action = ActionSetVlanId.read [
4
4
  0, 1, 0, 8, # header
5
5
  0, 1, # vlan_id
6
6
  0, 0 # padding
@@ -10,13 +10,13 @@ describe OpenFlow::Protocol::ActionSetVlanId do
10
10
  expect(action.vlan_id).to eq(1)
11
11
  end
12
12
  it 'should initialize with default values' do
13
- action = OpenFlow::Protocol::ActionSetVlanId.new
13
+ action = ActionSetVlanId.new
14
14
  expect(action.type).to eq(:set_vlan_id)
15
15
  expect(action.len).to eq(8)
16
16
  expect(action.vlan_id).to eq(0)
17
17
  end
18
18
  it 'should initialize with some values' do
19
- action = OpenFlow::Protocol::ActionSetVlanId.new(vlan_id: 1)
19
+ action = ActionSetVlanId.new(vlan_id: 1)
20
20
  expect(action.type).to eq(:set_vlan_id)
21
21
  expect(action.len).to eq(8)
22
22
  expect(action.vlan_id).to eq(1)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionSetVlanPcp do
1
+ describe ActionSetVlanPcp do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionSetVlanPcp.read [
3
+ action = ActionSetVlanPcp.read [
4
4
  0, 2, 0, 8, # header
5
5
  1, # vlan_pcp
6
6
  0, 0, 0 # padding
@@ -10,13 +10,13 @@ describe OpenFlow::Protocol::ActionSetVlanPcp do
10
10
  expect(action.vlan_pcp).to eq(1)
11
11
  end
12
12
  it 'should initialize with default values' do
13
- action = OpenFlow::Protocol::ActionSetVlanPcp.new
13
+ action = ActionSetVlanPcp.new
14
14
  expect(action.type).to eq(:set_vlan_pcp)
15
15
  expect(action.len).to eq(8)
16
16
  expect(action.vlan_pcp).to eq(0)
17
17
  end
18
18
  it 'should initialize with some values' do
19
- action = OpenFlow::Protocol::ActionSetVlanPcp.new(vlan_pcp: 1)
19
+ action = ActionSetVlanPcp.new(vlan_pcp: 1)
20
20
  expect(action.type).to eq(:set_vlan_pcp)
21
21
  expect(action.len).to eq(8)
22
22
  expect(action.vlan_pcp).to eq(1)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionStripVlan do
1
+ describe ActionStripVlan do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionStripVlan.read [
3
+ action = ActionStripVlan.read [
4
4
  0, 3, 0, 8, # header
5
5
  0, 0, 0, 0 # padding
6
6
  ].pack('C*')
@@ -8,7 +8,7 @@ describe OpenFlow::Protocol::ActionStripVlan do
8
8
  expect(action.len).to eq(8)
9
9
  end
10
10
  it 'should initialize with default values' do
11
- action = OpenFlow::Protocol::ActionStripVlan.new
11
+ action = ActionStripVlan.new
12
12
  expect(action.type).to eq(:strip_vlan)
13
13
  expect(action.len).to eq(8)
14
14
  end
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::ActionVendor do
1
+ describe ActionVendor do
2
2
  it 'should read binary' do
3
- action = OpenFlow::Protocol::ActionVendor.read [
3
+ action = ActionVendor.read [
4
4
  0xff, 0xff, 0, 8, # header
5
5
  0, 0, 0, 1 # vendor
6
6
  ].pack('C*')
@@ -9,13 +9,13 @@ describe OpenFlow::Protocol::ActionVendor do
9
9
  expect(action.vendor).to eq(1)
10
10
  end
11
11
  it 'should initialize with default values' do
12
- action = OpenFlow::Protocol::ActionVendor.new
12
+ action = ActionVendor.new
13
13
  expect(action.type).to eq(:vendor)
14
14
  expect(action.len).to eq(8)
15
15
  expect(action.vendor).to eq(0)
16
16
  end
17
17
  it 'should initialize with some values' do
18
- action = OpenFlow::Protocol::ActionVendor.new(vendor: 1)
18
+ action = ActionVendor.new(vendor: 1)
19
19
  expect(action.type).to eq(:vendor)
20
20
  expect(action.len).to eq(8)
21
21
  expect(action.vendor).to eq(1)
@@ -1,6 +1,6 @@
1
- describe OpenFlow::Protocol::Actions do
1
+ describe Actions do
2
2
  it 'should read binary' do
3
- actions = OpenFlow::Protocol::Actions.read [
3
+ actions = Actions.read [
4
4
  # output
5
5
  0, 0, 0, 8, # header
6
6
  0, 1, # port
@@ -16,13 +16,13 @@ describe OpenFlow::Protocol::Actions do
16
16
  expect(actions.last.type).to eq(:enqueue)
17
17
  end
18
18
  it 'should initialize with default values' do
19
- actions = OpenFlow::Protocol::Actions.new
19
+ actions = Actions.new
20
20
  expect(actions).to be_empty
21
21
  end
22
22
  it 'should initialize with some values' do
23
- actions = OpenFlow::Protocol::Actions.new([
24
- OpenFlow::Protocol::ActionOutput.new(port: 1, max_length: 0xffff),
25
- OpenFlow::Protocol::ActionEnqueue.new(port: 1, queue_id: 1)
23
+ actions = Actions.new([
24
+ ActionOutput.new(port: 1, max_length: 0xffff),
25
+ ActionEnqueue.new(port: 1, queue_id: 1)
26
26
  ])
27
27
  expect(actions.length).to eq(2)
28
28
  expect(actions.first.type).to eq(:output)
@@ -1,27 +1,27 @@
1
- describe OpenFlow::Protocol::BarrierReply do
1
+ describe BarrierReply do
2
2
  let(:data) { [1, 19, 0, 8, 0, 0, 0, 1].pack('C*') }
3
3
 
4
4
  it 'should read binary' do
5
- msg = OpenFlow::Protocol::BarrierReply.read(data)
6
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
5
+ msg = BarrierReply.read(data)
6
+ expect(msg.version).to eq(Message::OFP_VERSION)
7
7
  expect(msg.type).to eq(:barrier_reply)
8
8
  expect(msg.len).to eq(8)
9
9
  expect(msg.xid).to eq(1)
10
10
  end
11
11
  it 'should be parsable' do
12
- msg = OpenFlow::Protocol::Parser.read(data)
13
- expect(msg.class).to eq(OpenFlow::Protocol::BarrierReply)
12
+ msg = Parser.read(data)
13
+ expect(msg.class).to eq(BarrierReply)
14
14
  end
15
15
  it 'should initialize with default values' do
16
- msg = OpenFlow::Protocol::BarrierReply.new
17
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
16
+ msg = BarrierReply.new
17
+ expect(msg.version).to eq(Message::OFP_VERSION)
18
18
  expect(msg.type).to eq(:barrier_reply)
19
19
  expect(msg.len).to eq(8)
20
20
  expect(msg.xid).to eq(0)
21
21
  end
22
22
  it 'should initialize with some values' do
23
- msg = OpenFlow::Protocol::BarrierReply.new(xid: 1)
24
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
23
+ msg = BarrierReply.new(xid: 1)
24
+ expect(msg.version).to eq(Message::OFP_VERSION)
25
25
  expect(msg.type).to eq(:barrier_reply)
26
26
  expect(msg.len).to eq(8)
27
27
  expect(msg.xid).to eq(1)
@@ -1,27 +1,27 @@
1
- describe OpenFlow::Protocol::BarrierRequest do
1
+ describe BarrierRequest do
2
2
  let(:data) { [1, 18, 0, 8, 0, 0, 0, 1].pack('C*') }
3
3
 
4
4
  it 'should read binary' do
5
- msg = OpenFlow::Protocol::BarrierRequest.read(data)
6
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
5
+ msg = BarrierRequest.read(data)
6
+ expect(msg.version).to eq(Message::OFP_VERSION)
7
7
  expect(msg.type).to eq(:barrier_request)
8
8
  expect(msg.len).to eq(8)
9
9
  expect(msg.xid).to eq(1)
10
10
  end
11
11
  it 'should be parsable' do
12
- msg = OpenFlow::Protocol::Parser.read(data)
13
- expect(msg.class).to eq(OpenFlow::Protocol::BarrierRequest)
12
+ msg = Parser.read(data)
13
+ expect(msg.class).to eq(BarrierRequest)
14
14
  end
15
15
  it 'should initialize with default values' do
16
- msg = OpenFlow::Protocol::BarrierRequest.new
17
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
16
+ msg = BarrierRequest.new
17
+ expect(msg.version).to eq(Message::OFP_VERSION)
18
18
  expect(msg.type).to eq(:barrier_request)
19
19
  expect(msg.len).to eq(8)
20
20
  expect(msg.xid).to eq(0)
21
21
  end
22
22
  it 'should initialize with some values' do
23
- msg = OpenFlow::Protocol::BarrierRequest.new(xid: 1)
24
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
23
+ msg = BarrierRequest.new(xid: 1)
24
+ expect(msg.version).to eq(Message::OFP_VERSION)
25
25
  expect(msg.type).to eq(:barrier_request)
26
26
  expect(msg.len).to eq(8)
27
27
  expect(msg.xid).to eq(1)