Пример #1
0
    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
    def run(self):
        server = core.core()
        ofconn = ofcomm.ofserver(server)
        jsonconn = jsoncomm.jsonserver(server, file=self.sock, 
                                       forcebind=self.forcejson)
        ujson = udpjson.jsonudpserver(server, self.port)

        #OpenFlow Parser
        ofparse = ofevents.parser(server)
        #COIN main sever, maintaining connection
        coinserver = coinbr.bridge(server, ofconn.connections, 
                                   jsonconn.connections)

        #Network status
        sw = switches.dp_features(server)

        #OVS fabric manager
        ovs = coinovs.switch(server, jsonconn.connections)
        coinserver.switch = ovs

        #Flow management
        trafh = coinbr.traffic_handler(server, ofconn.connections, coinserver)

        #Add interfaces
        coinserver.setup(self.interfaces)

        server.order_handler(ofevents.features_reply.name,
                             sw, coinserver)
        server.order_cleanup(ofconn, ovs)

        server.run()
        sys.exit(0)
Пример #3
0
 def __init__(self):
     yapc.daemon.__init__(self)
     self.server = core.core()
     self.coin = coini.core(self.server)
     ##Force JSON connection or not
     self.forcejson = False
     ##Socket to talk to
     self.sock = coin.SOCK_NAME
Пример #4
0
    def run(self):
        server = core.core()
        intfmgr = neti.interfacemgr(server)

        self.configure_if(intfmgr)
        fs = flowsplitter(server, self.extintf, intfmgr.veth[0].names[0], self.ip)
        server.run()
        sys.exit(0)
Пример #5
0
 def run(self):
     ##yapc base
     server = core.core()
     ofconn = ofcomm.ofserver(server)
    
     server.run(runbg=True)
     app=QtGui.QApplication([])
     ret = gui.MainWindow("Flow Manager",500,650).run(app)
     sys.exit(ret)
Пример #6
0
    def run(self):
        server = core.core()

        pf = pktsrc.pcap_file(self.pcap)
        rs = rcomm.rawsocket(server, self.intf)

        pkt = pf.get_next()
        while (pkt != None):
            self.inject_packet(rs, pkt[1])
            pkt = pf.get_next()

        server.cleanup()
        sys.exit(0)
Пример #7
0
    def run(self):
        """Run server
        """
        #Create yapc base
        server = core.core()
        ofconn = ofcomm.ofserver(server)
        jsonconn = jsoncomm.jsonserver(server, file=self.sock, 
                                       forcebind=self.forcejson)

        #Debug/Profiling
        #ofmsg = ofdbg.of_msg_count(server)

        #OpenFlow Parser
        ofparse = ofevents.parser(server)
        #COIN main server, maintaining connections
        coinserver = coinnat.nat(server, ofconn.connections,
                                 jsonconn.connections)
        coin_info = coini.core(server)

        #Information components
        bwm = ns.coin_intf_bandwidth(coin_info)

        #Network status
        sw = switches.dp_features(server)
        swhost = switchhost.mac2sw_binding(server)

        #OVS fabric manager
        ovs = coinovs.switch(server, jsonconn.connections)
        coinserver.switch = ovs

        #Flow management
        arph = coinnat.arp_handler(server, ofconn.connections)
        iph = coinnat.ip_handler(server, ofconn.connections, coinserver)

        #Add interfaces
        coinserver.setup(self.interfaces)

        server.order_handler(ofevents.features_reply.name,
                             sw, coinserver)
        server.order_cleanup(ofconn, ovs)

        coin_info.start()
        server.run()       
        sys.exit(0)
Пример #8
0
                            output.dbg(str(oid)+" = "+val.prettyPrint(),
                                       self.__class__.__name__)
                        self.expectedCount += 1
                        snmpget.send(m, ('localhost', 161), snmpget.WALK)
            else:
                output.dbg("SNMP Error : "+event.response.recv_error.prettyPrint(),
                           self.__class__.__name__)
        else:
            output.dbg("Error", self.__class__.__name__)

        if(self.count == self.expectedCount):
            self.server.cleanup()
            
        return True

server = core.core()
output.set_mode("DBG")
snmpget = snmp.reliable_snmp(server)
snmps = snmpcomm.snmp_udp_server(server, 5000)
ps = print_snmp(server)
server.run(runbg=True)

m1 = snmpcomm.xet_message(
    {(1,3,6,1,2,1,1,1,0): None,
     (1,3,6,1,2,1,1,2,0): None})

snmpget.send(m1, ('openflow2.stanford.edu', 161), snmpget.GET)
output.dbg("Sent message 1")
snmpget.send(m1, ('localhost', 161), snmpget.GET)
output.dbg("Sent message 2")
Пример #9
0
import yapc.log.sqlite as sqlite
import yapc.log.openflow as oflog

import openwifi.webpage as owweb
import openwifi.facebookwebpage as fbweb
import openwifi.globals as owglobal
import openwifi.authenticate as owauth
import openwifi.logger as owlog
import sys
import time

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)
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)
Пример #10
0
 def __init__(self):
     yapc.daemon.__init__(self)
     self.server = core.core()
     self.bw = bwm(self.server, interval=1)
     self.kl = term.keylogger(self.server)
Пример #11
0
import yapc.log.sqlite as sqlite
import yapc.log.openflow as oflog

import openwifi.webpage as owweb
import openwifi.googlewebpage as howweb
import openwifi.globals as owglobal
import openwifi.authenticate as owauth
import openwifi.logger as owlog
import sys
import time

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()