@@ -202,28 +202,28 @@ module Controller = struct
202
202
let open ChunkController in
203
203
listen_pipe t (run (handshake 0x01 ) t.sub (listen t.sub))
204
204
205
- let clear_table ( t : t ) (sw_id : Client_id.t ) =
206
- send_result t sw_id (0l , M. FlowModMsg ( C. delete_all_flows))
207
-
208
- let send_flow_mods ?( clear = true ) ( t : t ) ( sw_id : Client_id.t ) flow_mods =
209
- begin if clear then clear_table t sw_id else return ( Result. Ok () ) end
210
- >> = function
211
- | Result. Error exn -> return (Result. Error exn )
212
- | Result. Ok () ->
213
- let sends = List. map flow_mods
214
- ~f: (fun f -> send_result t sw_id (0l , M. FlowModMsg f))
215
- in
216
- Deferred.Result. all_ignore sends
217
-
218
- let send_pkt_out (t : t ) (sw_id : Client_id.t ) pkt_out =
205
+ let clear_flows ?( pattern = C. match_all) ( t : t ) (sw_id : Client_id.t ) =
206
+ send_result t sw_id (0l , M. FlowModMsg
207
+ { C. delete_all_flows with C. pattern = pattern })
208
+
209
+ let send_flow_mods ?( clear = true ) ( t :t ) ( sw_id :Client_id.t ) flow_mods =
210
+ let open Deferred.Result in
211
+ begin if clear then clear_flows t sw_id else return () end
212
+ >> = fun () ->
213
+ let sends = List. map flow_mods
214
+ ~f: (fun f -> send_result t sw_id (0l , M. FlowModMsg f))
215
+ in
216
+ all_ignore sends
217
+
218
+ let send_pkt_out (t : t ) (sw_id : Client_id.t ) pkt_out =
219
219
send_result t sw_id (0l , M. PacketOutMsg pkt_out)
220
220
221
221
let barrier t sw_id =
222
222
send_txn_with t sw_id M. BarrierRequest (function
223
223
| M. BarrierReply -> Result. Ok ()
224
224
| _ -> assert false )
225
225
226
- let aggregate_stats t sw_id pattern =
226
+ let aggregate_stats ?( pattern = C. match_all) ( t :t ) sw_id =
227
227
let open OpenFlow0x01_Stats in
228
228
let msg = AggregateRequest
229
229
{ as_of_match = pattern
@@ -234,7 +234,7 @@ module Controller = struct
234
234
| M. StatsReplyMsg (AggregateFlowRep r ) -> Result. Ok r
235
235
| _ -> assert false )
236
236
237
- let individual_stats t sw_id pattern =
237
+ let individual_stats ?( pattern = C. match_all) ( t :t ) sw_id =
238
238
let open OpenFlow0x01_Stats in
239
239
let msg = IndividualRequest
240
240
{ is_of_match = pattern
0 commit comments