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,45 +1,45 @@
1
- describe OpenFlow::Protocol::EchoReply do
1
+ describe EchoReply do
2
2
  let(:data) { [1, 3, 0, 8, 0, 0, 0, 1].pack('C*') }
3
3
 
4
4
  it 'should read binary' do
5
- msg = OpenFlow::Protocol::EchoReply.read(data)
6
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
5
+ msg = EchoReply.read(data)
6
+ expect(msg.version).to eq(Message::OFP_VERSION)
7
7
  expect(msg.type).to eq(:echo_reply)
8
8
  expect(msg.len).to eq(8)
9
9
  expect(msg.xid).to eq(1)
10
10
  expect(msg.data).to be_empty
11
11
  end
12
12
  it 'should be parsable' do
13
- msg = OpenFlow::Protocol::Parser.read(data)
14
- expect(msg.class).to eq(OpenFlow::Protocol::EchoReply)
13
+ msg = Parser.read(data)
14
+ expect(msg.class).to eq(EchoReply)
15
15
  end
16
16
  it 'should read binary with data' do
17
- msg = OpenFlow::Protocol::EchoReply.read [1, 3, 0, 10, 0, 0, 0, 1, 10, 20].pack('C*')
18
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
17
+ msg = EchoReply.read [1, 3, 0, 10, 0, 0, 0, 1, 10, 20].pack('C*')
18
+ expect(msg.version).to eq(Message::OFP_VERSION)
19
19
  expect(msg.type).to eq(:echo_reply)
20
20
  expect(msg.len).to eq(10)
21
21
  expect(msg.xid).to eq(1)
22
22
  expect(msg.data.length).to eq(2)
23
23
  end
24
24
  it 'should initialize with default values' do
25
- msg = OpenFlow::Protocol::EchoReply.new
26
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
25
+ msg = EchoReply.new
26
+ expect(msg.version).to eq(Message::OFP_VERSION)
27
27
  expect(msg.type).to eq(:echo_reply)
28
28
  expect(msg.len).to eq(8)
29
29
  expect(msg.xid).to eq(0)
30
30
  expect(msg.data).to be_empty
31
31
  end
32
32
  it 'should initialize with some values' do
33
- msg = OpenFlow::Protocol::EchoReply.new(xid: 1)
34
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
33
+ msg = EchoReply.new(xid: 1)
34
+ expect(msg.version).to eq(Message::OFP_VERSION)
35
35
  expect(msg.type).to eq(:echo_reply)
36
36
  expect(msg.len).to eq(8)
37
37
  expect(msg.xid).to eq(1)
38
38
  expect(msg.data).to be_empty
39
39
  end
40
40
  it 'should initialize with data' do
41
- msg = OpenFlow::Protocol::EchoReply.new(data: [10, 20].pack('C*'))
42
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
41
+ msg = EchoReply.new(data: [10, 20].pack('C*'))
42
+ expect(msg.version).to eq(Message::OFP_VERSION)
43
43
  expect(msg.type).to eq(:echo_reply)
44
44
  expect(msg.len).to eq(10)
45
45
  expect(msg.xid).to eq(0)
@@ -1,54 +1,54 @@
1
- describe OpenFlow::Protocol::EchoRequest do
1
+ describe EchoRequest do
2
2
  let(:data) { [1, 2, 0, 8, 0, 0, 0, 1].pack('C*') }
3
3
 
4
4
  it 'should read binary' do
5
- msg = OpenFlow::Protocol::EchoRequest.read(data)
6
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
5
+ msg = EchoRequest.read(data)
6
+ expect(msg.version).to eq(Message::OFP_VERSION)
7
7
  expect(msg.type).to eq(:echo_request)
8
8
  expect(msg.len).to eq(8)
9
9
  expect(msg.xid).to eq(1)
10
10
  expect(msg.data).to be_empty
11
11
  end
12
12
  it 'should be parsable' do
13
- msg = OpenFlow::Protocol::Parser.read(data)
14
- expect(msg.class).to eq(OpenFlow::Protocol::EchoRequest)
13
+ msg = Parser.read(data)
14
+ expect(msg.class).to eq(EchoRequest)
15
15
  end
16
16
  it 'should read binary with data' do
17
- msg = OpenFlow::Protocol::EchoRequest.read [1, 2, 0, 10, 0, 0, 0, 1, 10, 20].pack('C*')
18
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
17
+ msg = EchoRequest.read [1, 2, 0, 10, 0, 0, 0, 1, 10, 20].pack('C*')
18
+ expect(msg.version).to eq(Message::OFP_VERSION)
19
19
  expect(msg.type).to eq(:echo_request)
20
20
  expect(msg.len).to eq(10)
21
21
  expect(msg.xid).to eq(1)
22
22
  expect(msg.data.length).to eq(2)
23
23
  end
24
24
  it 'should initialize with default values' do
25
- msg = OpenFlow::Protocol::EchoRequest.new
26
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
25
+ msg = EchoRequest.new
26
+ expect(msg.version).to eq(Message::OFP_VERSION)
27
27
  expect(msg.type).to eq(:echo_request)
28
28
  expect(msg.len).to eq(8)
29
29
  expect(msg.xid).to eq(0)
30
30
  expect(msg.data).to be_empty
31
31
  end
32
32
  it 'should initialize with some values' do
33
- msg = OpenFlow::Protocol::EchoRequest.new(xid: 1)
34
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
33
+ msg = EchoRequest.new(xid: 1)
34
+ expect(msg.version).to eq(Message::OFP_VERSION)
35
35
  expect(msg.type).to eq(:echo_request)
36
36
  expect(msg.len).to eq(8)
37
37
  expect(msg.xid).to eq(1)
38
38
  expect(msg.data).to be_empty
39
39
  end
40
40
  it 'should initialize with data' do
41
- msg = OpenFlow::Protocol::EchoRequest.new(data: [10, 20].pack('C*'))
42
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
41
+ msg = EchoRequest.new(data: [10, 20].pack('C*'))
42
+ expect(msg.version).to eq(Message::OFP_VERSION)
43
43
  expect(msg.type).to eq(:echo_request)
44
44
  expect(msg.len).to eq(10)
45
45
  expect(msg.xid).to eq(0)
46
46
  expect(msg.data.length).to eq(2)
47
47
  end
48
- it 'should convert to OpenFlow::Protocol::EchoReply' do
49
- msg = OpenFlow::Protocol::EchoRequest.new(xid: 1, data: [10, 20].pack('C*'))
48
+ it 'should convert to EchoReply' do
49
+ msg = EchoRequest.new(xid: 1, data: [10, 20].pack('C*'))
50
50
  msg_reply = msg.to_reply
51
- expect(msg_reply.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
51
+ expect(msg_reply.version).to eq(Message::OFP_VERSION)
52
52
  expect(msg_reply.type).to eq(:echo_reply)
53
53
  expect(msg.len).to eq(msg_reply.len)
54
54
  expect(msg.xid).to eq(msg_reply.xid)
@@ -1,4 +1,4 @@
1
- describe OpenFlow::Protocol::Error do
1
+ describe Error do
2
2
  let(:hello_msg) {
3
3
  [1, 0, 0, 8, 0, 0, 0, 1].pack('C*')
4
4
  }
@@ -11,8 +11,8 @@ describe OpenFlow::Protocol::Error do
11
11
  }
12
12
 
13
13
  it 'should read binary' do
14
- msg = OpenFlow::Protocol::Error.read(data)
15
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
14
+ msg = Error.read(data)
15
+ expect(msg.version).to eq(Message::OFP_VERSION)
16
16
  expect(msg.type).to eq(:error)
17
17
  expect(msg.len).to eq(20)
18
18
  expect(msg.xid).to eq(1)
@@ -24,16 +24,16 @@ describe OpenFlow::Protocol::Error do
24
24
  expect(hello.xid).to eq(1)
25
25
  end
26
26
  it 'should be parsable' do
27
- msg = OpenFlow::Protocol::Parser.read(data)
28
- expect(msg.class).to eq(OpenFlow::Protocol::Error)
27
+ msg = Parser.read(data)
28
+ expect(msg.class).to eq(Error)
29
29
  end
30
30
  it 'should read another binary' do
31
- msg = OpenFlow::Protocol::Error.read [
31
+ msg = Error.read [
32
32
  1, 1, 0, 12, 0, 0, 0, 1, # header
33
33
  0, 2, # type
34
34
  0, 4 # code
35
35
  ].pack('C*')
36
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
36
+ expect(msg.version).to eq(Message::OFP_VERSION)
37
37
  expect(msg.type).to eq(:error)
38
38
  expect(msg.len).to eq(12)
39
39
  expect(msg.xid).to eq(1)
@@ -42,8 +42,8 @@ describe OpenFlow::Protocol::Error do
42
42
  expect(msg.data).to be_empty
43
43
  end
44
44
  it 'should initialize with default values' do
45
- msg = OpenFlow::Protocol::Error.new
46
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
45
+ msg = Error.new
46
+ expect(msg.version).to eq(Message::OFP_VERSION)
47
47
  expect(msg.type).to eq(:error)
48
48
  expect(msg.len).to eq(12)
49
49
  expect(msg.xid).to eq(0)
@@ -52,12 +52,12 @@ describe OpenFlow::Protocol::Error do
52
52
  expect(msg.data).to be_empty
53
53
  end
54
54
  it 'should initialize with some values' do
55
- msg = OpenFlow::Protocol::Error.new(
55
+ msg = Error.new(
56
56
  xid: 1,
57
57
  error_type: :port_mod_failed,
58
58
  error_code: :bad_port
59
59
  )
60
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
60
+ expect(msg.version).to eq(Message::OFP_VERSION)
61
61
  expect(msg.type).to eq(:error)
62
62
  expect(msg.len).to eq(12)
63
63
  expect(msg.xid).to eq(1)
@@ -1,4 +1,4 @@
1
- describe OpenFlow::Protocol::FeaturesReply do
1
+ describe FeaturesReply do
2
2
  let(:data) {
3
3
  [
4
4
  1, 6, 0, 128, 0, 0, 0, 1, # header
@@ -88,8 +88,8 @@ describe OpenFlow::Protocol::FeaturesReply do
88
88
  }
89
89
 
90
90
  it 'should read binary' do
91
- msg = OpenFlow::Protocol::FeaturesReply.read(data)
92
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
91
+ msg = FeaturesReply.read(data)
92
+ expect(msg.version).to eq(Message::OFP_VERSION)
93
93
  expect(msg.type).to eq(:features_reply)
94
94
  expect(msg.len).to eq(128)
95
95
  expect(msg.xid).to eq(1)
@@ -125,16 +125,16 @@ describe OpenFlow::Protocol::FeaturesReply do
125
125
  expect(msg.ports[1].port_number).to eq(2)
126
126
  end
127
127
  it 'should be parsable' do
128
- msg = OpenFlow::Protocol::Parser.read(data)
129
- expect(msg.class).to eq(OpenFlow::Protocol::FeaturesReply)
128
+ msg = Parser.read(data)
129
+ expect(msg.class).to eq(FeaturesReply)
130
130
  end
131
131
  it 'should read a real binary message' do
132
- msg = OpenFlow::Protocol::FeaturesReply.read(real_data)
132
+ msg = FeaturesReply.read(real_data)
133
133
  expect(msg.ports.length).to eq(3)
134
134
  end
135
135
  it 'should initialize with default values' do
136
- msg = OpenFlow::Protocol::FeaturesReply.new
137
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
136
+ msg = FeaturesReply.new
137
+ expect(msg.version).to eq(Message::OFP_VERSION)
138
138
  expect(msg.type).to eq(:features_reply)
139
139
  expect(msg.len).to eq(32)
140
140
  expect(msg.xid).to eq(0)
@@ -146,7 +146,7 @@ describe OpenFlow::Protocol::FeaturesReply do
146
146
  expect(msg.ports).to be_empty
147
147
  end
148
148
  it 'should initialize with some values' do
149
- msg = OpenFlow::Protocol::FeaturesReply.new(
149
+ msg = FeaturesReply.new(
150
150
  xid: 1,
151
151
  datapath_id: 42,
152
152
  n_buffers: 10,
@@ -175,9 +175,9 @@ describe OpenFlow::Protocol::FeaturesReply do
175
175
  :set_tp_dst,
176
176
  :enqueue
177
177
  ],
178
- ports: [OpenFlow::Protocol::PhysicalPort.new]
178
+ ports: [PhysicalPort.new]
179
179
  )
180
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
180
+ expect(msg.version).to eq(Message::OFP_VERSION)
181
181
  expect(msg.type).to eq(:features_reply)
182
182
  expect(msg.len).to eq(80)
183
183
  expect(msg.xid).to eq(1)
@@ -1,27 +1,27 @@
1
- describe OpenFlow::Protocol::FeaturesRequest do
1
+ describe FeaturesRequest do
2
2
  let(:data) { [1, 5, 0, 8, 0, 0, 0, 1].pack('C*') }
3
3
 
4
4
  it 'should read binary' do
5
- msg = OpenFlow::Protocol::FeaturesRequest.read(data)
6
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
5
+ msg = FeaturesRequest.read(data)
6
+ expect(msg.version).to eq(Message::OFP_VERSION)
7
7
  expect(msg.type).to eq(:features_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::FeaturesRequest)
12
+ msg = Parser.read(data)
13
+ expect(msg.class).to eq(FeaturesRequest)
14
14
  end
15
15
  it 'should initialize with default values' do
16
- msg = OpenFlow::Protocol::FeaturesRequest.new
17
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
16
+ msg = FeaturesRequest.new
17
+ expect(msg.version).to eq(Message::OFP_VERSION)
18
18
  expect(msg.type).to eq(:features_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::FeaturesRequest.new(xid: 1)
24
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
23
+ msg = FeaturesRequest.new(xid: 1)
24
+ expect(msg.version).to eq(Message::OFP_VERSION)
25
25
  expect(msg.type).to eq(:features_request)
26
26
  expect(msg.len).to eq(8)
27
27
  expect(msg.xid).to eq(1)
@@ -1,4 +1,4 @@
1
- describe OpenFlow::Protocol::FlowMod do
1
+ describe FlowMod do
2
2
  let(:data) {
3
3
  [
4
4
  1, 14, 0, 80, 0, 0, 0, 1, # header
@@ -38,8 +38,8 @@ describe OpenFlow::Protocol::FlowMod do
38
38
  }
39
39
 
40
40
  it 'should read binary' do
41
- msg = OpenFlow::Protocol::FlowMod.read(data)
42
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
41
+ msg = FlowMod.read(data)
42
+ expect(msg.version).to eq(Message::OFP_VERSION)
43
43
  expect(msg.type).to eq(:flow_mod)
44
44
  expect(msg.len).to eq(80)
45
45
  expect(msg.xid).to eq(1)
@@ -56,12 +56,12 @@ describe OpenFlow::Protocol::FlowMod do
56
56
  expect(msg.actions.first.type).to eq(:output)
57
57
  end
58
58
  it 'should be parsable' do
59
- msg = OpenFlow::Protocol::Parser.read(data)
60
- expect(msg.class).to eq(OpenFlow::Protocol::FlowMod)
59
+ msg = Parser.read(data)
60
+ expect(msg.class).to eq(FlowMod)
61
61
  end
62
62
  it 'should initialize with default values' do
63
- msg = OpenFlow::Protocol::FlowMod.new
64
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
63
+ msg = FlowMod.new
64
+ expect(msg.version).to eq(Message::OFP_VERSION)
65
65
  expect(msg.type).to eq(:flow_mod)
66
66
  expect(msg.len).to eq(72)
67
67
  expect(msg.xid).to eq(0)
@@ -77,7 +77,7 @@ describe OpenFlow::Protocol::FlowMod do
77
77
  expect(msg.actions).to be_empty
78
78
  end
79
79
  it 'should initialize with some values' do
80
- msg = OpenFlow::Protocol::FlowMod.new(
80
+ msg = FlowMod.new(
81
81
  xid: 1,
82
82
  match: {
83
83
  wildcards: {
@@ -103,9 +103,9 @@ describe OpenFlow::Protocol::FlowMod do
103
103
  priority: 3000,
104
104
  buffer_id: 1,
105
105
  flags: [:send_flow_removed],
106
- actions: [OpenFlow::Protocol::ActionOutput.new(port: 1)]
106
+ actions: [ActionOutput.new(port: 1)]
107
107
  )
108
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
108
+ expect(msg.version).to eq(Message::OFP_VERSION)
109
109
  expect(msg.type).to eq(:flow_mod)
110
110
  expect(msg.len).to eq(80)
111
111
  expect(msg.xid).to eq(1)
@@ -122,12 +122,12 @@ describe OpenFlow::Protocol::FlowMod do
122
122
  expect(msg.actions.first.type).to eq(:output)
123
123
  end
124
124
  it 'should initialize with some other values' do
125
- msg = OpenFlow::Protocol::FlowMod.new(
125
+ msg = FlowMod.new(
126
126
  xid: 1,
127
127
  cookie: 2,
128
128
  command: :delete
129
129
  )
130
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
130
+ expect(msg.version).to eq(Message::OFP_VERSION)
131
131
  expect(msg.type).to eq(:flow_mod)
132
132
  expect(msg.len).to eq(72)
133
133
  expect(msg.xid).to eq(1)
@@ -1,4 +1,4 @@
1
- describe OpenFlow::Protocol::FlowRemoved do
1
+ describe FlowRemoved do
2
2
  let(:data) {
3
3
  [
4
4
  1, 11, 0, 88, 0, 0, 0, 1, # header
@@ -34,8 +34,8 @@ describe OpenFlow::Protocol::FlowRemoved do
34
34
  }
35
35
 
36
36
  it 'should read binary' do
37
- msg = OpenFlow::Protocol::FlowRemoved.read(data)
38
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
37
+ msg = FlowRemoved.read(data)
38
+ expect(msg.version).to eq(Message::OFP_VERSION)
39
39
  expect(msg.type).to eq(:flow_removed)
40
40
  expect(msg.len).to eq(88)
41
41
  expect(msg.xid).to eq(1)
@@ -50,12 +50,12 @@ describe OpenFlow::Protocol::FlowRemoved do
50
50
  expect(msg.byte_count).to eq(80)
51
51
  end
52
52
  it 'should be parsable' do
53
- msg = OpenFlow::Protocol::Parser.read(data)
54
- expect(msg.class).to eq(OpenFlow::Protocol::FlowRemoved)
53
+ msg = Parser.read(data)
54
+ expect(msg.class).to eq(FlowRemoved)
55
55
  end
56
56
  it 'should initialize with default values' do
57
- msg = OpenFlow::Protocol::FlowRemoved.new
58
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
57
+ msg = FlowRemoved.new
58
+ expect(msg.version).to eq(Message::OFP_VERSION)
59
59
  expect(msg.type).to eq(:flow_removed)
60
60
  expect(msg.len).to eq(88)
61
61
  expect(msg.xid).to eq(0)
@@ -70,7 +70,7 @@ describe OpenFlow::Protocol::FlowRemoved do
70
70
  expect(msg.byte_count).to eq(0)
71
71
  end
72
72
  it 'should initialize with some values' do
73
- msg = OpenFlow::Protocol::FlowRemoved.new(
73
+ msg = FlowRemoved.new(
74
74
  xid: 1,
75
75
  match: {
76
76
  wildcards: {
@@ -98,7 +98,7 @@ describe OpenFlow::Protocol::FlowRemoved do
98
98
  packet_count: 10,
99
99
  byte_count: 80
100
100
  )
101
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
101
+ expect(msg.version).to eq(Message::OFP_VERSION)
102
102
  expect(msg.type).to eq(:flow_removed)
103
103
  expect(msg.len).to eq(88)
104
104
  expect(msg.xid).to eq(1)
@@ -1,4 +1,4 @@
1
- describe OpenFlow::Protocol::GetConfigReply do
1
+ describe GetConfigReply do
2
2
  let(:data) {
3
3
  [
4
4
  1, 8, 0, 12, 0, 0, 0, 1, # header
@@ -8,8 +8,8 @@ describe OpenFlow::Protocol::GetConfigReply do
8
8
  }
9
9
 
10
10
  it 'should read binary' do
11
- msg = OpenFlow::Protocol::GetConfigReply.read(data)
12
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
11
+ msg = GetConfigReply.read(data)
12
+ expect(msg.version).to eq(Message::OFP_VERSION)
13
13
  expect(msg.type).to eq(:get_config_reply)
14
14
  expect(msg.len).to eq(12)
15
15
  expect(msg.xid).to eq(1)
@@ -17,12 +17,12 @@ describe OpenFlow::Protocol::GetConfigReply do
17
17
  expect(msg.miss_send_length).to eq(0xff)
18
18
  end
19
19
  it 'should be parsable' do
20
- msg = OpenFlow::Protocol::Parser.read(data)
21
- expect(msg.class).to eq(OpenFlow::Protocol::GetConfigReply)
20
+ msg = Parser.read(data)
21
+ expect(msg.class).to eq(GetConfigReply)
22
22
  end
23
23
  it 'should initialize with default values' do
24
- msg = OpenFlow::Protocol::GetConfigReply.new
25
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
24
+ msg = GetConfigReply.new
25
+ expect(msg.version).to eq(Message::OFP_VERSION)
26
26
  expect(msg.type).to eq(:get_config_reply)
27
27
  expect(msg.len).to eq(12)
28
28
  expect(msg.xid).to eq(0)
@@ -30,12 +30,12 @@ describe OpenFlow::Protocol::GetConfigReply do
30
30
  expect(msg.miss_send_length).to eq(0)
31
31
  end
32
32
  it 'should initialize with some values' do
33
- msg = OpenFlow::Protocol::GetConfigReply.new(
33
+ msg = GetConfigReply.new(
34
34
  xid: 1,
35
35
  flags: :fragments_normal,
36
36
  miss_send_length: 0xff
37
37
  )
38
- expect(msg.version).to eq(OpenFlow::Protocol::Message::OFP_VERSION)
38
+ expect(msg.version).to eq(Message::OFP_VERSION)
39
39
  expect(msg.type).to eq(:get_config_reply)
40
40
  expect(msg.len).to eq(12)
41
41
  expect(msg.xid).to eq(1)