Murphy, I think I figured this out. This is what I used to display which flow has been removed:
flow = event.ofp log.info("flow: src %s dst %s",flow.match.nw_src, flow.match.nw_dst) David On Thu, May 28, 2015 at 10:21 AM, David Li <dlipub...@gmail.com> wrote: > Hi Murphy, > > Does this approach require my code keeps track of the flow table on > the switch? I found sample code in topology.py: > > def _handle_FlowRemoved (self, event): > """ > process a flow removed event -- remove the matching flow from the table. > """ > flow_removed = event.ofp > for entry in self.flow_table.entries: > if (flow_removed.match == entry.match > and flow_removed.priority == entry.priority): > self.flow_table.remove_entry(entry) > self.raiseEvent(FlowTableModification(removed=[entry])) > return EventHalt > return EventContinue > > > Is this what you are talking about? > > Thanks! > > > On Tue, May 26, 2015 at 5:14 PM, Murphy McCauley > <murphy.mccau...@gmail.com> wrote: >> The information you want may not be available on the FlowRemoved event >> object itself, but as described in the "OpenFlow Events" section of the >> manual, the actual OpenFlow protocol message that caused the event is >> available on the event's .ofp attribute. In this case, that means it's an >> ofp_flow_removed object. If you look that up in the OpenFlow spec, you'll >> see there should be a .match attribute containing the match for the table >> entry as well as the .cookie (which, as I mention in my post on pox-dev a >> few minutes ago, is probably even more useful). >> >> -- Murphy >> >> On May 26, 2015, at 5:06 PM, David Li <dlipub...@gmail.com> wrote: >> >>> Hi, >>> >>> I added a handler for flow removal. But I am wondering if it's >>> possible to see from the event which flow has been removed. In the >>> FlowRemoved class, I can't see how this info can be obtained easily. >>> Maybe I am wrong. >>