# Path: lib/settings.py
# def get_top_domains(dbname):


import threading
import time
from lib.logger import *
from libnmap.process import NmapProcess
from libnmap.parser import NmapParser
from lib.settings import homenet, lock


class PortScanner(threading.Thread):
    def __init__(self, threadID):
        threading.Thread.__init__(self)
        self.threadID = threadID

    def run(self):

        # Wait until all active devices have been populated during boot
        time.sleep(30)

        while 1:
            ip_list = ','.join(homenet.hosts.keys())

            log.debug('FG-INFO: Port scan started')

            nm = NmapProcess(targets=ip_list, options='-sU -sS --min-rate 5000 --max-retries 1 --max-rtt-timeout 100ms -p1-10000 ')
            nm.run()

            try:
                nmap_report = NmapParser.parse(nm.stdout)

                with lock:
                    for host in nmap_report.hosts:

# Path: lib/settings.py
# def get_top_domains(dbname):


# Path: lib/recon.py
import threading
import time
from lib.logger import *
from libnmap.process import NmapProcess
from libnmap.parser import NmapParser
from lib.settings import homenet, lock



class PortScanner(threading.Thread):
    def __init__(self, threadID):
        threading.Thread.__init__(self)
        self.threadID = threadID

    def run(self):

        # Wait until all active devices have been populated during boot
        time.sleep(30)

        while 1:
            ip_list = ','.join(homenet.hosts.keys())

            log.debug('FG-INFO: Port scan started')

            nm = NmapProcess(targets=ip_list, options='-sU -sS --min-rate 5000 --max-retries 1 --max-rtt-timeout 100ms -p1-10000 ')
            nm.run()

            try:
                nmap_report = NmapParser.parse(nm.stdout)

                with lock:
                    for host in nmap_report.hosts:

                        if host.address in homenet.hosts.keys():