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