openflow-protocol 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openflow-protocol.rb +2 -1
- data/lib/openflow-protocol/actions/action.rb +30 -0
- data/lib/openflow-protocol/actions/action_enqueue.rb +16 -0
- data/lib/openflow-protocol/actions/action_output.rb +14 -0
- data/lib/openflow-protocol/actions/action_set_destination_port.rb +7 -0
- data/lib/openflow-protocol/actions/action_set_ip_destination.rb +7 -0
- data/lib/openflow-protocol/actions/action_set_ip_source.rb +13 -0
- data/lib/openflow-protocol/actions/action_set_ip_tos.rb +15 -0
- data/lib/openflow-protocol/actions/action_set_mac_destination.rb +7 -0
- data/lib/openflow-protocol/actions/action_set_mac_source.rb +15 -0
- data/lib/openflow-protocol/actions/action_set_source_port.rb +15 -0
- data/lib/openflow-protocol/actions/action_set_vlan_id.rb +15 -0
- data/lib/openflow-protocol/actions/action_set_vlan_pcp.rb +15 -0
- data/lib/openflow-protocol/actions/action_strip_vlan.rb +14 -0
- data/lib/openflow-protocol/actions/action_vendor.rb +13 -0
- data/lib/openflow-protocol/actions/actions.rb +9 -0
- data/lib/openflow-protocol/helpers/array_of_subclasses.rb +42 -0
- data/lib/openflow-protocol/helpers/superclass_base.rb +26 -0
- data/lib/openflow-protocol/messages/barrier_reply.rb +7 -0
- data/lib/openflow-protocol/messages/barrier_request.rb +7 -0
- data/lib/openflow-protocol/messages/echo_reply.rb +13 -0
- data/lib/openflow-protocol/messages/echo_request.rb +13 -0
- data/lib/openflow-protocol/messages/error.rb +69 -0
- data/lib/openflow-protocol/messages/features_reply.rb +44 -0
- data/lib/openflow-protocol/messages/features_request.rb +7 -0
- data/lib/openflow-protocol/messages/flow_mod.rb +24 -0
- data/lib/openflow-protocol/messages/flow_removed.rb +27 -0
- data/lib/openflow-protocol/messages/get_config_reply.rb +16 -0
- data/lib/openflow-protocol/messages/get_config_request.rb +7 -0
- data/lib/openflow-protocol/messages/hello.rb +7 -0
- data/lib/openflow-protocol/messages/message.rb +49 -0
- data/lib/openflow-protocol/messages/packet_in.rb +27 -0
- data/lib/openflow-protocol/messages/packet_out.rb +17 -0
- data/lib/openflow-protocol/messages/parser.rb +26 -0
- data/lib/openflow-protocol/messages/port_mod.rb +19 -0
- data/lib/openflow-protocol/messages/port_status.rb +18 -0
- data/lib/openflow-protocol/messages/queue_get_config_reply.rb +18 -0
- data/lib/openflow-protocol/messages/queue_get_config_request.rb +15 -0
- data/lib/openflow-protocol/messages/set_config.rb +7 -0
- data/lib/openflow-protocol/messages/statistics.rb +28 -0
- data/lib/openflow-protocol/messages/statistics/aggregate_statistics_reply.rb +14 -0
- data/lib/openflow-protocol/messages/statistics/aggregate_statistics_request.rb +7 -0
- data/lib/openflow-protocol/messages/statistics/description_statistics.rb +32 -0
- data/lib/openflow-protocol/messages/statistics/flow_statistics_reply.rb +25 -0
- data/lib/openflow-protocol/messages/statistics/flow_statistics_request.rb +14 -0
- data/lib/openflow-protocol/messages/statistics/port_statistics_reply.rb +24 -0
- data/lib/openflow-protocol/messages/statistics/port_statistics_request.rb +12 -0
- data/lib/openflow-protocol/messages/statistics/queue_statistics_reply.rb +16 -0
- data/lib/openflow-protocol/messages/statistics/queue_statistics_request.rb +13 -0
- data/lib/openflow-protocol/messages/statistics/table_statistics.rb +20 -0
- data/lib/openflow-protocol/messages/statistics/vendor_statistics.rb +11 -0
- data/lib/openflow-protocol/messages/statistics_reply.rb +26 -0
- data/lib/openflow-protocol/messages/statistics_request.rb +18 -0
- data/lib/openflow-protocol/messages/vendor.rb +14 -0
- data/lib/openflow-protocol/structs/match.rb +106 -0
- data/lib/openflow-protocol/structs/packet_queue.rb +14 -0
- data/lib/openflow-protocol/structs/physical_port.rb +50 -0
- data/lib/openflow-protocol/structs/port_number.rb +49 -0
- data/lib/openflow-protocol/structs/queue_properties/queue_properties.rb +9 -0
- data/lib/openflow-protocol/structs/queue_properties/queue_property.rb +20 -0
- data/lib/openflow-protocol/structs/queue_properties/queue_property_min_rate.rb +30 -0
- data/lib/openflow-protocol/structs/queue_properties/queue_property_none.rb +7 -0
- data/lib/openflow-protocol/version.rb +1 -1
- data/spec/actions/action_enqueue_spec.rb +4 -6
- data/spec/actions/action_output_spec.rb +4 -6
- data/spec/actions/action_set_destination_port_spec.rb +4 -6
- data/spec/actions/action_set_ip_destination_spec.rb +4 -6
- data/spec/actions/action_set_ip_source_spec.rb +4 -6
- data/spec/actions/action_set_ip_tos_spec.rb +4 -6
- data/spec/actions/action_set_mac_destination_spec.rb +4 -6
- data/spec/actions/action_set_mac_source_spec.rb +4 -6
- data/spec/actions/action_set_source_port_spec.rb +4 -6
- data/spec/actions/action_set_vlan_id_spec.rb +4 -6
- data/spec/actions/action_set_vlan_pcp_spec.rb +4 -6
- data/spec/actions/action_strip_vlan_spec.rb +3 -5
- data/spec/actions/action_vendor_spec.rb +4 -6
- data/spec/actions/actions_spec.rb +6 -8
- data/spec/messages/barrier_reply_spec.rb +9 -11
- data/spec/messages/barrier_request_spec.rb +9 -11
- data/spec/messages/echo_reply_spec.rb +13 -15
- data/spec/messages/echo_request_spec.rb +16 -18
- data/spec/messages/error_spec.rb +23 -20
- data/spec/messages/features_reply_spec.rb +11 -13
- data/spec/messages/features_request_spec.rb +9 -11
- data/spec/messages/flow_mod_spec.rb +12 -14
- data/spec/messages/flow_removed_spec.rb +9 -11
- data/spec/messages/get_config_reply_spec.rb +9 -11
- data/spec/messages/get_config_request_spec.rb +9 -11
- data/spec/messages/hello_spec.rb +9 -11
- data/spec/messages/packet_in_spec.rb +9 -11
- data/spec/messages/packet_out_spec.rb +10 -12
- data/spec/messages/parser_spec.rb +7 -9
- data/spec/messages/port_mod_spec.rb +9 -11
- data/spec/messages/port_status_spec.rb +10 -12
- data/spec/messages/queue_get_config_reply_spec.rb +9 -11
- data/spec/messages/queue_get_config_request_spec.rb +9 -11
- data/spec/messages/set_config_spec.rb +9 -11
- data/spec/messages/statistics/aggregate_statistics_reply_spec.rb +4 -6
- data/spec/messages/statistics/aggregate_statistics_request_spec.rb +4 -6
- data/spec/messages/statistics/description_statistics_spec.rb +11 -9
- data/spec/messages/statistics/flow_statistics_reply_spec.rb +4 -6
- data/spec/messages/statistics/flow_statistics_request_spec.rb +4 -6
- data/spec/messages/statistics/port_statistics_reply_spec.rb +4 -6
- data/spec/messages/statistics/port_statistics_request_spec.rb +4 -6
- data/spec/messages/statistics/queue_statistics_reply_spec.rb +4 -6
- data/spec/messages/statistics/queue_statistics_request_spec.rb +4 -6
- data/spec/messages/statistics/table_statistics_spec.rb +4 -6
- data/spec/messages/statistics/vendor_statistics_spec.rb +4 -6
- data/spec/messages/statistics_reply_spec.rb +62 -64
- data/spec/messages/statistics_request_spec.rb +45 -47
- data/spec/messages/vendor_spec.rb +13 -15
- data/spec/spec_helper.rb +1 -1
- data/spec/structs/match_spec.rb +7 -9
- data/spec/structs/packet_queue_spec.rb +5 -7
- data/spec/structs/physical_port_spec.rb +16 -18
- data/spec/structs/port_number_spec.rb +11 -13
- data/spec/structs/queue_properties/queue_properties_spec.rb +5 -7
- data/spec/structs/queue_properties/queue_property_min_rate_spec.rb +5 -7
- data/spec/structs/queue_properties/queue_property_none_spec.rb +3 -5
- metadata +78 -64
- data/lib/actions/action.rb +0 -26
- data/lib/actions/action_enqueue.rb +0 -12
- data/lib/actions/action_output.rb +0 -10
- data/lib/actions/action_set_destination_port.rb +0 -3
- data/lib/actions/action_set_ip_destination.rb +0 -3
- data/lib/actions/action_set_ip_source.rb +0 -9
- data/lib/actions/action_set_ip_tos.rb +0 -11
- data/lib/actions/action_set_mac_destination.rb +0 -3
- data/lib/actions/action_set_mac_source.rb +0 -11
- data/lib/actions/action_set_source_port.rb +0 -11
- data/lib/actions/action_set_vlan_id.rb +0 -11
- data/lib/actions/action_set_vlan_pcp.rb +0 -11
- data/lib/actions/action_strip_vlan.rb +0 -10
- data/lib/actions/action_vendor.rb +0 -9
- data/lib/actions/actions.rb +0 -5
- data/lib/helpers/array_of_subclasses.rb +0 -38
- data/lib/helpers/superclass_base.rb +0 -24
- data/lib/messages/barrier_reply.rb +0 -3
- data/lib/messages/barrier_request.rb +0 -3
- data/lib/messages/echo_reply.rb +0 -9
- data/lib/messages/echo_request.rb +0 -9
- data/lib/messages/error.rb +0 -61
- data/lib/messages/features_reply.rb +0 -40
- data/lib/messages/features_request.rb +0 -3
- data/lib/messages/flow_mod.rb +0 -20
- data/lib/messages/flow_removed.rb +0 -23
- data/lib/messages/get_config_reply.rb +0 -12
- data/lib/messages/get_config_request.rb +0 -3
- data/lib/messages/hello.rb +0 -3
- data/lib/messages/message.rb +0 -45
- data/lib/messages/packet_in.rb +0 -23
- data/lib/messages/packet_out.rb +0 -13
- data/lib/messages/parser.rb +0 -22
- data/lib/messages/port_mod.rb +0 -15
- data/lib/messages/port_status.rb +0 -14
- data/lib/messages/queue_get_config_reply.rb +0 -14
- data/lib/messages/queue_get_config_request.rb +0 -11
- data/lib/messages/set_config.rb +0 -3
- data/lib/messages/statistics.rb +0 -24
- data/lib/messages/statistics/aggregate_statistics_reply.rb +0 -10
- data/lib/messages/statistics/aggregate_statistics_request.rb +0 -3
- data/lib/messages/statistics/description_statistics.rb +0 -28
- data/lib/messages/statistics/flow_statistics_reply.rb +0 -21
- data/lib/messages/statistics/flow_statistics_request.rb +0 -10
- data/lib/messages/statistics/port_statistics_reply.rb +0 -20
- data/lib/messages/statistics/port_statistics_request.rb +0 -8
- data/lib/messages/statistics/queue_statistics_reply.rb +0 -12
- data/lib/messages/statistics/queue_statistics_request.rb +0 -9
- data/lib/messages/statistics/table_statistics.rb +0 -16
- data/lib/messages/statistics/vendor_statistics.rb +0 -7
- data/lib/messages/statistics_reply.rb +0 -22
- data/lib/messages/statistics_request.rb +0 -14
- data/lib/messages/vendor.rb +0 -10
- data/lib/structs/match.rb +0 -102
- data/lib/structs/packet_queue.rb +0 -10
- data/lib/structs/physical_port.rb +0 -46
- data/lib/structs/port_number.rb +0 -45
- data/lib/structs/queue_properties/queue_properties.rb +0 -5
- data/lib/structs/queue_properties/queue_property.rb +0 -16
- data/lib/structs/queue_properties/queue_property_min_rate.rb +0 -26
- data/lib/structs/queue_properties/queue_property_none.rb +0 -3
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe OFPhysicalPort do
|
1
|
+
describe OpenFlow::Protocol::PhysicalPort do
|
4
2
|
it 'should read binary' do
|
5
|
-
phy_port =
|
3
|
+
phy_port = OpenFlow::Protocol::PhysicalPort.read [
|
6
4
|
0, 1, # port_number
|
7
5
|
0, 0, 0, 0, 0, 1, # hardware_address
|
8
6
|
112, 111, 114, 116, # name
|
@@ -21,13 +19,13 @@ describe OFPhysicalPort do
|
|
21
19
|
expect(phy_port.name).to eq('port-1')
|
22
20
|
expect(phy_port.config).to eq([:port_down])
|
23
21
|
expect(phy_port.state).to eq([:link_down])
|
24
|
-
expect(phy_port.current_features).to eq(
|
25
|
-
expect(phy_port.advertised_features).to eq(
|
26
|
-
expect(phy_port.supported_features).to eq(
|
27
|
-
expect(phy_port.peer_features).to eq(
|
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)
|
28
26
|
end
|
29
27
|
it 'should initialize with default values' do
|
30
|
-
phy_port =
|
28
|
+
phy_port = OpenFlow::Protocol::PhysicalPort.new
|
31
29
|
expect(phy_port.port_number).to eq(0)
|
32
30
|
expect(phy_port.hardware_address).to eq('00:00:00:00:00:00')
|
33
31
|
expect(phy_port.name).to eq('')
|
@@ -39,25 +37,25 @@ describe OFPhysicalPort do
|
|
39
37
|
expect(phy_port.peer_features).to be_empty
|
40
38
|
end
|
41
39
|
it 'should initialize with some values' do
|
42
|
-
phy_port =
|
40
|
+
phy_port = OpenFlow::Protocol::PhysicalPort.new(
|
43
41
|
port_number: 1,
|
44
42
|
hardware_address: '00:00:00:00:00:01',
|
45
43
|
name: 'port-1',
|
46
44
|
config: [:port_down],
|
47
45
|
state: [:link_down],
|
48
|
-
current_features:
|
49
|
-
advertised_features:
|
50
|
-
supported_features:
|
51
|
-
peer_features:
|
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
|
52
50
|
)
|
53
51
|
expect(phy_port.port_number).to eq(1)
|
54
52
|
expect(phy_port.hardware_address).to eq('00:00:00:00:00:01')
|
55
53
|
expect(phy_port.name).to eq('port-1')
|
56
54
|
expect(phy_port.config).to eq([:port_down])
|
57
55
|
expect(phy_port.state).to eq([:link_down])
|
58
|
-
expect(phy_port.current_features).to eq(
|
59
|
-
expect(phy_port.advertised_features).to eq(
|
60
|
-
expect(phy_port.supported_features).to eq(
|
61
|
-
expect(phy_port.peer_features).to eq(
|
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)
|
62
60
|
end
|
63
61
|
end
|
@@ -1,38 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe OFPortNumberStrict do
|
1
|
+
describe OpenFlow::Protocol::PortNumberStrict do
|
4
2
|
it 'should read binary' do
|
5
|
-
port_number =
|
3
|
+
port_number = OpenFlow::Protocol::PortNumberStrict.read [0, 1].pack('C*')
|
6
4
|
expect(port_number).to eq(1)
|
7
5
|
end
|
8
6
|
it 'should initialize with default values' do
|
9
|
-
port_number =
|
7
|
+
port_number = OpenFlow::Protocol::PortNumberStrict.new
|
10
8
|
expect(port_number).to eq(0)
|
11
9
|
end
|
12
10
|
it 'should initialize with some values' do
|
13
|
-
port_number =
|
11
|
+
port_number = OpenFlow::Protocol::PortNumberStrict.new(2)
|
14
12
|
expect(port_number).to eq(2)
|
15
13
|
end
|
16
14
|
it 'should raise an error if greater than max value' do
|
17
|
-
expect {
|
18
|
-
expect {
|
15
|
+
expect { OpenFlow::Protocol::PortNumberStrict.new(:none) }.to raise_error(ArgumentError)
|
16
|
+
expect { OpenFlow::Protocol::PortNumberStrict.new(0xff01) }.to raise_error(ArgumentError)
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
22
|
-
describe
|
20
|
+
describe OpenFlow::Protocol::PortNumber do
|
23
21
|
it 'should read binary' do
|
24
|
-
port_number =
|
22
|
+
port_number = OpenFlow::Protocol::PortNumber.read [0, 1].pack('C*')
|
25
23
|
expect(port_number).to eq(1)
|
26
24
|
end
|
27
25
|
it 'should initialize with default values' do
|
28
|
-
port_number =
|
26
|
+
port_number = OpenFlow::Protocol::PortNumber.new
|
29
27
|
expect(port_number).to eq(:none)
|
30
28
|
end
|
31
29
|
it 'should initialize with some values' do
|
32
|
-
port_number =
|
30
|
+
port_number = OpenFlow::Protocol::PortNumber.new(:local)
|
33
31
|
expect(port_number).to eq(:local)
|
34
32
|
end
|
35
33
|
it 'should raise an error with invalid port' do
|
36
|
-
expect {
|
34
|
+
expect { OpenFlow::Protocol::PortNumber.new(0xff01) }.to raise_error(ArgumentError)
|
37
35
|
end
|
38
36
|
end
|
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe OFQueueProperties do
|
1
|
+
describe OpenFlow::Protocol::QueueProperties do
|
4
2
|
it 'should read binary' do
|
5
|
-
props =
|
3
|
+
props = OpenFlow::Protocol::QueueProperties.read [
|
6
4
|
# none
|
7
5
|
0, 0, 0, 8, 0, 0, 0, 0,
|
8
6
|
# min_rate
|
@@ -15,12 +13,12 @@ describe OFQueueProperties do
|
|
15
13
|
expect(props.last.type).to eq(:min_rate)
|
16
14
|
end
|
17
15
|
it 'should initialize with default values' do
|
18
|
-
props =
|
16
|
+
props = OpenFlow::Protocol::QueueProperties.new
|
19
17
|
expect(props).to be_empty
|
20
18
|
end
|
21
19
|
it 'should initialize with some values' do
|
22
|
-
props =
|
23
|
-
|
20
|
+
props = OpenFlow::Protocol::QueueProperties.new([
|
21
|
+
OpenFlow::Protocol::QueuePropertyMinRate.new(rate: 100)
|
24
22
|
])
|
25
23
|
expect(props.length).to eq(1)
|
26
24
|
expect(props.first.type).to eq(:min_rate)
|
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe OFQueuePropertyMinRate do
|
1
|
+
describe OpenFlow::Protocol::QueuePropertyMinRate do
|
4
2
|
it 'should read binary' do
|
5
|
-
prop =
|
3
|
+
prop = OpenFlow::Protocol::QueuePropertyMinRate.read [
|
6
4
|
0, 1, 0, 16, 0, 0, 0, 0, # header
|
7
5
|
0, 100, # rate
|
8
6
|
0, 0, 0, 0, 0, 0 # padding
|
@@ -12,19 +10,19 @@ describe OFQueuePropertyMinRate do
|
|
12
10
|
expect(prop.rate).to eq(100)
|
13
11
|
end
|
14
12
|
it 'should initialize with default values' do
|
15
|
-
prop =
|
13
|
+
prop = OpenFlow::Protocol::QueuePropertyMinRate.new
|
16
14
|
expect(prop.type).to eq(:min_rate)
|
17
15
|
expect(prop.len).to eq(16)
|
18
16
|
expect(prop.rate).to eq(0)
|
19
17
|
end
|
20
18
|
it 'should initialize with some values' do
|
21
|
-
prop =
|
19
|
+
prop = OpenFlow::Protocol::QueuePropertyMinRate.new(rate: 100)
|
22
20
|
expect(prop.type).to eq(:min_rate)
|
23
21
|
expect(prop.len).to eq(16)
|
24
22
|
expect(prop.rate).to eq(100)
|
25
23
|
end
|
26
24
|
it 'should disabled rate when > 1000' do
|
27
|
-
prop =
|
25
|
+
prop = OpenFlow::Protocol::QueuePropertyMinRate.new(rate: 1001)
|
28
26
|
expect(prop.type).to eq(:min_rate)
|
29
27
|
expect(prop.len).to eq(16)
|
30
28
|
expect(prop.rate).to eq(:disabled)
|
@@ -1,13 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe OFQueuePropertyNone do
|
1
|
+
describe OpenFlow::Protocol::QueuePropertyNone do
|
4
2
|
it 'should read binary' do
|
5
|
-
prop =
|
3
|
+
prop = OpenFlow::Protocol::QueuePropertyNone.read [0, 0, 0, 8, 0, 0, 0, 0].pack('C*')
|
6
4
|
expect(prop.type).to eq(:none)
|
7
5
|
expect(prop.len).to eq(8)
|
8
6
|
end
|
9
7
|
it 'should initialize with default values' do
|
10
|
-
prop =
|
8
|
+
prop = OpenFlow::Protocol::QueuePropertyNone.new
|
11
9
|
expect(prop.type).to eq(:none)
|
12
10
|
expect(prop.len).to eq(8)
|
13
11
|
end
|
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.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jérémy Pagé
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.4'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.4'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,69 +59,69 @@ executables: []
|
|
45
59
|
extensions: []
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
48
|
-
- lib/actions/action.rb
|
49
|
-
- lib/actions/action_enqueue.rb
|
50
|
-
- lib/actions/action_output.rb
|
51
|
-
- lib/actions/action_set_destination_port.rb
|
52
|
-
- lib/actions/action_set_ip_destination.rb
|
53
|
-
- lib/actions/action_set_ip_source.rb
|
54
|
-
- lib/actions/action_set_ip_tos.rb
|
55
|
-
- lib/actions/action_set_mac_destination.rb
|
56
|
-
- lib/actions/action_set_mac_source.rb
|
57
|
-
- lib/actions/action_set_source_port.rb
|
58
|
-
- lib/actions/action_set_vlan_id.rb
|
59
|
-
- lib/actions/action_set_vlan_pcp.rb
|
60
|
-
- lib/actions/action_strip_vlan.rb
|
61
|
-
- lib/actions/action_vendor.rb
|
62
|
-
- lib/actions/actions.rb
|
63
|
-
- lib/helpers/array_of_subclasses.rb
|
64
|
-
- lib/helpers/superclass_base.rb
|
65
|
-
- lib/messages/barrier_reply.rb
|
66
|
-
- lib/messages/barrier_request.rb
|
67
|
-
- lib/messages/echo_reply.rb
|
68
|
-
- lib/messages/echo_request.rb
|
69
|
-
- lib/messages/error.rb
|
70
|
-
- lib/messages/features_reply.rb
|
71
|
-
- lib/messages/features_request.rb
|
72
|
-
- lib/messages/flow_mod.rb
|
73
|
-
- lib/messages/flow_removed.rb
|
74
|
-
- lib/messages/get_config_reply.rb
|
75
|
-
- lib/messages/get_config_request.rb
|
76
|
-
- lib/messages/hello.rb
|
77
|
-
- lib/messages/message.rb
|
78
|
-
- lib/messages/packet_in.rb
|
79
|
-
- lib/messages/packet_out.rb
|
80
|
-
- lib/messages/parser.rb
|
81
|
-
- lib/messages/port_mod.rb
|
82
|
-
- lib/messages/port_status.rb
|
83
|
-
- lib/messages/queue_get_config_reply.rb
|
84
|
-
- lib/messages/queue_get_config_request.rb
|
85
|
-
- lib/messages/set_config.rb
|
86
|
-
- lib/messages/statistics.rb
|
87
|
-
- lib/messages/statistics/aggregate_statistics_reply.rb
|
88
|
-
- lib/messages/statistics/aggregate_statistics_request.rb
|
89
|
-
- lib/messages/statistics/description_statistics.rb
|
90
|
-
- lib/messages/statistics/flow_statistics_reply.rb
|
91
|
-
- lib/messages/statistics/flow_statistics_request.rb
|
92
|
-
- lib/messages/statistics/port_statistics_reply.rb
|
93
|
-
- lib/messages/statistics/port_statistics_request.rb
|
94
|
-
- lib/messages/statistics/queue_statistics_reply.rb
|
95
|
-
- lib/messages/statistics/queue_statistics_request.rb
|
96
|
-
- lib/messages/statistics/table_statistics.rb
|
97
|
-
- lib/messages/statistics/vendor_statistics.rb
|
98
|
-
- lib/messages/statistics_reply.rb
|
99
|
-
- lib/messages/statistics_request.rb
|
100
|
-
- lib/messages/vendor.rb
|
101
62
|
- lib/openflow-protocol.rb
|
63
|
+
- lib/openflow-protocol/actions/action.rb
|
64
|
+
- lib/openflow-protocol/actions/action_enqueue.rb
|
65
|
+
- lib/openflow-protocol/actions/action_output.rb
|
66
|
+
- lib/openflow-protocol/actions/action_set_destination_port.rb
|
67
|
+
- lib/openflow-protocol/actions/action_set_ip_destination.rb
|
68
|
+
- lib/openflow-protocol/actions/action_set_ip_source.rb
|
69
|
+
- lib/openflow-protocol/actions/action_set_ip_tos.rb
|
70
|
+
- lib/openflow-protocol/actions/action_set_mac_destination.rb
|
71
|
+
- lib/openflow-protocol/actions/action_set_mac_source.rb
|
72
|
+
- lib/openflow-protocol/actions/action_set_source_port.rb
|
73
|
+
- lib/openflow-protocol/actions/action_set_vlan_id.rb
|
74
|
+
- lib/openflow-protocol/actions/action_set_vlan_pcp.rb
|
75
|
+
- lib/openflow-protocol/actions/action_strip_vlan.rb
|
76
|
+
- lib/openflow-protocol/actions/action_vendor.rb
|
77
|
+
- lib/openflow-protocol/actions/actions.rb
|
78
|
+
- lib/openflow-protocol/helpers/array_of_subclasses.rb
|
79
|
+
- lib/openflow-protocol/helpers/superclass_base.rb
|
80
|
+
- lib/openflow-protocol/messages/barrier_reply.rb
|
81
|
+
- lib/openflow-protocol/messages/barrier_request.rb
|
82
|
+
- lib/openflow-protocol/messages/echo_reply.rb
|
83
|
+
- lib/openflow-protocol/messages/echo_request.rb
|
84
|
+
- lib/openflow-protocol/messages/error.rb
|
85
|
+
- lib/openflow-protocol/messages/features_reply.rb
|
86
|
+
- lib/openflow-protocol/messages/features_request.rb
|
87
|
+
- lib/openflow-protocol/messages/flow_mod.rb
|
88
|
+
- lib/openflow-protocol/messages/flow_removed.rb
|
89
|
+
- lib/openflow-protocol/messages/get_config_reply.rb
|
90
|
+
- lib/openflow-protocol/messages/get_config_request.rb
|
91
|
+
- lib/openflow-protocol/messages/hello.rb
|
92
|
+
- lib/openflow-protocol/messages/message.rb
|
93
|
+
- lib/openflow-protocol/messages/packet_in.rb
|
94
|
+
- lib/openflow-protocol/messages/packet_out.rb
|
95
|
+
- lib/openflow-protocol/messages/parser.rb
|
96
|
+
- lib/openflow-protocol/messages/port_mod.rb
|
97
|
+
- lib/openflow-protocol/messages/port_status.rb
|
98
|
+
- lib/openflow-protocol/messages/queue_get_config_reply.rb
|
99
|
+
- lib/openflow-protocol/messages/queue_get_config_request.rb
|
100
|
+
- lib/openflow-protocol/messages/set_config.rb
|
101
|
+
- lib/openflow-protocol/messages/statistics.rb
|
102
|
+
- lib/openflow-protocol/messages/statistics/aggregate_statistics_reply.rb
|
103
|
+
- lib/openflow-protocol/messages/statistics/aggregate_statistics_request.rb
|
104
|
+
- lib/openflow-protocol/messages/statistics/description_statistics.rb
|
105
|
+
- lib/openflow-protocol/messages/statistics/flow_statistics_reply.rb
|
106
|
+
- lib/openflow-protocol/messages/statistics/flow_statistics_request.rb
|
107
|
+
- lib/openflow-protocol/messages/statistics/port_statistics_reply.rb
|
108
|
+
- lib/openflow-protocol/messages/statistics/port_statistics_request.rb
|
109
|
+
- lib/openflow-protocol/messages/statistics/queue_statistics_reply.rb
|
110
|
+
- lib/openflow-protocol/messages/statistics/queue_statistics_request.rb
|
111
|
+
- lib/openflow-protocol/messages/statistics/table_statistics.rb
|
112
|
+
- lib/openflow-protocol/messages/statistics/vendor_statistics.rb
|
113
|
+
- lib/openflow-protocol/messages/statistics_reply.rb
|
114
|
+
- lib/openflow-protocol/messages/statistics_request.rb
|
115
|
+
- lib/openflow-protocol/messages/vendor.rb
|
116
|
+
- lib/openflow-protocol/structs/match.rb
|
117
|
+
- lib/openflow-protocol/structs/packet_queue.rb
|
118
|
+
- lib/openflow-protocol/structs/physical_port.rb
|
119
|
+
- lib/openflow-protocol/structs/port_number.rb
|
120
|
+
- lib/openflow-protocol/structs/queue_properties/queue_properties.rb
|
121
|
+
- lib/openflow-protocol/structs/queue_properties/queue_property.rb
|
122
|
+
- lib/openflow-protocol/structs/queue_properties/queue_property_min_rate.rb
|
123
|
+
- lib/openflow-protocol/structs/queue_properties/queue_property_none.rb
|
102
124
|
- lib/openflow-protocol/version.rb
|
103
|
-
- lib/structs/match.rb
|
104
|
-
- lib/structs/packet_queue.rb
|
105
|
-
- lib/structs/physical_port.rb
|
106
|
-
- lib/structs/port_number.rb
|
107
|
-
- lib/structs/queue_properties/queue_properties.rb
|
108
|
-
- lib/structs/queue_properties/queue_property.rb
|
109
|
-
- lib/structs/queue_properties/queue_property_min_rate.rb
|
110
|
-
- lib/structs/queue_properties/queue_property_none.rb
|
111
125
|
- spec/actions/action_enqueue_spec.rb
|
112
126
|
- spec/actions/action_output_spec.rb
|
113
127
|
- spec/actions/action_set_destination_port_spec.rb
|
data/lib/actions/action.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
(Dir[File.expand_path '../helpers/**/*.rb', __dir__] +
|
2
|
-
Dir[File.expand_path '../structs/**/*.rb', __dir__]).each do |file|
|
3
|
-
require file
|
4
|
-
end
|
5
|
-
|
6
|
-
class OFAction < SuperclassBase
|
7
|
-
HEADER_LENGTH = 4
|
8
|
-
TYPES = [
|
9
|
-
:output,
|
10
|
-
:set_vlan_id,
|
11
|
-
:set_vlan_pcp,
|
12
|
-
:strip_vlan,
|
13
|
-
:set_mac_source, # set_dl_src
|
14
|
-
:set_mac_destination, # set_dl_dst
|
15
|
-
:set_ip_source, # set_nw_src
|
16
|
-
:set_ip_destination, # set_nw_dst
|
17
|
-
:set_ip_tos, # set_nw_tos
|
18
|
-
:set_source_port, # set_tp_src
|
19
|
-
:set_destination_port, # set_tp_dst
|
20
|
-
:enqueue
|
21
|
-
]
|
22
|
-
TYPES[0xffff] = :vendor
|
23
|
-
|
24
|
-
enum16 :type, list: TYPES, asserted_value: -> { type_str.to_sym }
|
25
|
-
uint16 :len, value: -> { HEADER_LENGTH + body_length }
|
26
|
-
end
|