diff --git a/async/Frenetic_OpenFlow0x04_Plugin.ml b/async/Frenetic_OpenFlow0x04_Plugin.ml index 606e4531d..7af1feac8 100644 --- a/async/Frenetic_OpenFlow0x04_Plugin.ml +++ b/async/Frenetic_OpenFlow0x04_Plugin.ml @@ -91,7 +91,6 @@ let read_respond_loop (reader : Reader.t) let header = Frenetic_OpenFlow_Header.parse (Cstruct.of_string header_buf) in let message_len = header.length - Frenetic_OpenFlow_Header.size in let message_buf = Bytes.create message_len in - Log.info "Got message %s" (Frenetic_OpenFlow_Header.to_string header); Reader.really_read reader message_buf >>= function | `Eof _ -> diff --git a/lib/Frenetic_NetKAT_Compiler.ml b/lib/Frenetic_NetKAT_Compiler.ml index 18f196a75..c6f582699 100644 --- a/lib/Frenetic_NetKAT_Compiler.ml +++ b/lib/Frenetic_NetKAT_Compiler.ml @@ -922,20 +922,20 @@ let flow_table_subtrees (layout : flow_layout) (t : t) : flow_subtrees = let rec subtrees_for_table (table : Field.t list) (t : t) (subtrees : t list) : t list = match FDD.unget t with - | Leaf _ -> subtrees + | Leaf _ -> + t :: subtrees | Branch ((field, _), tru, fls) -> if (List.mem table field) then t :: subtrees else subtrees_for_table table tru subtrees - |> subtrees_for_table table fls - in + |> subtrees_for_table table fls in let meta_id = ref 0 in - List.map layout ~f:(fun table -> subtrees_for_table table t []) - |> List.filter ~f:(fun subtrees -> subtrees <> []) - |> List.foldi ~init:Map.Poly.empty ~f:(fun tbl_id accum subtrees -> + List.map layout ~f:(fun table -> subtrees_for_table table t []) + |> List.filter ~f:(fun subtrees -> subtrees <> []) + |> List.foldi ~init:Map.Poly.empty ~f:(fun tbl_id accum subtrees -> List.fold_right subtrees ~init:accum ~f:(fun t accum -> - Map.add accum ~key:t ~data:(tbl_id,(post meta_id)))) + Map.add accum ~key:t ~data:(tbl_id,(post meta_id)))) (* make a flow struct that includes the table and meta id of the flow *) let mk_multitable_flow options (pattern : Frenetic_OpenFlow.Pattern.t) @@ -972,7 +972,8 @@ let subtree_to_table options (subtrees : flow_subtrees) (subtree : (t * flowId)) | Branch (test, tru, fls) -> List.filter_opt (List.append (dfs [test] subtrees tru flowId) (dfs [] subtrees fls flowId)) - | Leaf _ -> assert false (* each entry in the subtree map is a branch *) + | Leaf _ -> + List.filter_opt (dfs [] subtrees t flowId) (* Collect the flow table rows for each subtree in one list. *) let subtrees_to_multitable options (subtrees : flow_subtrees) : (multitable_flow list * Frenetic_GroupTable0x04.t) =