0

In POX Controller, can I create an event listener that will be raised when a hard_timeout value is expired? Suppose I installed a flow_mod of hard_timeout= 10. After 10 seconds, my listener should be able to capture an event raised from this expiration. The reason of my question is that I want to activate a function only after a specific flow rule is expired.

Thank you

Don
  • 393
  • 3
  • 12

1 Answers1

0

You can listen the event from the topology module for a flow removal

core.openflow.addListenerByName("FlowRemoved", self._handle_flow_removal)

then in the class method _handle_flow_removal you can get the reason

def _handle_flow_removal (self, event):
    """
    handler flow removed event here
    """
    print event.__dict__() # to get available info

In the event dict find the ofp key and extract the bool

ofp.reason == of.OFPRR_HARD_TIMEOUT: