From 4d97e69d05e75562f400ae5506f01f03ebd6ab0f Mon Sep 17 00:00:00 2001 From: Yasuhito Takamiya Date: Thu, 26 Nov 2015 08:10:51 +0900 Subject: [PATCH] Refactor OpenFlow classes --- .../aggregate_stats_request.feature | 6 +- features/open_flow10/bad_request.feature | 6 +- features/open_flow10/barrier_reply.feature | 6 +- features/open_flow10/barrier_request.feature | 6 +- .../description_stats_request.feature | 6 +- features/open_flow10/echo_reply.feature | 21 +-- features/open_flow10/echo_request.feature | 25 +-- features/open_flow10/exact_match.feature | 2 +- features/open_flow10/features_reply.feature | 4 +- features/open_flow10/features_request.feature | 8 +- features/open_flow10/flow_mod.feature | 16 +- features/open_flow10/flow_removed.feature | 3 +- features/open_flow10/flow_stats_reply.feature | 6 +- .../open_flow10/flow_stats_request.feature | 6 +- features/open_flow10/hello.feature | 19 +- features/open_flow10/hello_failed.feature | 10 +- features/open_flow10/packet_in.feature | 12 +- features/open_flow10/packet_out.feature | 2 +- features/open_flow10/port_status.feature | 3 +- features/open_flow10/send_out_port.feature | 18 +- .../set_destination_mac_address.feature | 4 +- .../set_source_mac_address.feature | 4 +- .../open_flow10/table_stats_request.feature | 6 +- features/open_flow13/apply_actions.feature | 22 +-- features/open_flow13/bad_request.feature | 6 +- features/open_flow13/copy_ttl_inwards.feature | 4 +- .../open_flow13/copy_ttl_outwards.feature | 4 +- features/open_flow13/decrement_ip_ttl.feature | 4 +- features/open_flow13/echo_reply.feature | 16 +- features/open_flow13/echo_request.feature | 16 +- features/open_flow13/features_reply.feature | 32 ++-- features/open_flow13/features_request.feature | 12 +- features/open_flow13/flow_mod.feature | 22 +-- features/open_flow13/hello.feature | 30 +--- features/open_flow13/hello_failed.feature | 10 +- features/open_flow13/match.feature | 166 +++++++++--------- features/open_flow13/nicira_reg_load.feature | 8 +- features/open_flow13/nicira_reg_move.feature | 14 +- .../open_flow13/nicira_send_out_port.feature | 6 +- features/open_flow13/nicira_stack_pop.feature | 6 +- .../open_flow13/nicira_stack_push.feature | 6 +- features/open_flow13/packet_in.feature | 6 +- features/open_flow13/packet_out.feature | 6 +- features/open_flow13/send_out_port.feature | 20 +-- .../open_flow13/set_arp_operation.feature | 4 +- .../set_arp_sender_hardware_address.feature | 4 +- .../set_arp_sender_protocol_address.feature | 4 +- .../set_destination_mac_address.feature | 4 +- features/open_flow13/set_ip_ttl.feature | 4 +- features/open_flow13/set_metadata.feature | 4 +- .../set_source_mac_address.feature | 4 +- features/open_flow_read.feature | 15 +- features/step_definitions/open_flow_steps.rb | 2 +- .../step_definitions/packet_data_steps.rb | 7 +- lib/pio/open_flow.rb | 36 ++-- lib/pio/open_flow/{match.rb => flow_match.rb} | 4 +- lib/pio/open_flow/instruction.rb | 10 ++ lib/pio/open_flow10/actions.rb | 2 +- lib/pio/open_flow10/exact_match.rb | 22 +-- lib/pio/open_flow10/flow_mod.rb | 3 +- lib/pio/open_flow10/flow_stats/reply.rb | 2 +- lib/pio/open_flow10/match.rb | 4 +- lib/pio/open_flow10/packet_out.rb | 2 +- lib/pio/open_flow10/port_status.rb | 1 + lib/pio/open_flow13/actions.rb | 4 +- lib/pio/open_flow13/apply.rb | 47 ++--- lib/pio/open_flow13/features/reply.rb | 1 + lib/pio/open_flow13/match.rb | 4 +- lib/pio/open_flow13/packet_out.rb | 2 +- 69 files changed, 385 insertions(+), 426 deletions(-) rename lib/pio/open_flow/{match.rb => flow_match.rb} (77%) create mode 100644 lib/pio/open_flow/instruction.rb diff --git a/features/open_flow10/aggregate_stats_request.feature b/features/open_flow10/aggregate_stats_request.feature index cc0071a0..dec46421 100644 --- a/features/open_flow10/aggregate_stats_request.feature +++ b/features/open_flow10/aggregate_stats_request.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::AggregateStats::Request +Feature: Pio::OpenFlow::AggregateStats::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::AggregateStats::Request.new(match: Match.new(in_port: 1)) + Pio::OpenFlow::AggregateStats::Request.new(match: Pio::OpenFlow::Match.new(in_port: 1)) """ Then it should finish successfully And the message has the following fields and values: @@ -32,7 +32,7 @@ Feature: Pio::AggregateStats::Request Scenario: read - When I try to parse a file named "open_flow10/aggregate_stats_request.raw" with "AggregateStats::Request" class + When I try to parse a file named "open_flow10/aggregate_stats_request.raw" with "Pio::OpenFlow::AggregateStats::Request" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow10/bad_request.feature b/features/open_flow10/bad_request.feature index 9c7e61f1..e64c257a 100644 --- a/features/open_flow10/bad_request.feature +++ b/features/open_flow10/bad_request.feature @@ -1,12 +1,12 @@ @open_flow10 -Feature: Pio::Error::BadRequest +Feature: Pio::OpenFlow::Error::BadRequest Request was not understood error. Scenario: new (raw_data = Echo request 1.3) When I try to create an OpenFlow message with: """ - Pio::Error::BadRequest.new(raw_data: Pio::OpenFlow13::Echo::Request.new.to_binary) + Pio::OpenFlow::Error::BadRequest.new(raw_data: Pio::OpenFlow13::Echo::Request.new.to_binary) """ Then it should finish successfully And the message has the following fields and values: @@ -21,7 +21,7 @@ Feature: Pio::Error::BadRequest | raw_data.length | 8 | Scenario: read - When I try to parse a file named "open_flow10/bad_request.raw" with "Pio::Error::BadRequest" class + When I try to parse a file named "open_flow10/bad_request.raw" with "Pio::OpenFlow::Error::BadRequest" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow10/barrier_reply.feature b/features/open_flow10/barrier_reply.feature index 7859ed1b..a632229a 100644 --- a/features/open_flow10/barrier_reply.feature +++ b/features/open_flow10/barrier_reply.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::Barrier::Reply +Feature: Pio::OpenFlow::Barrier::Reply Scenario: new When I try to create an OpenFlow message with: """ - Pio::Barrier::Reply.new + Pio::OpenFlow::Barrier::Reply.new """ Then it should finish successfully And the message has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::Barrier::Reply Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Barrier::Reply.new(transaction_id: 123) + Pio::OpenFlow::Barrier::Reply.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: diff --git a/features/open_flow10/barrier_request.feature b/features/open_flow10/barrier_request.feature index ffbef949..88466dbc 100644 --- a/features/open_flow10/barrier_request.feature +++ b/features/open_flow10/barrier_request.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::Barrier::Request +Feature: Pio::OpenFlow::Barrier::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::Barrier::Request.new + Pio::OpenFlow::Barrier::Request.new """ Then it should finish successfully And the message has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::Barrier::Request Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Barrier::Request.new(transaction_id: 123) + Pio::OpenFlow::Barrier::Request.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: diff --git a/features/open_flow10/description_stats_request.feature b/features/open_flow10/description_stats_request.feature index 899df29b..c31ded79 100644 --- a/features/open_flow10/description_stats_request.feature +++ b/features/open_flow10/description_stats_request.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::DescriptionStats::Request +Feature: Pio::OpenFlow::DescriptionStats::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::DescriptionStats::Request.new + Pio::OpenFlow::DescriptionStats::Request.new """ Then it should finish successfully And the message has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::DescriptionStats::Request Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::DescriptionStats::Request.new(transaction_id: 123) + Pio::OpenFlow::DescriptionStats::Request.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: diff --git a/features/open_flow10/echo_reply.feature b/features/open_flow10/echo_reply.feature index e3537264..3a7a8d5d 100644 --- a/features/open_flow10/echo_reply.feature +++ b/features/open_flow10/echo_reply.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::Echo::Reply +Feature: Pio::OpenFlow::Echo::Reply Scenario: new When I try to create an OpenFlow message with: """ - Pio::Echo::Reply.new + Pio::OpenFlow::Echo::Reply.new """ Then it should finish successfully And the message has the following fields and values: @@ -19,7 +19,7 @@ Feature: Pio::Echo::Reply Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Echo::Reply.new(transaction_id: 123) + Pio::OpenFlow::Echo::Reply.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: @@ -35,7 +35,7 @@ Feature: Pio::Echo::Reply Scenario: new(body: 'echo reply body') When I try to create an OpenFlow message with: """ - Pio::Echo::Reply.new(body: 'echo reply body') + Pio::OpenFlow::Echo::Reply.new(body: 'echo reply body') """ Then it should finish successfully And the message has the following fields and values: @@ -47,16 +47,3 @@ Feature: Pio::Echo::Reply | xid | 0 | | body | echo reply body | | user_data | echo reply body | - - Scenario: read (no message body) - When I try to parse a file named "open_flow10/echo_reply.raw" with "Pio::Echo::Reply" class - Then it should finish successfully - And the message has the following fields and values: - | field | value | - | ofp_version | 1 | - | message_type | 3 | - | message_length | 8 | - | transaction_id | 6 | - | xid | 6 | - | body | | - | user_data | | diff --git a/features/open_flow10/echo_request.feature b/features/open_flow10/echo_request.feature index 54ec3d43..2aa769e9 100644 --- a/features/open_flow10/echo_request.feature +++ b/features/open_flow10/echo_request.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::Echo::Request +Feature: Pio::OpenFlow::Echo::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::Echo::Request.new + Pio::OpenFlow::Echo::Request.new """ Then it should finish successfully And the message has the following fields and values: @@ -19,7 +19,7 @@ Feature: Pio::Echo::Request Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Echo::Request.new(transaction_id: 123) + Pio::OpenFlow::Echo::Request.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: @@ -35,7 +35,7 @@ Feature: Pio::Echo::Request Scenario: new(body: 'echo request body') When I try to create an OpenFlow message with: """ - Pio::Echo::Request.new(body: 'echo request body') + Pio::OpenFlow::Echo::Request.new(body: 'echo request body') """ Then it should finish successfully And the message has the following fields and values: @@ -47,20 +47,3 @@ Feature: Pio::Echo::Request | xid | 0 | | body | echo request body | | user_data | echo request body | - - Scenario: read (no message body) - When I try to parse a file named "open_flow10/echo_request.raw" with "Pio::Echo::Request" class - Then it should finish successfully - And the message has the following fields and values: - | field | value | - | ofp_version | 1 | - | message_type | 2 | - | message_length | 8 | - | transaction_id | 0 | - | xid | 0 | - | body | | - | user_data | | - - Scenario: parse error - When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Echo::Request" class - Then it should fail with "Pio::ParseError", "Invalid OpenFlow10 Echo Request message." diff --git a/features/open_flow10/exact_match.feature b/features/open_flow10/exact_match.feature index 54c360a1..50e42ca4 100644 --- a/features/open_flow10/exact_match.feature +++ b/features/open_flow10/exact_match.feature @@ -1,4 +1,4 @@ -Feature: Pio::ExactMatch +Feature: Pio::OpenFlow::ExactMatch Scenario: new (from ARP request Packet In) When I create an exact match from "open_flow10/packet_in_arp_request.raw" Then the message has the following fields and values: diff --git a/features/open_flow10/features_reply.feature b/features/open_flow10/features_reply.feature index f07e68bd..6f6f3f43 100644 --- a/features/open_flow10/features_reply.feature +++ b/features/open_flow10/features_reply.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::Features::Reply +Feature: Pio::OpenFlow::Features::Reply Scenario: new When I try to create an OpenFlow message with: """ - Pio::Features::Reply.new( + Pio::OpenFlow::Features::Reply.new( datapath_id: 0x123, n_buffers: 0x100, n_tables: 0xfe, diff --git a/features/open_flow10/features_request.feature b/features/open_flow10/features_request.feature index 06f23826..e8bb9085 100644 --- a/features/open_flow10/features_request.feature +++ b/features/open_flow10/features_request.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::Features::Request +Feature: Pio::OpenFlow::Features::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::Features::Request.new + Pio::OpenFlow::Features::Request.new """ Then it should finish successfully And the message has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::Features::Request Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Features::Request.new(transaction_id: 123) + Pio::OpenFlow::Features::Request.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: @@ -31,7 +31,7 @@ Feature: Pio::Features::Request | user_data | | Scenario: read - When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Features::Request" class + When I try to parse a file named "open_flow10/features_request.raw" with "Pio::OpenFlow::Features::Request" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow10/flow_mod.feature b/features/open_flow10/flow_mod.feature index 47486ba3..f2e4ee9d 100644 --- a/features/open_flow10/flow_mod.feature +++ b/features/open_flow10/flow_mod.feature @@ -1,16 +1,16 @@ @open_flow10 -Feature: Pio::FlowMod +Feature: Pio::OpenFlow::FlowMod Scenario: new When I try to create an OpenFlow message with: """ - Pio::FlowMod.new( + Pio::OpenFlow::FlowMod.new( actions: [], buffer_id: 0, command: :add, flags: [], hard_timeout: 0, idle_timeout: 0, - match: Match.new(), + match: Pio::OpenFlow::Match.new(), out_port: 0, priority: 0 ) @@ -43,7 +43,7 @@ Feature: Pio::FlowMod | priority | 0 | Scenario: read (Flow Mod Add) - When I try to parse a file named "open_flow10/flow_mod_add.raw" with "Pio::FlowMod" class + When I try to parse a file named "open_flow10/flow_mod_add.raw" with "Pio::OpenFlow::FlowMod" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -80,7 +80,7 @@ Feature: Pio::FlowMod | actions.first.vlan_id | 10 | Scenario: read (Flow Mod Modify) - When I try to parse a file named "open_flow10/flow_mod_modify.raw" with "Pio::FlowMod" class + When I try to parse a file named "open_flow10/flow_mod_modify.raw" with "Pio::OpenFlow::FlowMod" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -117,7 +117,7 @@ Feature: Pio::FlowMod | actions.first.vlan_id | 10 | Scenario: read (Flow Mod Modify Strict) - When I try to parse a file named "open_flow10/flow_mod_modify_strict.raw" with "Pio::FlowMod" class + When I try to parse a file named "open_flow10/flow_mod_modify_strict.raw" with "Pio::OpenFlow::FlowMod" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -154,7 +154,7 @@ Feature: Pio::FlowMod | actions.first.vlan_id | 10 | Scenario: read (Flow Mod Delete) - When I try to parse a file named "open_flow10/flow_mod_delete.raw" with "Pio::FlowMod" class + When I try to parse a file named "open_flow10/flow_mod_delete.raw" with "Pio::OpenFlow::FlowMod" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -189,7 +189,7 @@ Feature: Pio::FlowMod | actions | [] | Scenario: read (Flow Mod Delete Strict) - When I try to parse a file named "open_flow10/flow_mod_delete_strict.raw" with "Pio::FlowMod" class + When I try to parse a file named "open_flow10/flow_mod_delete_strict.raw" with "Pio::OpenFlow::FlowMod" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow10/flow_removed.feature b/features/open_flow10/flow_removed.feature index 0e234302..46c89382 100644 --- a/features/open_flow10/flow_removed.feature +++ b/features/open_flow10/flow_removed.feature @@ -1,7 +1,6 @@ @open_flow10 -Feature: Pio::FlowRemoved +Feature: Pio::OpenFlow::FlowRemoved - @open_flow10 Scenario: read When I try to parse a file named "open_flow10/flow_removed.raw" with "FlowRemoved" class Then it should finish successfully diff --git a/features/open_flow10/flow_stats_reply.feature b/features/open_flow10/flow_stats_reply.feature index c4700a3b..acaf6e0d 100644 --- a/features/open_flow10/flow_stats_reply.feature +++ b/features/open_flow10/flow_stats_reply.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::FlowStats::Reply +Feature: Pio::OpenFlow::FlowStats::Reply Scenario: new When I try to create an OpenFlow message with: """ - Pio::FlowStats::Reply.new + Pio::OpenFlow::FlowStats::Reply.new """ Then it should finish successfully And the message has the following fields and values: @@ -20,7 +20,7 @@ Feature: Pio::FlowStats::Reply Scenario: new(more options) When I try to create an OpenFlow message with: """ - Pio::FlowStats::Reply.new(more options) + Pio::OpenFlow::FlowStats::Reply.new(more options) """ Then it should finish successfully diff --git a/features/open_flow10/flow_stats_request.feature b/features/open_flow10/flow_stats_request.feature index eb817ac7..8a59edaa 100644 --- a/features/open_flow10/flow_stats_request.feature +++ b/features/open_flow10/flow_stats_request.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::FlowStats::Request +Feature: Pio::OpenFlow::FlowStats::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::FlowStats::Request.new + Pio::OpenFlow::FlowStats::Request.new """ Then it should finish successfully And the message has the following fields and values: @@ -33,7 +33,7 @@ Feature: Pio::FlowStats::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::FlowStats::Request.new(match: Match.new(in_port: 1)) + Pio::OpenFlow::FlowStats::Request.new(match: Pio::OpenFlow::Match.new(in_port: 1)) """ Then it should finish successfully And the message has the following fields and values: diff --git a/features/open_flow10/hello.feature b/features/open_flow10/hello.feature index 606702e8..7489df02 100644 --- a/features/open_flow10/hello.feature +++ b/features/open_flow10/hello.feature @@ -1,5 +1,5 @@ @open_flow10 -Feature: Pio::Hello +Feature: Pio::OpenFlow10::Hello Hello messages are exchanged between the switch and controller upon connection startup. @@ -7,7 +7,7 @@ Feature: Pio::Hello Scenario: new When I try to create an OpenFlow message with: """ - Pio::OpenFlow10::Hello.new + Pio::OpenFlow::Hello.new """ Then it should finish successfully And the message has the following fields and values: @@ -23,7 +23,7 @@ Feature: Pio::Hello Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Hello.new(transaction_id: 123) + Pio::OpenFlow::Hello.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: @@ -35,16 +35,3 @@ Feature: Pio::Hello | xid | 123 | | body | | | user_data | | - - Scenario: read - When I try to parse a file named "open_flow10/hello.raw" with "Hello" class - Then it should finish successfully - And the message has the following fields and values: - | field | value | - | ofp_version | 1 | - | message_type | 0 | - | message_length | 8 | - | transaction_id | 23 | - | xid | 23 | - | body | | - | user_data | | diff --git a/features/open_flow10/hello_failed.feature b/features/open_flow10/hello_failed.feature index c70a5195..ad96b1b9 100644 --- a/features/open_flow10/hello_failed.feature +++ b/features/open_flow10/hello_failed.feature @@ -1,12 +1,12 @@ @open_flow10 -Feature: Pio::Error::HelloFailed +Feature: Pio::OpenFlow::Error::HelloFailed Hello protocol failed Scenario: new When I try to create an OpenFlow message with: """ - Pio::Error::HelloFailed.new + Pio::OpenFlow::Error::HelloFailed.new """ Then it should finish successfully And the message has the following fields and values: @@ -23,7 +23,7 @@ Feature: Pio::Error::HelloFailed Scenario: new(description: 'error description') When I try to create an OpenFlow message with: """ - Pio::Error::HelloFailed.new(description: 'error description') + Pio::OpenFlow::Error::HelloFailed.new(description: 'error description') """ Then it should finish successfully And the message has the following fields and values: @@ -40,7 +40,7 @@ Feature: Pio::Error::HelloFailed Scenario: new(error_code: :permissions_error) When I try to create an OpenFlow message with: """ - Pio::Error::HelloFailed.new(error_code: :permissions_error) + Pio::OpenFlow::Error::HelloFailed.new(error_code: :permissions_error) """ Then it should finish successfully And the message has the following fields and values: @@ -55,7 +55,7 @@ Feature: Pio::Error::HelloFailed | description | | Scenario: read - When I try to parse a file named "open_flow10/hello_failed.raw" with "Pio::Error::HelloFailed" class + When I try to parse a file named "open_flow10/hello_failed.raw" with "Pio::OpenFlow::Error::HelloFailed" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow10/packet_in.feature b/features/open_flow10/packet_in.feature index 9936882a..f2cd4664 100644 --- a/features/open_flow10/packet_in.feature +++ b/features/open_flow10/packet_in.feature @@ -1,5 +1,5 @@ @open_flow10 -Feature: Pio::PacketIn +Feature: Pio::OpenFlow::PacketIn Scenario: new When I try to create an OpenFlow message with: """ @@ -12,11 +12,11 @@ Feature: Pio::PacketIn 0x00, 0x00, 0x00, 0x00, 0x00 ].pack('C*') - Pio::PacketIn.new(transaction_id: 0, - buffer_id: 0xffffff00, - in_port: 1, - reason: :no_match, - raw_data: data_dump) + Pio::OpenFlow::PacketIn.new(transaction_id: 0, + buffer_id: 0xffffff00, + in_port: 1, + reason: :no_match, + raw_data: data_dump) """ Then it should finish successfully And the message has the following fields and values: diff --git a/features/open_flow10/packet_out.feature b/features/open_flow10/packet_out.feature index 59381d98..963b0a0f 100644 --- a/features/open_flow10/packet_out.feature +++ b/features/open_flow10/packet_out.feature @@ -1,5 +1,5 @@ @open_flow10 -Feature: Pio::PacketOut +Feature: Pio::OpenFlow::PacketOut Scenario: read When I try to parse a file named "open_flow10/packet_out.raw" with "PacketOut" class Then it should finish successfully diff --git a/features/open_flow10/port_status.feature b/features/open_flow10/port_status.feature index ecbc6882..e430c260 100644 --- a/features/open_flow10/port_status.feature +++ b/features/open_flow10/port_status.feature @@ -1,4 +1,5 @@ -Feature: Pio::PortStatus +@open_flow10 +Feature: Pio::OpenFlow::PortStatus Scenario: read When I try to parse a file named "open_flow10/port_status.raw" with "PortStatus" class Then it should finish successfully diff --git a/features/open_flow10/send_out_port.feature b/features/open_flow10/send_out_port.feature index ecc8f738..dc931c2d 100644 --- a/features/open_flow10/send_out_port.feature +++ b/features/open_flow10/send_out_port.feature @@ -1,10 +1,10 @@ @open_flow10 -Feature: Pio::SendOutPort +Feature: Pio::OpenFlow::SendOutPort Scenario: new(1) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(1) + Pio::OpenFlow::SendOutPort.new(1) """ Then it should finish successfully And the action has the following fields and values: @@ -17,7 +17,7 @@ Feature: Pio::SendOutPort Scenario: new(:all) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:all) + Pio::OpenFlow::SendOutPort.new(:all) """ Then it should finish successfully And the action has the following fields and values: @@ -30,7 +30,7 @@ Feature: Pio::SendOutPort Scenario: new(:controller) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:controller) + Pio::OpenFlow::SendOutPort.new(:controller) """ Then it should finish successfully And the action has the following fields and values: @@ -43,7 +43,7 @@ Feature: Pio::SendOutPort Scenario: new(:local) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:local) + Pio::OpenFlow::SendOutPort.new(:local) """ Then it should finish successfully And the action has the following fields and values: @@ -56,7 +56,7 @@ Feature: Pio::SendOutPort Scenario: new(:table) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:table) + Pio::OpenFlow::SendOutPort.new(:table) """ Then it should finish successfully And the action has the following fields and values: @@ -69,7 +69,7 @@ Feature: Pio::SendOutPort Scenario: new(:in_port) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:in_port) + Pio::OpenFlow::SendOutPort.new(:in_port) """ Then it should finish successfully And the action has the following fields and values: @@ -82,7 +82,7 @@ Feature: Pio::SendOutPort Scenario: new(:normal) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:normal) + Pio::OpenFlow::SendOutPort.new(:normal) """ Then it should finish successfully And the action has the following fields and values: @@ -95,7 +95,7 @@ Feature: Pio::SendOutPort Scenario: new(:flood) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:flood) + Pio::OpenFlow::SendOutPort.new(:flood) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow10/set_destination_mac_address.feature b/features/open_flow10/set_destination_mac_address.feature index 88787e8e..0597d47b 100644 --- a/features/open_flow10/set_destination_mac_address.feature +++ b/features/open_flow10/set_destination_mac_address.feature @@ -1,10 +1,10 @@ @open_flow10 -Feature: Pio::SetDestinationMacAddress +Feature: Pio::OpenFlow::SetDestinationMacAddress Scenario: new('11:22:33:44:55:66') When I try to create an OpenFlow action with: """ - Pio::SetDestinationMacAddress.new('11:22:33:44:55:66') + Pio::OpenFlow::SetDestinationMacAddress.new('11:22:33:44:55:66') """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow10/set_source_mac_address.feature b/features/open_flow10/set_source_mac_address.feature index 77690030..cf7f5e41 100644 --- a/features/open_flow10/set_source_mac_address.feature +++ b/features/open_flow10/set_source_mac_address.feature @@ -1,10 +1,10 @@ @open_flow10 -Feature: Pio::SetSourceMacAddress +Feature: Pio::OpenFlow::SetSourceMacAddress Scenario: new('11:22:33:44:55:66') When I try to create an OpenFlow action with: """ - Pio::SetSourceMacAddress.new('11:22:33:44:55:66') + Pio::OpenFlow::SetSourceMacAddress.new('11:22:33:44:55:66') """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow10/table_stats_request.feature b/features/open_flow10/table_stats_request.feature index d1be8cea..311a7019 100644 --- a/features/open_flow10/table_stats_request.feature +++ b/features/open_flow10/table_stats_request.feature @@ -1,9 +1,9 @@ @open_flow10 -Feature: Pio::TableStats::Request +Feature: Pio::OpenFlow::TableStats::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::TableStats::Request.new + Pio::OpenFlow::TableStats::Request.new """ Then it should finish successfully And the message has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::TableStats::Request Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::TableStats::Request.new(transaction_id: 123) + Pio::OpenFlow::TableStats::Request.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: diff --git a/features/open_flow13/apply_actions.feature b/features/open_flow13/apply_actions.feature index dac26446..3f24efee 100644 --- a/features/open_flow13/apply_actions.feature +++ b/features/open_flow13/apply_actions.feature @@ -1,27 +1,27 @@ @open_flow13 -Feature: Apply-Actions instruction. +Feature: Pio::OpenFlow::Apply Scenario: new() When I try to create an OpenFlow instruction with: """ - Pio::Apply.new + Pio::OpenFlow::Apply.new """ Then it should finish successfully And the message has the following fields and values: - | field | value | - | class | Pio::Apply | - | instruction_type | 4 | - | instruction_length | 8 | - | actions | [] | + | field | value | + | class | Pio::OpenFlow13::Apply | + | instruction_type | 4 | + | instruction_length | 8 | + | actions | [] | Scenario: new(SendOutPort.new(1)) When I try to create an OpenFlow instruction with: """ - Pio::Apply.new(SendOutPort.new(1)) + Pio::OpenFlow::Apply.new(Pio::OpenFlow::SendOutPort.new(1)) """ Then it should finish successfully And the message has the following fields and values: | field | value | - | class | Pio::Apply | + | class | Pio::OpenFlow13::Apply | | instruction_type | 4 | | instruction_length | 24 | | actions.size | 1 | @@ -29,11 +29,11 @@ Feature: Apply-Actions instruction. | actions.at(0).port | 1 | Scenario: read - When I try to parse a file named "open_flow13/apply_actions.raw" with "Pio::Apply" class + When I try to parse a file named "open_flow13/apply_actions.raw" with "Pio::OpenFlow::Apply" class Then it should finish successfully And the message has the following fields and values: | field | value | - | class | Pio::Apply | + | class | Pio::OpenFlow13::Apply | | instruction_type | 4 | | instruction_length | 24 | | actions.size | 1 | diff --git a/features/open_flow13/bad_request.feature b/features/open_flow13/bad_request.feature index d84f11ef..bd399397 100644 --- a/features/open_flow13/bad_request.feature +++ b/features/open_flow13/bad_request.feature @@ -1,12 +1,12 @@ @open_flow13 -Feature: Pio::Error::BadRequest +Feature: Pio::OpenFlow::Error::BadRequest Request was not understood error. Scenario: new (raw_data = Echo request 1.0) When I try to create an OpenFlow message with: """ - Pio::Error::BadRequest.new(raw_data: Pio::OpenFlow10::Echo::Request.new.to_binary) + Pio::OpenFlow::Error::BadRequest.new(raw_data: Pio::OpenFlow10::Echo::Request.new.to_binary) """ Then it should finish successfully And the message has the following fields and values: @@ -21,7 +21,7 @@ Feature: Pio::Error::BadRequest | raw_data.length | 8 | Scenario: read - When I try to parse a file named "open_flow13/bad_request.raw" with "Pio::Error::BadRequest" class + When I try to parse a file named "open_flow13/bad_request.raw" with "Pio::OpenFlow::Error::BadRequest" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow13/copy_ttl_inwards.feature b/features/open_flow13/copy_ttl_inwards.feature index 8ca08848..ecfd7e78 100644 --- a/features/open_flow13/copy_ttl_inwards.feature +++ b/features/open_flow13/copy_ttl_inwards.feature @@ -1,12 +1,12 @@ @open_flow13 -Feature: Pio::CopyTtlInwards +Feature: Pio::OpenFlow::CopyTtlInwards Copies TTL "inwards" -- from outermost to next-to-outermost Scenario: new When I try to create an OpenFlow action with: """ - Pio::CopyTtlInwards.new + Pio::OpenFlow::CopyTtlInwards.new """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/copy_ttl_outwards.feature b/features/open_flow13/copy_ttl_outwards.feature index 598080dd..2fff90ba 100644 --- a/features/open_flow13/copy_ttl_outwards.feature +++ b/features/open_flow13/copy_ttl_outwards.feature @@ -1,12 +1,12 @@ @open_flow13 -Feature: Pio::CopyTtlOutwards +Feature: Pio::OpenFlow::CopyTtlOutwards Copies TTL "outwards" -- from next-to-outermost to outermost Scenario: new When I try to create an OpenFlow action with: """ - Pio::CopyTtlOutwards.new + Pio::OpenFlow::CopyTtlOutwards.new """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/decrement_ip_ttl.feature b/features/open_flow13/decrement_ip_ttl.feature index 9b95c00a..bbafc0e9 100644 --- a/features/open_flow13/decrement_ip_ttl.feature +++ b/features/open_flow13/decrement_ip_ttl.feature @@ -1,10 +1,10 @@ @open_flow13 -Feature: Pio::DecrementIpTtl +Feature: Pio::OpenFlow::DecrementIpTtl Scenario: new When I try to create an OpenFlow action with: """ - Pio::DecrementIpTtl.new + Pio::OpenFlow::DecrementIpTtl.new """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/echo_reply.feature b/features/open_flow13/echo_reply.feature index d4585de4..3df3aef4 100644 --- a/features/open_flow13/echo_reply.feature +++ b/features/open_flow13/echo_reply.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::Echo::Reply +Feature: Pio::OpenFlow::Echo::Reply Scenario: new When I try to create an OpenFlow message with: """ - Pio::Echo::Reply.new + Pio::OpenFlow::Echo::Reply.new """ Then it should finish successfully And the message has the following fields and values: @@ -19,7 +19,7 @@ Feature: Pio::Echo::Reply Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Echo::Reply.new(transaction_id: 123) + Pio::OpenFlow::Echo::Reply.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: @@ -35,7 +35,7 @@ Feature: Pio::Echo::Reply Scenario: new(body: 'echo reply body') When I try to create an OpenFlow message with: """ - Pio::Echo::Reply.new(body: 'echo reply body') + Pio::OpenFlow::Echo::Reply.new(body: 'echo reply body') """ Then it should finish successfully And the message has the following fields and values: @@ -51,12 +51,12 @@ Feature: Pio::Echo::Reply Scenario: new(unknown_attr: 'foo') and error When I try to create an OpenFlow message with: """ - Pio::Echo::Reply.new(unknown_attr: 'foo') + Pio::OpenFlow::Echo::Reply.new(unknown_attr: 'foo') """ Then it should fail with "RuntimeError", "Unknown option: unknown_attr" Scenario: read (no message body) - When I try to parse a file named "open_flow13/echo_reply_no_body.raw" with "Pio::Echo::Reply" class + When I try to parse a file named "open_flow13/echo_reply_no_body.raw" with "Pio::OpenFlow::Echo::Reply" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -69,7 +69,7 @@ Feature: Pio::Echo::Reply | user_data | | Scenario: read - When I try to parse a file named "open_flow13/echo_reply_body.raw" with "Pio::Echo::Reply" class + When I try to parse a file named "open_flow13/echo_reply_body.raw" with "Pio::OpenFlow::Echo::Reply" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -82,5 +82,5 @@ Feature: Pio::Echo::Reply | user_data | hogehogehogehogehoge | Scenario: parse error - When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Echo::Reply" class + When I try to parse a file named "open_flow10/features_request.raw" with "Pio::OpenFlow::Echo::Reply" class Then it should fail with "Pio::ParseError", "Invalid OpenFlow13 Echo Reply message." diff --git a/features/open_flow13/echo_request.feature b/features/open_flow13/echo_request.feature index 0b04326f..e549fa26 100644 --- a/features/open_flow13/echo_request.feature +++ b/features/open_flow13/echo_request.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::Echo::Request +Feature: Pio::OpenFlow::Echo::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::Echo::Request.new + Pio::OpenFlow::Echo::Request.new """ Then it should finish successfully And the message has the following fields and values: @@ -19,7 +19,7 @@ Feature: Pio::Echo::Request Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Echo::Request.new(transaction_id: 123) + Pio::OpenFlow::Echo::Request.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: @@ -35,7 +35,7 @@ Feature: Pio::Echo::Request Scenario: new(body: 'echo request body') When I try to create an OpenFlow message with: """ - Pio::Echo::Request.new(body: 'echo request body') + Pio::OpenFlow::Echo::Request.new(body: 'echo request body') """ Then it should finish successfully And the message has the following fields and values: @@ -51,12 +51,12 @@ Feature: Pio::Echo::Request Scenario: new(unknown_attr: 'foo') and error When I try to create an OpenFlow message with: """ - Pio::Echo::Request.new(unknown_attr: 'foo') + Pio::OpenFlow::Echo::Request.new(unknown_attr: 'foo') """ Then it should fail with "RuntimeError", "Unknown option: unknown_attr" Scenario: read (no message body) - When I try to parse a file named "open_flow13/echo_request_no_body.raw" with "Pio::Echo::Request" class + When I try to parse a file named "open_flow13/echo_request_no_body.raw" with "Pio::OpenFlow::Echo::Request" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -69,7 +69,7 @@ Feature: Pio::Echo::Request | user_data | | Scenario: read - When I try to parse a file named "open_flow13/echo_request_body.raw" with "Pio::Echo::Request" class + When I try to parse a file named "open_flow13/echo_request_body.raw" with "Pio::OpenFlow::Echo::Request" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -82,5 +82,5 @@ Feature: Pio::Echo::Request | user_data | hogehogehogehogehoge | Scenario: parse error - When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Echo::Request" class + When I try to parse a file named "open_flow10/features_request.raw" with "Pio::OpenFlow::Echo::Request" class Then it should fail with "Pio::ParseError", "Invalid OpenFlow13 Echo Request message." diff --git a/features/open_flow13/features_reply.feature b/features/open_flow13/features_reply.feature index 9ebc7825..47d5692a 100644 --- a/features/open_flow13/features_reply.feature +++ b/features/open_flow13/features_reply.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::Features::Reply +Feature: Pio::OpenFlow::Features::Reply Scenario: new When I try to create an OpenFlow message with: """ - Pio::Features::Reply.new( + Pio::OpenFlow::Features::Reply.new( datapath_id: 0x123, n_buffers: 0x100, n_tables: 0xfe, @@ -27,19 +27,19 @@ Feature: Pio::Features::Reply | reserved | 0 | Scenario: read - When I try to parse a file named "open_flow13/features_reply.raw" with "Pio::Features::Reply" class + When I try to parse a file named "open_flow13/features_reply.raw" with "Pio::OpenFlow::Features::Reply" class Then it should finish successfully And the message has the following fields and values: - | field | value | - | ofp_version | 4 | - | message_type | 6 | - | message_length | 32 | - | transaction_id | 0 | - | xid | 0 | - | datapath_id | 281474976710657 | - | dpid | 281474976710657 | - | n_buffers | 256 | - | n_tables | 1 | - | auxiliary_id | 0 | - | capabilities | [:flow_stats, :table_stats, :port_stats, :group_stats, :ip_reasm, :queue_stats, :port_blocked] | - | reserved | 0 | + | field | value | + | ofp_version | 4 | + | message_type | 6 | + | message_length | 32 | + | transaction_id | 0 | + | xid | 0 | + | datapath_id | 281474976710657 | + | dpid | 281474976710657 | + | n_buffers | 256 | + | n_tables | 1 | + | auxiliary_id | 0 | + | capabilities | [:flow_stats, :table_stats, :port_stats, :group_stats, :ip_reasm, :queue_stats, :port_blocked] | + | reserved | 0 | diff --git a/features/open_flow13/features_request.feature b/features/open_flow13/features_request.feature index 761fed56..4a3b1fc5 100644 --- a/features/open_flow13/features_request.feature +++ b/features/open_flow13/features_request.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::Features::Request +Feature: Pio::OpenFlow::Features::Request Scenario: new When I try to create an OpenFlow message with: """ - Pio::Features::Request.new + Pio::OpenFlow::Features::Request.new """ Then it should finish successfully And the message has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::Features::Request Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Features::Request.new(transaction_id: 123) + Pio::OpenFlow::Features::Request.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: @@ -33,12 +33,12 @@ Feature: Pio::Features::Request Scenario: new(unknown_attr: 'foo') and error When I try to create an OpenFlow message with: """ - Pio::Features::Request.new(unknown_attr: 'foo') + Pio::OpenFlow::Features::Request.new(unknown_attr: 'foo') """ Then it should fail with "RuntimeError", "Unknown option: unknown_attr" Scenario: read - When I try to parse a file named "open_flow13/features_request.raw" with "Pio::Features::Request" class + When I try to parse a file named "open_flow13/features_request.raw" with "Pio::OpenFlow::Features::Request" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -50,5 +50,5 @@ Feature: Pio::Features::Request | body | | Scenario: parse error - When I try to parse a file named "open_flow10/hello.raw" with "Pio::Features::Request" class + When I try to parse a file named "open_flow10/hello.raw" with "Pio::OpenFlow::Features::Request" class Then it should fail with "Pio::ParseError", "Invalid OpenFlow13 Features Request message." diff --git a/features/open_flow13/flow_mod.feature b/features/open_flow13/flow_mod.feature index 6bd03f11..ffd05943 100644 --- a/features/open_flow13/flow_mod.feature +++ b/features/open_flow13/flow_mod.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::FlowMod +Feature: Pio::OpenFlow::FlowMod Scenario: new When I try to create an OpenFlow message with: """ - Pio::FlowMod.new + Pio::OpenFlow::FlowMod.new """ Then it should finish successfully And the message has the following fields and values: @@ -28,10 +28,10 @@ Feature: Pio::FlowMod | match.match_fields | [] | | instructions | [] | - Scenario: new(instructions: Pio::Apply.new(SendOutPort.new(1))) + Scenario: new(instructions: Pio::OpenFlow::Apply.new(Pio::OpenFlow::SendOutPort.new(1))) When I try to create an OpenFlow message with: """ - Pio::FlowMod.new(instructions: Pio::Apply.new(SendOutPort.new(1))) + Pio::OpenFlow::FlowMod.new(instructions: Pio::OpenFlow::Apply.new(Pio::OpenFlow::SendOutPort.new(1))) """ Then it should finish successfully And the message has the following fields and values: @@ -54,14 +54,14 @@ Feature: Pio::FlowMod | flags | [] | | match.match_fields | [] | | instructions.size | 1 | - | instructions.at(0).class | Pio::Apply | + | instructions.at(0).class | Pio::OpenFlow13::Apply | | instructions.at(0).actions.at(0).class | Pio::OpenFlow13::SendOutPort | | instructions.at(0).actions.at(0).port | 1 | - Scenario: new(match: Pio::Match.new(in_port: 1), instructions: Pio::Apply.new(SendOutPort.new(1))) + Scenario: new(match: Pio::OpenFlow::Match.new(in_port: 1), instructions: Pio::OpenFlow::Apply.new(Pio::OpenFlow::SendOutPort.new(1))) When I try to create an OpenFlow message with: """ - Pio::FlowMod.new(match: Pio::Match.new(in_port: 1), instructions: Pio::Apply.new(SendOutPort.new(1))) + Pio::OpenFlow::FlowMod.new(match: Pio::OpenFlow::Match.new(in_port: 1), instructions: Pio::OpenFlow::Apply.new(Pio::OpenFlow::SendOutPort.new(1))) """ Then it should finish successfully And the message has the following fields and values: @@ -84,12 +84,12 @@ Feature: Pio::FlowMod | flags | [] | | match.in_port | 1 | | instructions.size | 1 | - | instructions.at(0).class | Pio::Apply | + | instructions.at(0).class | Pio::OpenFlow13::Apply | | instructions.at(0).actions.at(0).class | Pio::OpenFlow13::SendOutPort | | instructions.at(0).actions.at(0).port | 1 | Scenario: read (no match or instructions) - When I try to parse a file named "open_flow13/flow_mod_no_match_or_instructions.raw" with "Pio::FlowMod" class + When I try to parse a file named "open_flow13/flow_mod_no_match_or_instructions.raw" with "Pio::OpenFlow::FlowMod" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -113,7 +113,7 @@ Feature: Pio::FlowMod | instructions | [] | Scenario: read (instruction = apply, action = SendOutPort(port: 1)) - When I try to parse a file named "open_flow13/flow_mod_add_apply_no_match.raw" with "Pio::FlowMod" class + When I try to parse a file named "open_flow13/flow_mod_add_apply_no_match.raw" with "Pio::OpenFlow::FlowMod" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -135,6 +135,6 @@ Feature: Pio::FlowMod | flags | [] | | match.match_fields | [] | | instructions.size | 1 | - | instructions.at(0).class | Pio::Apply | + | instructions.at(0).class | Pio::OpenFlow13::Apply | | instructions.at(0).actions.at(0).class | Pio::OpenFlow13::SendOutPort | | instructions.at(0).actions.at(0).port | 1 | diff --git a/features/open_flow13/hello.feature b/features/open_flow13/hello.feature index b1dcffae..2456f678 100644 --- a/features/open_flow13/hello.feature +++ b/features/open_flow13/hello.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::Hello +Feature: Pio::OpenFlow::Hello Scenario: new When I try to create an OpenFlow message with: """ - Pio::Hello.new + Pio::OpenFlow::Hello.new """ Then it should finish successfully And the message has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::Hello Scenario: new(transaction_id: 123) When I try to create an OpenFlow message with: """ - Pio::Hello.new(transaction_id: 123) + Pio::OpenFlow::Hello.new(transaction_id: 123) """ Then it should finish successfully And the message has the following fields and values: @@ -29,27 +29,3 @@ Feature: Pio::Hello | transaction_id | 123 | | xid | 123 | | supported_versions | [:open_flow13] | - - Scenario: read (no version bitmap) - When I try to parse a file named "open_flow13/hello_no_version_bitmap.raw" with "Pio::Hello" class - Then it should finish successfully - And the message has the following fields and values: - | field | value | - | ofp_version | 4 | - | message_type | 0 | - | message_length | 8 | - | transaction_id | 0 | - | xid | 0 | - | supported_versions | [] | - - Scenario: read - When I try to parse a file named "open_flow13/hello_version_bitmap.raw" with "Pio::Hello" class - Then it should finish successfully - And the message has the following fields and values: - | field | value | - | ofp_version | 4 | - | message_type | 0 | - | message_length | 16 | - | transaction_id | 0 | - | xid | 0 | - | supported_versions | [:open_flow10, :open_flow13] | diff --git a/features/open_flow13/hello_failed.feature b/features/open_flow13/hello_failed.feature index 065deb74..0622d429 100644 --- a/features/open_flow13/hello_failed.feature +++ b/features/open_flow13/hello_failed.feature @@ -1,12 +1,12 @@ @open_flow13 -Feature: Pio::Error::HelloFailed +Feature: Pio::OpenFlow::Error::HelloFailed Hello protocol failed Scenario: new When I try to create an OpenFlow message with: """ - Pio::Error::HelloFailed.new + Pio::OpenFlow::Error::HelloFailed.new """ Then it should finish successfully And the message has the following fields and values: @@ -23,7 +23,7 @@ Feature: Pio::Error::HelloFailed Scenario: new(description: 'error description') When I try to create an OpenFlow message with: """ - Pio::Error::HelloFailed.new(description: 'error description') + Pio::OpenFlow::Error::HelloFailed.new(description: 'error description') """ Then it should finish successfully And the message has the following fields and values: @@ -40,7 +40,7 @@ Feature: Pio::Error::HelloFailed Scenario: new(error_code: :permissions_error) When I try to create an OpenFlow message with: """ - Pio::Error::HelloFailed.new(error_code: :permissions_error) + Pio::OpenFlow::Error::HelloFailed.new(error_code: :permissions_error) """ Then it should finish successfully And the message has the following fields and values: @@ -55,7 +55,7 @@ Feature: Pio::Error::HelloFailed | description | | Scenario: read - When I try to parse a file named "open_flow13/hello_failed.raw" with "Pio::Error::HelloFailed" class + When I try to parse a file named "open_flow13/hello_failed.raw" with "Pio::OpenFlow::Error::HelloFailed" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow13/match.feature b/features/open_flow13/match.feature index b6e4de4d..43dceafb 100644 --- a/features/open_flow13/match.feature +++ b/features/open_flow13/match.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::Match +Feature: Pio::OpenFlow::Match Scenario: new When I try to create an OpenFlow message with: """ - Pio::Match.new + Pio::OpenFlow::Match.new """ Then it should finish successfully And the message has the following fields and values: @@ -13,7 +13,7 @@ Feature: Pio::Match Scenario: new(in_port: 1) When I try to create an OpenFlow message with: """ - Pio::Match.new(in_port: 1) + Pio::OpenFlow::Match.new(in_port: 1) """ Then it should finish successfully And the message has the following fields and values: @@ -23,7 +23,7 @@ Feature: Pio::Match Scenario: new(metadata: 1) When I try to create an OpenFlow message with: """ - Pio::Match.new(metadata: 1) + Pio::OpenFlow::Match.new(metadata: 1) """ Then it should finish successfully And the message has the following fields and values: @@ -33,7 +33,7 @@ Feature: Pio::Match Scenario: new(metadata: 1, metadata_mask: 1) When I try to create an OpenFlow message with: """ - Pio::Match.new(metadata: 1, metadata_mask: 1) + Pio::OpenFlow::Match.new(metadata: 1, metadata_mask: 1) """ Then it should finish successfully And the message has the following fields and values: @@ -44,7 +44,7 @@ Feature: Pio::Match Scenario: new(source_mac_address: '01:02:03:04:05:06') When I try to create an OpenFlow message with: """ - Pio::Match.new(source_mac_address: '01:02:03:04:05:06') + Pio::OpenFlow::Match.new(source_mac_address: '01:02:03:04:05:06') """ Then it should finish successfully And the message has the following fields and values: @@ -54,7 +54,7 @@ Feature: Pio::Match Scenario: new(destination_mac_address: '01:02:03:04:05:06') When I try to create an OpenFlow message with: """ - Pio::Match.new(destination_mac_address: '01:02:03:04:05:06') + Pio::OpenFlow::Match.new(destination_mac_address: '01:02:03:04:05:06') """ Then it should finish successfully And the message has the following fields and values: @@ -64,7 +64,7 @@ Feature: Pio::Match Scenario: new(source_mac_address: '01:02:03:04:05:06', source_mac_address_mask: 'ff:ff:ff:00:00:00') When I try to create an OpenFlow message with: """ - Pio::Match.new(source_mac_address: '01:02:03:04:05:06', source_mac_address_mask: 'ff:ff:ff:00:00:00') + Pio::OpenFlow::Match.new(source_mac_address: '01:02:03:04:05:06', source_mac_address_mask: 'ff:ff:ff:00:00:00') """ Then it should finish successfully And the message has the following fields and values: @@ -75,7 +75,7 @@ Feature: Pio::Match Scenario: new(destination_mac_address: '01:02:03:04:05:06', destination_mac_address_mask: 'ff:ff:ff:00:00:00') When I try to create an OpenFlow message with: """ - Pio::Match.new(destination_mac_address: '01:02:03:04:05:06', destination_mac_address_mask: 'ff:ff:ff:00:00:00') + Pio::OpenFlow::Match.new(destination_mac_address: '01:02:03:04:05:06', destination_mac_address_mask: 'ff:ff:ff:00:00:00') """ Then it should finish successfully And the message has the following fields and values: @@ -86,7 +86,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800) + Pio::OpenFlow::Match.new(ether_type: 0x0800) """ Then it should finish successfully And the message has the following fields and values: @@ -96,7 +96,7 @@ Feature: Pio::Match Scenario: new(vlan_vid: 10) When I try to create an OpenFlow message with: """ - Pio::Match.new(vlan_vid: 10) + Pio::OpenFlow::Match.new(vlan_vid: 10) """ Then it should finish successfully And the message has the following fields and values: @@ -106,7 +106,7 @@ Feature: Pio::Match Scenario: new(vlan_vid: 10, vlan_pcp: 5) When I try to create an OpenFlow message with: """ - Pio::Match.new(vlan_vid: 10, vlan_pcp: 5) + Pio::OpenFlow::Match.new(vlan_vid: 10, vlan_pcp: 5) """ Then it should finish successfully And the message has the following fields and values: @@ -117,7 +117,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2048, ip_dscp: 46) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2048, ip_dscp: 46) + Pio::OpenFlow::Match.new(ether_type: 2048, ip_dscp: 46) """ Then it should finish successfully And the message has the following fields and values: @@ -128,7 +128,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2048, ip_ecn: 3) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2048, ip_ecn: 46) + Pio::OpenFlow::Match.new(ether_type: 2048, ip_ecn: 46) """ Then it should finish successfully And the message has the following fields and values: @@ -139,7 +139,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ipv4_source_address: '192.168.0.1') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ipv4_source_address: '192.168.0.1') + Pio::OpenFlow::Match.new(ether_type: 0x0800, ipv4_source_address: '192.168.0.1') """ Then it should finish successfully And the message has the following fields and values: @@ -150,7 +150,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ipv4_destination_address: '192.168.0.1') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ipv4_destination_address: '192.168.0.1') + Pio::OpenFlow::Match.new(ether_type: 0x0800, ipv4_destination_address: '192.168.0.1') """ Then it should finish successfully And the message has the following fields and values: @@ -161,7 +161,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ipv4_source_address: '192.168.0.1', ivp4_source_address_mask: '255.255.0.0') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ipv4_source_address: '192.168.0.1', ipv4_source_address_mask: '255.255.0.0') + Pio::OpenFlow::Match.new(ether_type: 0x0800, ipv4_source_address: '192.168.0.1', ipv4_source_address_mask: '255.255.0.0') """ Then it should finish successfully And the message has the following fields and values: @@ -173,7 +173,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ipv4_destination_address: '192.168.0.1', ivp4_destination_address_mask: '255.255.0.0') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ipv4_destination_address: '192.168.0.1', ipv4_destination_address_mask: '255.255.0.0') + Pio::OpenFlow::Match.new(ether_type: 0x0800, ipv4_destination_address: '192.168.0.1', ipv4_destination_address_mask: '255.255.0.0') """ Then it should finish successfully And the message has the following fields and values: @@ -185,7 +185,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ip_protocol: 6, tcp_source_port: 1111) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ip_protocol: 6, tcp_source_port: 1111) + Pio::OpenFlow::Match.new(ether_type: 0x0800, ip_protocol: 6, tcp_source_port: 1111) """ Then it should finish successfully And the message has the following fields and values: @@ -197,7 +197,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ip_protocol: 6, tcp_destination_port: 80) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ip_protocol: 6, tcp_destination_port: 80) + Pio::OpenFlow::Match.new(ether_type: 0x0800, ip_protocol: 6, tcp_destination_port: 80) """ Then it should finish successfully And the message has the following fields and values: @@ -209,7 +209,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ip_protocol: 17, udp_source_port: 2222) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ip_protocol: 17, udp_source_port: 2222) + Pio::OpenFlow::Match.new(ether_type: 0x0800, ip_protocol: 17, udp_source_port: 2222) """ Then it should finish successfully And the message has the following fields and values: @@ -221,7 +221,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ip_protocol: 17, udp_destination_port: 3333) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ip_protocol: 17, udp_destination_port: 3333) + Pio::OpenFlow::Match.new(ether_type: 0x0800, ip_protocol: 17, udp_destination_port: 3333) """ Then it should finish successfully And the message has the following fields and values: @@ -233,7 +233,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ip_protocol: 132, sctp_source_port: 22) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ip_protocol: 132, sctp_source_port: 22) + Pio::OpenFlow::Match.new(ether_type: 0x0800, ip_protocol: 132, sctp_source_port: 22) """ Then it should finish successfully And the message has the following fields and values: @@ -245,7 +245,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ip_protocol: 132, sctp_destination_port: 22) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ip_protocol: 132, sctp_destination_port: 22) + Pio::OpenFlow::Match.new(ether_type: 0x0800, ip_protocol: 132, sctp_destination_port: 22) """ Then it should finish successfully And the message has the following fields and values: @@ -257,7 +257,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ip_protocol: 1, icmpv4_type: 8) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ip_protocol: 1, icmpv4_type: 8) + Pio::OpenFlow::Match.new(ether_type: 0x0800, ip_protocol: 1, icmpv4_type: 8) """ Then it should finish successfully And the message has the following fields and values: @@ -269,7 +269,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x0800, ip_protocol: 1, icmpv4_code: 0) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x0800, ip_protocol: 1, icmpv4_code: 0) + Pio::OpenFlow::Match.new(ether_type: 0x0800, ip_protocol: 1, icmpv4_code: 0) """ Then it should finish successfully And the message has the following fields and values: @@ -281,7 +281,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_operation: 1) When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_operation: 1) + Pio::OpenFlow::Match.new(ether_type: 2054, arp_operation: 1) """ Then it should finish successfully And the message has the following fields and values: @@ -292,7 +292,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_sender_protocol_address: '1.2.3.4') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_sender_protocol_address: '1.2.3.4') + Pio::OpenFlow::Match.new(ether_type: 2054, arp_sender_protocol_address: '1.2.3.4') """ Then it should finish successfully And the message has the following fields and values: @@ -303,7 +303,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_sender_protocol_address: '1.2.3.4', arp_sender_protocol_address_mask: '255.255.0.0') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_sender_protocol_address: '1.2.3.4', arp_sender_protocol_address_mask: '255.255.0.0') + Pio::OpenFlow::Match.new(ether_type: 2054, arp_sender_protocol_address: '1.2.3.4', arp_sender_protocol_address_mask: '255.255.0.0') """ Then it should finish successfully And the message has the following fields and values: @@ -315,7 +315,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_target_protocol_address: '1.2.3.4') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_target_protocol_address: '1.2.3.4') + Pio::OpenFlow::Match.new(ether_type: 2054, arp_target_protocol_address: '1.2.3.4') """ Then it should finish successfully And the message has the following fields and values: @@ -326,7 +326,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_target_protocol_address: '1.2.3.4', arp_target_protocol_address_mask: '255.255.0.0') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_target_protocol_address: '1.2.3.4', arp_target_protocol_address_mask: '255.255.0.0') + Pio::OpenFlow::Match.new(ether_type: 2054, arp_target_protocol_address: '1.2.3.4', arp_target_protocol_address_mask: '255.255.0.0') """ Then it should finish successfully And the message has the following fields and values: @@ -338,7 +338,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_sender_hardware_address: '11:22:33:44:55:66') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_sender_hardware_address: '11:22:33:44:55:66') + Pio::OpenFlow::Match.new(ether_type: 2054, arp_sender_hardware_address: '11:22:33:44:55:66') """ Then it should finish successfully And the message has the following fields and values: @@ -349,7 +349,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_sender_hardware_address: '11:22:33:44:55:66', arp_sender_hardware_address_mask: 'ff:ff:ff:00:00:00') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_sender_hardware_address: '11:22:33:44:55:66', arp_sender_hardware_address_mask: 'ff:ff:ff:00:00:00') + Pio::OpenFlow::Match.new(ether_type: 2054, arp_sender_hardware_address: '11:22:33:44:55:66', arp_sender_hardware_address_mask: 'ff:ff:ff:00:00:00') """ Then it should finish successfully And the message has the following fields and values: @@ -361,7 +361,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_target_hardware_address: '11:22:33:44:55:66') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_target_hardware_address: '11:22:33:44:55:66') + Pio::OpenFlow::Match.new(ether_type: 2054, arp_target_hardware_address: '11:22:33:44:55:66') """ Then it should finish successfully And the message has the following fields and values: @@ -372,7 +372,7 @@ Feature: Pio::Match Scenario: new(eth_type: 2054, arp_target_hardware_address: '11:22:33:44:55:66', arp_target_hardware_address_mask: 'ff:ff:ff:00:00:00') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 2054, arp_target_hardware_address: '11:22:33:44:55:66', arp_target_hardware_address_mask: 'ff:ff:ff:00:00:00') + Pio::OpenFlow::Match.new(ether_type: 2054, arp_target_hardware_address: '11:22:33:44:55:66', arp_target_hardware_address_mask: 'ff:ff:ff:00:00:00') """ Then it should finish successfully And the message has the following fields and values: @@ -384,7 +384,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x86dd, ipv6_source_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x86dd, ipv6_source_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee') + Pio::OpenFlow::Match.new(ether_type: 0x86dd, ipv6_source_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee') """ Then it should finish successfully And the message has the following fields and values: @@ -395,7 +395,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x86dd, ipv6_source_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee', ipv6_source_address_mask: 'ffff:ffff:ffff:ffff::') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x86dd, ipv6_source_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee', ipv6_source_address_mask: 'ffff:ffff:ffff:ffff::') + Pio::OpenFlow::Match.new(ether_type: 0x86dd, ipv6_source_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee', ipv6_source_address_mask: 'ffff:ffff:ffff:ffff::') """ Then it should finish successfully And the message has the following fields and values: @@ -407,7 +407,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x86dd, ipv6_destination_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x86dd, ipv6_destination_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee') + Pio::OpenFlow::Match.new(ether_type: 0x86dd, ipv6_destination_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee') """ Then it should finish successfully And the message has the following fields and values: @@ -418,7 +418,7 @@ Feature: Pio::Match Scenario: new(ether_type: 0x86dd, ipv6_destination_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee', ipv6_destination_address_mask: 'ffff:ffff:ffff:ffff::') When I try to create an OpenFlow message with: """ - Pio::Match.new(ether_type: 0x86dd, ipv6_destination_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee', ipv6_destination_address_mask: 'ffff:ffff:ffff:ffff::') + Pio::OpenFlow::Match.new(ether_type: 0x86dd, ipv6_destination_address: '2001:db8:bd05:1d2:288a:1fc0:1:10ee', ipv6_destination_address_mask: 'ffff:ffff:ffff:ffff::') """ Then it should finish successfully And the message has the following fields and values: @@ -430,7 +430,7 @@ Feature: Pio::Match Scenario: new(tunnel_id: 1) When I try to create an OpenFlow message with: """ - Pio::Match.new(tunnel_id: 1) + Pio::OpenFlow::Match.new(tunnel_id: 1) """ Then it should finish successfully And the message has the following fields and values: @@ -440,7 +440,7 @@ Feature: Pio::Match Scenario: new(tunnel_id: 1, tunnel_id_mask: 9223372036854775808) When I try to create an OpenFlow message with: """ - Pio::Match.new(tunnel_id: 1, tunnel_id_mask: 9223372036854775808) + Pio::OpenFlow::Match.new(tunnel_id: 1, tunnel_id_mask: 9223372036854775808) """ Then it should finish successfully And the message has the following fields and values: @@ -449,28 +449,28 @@ Feature: Pio::Match | tunnel_id_mask | 9223372036854775808 | Scenario: read (file: open_flow13/oxm_no_fields.raw) - When I try to parse a file named "open_flow13/oxm_no_fields.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_no_fields.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | | match_fields | [] | Scenario: read (file: open_flow13/oxm_in_port_field.raw) - When I try to parse a file named "open_flow13/oxm_in_port_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_in_port_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | | in_port | 1 | Scenario: read (file: open_flow13/oxm_metadata_field.raw) - When I try to parse a file named "open_flow13/oxm_metadata_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_metadata_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | | metadata | 1 | Scenario: read (file: open_flow13/oxm_metadata_masked_field.raw) - When I try to parse a file named "open_flow13/oxm_metadata_masked_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_metadata_masked_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -478,21 +478,21 @@ Feature: Pio::Match | metadata_mask | 18446744069414584320 | Scenario: read (file: open_flow13/oxm_ether_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_ether_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ether_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | | destination_mac_address | ff:ff:ff:ff:ff:ff | Scenario: read (file: open_flow13/oxm_ether_source_field.raw) - When I try to parse a file named "open_flow13/oxm_ether_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ether_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | | source_mac_address | 01:02:03:04:05:06 | Scenario: read (file: open_flow13/oxm_masked_ether_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_ether_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_ether_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -500,7 +500,7 @@ Feature: Pio::Match | destination_mac_address_mask | ff:ff:ff:00:00:00 | Scenario: read (file: open_flow13/oxm_masked_ether_source_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_ether_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_ether_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -508,21 +508,21 @@ Feature: Pio::Match | source_mac_address_mask | ff:ff:ff:00:00:00 | Scenario: read (file: open_flow13/oxm_ether_type_field.raw) - When I try to parse a file named "open_flow13/oxm_ether_type_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ether_type_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | | ether_type | 0 | Scenario: read (file: open_flow13/oxm_vlan_vid_field.raw) - When I try to parse a file named "open_flow13/oxm_vlan_vid_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_vlan_vid_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | | vlan_vid | 10 | Scenario: read (file: open_flow13/oxm_vlan_pcp_field.raw) - When I try to parse a file named "open_flow13/oxm_vlan_pcp_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_vlan_pcp_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -530,7 +530,7 @@ Feature: Pio::Match | vlan_pcp | 5 | Scenario: read (file: open_flow13/oxm_ip_dscp_field.raw) - When I try to parse a file named "open_flow13/oxm_ip_dscp_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ip_dscp_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -538,7 +538,7 @@ Feature: Pio::Match | ip_dscp | 46 | Scenario: read (file: open_flow13/oxm_ip_ecn_field.raw) - When I try to parse a file named "open_flow13/oxm_ip_ecn_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ip_ecn_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -546,7 +546,7 @@ Feature: Pio::Match | ip_ecn | 3 | Scenario: read (file: open_flow13/oxm_ipv4_source_field.raw) - When I try to parse a file named "open_flow13/oxm_ipv4_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ipv4_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -554,7 +554,7 @@ Feature: Pio::Match | ipv4_source_address | 1.2.3.4 | Scenario: read (file: open_flow13/oxm_ipv4_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_ipv4_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ipv4_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -562,7 +562,7 @@ Feature: Pio::Match | ipv4_destination_address | 11.22.33.44 | Scenario: read (file: open_flow13/oxm_masked_ipv4_source_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_ipv4_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_ipv4_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -571,7 +571,7 @@ Feature: Pio::Match | ipv4_source_address_mask | 255.255.0.0 | Scenario: read (file: open_flow13/oxm_masked_ipv4_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_ipv4_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_ipv4_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -580,7 +580,7 @@ Feature: Pio::Match | ipv4_destination_address_mask | 255.255.255.0 | Scenario: read (file: open_flow13/oxm_tcp_source_field.raw) - When I try to parse a file named "open_flow13/oxm_tcp_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_tcp_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -589,7 +589,7 @@ Feature: Pio::Match | tcp_source_port | 1111 | Scenario: read (file: open_flow13/oxm_tcp_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_tcp_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_tcp_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -598,7 +598,7 @@ Feature: Pio::Match | tcp_destination_port | 80 | Scenario: read (file: open_flow13/oxm_udp_source_field.raw) - When I try to parse a file named "open_flow13/oxm_udp_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_udp_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -607,7 +607,7 @@ Feature: Pio::Match | udp_source_port | 2222 | Scenario: read (file: open_flow13/oxm_udp_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_udp_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_udp_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -616,7 +616,7 @@ Feature: Pio::Match | udp_destination_port | 3333 | Scenario: read (file: open_flow13/oxm_sctp_source_field.raw) - When I try to parse a file named "open_flow13/oxm_sctp_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_sctp_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -625,7 +625,7 @@ Feature: Pio::Match | sctp_source_port | 22 | Scenario: read (file: open_flow13/oxm_sctp_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_sctp_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_sctp_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -634,7 +634,7 @@ Feature: Pio::Match | sctp_destination_port | 22 | Scenario: read (file: open_flow13/oxm_icmpv4_type_field.raw) - When I try to parse a file named "open_flow13/oxm_icmpv4_type_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_icmpv4_type_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -643,7 +643,7 @@ Feature: Pio::Match | icmpv4_type | 8 | Scenario: read (file: open_flow13/oxm_icmpv4_code_field.raw) - When I try to parse a file named "open_flow13/oxm_icmpv4_code_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_icmpv4_code_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -652,7 +652,7 @@ Feature: Pio::Match | icmpv4_code | 0 | Scenario: read (file: open_flow13/oxm_arp_op_field.raw) - When I try to parse a file named "open_flow13/oxm_arp_op_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_arp_op_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -660,7 +660,7 @@ Feature: Pio::Match | arp_operation | 1 | Scenario: read (file: open_flow13/oxm_arp_spa_field.raw) - When I try to parse a file named "open_flow13/oxm_arp_spa_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_arp_spa_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -668,7 +668,7 @@ Feature: Pio::Match | arp_sender_protocol_address | 1.2.3.4 | Scenario: read (file: open_flow13/oxm_masked_arp_spa_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_arp_spa_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_arp_spa_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -677,7 +677,7 @@ Feature: Pio::Match | arp_sender_protocol_address_mask | 255.255.0.0 | Scenario: read (file: open_flow13/oxm_arp_tpa_field.raw) - When I try to parse a file named "open_flow13/oxm_arp_tpa_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_arp_tpa_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -685,7 +685,7 @@ Feature: Pio::Match | arp_target_protocol_address | 1.2.3.4 | Scenario: read (file: open_flow13/oxm_masked_arp_tpa_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_arp_tpa_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_arp_tpa_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -694,7 +694,7 @@ Feature: Pio::Match | arp_target_protocol_address_mask | 255.255.0.0 | Scenario: read (file: open_flow13/oxm_arp_sha_field.raw) - When I try to parse a file named "open_flow13/oxm_arp_sha_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_arp_sha_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -702,7 +702,7 @@ Feature: Pio::Match | arp_sender_hardware_address | 11:22:33:44:55:66 | Scenario: read (file: open_flow13/oxm_masked_arp_sha_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_arp_sha_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_arp_sha_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -711,7 +711,7 @@ Feature: Pio::Match | arp_sender_hardware_address_mask | ff:ff:ff:ff:ff:ff | Scenario: read (file: open_flow13/oxm_arp_tha_field.raw) - When I try to parse a file named "open_flow13/oxm_arp_tha_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_arp_tha_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -719,7 +719,7 @@ Feature: Pio::Match | arp_target_hardware_address | 11:22:33:44:55:66 | Scenario: read (file: open_flow13/oxm_masked_arp_tha_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_arp_tha_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_arp_tha_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -728,7 +728,7 @@ Feature: Pio::Match | arp_target_hardware_address_mask | ff:ff:ff:ff:ff:ff | Scenario: read (file: open_flow13/oxm_ipv6_source_field.raw) - When I try to parse a file named "open_flow13/oxm_ipv6_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ipv6_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -736,7 +736,7 @@ Feature: Pio::Match | ipv6_source_address | 2001:db8:bd05:1d2:288a:1fc0:1:10ee | Scenario: read (file: open_flow13/oxm_masked_ipv6_source_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_ipv6_source_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_ipv6_source_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -745,7 +745,7 @@ Feature: Pio::Match | ipv6_source_address_mask | ffff:ffff:ffff:ffff:: | Scenario: read (file: open_flow13/oxm_ipv6_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_ipv6_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_ipv6_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -753,7 +753,7 @@ Feature: Pio::Match | ipv6_destination_address | 2001:db8:bd05:1d2:288a:1fc0:1:10ee | Scenario: read (file: open_flow13/oxm_masked_ipv6_destination_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_ipv6_destination_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_ipv6_destination_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -762,14 +762,14 @@ Feature: Pio::Match | ipv6_destination_address_mask | ffff:ffff:ffff:ffff:: | Scenario: read (file: open_flow13/oxm_tunnel_id_field.raw) - When I try to parse a file named "open_flow13/oxm_tunnel_id_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_tunnel_id_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | | tunnel_id | 1 | Scenario: read (file: open_flow13/oxm_masked_tunnel_id_field.raw) - When I try to parse a file named "open_flow13/oxm_masked_tunnel_id_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_masked_tunnel_id_field.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | @@ -777,11 +777,11 @@ Feature: Pio::Match | tunnel_id_mask | 9223372036854775808 | Scenario: read (file: open_flow13/oxm_invalid_field.raw) - When I try to parse a file named "open_flow13/oxm_invalid_field.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_invalid_field.raw" with "Pio::OpenFlow::Match" class Then it should fail with "RuntimeError", "Unknown OXM field value: 40" Scenario: read (file: open_flow13/oxm_experimenter_stratos_basic_dot11.raw) - When I try to parse a file named "open_flow13/oxm_experimenter_stratos_basic_dot11.raw" with "Pio::Match" class + When I try to parse a file named "open_flow13/oxm_experimenter_stratos_basic_dot11.raw" with "Pio::OpenFlow::Match" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow13/nicira_reg_load.feature b/features/open_flow13/nicira_reg_load.feature index 50e3b511..e6d71217 100644 --- a/features/open_flow13/nicira_reg_load.feature +++ b/features/open_flow13/nicira_reg_load.feature @@ -1,5 +1,5 @@ @open_flow13 -Feature: Pio::NiciraRegLoad +Feature: Pio::OpenFlow::NiciraRegLoad Copies value[0:n_bits] to destination[ofs:ofs+n_bits], where a[b:c] denotes the bits within 'a' numbered 'b' through 'c' (not including bit 'c'). @@ -7,7 +7,7 @@ Feature: Pio::NiciraRegLoad Scenario: new(0xdeadbeef, :reg0) When I try to create an OpenFlow action with: """ - Pio::NiciraRegLoad.new(0xdeadbeef, :reg0) + Pio::OpenFlow::NiciraRegLoad.new(0xdeadbeef, :reg0) """ Then it should finish successfully And the action has the following fields and values: @@ -20,7 +20,7 @@ Feature: Pio::NiciraRegLoad Scenario: new(0xdeadbeef, :metadata) When I try to create an OpenFlow action with: """ - Pio::NiciraRegLoad.new(0xdeadbeef, :metadata) + Pio::OpenFlow::NiciraRegLoad.new(0xdeadbeef, :metadata) """ Then it should finish successfully And the action has the following fields and values: @@ -33,7 +33,7 @@ Feature: Pio::NiciraRegLoad Scenario: new(0xdeadbeef, :reg0, offset: 16, n_bits: 16) When I try to create an OpenFlow action with: """ - Pio::NiciraRegLoad.new(0xdeadbeef, :reg0, offset: 16, n_bits: 16) + Pio::OpenFlow::NiciraRegLoad.new(0xdeadbeef, :reg0, offset: 16, n_bits: 16) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/nicira_reg_move.feature b/features/open_flow13/nicira_reg_move.feature index 34e10136..419d60d6 100644 --- a/features/open_flow13/nicira_reg_move.feature +++ b/features/open_flow13/nicira_reg_move.feature @@ -1,5 +1,5 @@ @open_flow13 -Feature: Pio::NiciraRegMove +Feature: Pio::OpenFlow::NiciraRegMove Copies source[source_offset:sourcce_offset+n_bits] to destination[destination_offset:dst_ofs+n_bits], where a[b:c] denotes @@ -8,8 +8,8 @@ Feature: Pio::NiciraRegMove Scenario: new(source: :arp_sender_hardware_address, destination: :arp_target_hardware_address) When I try to create an OpenFlow action with: """ - Pio::NiciraRegMove.new(source: :arp_sender_hardware_address, - destination: :arp_target_hardware_address) + Pio::OpenFlow::NiciraRegMove.new(source: :arp_sender_hardware_address, + destination: :arp_target_hardware_address) """ Then it should finish successfully And the action has the following fields and values: @@ -23,7 +23,7 @@ Feature: Pio::NiciraRegMove Scenario: new(source: :reg0, destination: :reg7) When I try to create an OpenFlow action with: """ - Pio::NiciraRegMove.new(source: :reg0, destination: :reg7) + Pio::OpenFlow::NiciraRegMove.new(source: :reg0, destination: :reg7) """ Then it should finish successfully And the action has the following fields and values: @@ -37,9 +37,9 @@ Feature: Pio::NiciraRegMove Scenario: new(source: :reg0, source_offset: 16, destination: :reg7, destination_offset: 16, n_bits: 16) When I try to create an OpenFlow action with: """ - Pio::NiciraRegMove.new(source: :reg0, source_offset: 16, - destination: :reg7, destination_offset: 16, - n_bits: 16) + Pio::OpenFlow::NiciraRegMove.new(source: :reg0, source_offset: 16, + destination: :reg7, destination_offset: 16, + n_bits: 16) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/nicira_send_out_port.feature b/features/open_flow13/nicira_send_out_port.feature index ee44cf77..660227d7 100644 --- a/features/open_flow13/nicira_send_out_port.feature +++ b/features/open_flow13/nicira_send_out_port.feature @@ -1,12 +1,12 @@ @open_flow13 -Feature: Pio::NiciraSendOutPort +Feature: Pio::OpenFlow::NiciraSendOutPort Outputs to the OpenFlow port number written to source[offset:offset+n_bits] Scenario: new(:reg0) When I try to create an OpenFlow action with: """ - Pio::NiciraSendOutPort.new(:reg0) + Pio::OpenFlow::NiciraSendOutPort.new(:reg0) """ Then it should finish successfully And the action has the following fields and values: @@ -19,7 +19,7 @@ Feature: Pio::NiciraSendOutPort Scenario: new(:reg0, offset: 16, n_bits: 16, max_length: 256) When I try to create an OpenFlow action with: """ - Pio::NiciraSendOutPort.new(:reg0, offset: 16, n_bits: 16, max_length: 256) + Pio::OpenFlow::NiciraSendOutPort.new(:reg0, offset: 16, n_bits: 16, max_length: 256) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/nicira_stack_pop.feature b/features/open_flow13/nicira_stack_pop.feature index 0db72198..22f168ff 100644 --- a/features/open_flow13/nicira_stack_pop.feature +++ b/features/open_flow13/nicira_stack_pop.feature @@ -1,12 +1,12 @@ @open_flow13 -Feature: Pio::NiciraStackPop +Feature: Pio::OpenFlow::NiciraStackPop Pops field[offset: offset + n_bits] from top of the stack. Scenario: new(:reg0) When I try to create an OpenFlow action with: """ - Pio::NiciraStackPop.new(:reg0) + Pio::OpenFlow::NiciraStackPop.new(:reg0) """ Then it should finish successfully And the action has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::NiciraStackPop Scenario: new(:reg0, n_bits: 16, offset: 16) When I try to create an OpenFlow action with: """ - Pio::NiciraStackPop.new(:reg0, n_bits: 16, offset: 16) + Pio::OpenFlow::NiciraStackPop.new(:reg0, n_bits: 16, offset: 16) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/nicira_stack_push.feature b/features/open_flow13/nicira_stack_push.feature index ce511c0c..5197e655 100644 --- a/features/open_flow13/nicira_stack_push.feature +++ b/features/open_flow13/nicira_stack_push.feature @@ -1,12 +1,12 @@ @open_flow13 -Feature: Pio::NiciraStackPush +Feature: Pio::OpenFlow::NiciraStackPush Pushes field[offset: offset + n_bits] to top of the stack. Scenario: new(:reg0) When I try to create an OpenFlow action with: """ - Pio::NiciraStackPush.new(:reg0) + Pio::OpenFlow::NiciraStackPush.new(:reg0) """ Then it should finish successfully And the action has the following fields and values: @@ -18,7 +18,7 @@ Feature: Pio::NiciraStackPush Scenario: new(:reg0, n_bits: 16, offset: 16) When I try to create an OpenFlow action with: """ - Pio::NiciraStackPush.new(:reg0, n_bits: 16, offset: 16) + Pio::OpenFlow::NiciraStackPush.new(:reg0, n_bits: 16, offset: 16) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/packet_in.feature b/features/open_flow13/packet_in.feature index 74f00e07..708b8a8e 100644 --- a/features/open_flow13/packet_in.feature +++ b/features/open_flow13/packet_in.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::PacketIn +Feature: Pio::OpenFlow::PacketIn Scenario: new When I try to create an OpenFlow message with: """ - Pio::PacketIn.new + Pio::OpenFlow::PacketIn.new """ Then it should finish successfully And the message has the following fields and values: @@ -33,7 +33,7 @@ Feature: Pio::PacketIn 0x00, 0x00, 0x00, 0x00, 0x00 ].pack('C*') - Pio::PacketIn.new(raw_data: data_dump) + Pio::OpenFlow::PacketIn.new(raw_data: data_dump) """ Then it should finish successfully And the message has the following fields and values: diff --git a/features/open_flow13/packet_out.feature b/features/open_flow13/packet_out.feature index 0aa520ae..30fbbd8c 100644 --- a/features/open_flow13/packet_out.feature +++ b/features/open_flow13/packet_out.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::PacketOut +Feature: Pio::OpenFlow::PacketOut Scenario: new When I try to create an OpenFlow message with: """ - Pio::PacketOut.new + Pio::OpenFlow::PacketOut.new """ Then it should finish successfully And the message has the following fields and values: @@ -31,7 +31,7 @@ Feature: Pio::PacketOut 0x00, 0x00, 0x00, 0x00, 0x00 ].pack('C*') - Pio::PacketOut.new(raw_data: data_dump, actions: Pio::SendOutPort.new(1)) + Pio::OpenFlow::PacketOut.new(raw_data: data_dump, actions: Pio::OpenFlow::SendOutPort.new(1)) """ Then it should finish successfully And the message has the following fields and values: diff --git a/features/open_flow13/send_out_port.feature b/features/open_flow13/send_out_port.feature index ad7f136e..dd44dd69 100644 --- a/features/open_flow13/send_out_port.feature +++ b/features/open_flow13/send_out_port.feature @@ -1,9 +1,9 @@ @open_flow13 -Feature: Pio::SendOutPort +Feature: Pio::OpenFlow::SendOutPort Scenario: new(1) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(1) + Pio::OpenFlow::SendOutPort.new(1) """ Then it should finish successfully And the message has the following fields and values: @@ -16,7 +16,7 @@ Feature: Pio::SendOutPort Scenario: new(:all) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:all) + Pio::OpenFlow::SendOutPort.new(:all) """ Then it should finish successfully And the action has the following fields and values: @@ -29,7 +29,7 @@ Feature: Pio::SendOutPort Scenario: new(:controller) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:controller) + Pio::OpenFlow::SendOutPort.new(:controller) """ Then it should finish successfully And the action has the following fields and values: @@ -42,7 +42,7 @@ Feature: Pio::SendOutPort Scenario: new(:local) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:local) + Pio::OpenFlow::SendOutPort.new(:local) """ Then it should finish successfully And the action has the following fields and values: @@ -55,7 +55,7 @@ Feature: Pio::SendOutPort Scenario: new(:table) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:table) + Pio::OpenFlow::SendOutPort.new(:table) """ Then it should finish successfully And the action has the following fields and values: @@ -68,7 +68,7 @@ Feature: Pio::SendOutPort Scenario: new(:in_port) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:in_port) + Pio::OpenFlow::SendOutPort.new(:in_port) """ Then it should finish successfully And the action has the following fields and values: @@ -81,7 +81,7 @@ Feature: Pio::SendOutPort Scenario: new(:normal) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:normal) + Pio::OpenFlow::SendOutPort.new(:normal) """ Then it should finish successfully And the action has the following fields and values: @@ -94,7 +94,7 @@ Feature: Pio::SendOutPort Scenario: new(:flood) When I try to create an OpenFlow action with: """ - Pio::SendOutPort.new(:flood) + Pio::OpenFlow::SendOutPort.new(:flood) """ Then it should finish successfully And the action has the following fields and values: @@ -105,7 +105,7 @@ Feature: Pio::SendOutPort | max_length | :no_buffer | Scenario: read - When I try to parse a file named "open_flow13/send_out_port.raw" with "Pio::SendOutPort" class + When I try to parse a file named "open_flow13/send_out_port.raw" with "Pio::OpenFlow::SendOutPort" class Then it should finish successfully And the message has the following fields and values: | field | value | diff --git a/features/open_flow13/set_arp_operation.feature b/features/open_flow13/set_arp_operation.feature index 9086b17e..fee819c2 100644 --- a/features/open_flow13/set_arp_operation.feature +++ b/features/open_flow13/set_arp_operation.feature @@ -1,10 +1,10 @@ @open_flow13 -Feature: Pio::SetArpOperation +Feature: Pio::OpenFlow::SetArpOperation Scenario: new(Pio::Arp::Reply::OPERATION) When I try to create an OpenFlow action with: """ - Pio::SetArpOperation.new(Pio::Arp::Reply::OPERATION) + Pio::OpenFlow::SetArpOperation.new(Pio::Arp::Reply::OPERATION) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/set_arp_sender_hardware_address.feature b/features/open_flow13/set_arp_sender_hardware_address.feature index ab6ac774..8ac61469 100644 --- a/features/open_flow13/set_arp_sender_hardware_address.feature +++ b/features/open_flow13/set_arp_sender_hardware_address.feature @@ -1,10 +1,10 @@ @open_flow13 -Feature: Pio::SetArpSenderHardwareAddress +Feature: Pio::OpenFlow::SetArpSenderHardwareAddress Scenario: new('00:00:de:ad:be:ef') When I try to create an OpenFlow action with: """ - Pio::SetArpSenderHardwareAddress.new('00:00:de:ad:be:ef') + Pio::OpenFlow::SetArpSenderHardwareAddress.new('00:00:de:ad:be:ef') """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/set_arp_sender_protocol_address.feature b/features/open_flow13/set_arp_sender_protocol_address.feature index 2d603a4e..b6c60870 100644 --- a/features/open_flow13/set_arp_sender_protocol_address.feature +++ b/features/open_flow13/set_arp_sender_protocol_address.feature @@ -1,10 +1,10 @@ @open_flow13 -Feature: Pio::SetArpSenderProtocolAddress +Feature: Pio::OpenFlow::SetArpSenderProtocolAddress Scenario: new('192.168.1.1') When I try to create an OpenFlow action with: """ - Pio::SetArpSenderProtocolAddress.new('192.168.1.1') + Pio::OpenFlow::SetArpSenderProtocolAddress.new('192.168.1.1') """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/set_destination_mac_address.feature b/features/open_flow13/set_destination_mac_address.feature index 814d6a90..bd02fae8 100644 --- a/features/open_flow13/set_destination_mac_address.feature +++ b/features/open_flow13/set_destination_mac_address.feature @@ -1,10 +1,10 @@ @open_flow13 -Feature: Pio::SetDestinationMacAddress +Feature: Pio::OpenFlow::SetDestinationMacAddress Scenario: new('11:22:33:44:55:66') When I try to create an OpenFlow action with: """ - Pio::SetDestinationMacAddress.new('11:22:33:44:55:66') + Pio::OpenFlow::SetDestinationMacAddress.new('11:22:33:44:55:66') """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/set_ip_ttl.feature b/features/open_flow13/set_ip_ttl.feature index cee9f983..e1f0d523 100644 --- a/features/open_flow13/set_ip_ttl.feature +++ b/features/open_flow13/set_ip_ttl.feature @@ -1,10 +1,10 @@ @open_flow13 -Feature: Pio::SetIpTtl +Feature: Pio::OpenFlow::SetIpTtl Scenario: new(10) When I try to create an OpenFlow action with: """ - Pio::SetIpTtl.new(10) + Pio::OpenFlow::SetIpTtl.new(10) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/set_metadata.feature b/features/open_flow13/set_metadata.feature index f7f8cad3..31437497 100644 --- a/features/open_flow13/set_metadata.feature +++ b/features/open_flow13/set_metadata.feature @@ -1,10 +1,10 @@ @open_flow13 -Feature: Pio::SetMetadata +Feature: Pio::OpenFlow::SetMetadata Scenario: new(0x123) When I try to create an OpenFlow action with: """ - Pio::SetMetadata.new(0x123) + Pio::OpenFlow::SetMetadata.new(0x123) """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow13/set_source_mac_address.feature b/features/open_flow13/set_source_mac_address.feature index 78c98ab2..3183ab88 100644 --- a/features/open_flow13/set_source_mac_address.feature +++ b/features/open_flow13/set_source_mac_address.feature @@ -1,10 +1,10 @@ @open_flow13 -Feature: Pio::SetSourceMacAddress +Feature: Pio::OpenFlow::SetSourceMacAddress Scenario: new('11:22:33:44:55:66') When I try to create an OpenFlow action with: """ - Pio::SetSourceMacAddress.new('11:22:33:44:55:66') + Pio::OpenFlow::SetSourceMacAddress.new('11:22:33:44:55:66') """ Then it should finish successfully And the action has the following fields and values: diff --git a/features/open_flow_read.feature b/features/open_flow_read.feature index 5a24e237..88b4cf3f 100644 --- a/features/open_flow_read.feature +++ b/features/open_flow_read.feature @@ -1,5 +1,5 @@ Feature: Pio::OpenFlow.read - Scenario: OpenFlow10 + Scenario: OpenFlow 1.0 Given I switch the Pio::OpenFlow version to "OpenFlow10" Then the following each raw file should be parsed into its corresponding object using OpenFlow.read | raw file | result object | @@ -21,6 +21,13 @@ Feature: Pio::OpenFlow.read | open_flow10/hello_failed.raw | Pio::OpenFlow10::Error::HelloFailed | | open_flow10/packet_in.raw | Pio::OpenFlow10::PacketIn | | open_flow10/packet_out.raw | Pio::OpenFlow10::PacketOut | - | open_flow10/port_status.raw | Pio::OpenFlow10::PortStatus | - | open_flow13/bad_request.raw | Pio::OpenFlow13::Error::BadRequest | - | open_flow13/hello_failed.raw | Pio::OpenFlow13::Error::HelloFailed | + | open_flow10/port_status.raw | Pio::OpenFlow10::PortStatus | + + Scenario: OpenFlow 1.3 + Given I switch the Pio::OpenFlow version to "OpenFlow13" + Then the following each raw file should be parsed into its corresponding object using OpenFlow.read + | raw file | result object | + | open_flow13/hello_no_version_bitmap.raw | Pio::OpenFlow13::Hello | + | open_flow13/hello_version_bitmap.raw | Pio::OpenFlow13::Hello | + | open_flow13/bad_request.raw | Pio::OpenFlow13::Error::BadRequest | + | open_flow13/hello_failed.raw | Pio::OpenFlow13::Error::HelloFailed | diff --git a/features/step_definitions/open_flow_steps.rb b/features/step_definitions/open_flow_steps.rb index 73af9cba..c90e2caa 100644 --- a/features/step_definitions/open_flow_steps.rb +++ b/features/step_definitions/open_flow_steps.rb @@ -33,7 +33,7 @@ # rubocop:disable LineLength Then(/^the following each raw file should be parsed into its corresponding object using OpenFlow\.read$/) do |table| table.hashes.each do |each| - step %(I try to parse a file named "#{each['raw file']}" with "OpenFlow" class) + step %(I try to parse a file named "#{each['raw file']}" with "Pio::OpenFlow" class) step 'it should finish successfully' step %(the message should be a "#{each['result object']}") end diff --git a/features/step_definitions/packet_data_steps.rb b/features/step_definitions/packet_data_steps.rb index fcbaebc0..ea73b87b 100644 --- a/features/step_definitions/packet_data_steps.rb +++ b/features/step_definitions/packet_data_steps.rb @@ -2,7 +2,7 @@ When(/^I try to parse a file named "(.*?\.raw)" with "(.*?)" class$/) do |path, klass| full_path = File.expand_path(File.join(__dir__, '..', path)) raw_data = IO.read(full_path) - parser_klass = Pio.const_get(klass) + parser_klass = Pio::OpenFlow.const_get(klass) begin @result = parser_klass.read(raw_data) rescue @@ -15,7 +15,7 @@ When(/^I try to parse a file named "(.*?\.pcap)" with "(.*?)" class$/) do |path, klass| full_path = File.expand_path(File.join(__dir__, '..', path)) pcap = Pio::Pcap::Frame.read(IO.read(full_path)) - parser_klass = Pio.const_get(klass) + parser_klass = Pio::OpenFlow.const_get(klass) begin @result = pcap.records.each_with_object([]) do |each, result| result << parser_klass.read(each.data) @@ -37,7 +37,8 @@ When(/^I create an exact match from "(.*?)"$/) do |path| full_path = File.expand_path(File.join(__dir__, '..', path)) - @result = Pio::ExactMatch.new(Pio::PacketIn.read(IO.read(full_path))) + packet_in = Pio::OpenFlow::PacketIn.read(IO.read(full_path)) + @result = Pio::OpenFlow::ExactMatch.new(packet_in) end Then(/^the message should be a "([^"]*)"$/) do |expected_klass| diff --git a/lib/pio/open_flow.rb b/lib/pio/open_flow.rb index a9a07a26..d66c8155 100644 --- a/lib/pio/open_flow.rb +++ b/lib/pio/open_flow.rb @@ -13,7 +13,7 @@ module OpenFlow module_function def version=(version) - [Message, Action, Match].each do |each| + [Message, Instruction, Action, FlowMatch].each do |each| each.descendants.each do |klass| switch_class klass, version end @@ -26,8 +26,8 @@ def switch_class(klass, version) return if klass.parents.include?(Pio::OpenFlow) return unless klass.parents.include?(open_flow_module) klass_name = klass.name.split('::')[2].to_sym - Pio.__send__ :remove_const, klass_name if Pio.const_defined?(klass_name) - Pio.const_set(klass_name, open_flow_module.const_get(klass_name)) + remove_const(klass_name) if const_defined?(klass_name) + const_set klass_name, open_flow_module.const_get(klass_name) rescue NameError raise "#{version} is not supported yet." end @@ -39,21 +39,21 @@ def switch_class(klass, version) # rubocop:disable MethodLength def read(binary) { - 0 => Pio::Hello, - 1 => Pio::OpenFlow::Error, - 2 => Pio::Echo::Request, - 3 => Pio::Echo::Reply, - 5 => Pio::Features::Request, - 6 => Pio::Features::Reply, - 10 => Pio::PacketIn, - 11 => Pio::FlowRemoved, - 12 => Pio::PortStatus, - 13 => Pio::PacketOut, - 14 => Pio::FlowMod, - 16 => Pio::Stats::Request, - 17 => Pio::Stats::Reply, - 18 => Pio::Barrier::Request, - 19 => Pio::Barrier::Reply + 0 => Hello, + 1 => Error, + 2 => Echo::Request, + 3 => Echo::Reply, + 5 => Features::Request, + 6 => Features::Reply, + 10 => PacketIn, + 11 => FlowRemoved, + 12 => PortStatus, + 13 => PacketOut, + 14 => FlowMod, + 16 => Stats::Request, + 17 => Stats::Reply, + 18 => Barrier::Request, + 19 => Barrier::Reply }.fetch(OpenFlowHeaderParser.read(binary).message_type).read(binary) end # rubocop:enable MethodLength diff --git a/lib/pio/open_flow/match.rb b/lib/pio/open_flow/flow_match.rb similarity index 77% rename from lib/pio/open_flow/match.rb rename to lib/pio/open_flow/flow_match.rb index 286b2b94..3c825c16 100644 --- a/lib/pio/open_flow/match.rb +++ b/lib/pio/open_flow/flow_match.rb @@ -2,8 +2,8 @@ module Pio module OpenFlow - # OpenFlow matches. - class Match + # Flow match + class FlowMatch extend ActiveSupport::DescendantsTracker end end diff --git a/lib/pio/open_flow/instruction.rb b/lib/pio/open_flow/instruction.rb new file mode 100644 index 00000000..1901fb90 --- /dev/null +++ b/lib/pio/open_flow/instruction.rb @@ -0,0 +1,10 @@ +require 'active_support/descendants_tracker' + +module Pio + module OpenFlow + # Flow instruction + class Instruction + extend ActiveSupport::DescendantsTracker + end + end +end diff --git a/lib/pio/open_flow10/actions.rb b/lib/pio/open_flow10/actions.rb index 950fa12d..facc8344 100644 --- a/lib/pio/open_flow10/actions.rb +++ b/lib/pio/open_flow10/actions.rb @@ -15,7 +15,7 @@ module Pio module OpenFlow # Actions list. - class Actions < BinData::Primitive + class Actions10 < BinData::Primitive ACTION_CLASS = { 0 => Pio::OpenFlow10::SendOutPort, 1 => Pio::OpenFlow10::SetVlanVid, diff --git a/lib/pio/open_flow10/exact_match.rb b/lib/pio/open_flow10/exact_match.rb index fd58249a..3112db24 100644 --- a/lib/pio/open_flow10/exact_match.rb +++ b/lib/pio/open_flow10/exact_match.rb @@ -1,17 +1,19 @@ require 'pio/open_flow10/match' module Pio - # OpenFlow 1.0 exact match - class ExactMatch - def initialize(packet_in) - @match = packet_in.data.to_exact_match(packet_in.in_port) - rescue NoMethodError - raise NotImplementedError, - "#{packet_in.data.class} is not yet supported by ExactMatch." - end + module OpenFlow10 + # OpenFlow 1.0 exact match + class ExactMatch < OpenFlow::FlowMatch + def initialize(packet_in) + @match = packet_in.data.to_exact_match(packet_in.in_port) + rescue NoMethodError + raise NotImplementedError, + "#{packet_in.data.class} is not yet supported by ExactMatch." + end - def method_missing(method, *args, &block) - @match.__send__ method, *args, &block + def method_missing(method, *args, &block) + @match.__send__ method, *args, &block + end end end end diff --git a/lib/pio/open_flow10/flow_mod.rb b/lib/pio/open_flow10/flow_mod.rb index 2e318bc2..9b9dc455 100644 --- a/lib/pio/open_flow10/flow_mod.rb +++ b/lib/pio/open_flow10/flow_mod.rb @@ -1,4 +1,5 @@ require 'pio/open_flow' +require 'pio/open_flow/flags' require 'pio/open_flow10/actions' require 'pio/open_flow10/match10' @@ -47,7 +48,7 @@ def set(value) uint32 :buffer_id uint16 :out_port flags :flags - actions :actions, length: -> { message_length - 72 } + actions10 :actions, length: -> { message_length - 72 } end end end diff --git a/lib/pio/open_flow10/flow_stats/reply.rb b/lib/pio/open_flow10/flow_stats/reply.rb index 4c1750f2..7c21444a 100644 --- a/lib/pio/open_flow10/flow_stats/reply.rb +++ b/lib/pio/open_flow10/flow_stats/reply.rb @@ -27,7 +27,7 @@ class FlowStatsEntry < BinData::Record uint64 :cookie uint64 :packet_count uint64 :byte_count - actions :actions, length: -> { entry_length - 88 } + actions10 :actions, length: -> { entry_length - 88 } end open_flow_header version: 1, diff --git a/lib/pio/open_flow10/match.rb b/lib/pio/open_flow10/match.rb index 43c6b5be..616e751f 100644 --- a/lib/pio/open_flow10/match.rb +++ b/lib/pio/open_flow10/match.rb @@ -1,13 +1,13 @@ require 'English' require 'bindata' -require 'pio/open_flow/match' +require 'pio/open_flow/flow_match' require 'pio/type/ip_address' require 'pio/type/mac_address' module Pio module OpenFlow10 # Fields to match against flows - class Match < OpenFlow::Match + class Match < OpenFlow::FlowMatch # Flow wildcards class Wildcards < BinData::Primitive BITS = { diff --git a/lib/pio/open_flow10/packet_out.rb b/lib/pio/open_flow10/packet_out.rb index c012d1c4..99615668 100644 --- a/lib/pio/open_flow10/packet_out.rb +++ b/lib/pio/open_flow10/packet_out.rb @@ -12,7 +12,7 @@ class PacketOut < OpenFlow::Message uint32 :buffer_id uint16 :in_port uint16 :actions_len, initial_value: -> { actions.binary.length } - actions :actions, length: -> { actions_len } + actions10 :actions, length: -> { actions_len } rest :raw_data end end diff --git a/lib/pio/open_flow10/port_status.rb b/lib/pio/open_flow10/port_status.rb index 017c9b96..d326cca7 100644 --- a/lib/pio/open_flow10/port_status.rb +++ b/lib/pio/open_flow10/port_status.rb @@ -1,4 +1,5 @@ require 'pio/open_flow/message' +require 'pio/open_flow10/phy_port16' module Pio module OpenFlow10 diff --git a/lib/pio/open_flow13/actions.rb b/lib/pio/open_flow13/actions.rb index db605449..667e3414 100644 --- a/lib/pio/open_flow13/actions.rb +++ b/lib/pio/open_flow13/actions.rb @@ -15,7 +15,7 @@ def to_binary end # Actions list of actions-apply instruction. - class Actions < BinData::Primitive + class Actions13 < BinData::Primitive mandatory_parameter :length endian :big @@ -33,7 +33,7 @@ def get while tmp.length > 0 action = case BinData::Uint16be.read(tmp) when 0 - SendOutPort.read(tmp) + OpenFlow::SendOutPort.read(tmp) else UnsupportedAction.read(tmp) end diff --git a/lib/pio/open_flow13/apply.rb b/lib/pio/open_flow13/apply.rb index 1833f88f..1e7e7cbc 100644 --- a/lib/pio/open_flow13/apply.rb +++ b/lib/pio/open_flow13/apply.rb @@ -1,36 +1,39 @@ require 'bindata' require 'forwardable' +require 'pio/open_flow/instruction' require 'pio/open_flow13/actions' module Pio - # An instruction to apply a list of actions to a packet in-order. - class Apply - # OpenFlow 1.3.4 OFPIT_APPLY_ACTIONS instruction format. - class Format < BinData::Record - endian :big + module OpenFlow13 + # An instruction to apply a list of actions to a packet in-order. + class Apply < OpenFlow::Instruction + # OpenFlow 1.3.4 OFPIT_APPLY_ACTIONS instruction format. + class Format < BinData::Record + endian :big - uint16 :instruction_type, value: 4 - uint16 :instruction_length, - initial_value: -> { 8 + actions.binary.length } - string :padding, length: 4 - actions :actions, length: -> { instruction_length - 8 } - end + uint16 :instruction_type, value: 4 + uint16 :instruction_length, + initial_value: -> { 8 + actions.binary.length } + string :padding, length: 4 + actions13 :actions, length: -> { instruction_length - 8 } + end - def self.read(raw_data) - allocate.tap do |apply| - apply.instance_variable_set :@format, Format.read(raw_data) + def self.read(raw_data) + allocate.tap do |apply| + apply.instance_variable_set :@format, Format.read(raw_data) + end end - end - extend Forwardable + extend Forwardable - def_delegators :@format, :instruction_type - def_delegators :@format, :instruction_length - def_delegators :@format, :actions - def_delegators :@format, :to_binary_s + def_delegators :@format, :instruction_type + def_delegators :@format, :instruction_length + def_delegators :@format, :actions + def_delegators :@format, :to_binary_s - def initialize(actions = []) - @format = Format.new(actions: actions) + def initialize(actions = []) + @format = Format.new(actions: actions) + end end end end diff --git a/lib/pio/open_flow13/features/reply.rb b/lib/pio/open_flow13/features/reply.rb index d3e81655..1e2f6c7d 100644 --- a/lib/pio/open_flow13/features/reply.rb +++ b/lib/pio/open_flow13/features/reply.rb @@ -1,3 +1,4 @@ +require 'pio/open_flow/datapath_id' require 'pio/open_flow/message' module Pio diff --git a/lib/pio/open_flow13/match.rb b/lib/pio/open_flow13/match.rb index 1ee81df6..50a05de2 100644 --- a/lib/pio/open_flow13/match.rb +++ b/lib/pio/open_flow13/match.rb @@ -1,5 +1,5 @@ require 'bindata' -require 'pio/open_flow/match' +require 'pio/open_flow/flow_match' require 'pio/type/ip_address' require 'pio/type/ipv6_address' require 'pio/type/mac_address' @@ -12,7 +12,7 @@ module OpenFlow13 MATCH_TYPE_OXM = 1 # OpenFlow eXtensible Match (OXM) - class Match < OpenFlow::Match + class Match < OpenFlow::FlowMatch # OFPXMC_NXM_1 TLV value class NiciraMatchExtensionValue < BinData::Record OXM_CLASS = 0x1 diff --git a/lib/pio/open_flow13/packet_out.rb b/lib/pio/open_flow13/packet_out.rb index bb2eb309..0a4c2f7f 100644 --- a/lib/pio/open_flow13/packet_out.rb +++ b/lib/pio/open_flow13/packet_out.rb @@ -31,7 +31,7 @@ def set(value) in_port :in_port uint16 :actions_length, initial_value: -> { actions.binary.length } string :padding, length: 6 - actions :actions, length: :actions_length + actions13 :actions, length: :actions_length string :raw_data, read_length: -> { message_length - 24 - actions_length } def data