From 831f628e36a8ecb6b063c9c078ff8fe71abacf81 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Tue, 11 Dec 2018 12:07:02 +0100 Subject: [PATCH 1/5] Restored ext_type from of_port_desc_prop_experimenter --- openflow_input/standard-1.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openflow_input/standard-1.4 b/openflow_input/standard-1.4 index 51a1a1906..1e2f7d068 100644 --- a/openflow_input/standard-1.4 +++ b/openflow_input/standard-1.4 @@ -880,7 +880,7 @@ struct of_port_desc_prop_experimenter : of_port_desc_prop { uint16_t type == 0xffff; uint16_t length; uint32_t experimenter == ?; - //uint32_t exp_type; + uint32_t exp_type; }; struct of_port_desc { From 1f46952477604cf3e5d0c237c904051c3c0be637 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Tue, 11 Dec 2018 12:07:55 +0100 Subject: [PATCH 2/5] Decode embedded requestforward messages on 1.4 --- openflow_input/standard-1.4 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openflow_input/standard-1.4 b/openflow_input/standard-1.4 index 1e2f7d068..013c6f709 100644 --- a/openflow_input/standard-1.4 +++ b/openflow_input/standard-1.4 @@ -2671,7 +2671,5 @@ struct of_requestforward : of_header { uint8_t type == 32; uint16_t length; uint32_t xid; - uint32_t role; - // TODO support embedding of_header - of_octets_t data; + of_header_t request; }; From 230da96ee764c018c35d367d9090515a6d3fbfd5 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Tue, 11 Dec 2018 12:14:45 +0100 Subject: [PATCH 3/5] Backport some flow monitor structs from 1.5 to 1.4 --- openflow_input/standard-1.4 | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/openflow_input/standard-1.4 b/openflow_input/standard-1.4 index 013c6f709..7bc0ff70f 100644 --- a/openflow_input/standard-1.4 +++ b/openflow_input/standard-1.4 @@ -240,6 +240,16 @@ enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) { OFPIT_EXPERIMENTER = 0xffff, }; +enum ofp_flow_monitor_flags (wire_type=uint16_t, bitmask=True){ + OFPFMF_INITIAL = 0x1, + OFPFMF_ADD = 0x2, + OFPFMF_REMOVED = 0x4, + OFPFMF_MODIFY = 0x8, + OFPFMF_INSTRUCTIONS = 0x10, + OFPFMF_NO_ABBREV = 0x20, + OFPFMF_ONLY_OWN = 0x40, +}; + enum ofp_flow_mod_command(wire_type=uint8_t) { OFPFC_ADD = 0, OFPFC_MODIFY = 1, @@ -2130,6 +2140,62 @@ struct of_group_stats_reply : of_stats_reply { list(of_group_stats_entry_t) entries; }; +/* Flow monitor commands */ +enum ofp_flow_monitor_command(wire_type=uint8_t) { + OFPFMC_ADD = 0, + OFPFMC_MODIFY = 1, + OFPFMC_DELETE = 2, +}; + +struct of_flow_monitor_entry { + uint32_t monitor_id; + uint32_t out_port; + uint32_t out_group; + enum ofp_flow_monitor_flags flags; + uint8_t table_id; + enum ofp_flow_monitor_command command; + of_match_t match; +}; + +/* Body of OFPMP_FLOW_MONITOR request */ +struct of_flow_monitor_request : of_stats_request { + uint8_t version; + uint8_t type == 18; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 16; + enum ofp_stats_request_flags flags; + pad(4); + list(of_flow_monitor_entry_t) entries; +}; + +enum ofp_flow_update_event(wire_type=uint16_t) { + OFPFME_INITIAL = 0, + OFPFME_ADDED = 1, + OFPFME_REMOVED = 2, + OFPFME_MODIFIED = 3, + OFPFME_ABBREV = 4, + OFPFME_PAUSED = 5, + OFPFME_RESUMED = 6, +}; + +struct of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == ?; +}; + +/* Body of OFPMP_FLOW_MONITOR reply */ +struct of_flow_monitor_reply : of_stats_reply { + uint8_t version; + uint8_t type == 19; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 16; + enum ofp_stats_reply_flags flags; + pad(4); + list(of_flow_monitor_reply_entry_t) entries; +}; + struct of_group_desc_stats_request : of_stats_request { uint8_t version; uint8_t type == 18; From 5baff7ea88ac9553912a54d9406d6078a7d6331a Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Tue, 11 Dec 2018 12:17:42 +0100 Subject: [PATCH 4/5] Add flow update events structures --- openflow_input/standard-1.4 | 56 +++++++++++++++++++++++++++++++++ openflow_input/standard-1.5 | 62 ++++++++++++++++++++++++++++++++++--- 2 files changed, 113 insertions(+), 5 deletions(-) diff --git a/openflow_input/standard-1.4 b/openflow_input/standard-1.4 index 7bc0ff70f..921128f4d 100644 --- a/openflow_input/standard-1.4 +++ b/openflow_input/standard-1.4 @@ -2196,6 +2196,62 @@ struct of_flow_monitor_reply : of_stats_reply { list(of_flow_monitor_reply_entry_t) entries; }; +struct of_flow_update_full_initial : of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == 0; + uint8_t table_id; + uint8_t reason; + uint16_t idle_timeout; + uint16_t hard_timeout; + uint16_t priority; + pad(4); + uint64_t cookie; + of_match_t match; + list(of_instruction_t) instructions; +}; + +struct of_flow_update_full_added : of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == 1; + uint8_t table_id; + uint8_t reason; + uint16_t idle_timeout; + uint16_t hard_timeout; + uint16_t priority; + pad(4); + uint64_t cookie; + of_match_t match; + list(of_instruction_t) instructions; +}; + +struct of_flow_update_full_removed : of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == 2; + uint8_t table_id; + uint8_t reason; + uint16_t idle_timeout; + uint16_t hard_timeout; + uint16_t priority; + pad(4); + uint64_t cookie; + of_match_t match; + list(of_instruction_t) instructions; +}; + +struct of_flow_update_full_modified : of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == 3; + uint8_t table_id; + uint8_t reason; + uint16_t idle_timeout; + uint16_t hard_timeout; + uint16_t priority; + pad(4); + uint64_t cookie; + of_match_t match; + list(of_instruction_t) instructions; +}; + struct of_group_desc_stats_request : of_stats_request { uint8_t version; uint8_t type == 18; diff --git a/openflow_input/standard-1.5 b/openflow_input/standard-1.5 index a875c5ad7..e52f7b192 100644 --- a/openflow_input/standard-1.5 +++ b/openflow_input/standard-1.5 @@ -2296,7 +2296,7 @@ enum ofp_flow_update_event(wire_type=uint16_t) { struct of_flow_monitor_reply_entry { uint16_t length; - enum ofp_flow_update_event event; + enum ofp_flow_update_event event == ?; }; /* Body of OFPMP_FLOW_MONITOR reply */ @@ -2311,6 +2311,62 @@ struct of_flow_monitor_reply : of_stats_reply { list(of_flow_monitor_reply_entry_t) entries; }; +struct of_flow_update_full_initial : of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == 0; + uint8_t table_id; + uint8_t reason; + uint16_t idle_timeout; + uint16_t hard_timeout; + uint16_t priority; + pad(4); + uint64_t cookie; + of_match_t match; + list(of_instruction_t) instructions; +}; + +struct of_flow_update_full_added : of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == 1; + uint8_t table_id; + uint8_t reason; + uint16_t idle_timeout; + uint16_t hard_timeout; + uint16_t priority; + pad(4); + uint64_t cookie; + of_match_t match; + list(of_instruction_t) instructions; +}; + +struct of_flow_update_full_removed : of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == 2; + uint8_t table_id; + uint8_t reason; + uint16_t idle_timeout; + uint16_t hard_timeout; + uint16_t priority; + pad(4); + uint64_t cookie; + of_match_t match; + list(of_instruction_t) instructions; +}; + +struct of_flow_update_full_modified : of_flow_monitor_reply_entry { + uint16_t length; + enum ofp_flow_update_event event == 3; + uint8_t table_id; + uint8_t reason; + uint16_t idle_timeout; + uint16_t hard_timeout; + uint16_t priority; + pad(4); + uint64_t cookie; + of_match_t match; + list(of_instruction_t) instructions; +}; + /* Body of OFPMP_TABLE_DESC request. */ struct of_table_desc_stats_request : of_stats_request { uint8_t version; @@ -3604,7 +3660,3 @@ struct of_packet_queue { pad(6); list(of_queue_prop_t) properties; }; - - - - From 671c4a3508dae0e8b2b29cf8a1aaea44b0ea1292 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Mon, 7 Jan 2019 17:02:44 +0100 Subject: [PATCH 5/5] Fix packet_type 1.5 OXM --- openflow_input/oxm-1.5 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/openflow_input/oxm-1.5 b/openflow_input/oxm-1.5 index f5d2e4cd8..4b985be58 100644 --- a/openflow_input/oxm-1.5 +++ b/openflow_input/oxm-1.5 @@ -22,14 +22,7 @@ struct of_oxm_actset_output_masked : of_oxm { of_port_no_t value_mask; }; - struct of_oxm_packet_type : of_oxm { uint32_t type_len == 0x80005804; - uint8_t value; -}; - -struct of_oxm_packet_type_masked : of_oxm { - uint32_t type_len == 0x80005908; - uint8_t value; - uint8_t value_mask; + enum ofp_packet_type value; };