Hey, I just got it resolved yesterday by writing a utility function in util.py. KK helped me in pointing that out.
-Yogesh On Tue, Jan 26, 2010 at 1:10 PM, Martin Casado <[email protected]> wrote: > Did you register an event converter in pycontext.cc? > >> Hi, >> >> I added vendor_msg event in the nox core (attaching the patch, but not >> sure if its strictly required or if there is any work around). With >> that patch applied to nox 0.5.0, I wrote following callback in the >> pyswitch: >> >> <code> >> def vendor_msg_callback(*params): >> print "In here for vendor message" >> if params: >> for para in params: >> print "(%s)" % (para) >> return CONTINUE >> </code> >> >> I am sending some vendor specific events from Openflow Click switch. I >> get following output at the Nox console: >> >> <output> >> 00035|nox|DBG:Registering switch with DPID = f5de7bce86 >> 00036|nox.coreapps.examples.pyswitch|INFO:Switch f5de7bce86 has joined >> the network >> 00037|openflow-event|DBG:received vendor event from 00f5de7bce86 >> In here for vendor message >> (<nox.coreapps.pyrt.pycomponent.pyevent; proxy of <Swig Object of type >> 'pyevent *' at 0xb5f00578> >) >> 00038|openflow-event|DBG:received echo-request event from 00f5de7bce86 >> (len:0) >> </output> >> >> It seems that its only sending one parameter which is swig proxy >> object. But I think I have written conversion function properly in >> pyrt.cc. Any ideas how to fix it? >> >> -Yogesh >> >> On Mon, Jan 25, 2010 at 5:18 AM, Yogesh Mundada <[email protected]> wrote: >> >>> >>> Hi KK, >>> >>> Is there a way to register for vendor specific msg events in python >>> applications in Nox? >>> >>> I see from >>> "http://noxrepo.org/pipermail/nox-dev_noxrepo.org/2008-December/000484.html" >>> that you had somehow enabled Openflow_msg_event. I am assuming that >>> its like a generic event thrown for any un-handled ofp_type (Is that >>> right?). However, when I saw code for openflow-event.cc, there is no >>> handle_openflow_msg() being called. Also in core.py, there is no >>> register_for_openflow_msg(). There is a magic etc/nox.xml file with >>> couple of events and filters mentioned in it. Can you shed some light >>> on how it is to be used? >>> >>> My Nox controller version is 0.5.0 and OFClick switch is 0.8.9~2. >>> >>> If I have to add this event myself, I think I would have to make >>> following changes at the very least: >>> 1. Detect the packet type as OpenFlow Vendor header and write a >>> handler in openflow-event.cc >>> 2. Define a Vendor_msg_event class in include/vendor-msg.hh >>> 3. Register in event-dispatcher-component.cc >>> 4. Write conversion functions in pyrt.cc and interface information in >>> event.i >>> 5. Write register_for_vendor_msg_event() in core.py >>> >>> Would that be all? >>> >>> -Yogesh >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> nox-dev mailing list >>> [email protected] >>> http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org >>> > > _______________________________________________ nox-dev mailing list [email protected] http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
