예제 #1
0
def nda_loop():
	ndutil.setTimezone()

	ndlCom = NdlCom('nDroid-Executer', '127.0.0.1', 12322)
	ndlCom.doCom('Initiating')

	ndlCom.doCom('Loading Config')
	cnfManager = CnfManager()
	cnfManager.load('./nde.cnf')
	cnfData = cnfManager.getCnfData()

	nsQueue = Queue()
	nsLock = threading.Lock()

	netManager = NetManager()
	netManager.setNdlCom(ndlCom)
	netManager.setNsQueue(nsQueue, nsLock)

	ndlCom.doCom('Starting Threads')
	scheduler = Scheduler([ndlCom, nsQueue, nsLock], 'Scheduler')

	scheduler.start()

	reactor.listenUDP(cnfData['comPort'], netManager)
	ndlCom.doCom('Listening Com Port')
	reactor.run()

	scheduler.join()
예제 #2
0
def nds_loop(doInit):
	ndutil.setTimezone()

	ndlCom = NdlCom('nDroid-Storage', '127.0.0.1', 12322)
	ndlCom.doCom('Initiating')

	ndlCom.doCom('Loading Configuration')
	cnfManager = CnfManager()
	cnfManager.load('./nds.cnf')
	cnfData = cnfManager.getCnfData()

	ndutil.enableDir(cnfData['storageDir'])

	ndlCom.doCom('Connecting to DB')
	dbManager = DbManager(cnfData['dbHost'], cnfData['dbUser'], cnfData['dbPass'], cnfData['dbName'])
	if doInit:
		dbManager.create_table()
		os.system('rm -fr %s/*' % cnfData['storageDir'])

	msgManager = MsgManager()

	netManager = NetManager()
	netManager.setStorageDir(cnfData['storageDir'])
	netManager.setFileMode(cnfData['fileMode'])
	netManager.setNdlCom(ndlCom)
	netManager.setDbManager(dbManager)
	netManager.setMsgManager(msgManager)

	reactor.listenUDP(cnfData['comPort'], netManager)
	ndlCom.doCom('Listening Com Port')
	reactor.run()
예제 #3
0
def ndss_loop(doInit):
    ndutil.set_timezone()

    ndlCom = NdlCom('nDroid-Scheduler', '127.0.0.1', 12322)
    ndlCom.do_com('Initiating')

    ndlCom.do_com('Loading Configuration')
    cnfManager = CnfManager()
    cnfManager.load('./ndss.cnf')
    cnfData = cnfManager.get_cnf_data()

    if doInit:
        pass

    msgManager = MsgManager()

    ndsCom = NdsCom('127.0.0.1', 12321)
    ndaCom = NdaCom('127.0.0.1', 12323)

    netManager = NetManager()
    netManager.set_msgmanager(msgManager)
    netManager.set_ndlcom(ndlCom)
    netManager.set_ndscom(ndsCom)
    netManager.set_ndacom(ndaCom)

    reactor.listenUDP(cnfData['comPort'], netManager)
    ndlCom.do_com('Listening Com Port %d' % cnfData['comPort'])
    reactor.run()
예제 #4
0
파일: nda.py 프로젝트: jovistar/nDroid-ADB
def nda_loop(doInit):
    ndutil.setTimezone()

    ndlCom = NdlCom('nDroid-ADB', '127.0.0.1', 12322)
    ndlCom.doCom('Initiating')

    ndlCom.doCom('Loading Config')
    cnfManager = CnfManager()
    cnfManager.load('./nda.cnf')
    cnfData = cnfManager.get_cnf_data()

    ndlCom.doCom('Connecting to DB')
    dbManager = DbManager(cnfData['dbHost'], cnfData['dbUser'], cnfData['dbPass'], cnfData['dbName'])

    if doInit:
        dbManager.create_table()

    netManager = NetManager()
    netManager.setNdlCom(ndlCom)
    netManager.setDbManager(dbManager)

    reactor.listenUDP(cnfData['comPort'], netManager)
    ndlCom.doCom('Listening Com Port')
    reactor.run()