Hello all,

I am trying to create a NOX component called 'pyflushroutes.py' in python,
which get the routes from the openflow switche on the network and flush it
to all the openflow switches in the network. The first thing I am trying to
do is to just use the function 'get_routes()' and print that routes in the
handler function flow_in. According to
that<http://noxrepo.org/noxwiki/index.php/Routing> routing
module listens for flow_in_events and perform the routing. I have registered
the function Flow_in_event and write a simpel handler function for that
event,

Below is the excerpts of the component.

class pyflushroutes(Component):

        def __init__(self, ctxt):
                Component.__init__(self, ctxt)
                self.routing = None
                log.startLogging(sys.stdout)

        def install(self):

                self.routing = self.resolve(pyrouting.PyRouting)
                self.register_handler(Flow_in_event.static_get_name(),
Pywaqas.handle_flow_in)

 def handle_flow_in ( self, event):
               log.msg("Flow_in recieved\n")
               route = pyrouting.Route()
               if self.routing.get_route(route):
                        checked=True
                        log.msg(str(route))
               else:
                     log.err("No Route between %s and %s." %
(hex(route.id.src.as_host()),hex(route.id.dst.as_host())))


But it did not print any thing even the Flow in recieved message. :(
Any idea where I am doing wrong ?



Best Regards,

Waqas Daar
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to