[pox-dev] creating new message

adria sole adriasole at gmail.com
Mon Jul 15 08:42:15 PDT 2013


I try to add a message similar to barrier request/reply, but when I add my
code I get this error:

I can't find where is the error, I think it is because of number 23 and 24
I have put to my adria messages...

Ty in advance!

POX 0.1.0 (betta) / Copyright 2011-2013 James McCauley, et al.
Traceback (most recent call last):
  File "./pox.py", line 44, in <module>
    from pox.boot import boot
  File "/home/adria/Descargas/pox/pox/boot.py", line 57, in <module>
    import pox.openflow.of_01
  File "/home/adria/Descargas/pox/pox/openflow/of_01.py", line 43, in
<module>
    unpackers = make_type_to_unpacker_table()
  File "/home/adria/Descargas/pox/pox/openflow/util.py", line 31, in
make_type_to_unpacker_table
    r = [of._message_type_to_class[i].unpack_new for i in range(0, top)]
KeyError: 22

In libopenflow_01 I have added:
@openflow_s_message("OFPT_ADRIA_REPLY", 23,
    reply_to="ofp_adria_request")
class ofp_adria_reply (ofp_header):
  /*Here same code as Barrier*/

@openflow_c_message("OFPT_ADRIA_REQUEST", 24,
    request_for="ofp_adria_reply")
class ofp_adria_request (ofp_header):
   /*Here same code as Barrier*/

In __init__.py I have added:
class OpenFlowNexus (EventMixin):
  _eventMixin_events = set([
    ...
    AdriaIn,
    ...
  ])

class AdriaIn (Event):
  /*Same code as barrier In*/

In of_01.py:
  handlerMap = {
    ...
    of.OFTP_ADRIA_REPLY : handle_ADRIA,
    ...
  }

  def handle_ADRIA (con, msg):
    e = con.ofnexus.raiseEventNoErrors(AdriaIn, con, msg)
    if e is None or e.halt != True:
      con.raiseEventNoErrors(AdriaIn, con, msg)

In my_component.py (which I run with pox.py):
  when I want on code inside a def of class LearningSwitch (object)::
     adriamsg = of.ofp_adria_request()
     self.connection.send(adriamsg)

  In class LearningSwitch (object):
    def _handle_AdriaIn (self, event):
    print "ADRIA: rebut un adria"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noxrepo.org/pipermail/pox-dev-noxrepo.org/attachments/20130715/e2fdc7ae/attachment.htm>


More information about the pox-dev mailing list