コード例 #1
0
ファイル: yapc-flow-switch.py プロジェクト: yapkke/yapc
    def run(self):
        """Run server
        """
        # Configure logging
        output.set_mode(self.debug)

        # Create yapc base
        server = core.core()
        ofconn = ofcomm.ofserver(server, self.port)

        # Debugger/Profiler
        # ofcount = ofdbg.of_msg_count(server)

        # OpenFlow Parser
        ofparse = ofevents.parser(server)
        # Switch-host binding
        swhost = switchhost.mac2sw_binding(server)
        # Flow switch
        fsw = fswitch.learningswitch(server, ofconn.connections, self.fpr)
        if self.fpr:
            pfr = ofdbg.show_flow_removed(server)
        # Drop unhandled flows
        fp = default.floodpkt(server, ofconn.connections)

        server.run()

        sys.exit(0)
コード例 #2
0
mcutil.memcache_mode = mcutil.MEMCACHE_MODE["LOCAL"]
web.config.debug=False

server = yapc.core()
webcleanup = owweb.cleanup(server)
owglobal.server = server
ofconn = ofcomm.ofserver(server)
jsonconn = jsoncomm.jsonserver(server)
ofparse = ofevents.parser(server)
swconfig = swstate.dp_config(server, ofconn.connections)
swconfig.default_miss_send_len = 65535
swhost = switchhost.mac2sw_binding(server)
owredirect = owauth.redirect(server, ofconn.connections)
owfilter = owauth.filter(server, ofconn.connections)
fsw = fswitch.learningswitch(server, ofconn.connections, True)
fp = default.floodpkt(server, ofconn.connections)
#pfr = ofdbg.show_flow_removed(server)
db = sqlite.SqliteDB(server, "openwifi.sqlite", jsonconn.connections)
fl = oflog.flowlogger(server, db)
al = owlog.authlogger(server, db)
db.start()

fb.init(105259509564192)

webapp = web.application(fbweb.urls, globals())
session = web.session.Session(webapp, 
                              web.session.DiskStore('sessions'), 
                              initializer={'datapath': None, 
                                           'host': None})
owglobal.session = session
hauth = owauth.host_auth(server)
コード例 #3
0
output.set_mode("DBG")
mcutil.memcache_mode = mcutil.MEMCACHE_MODE["LOCAL"]
web.config.debug=False

server = yapc.core()
webcleanup = owweb.cleanup(server)
owglobal.server = server
ofconn = ofcomm.ofserver(server)
ofparse = ofevents.parser(server)
swconfig = swstate.dp_config(server, ofconn.connections)
swconfig.default_miss_send_len = 65535
swhost = switchhost.mac2sw_binding(server)
owredirect = owauth.redirect(server, ofconn.connections)
fsw = fswitch.learningswitch(server, ofconn.connections, True)
fp = default.floodpkt(server, ofconn.connections)
#pfr = ofdbg.show_flow_removed(server)
db = sqlite.SqliteDB(server, "openwifi.sqlite")
fl = oflog.flowlogger(server, db)
al = owlog.authlogger(server, db)
db.start()

webapp = web.application(howweb.urls, globals())
session = web.session.Session(webapp, 
                              web.session.DiskStore('sessions'), 
                              initializer={'datapath': None, 
                                           'host': None})
owglobal.session = session
hauth = owauth.host_auth(server)

if __name__ == "__main__":