Hello,

i am trying to implement a controller module that handles two types of Events:
the already existing FlowRemoved and another of my own creation
"CustomEvent" that i will execute in various circumstances.

I have read the section on custom events contained in the POX manual
( 
https://openflow.stanford.edu/display/ONL/POX+Wiki#POXWiki-TheEventSystem%3Apox.lib.revent
)
 and have successfully executed the examples.

I have looked up a bit how the POX raises events such as PacketIn.
I added the following lines of code in pox/pox/openflow/__init__.py

class CustomEvent(Event):
  """
  Our own custom event
  """
  def __init__(self):
    Event.__init__(self)

Then i added a handler for that event in an already existing controller module,

def _handle_CustomEvent (self, event):
  log.debug('The Event was raised successfully')

However when i manually raise the above event,
(e.g. during the handling of a PacketIn event in
forwarding.l2_learning) nothing happens.
I used both the method explained in the manual (creating a subclass of
EventMixin with _eventMixin_set=([CustomEvent], creating an instance
of that class and raising the event on that instance), and the
core.raiselater method.

Important note: In the same module there is a handler for FlowRemoved
Events, that is notified without issues, when a flow is removed from the
switch, so i don't think there is a listener issue.

In my efforts to find the problem i tried to experiment in
openflow/of_01.py and specifically in lines 85, 177 where FlowRemoved
and PacketIn events are raised from the Controller, i tried to force
raise my own
event when a PacketIn was supposed to be raised.

def handle_PACKET_IN (con, msg): #A
  e = con.ofnexus.raiseEventNoErrors(CustomEvent, con, msg)
  if e is None or e.halt != True:
    con.raiseEventNoErrors(CustomEvent, con, msg)

Nothing happened either (apart from losing connectivity between the hosts).

I would appreciate any help,
Adam Pavlidis

Reply via email to