-
Notifications
You must be signed in to change notification settings - Fork 5
Description
we now have a basic stub to accept FlowRemoved events from the NetCore runtime. these should be exposed as events within FlowLog, like switch_port, switch_down, etc.
one design point is how to connect these events to FlowLog programs. ideally, it should be very natural, at a high-level, and not expose programmers to the details of OpenFlow switches.
for now, we can probably expose the raw match / pattern which expired. the FlowLog program will be responsible for interpreting it.
if we want to connect things at a higher level, we will probably need to associate the OpenFlow0x01_Core.pattern = OpenFlow0x01.Match.t which is returned by the FlowRemoved event with the original predicate (NetCore_Types.pred) we sent in the Seq(Filter(pred), Action(...)) partial evaluation.
to convert a NetCore_Types.pred to the low-level OpenFlow match, we can call NetCore_Compiler.CompilePol.compile_pred which will give us a "BoolClassifier". roughly speaking, this is a list of NetCore patterns which accept or reject packets. to be specific: the type of BoolClassifier.t is (NetCore_Pattern.t * bool * NetCore_Types.ruleMeta) list. finally, a call to NetCore_Pattern.to_match0x01 will convert that NetCore_Pattern.t to the OpenFlow match we received in the FlowRemoved message.