from collections import namedtuple from dataclasses import dataclass @dataclass class Options: # TODO: move this out of Options, since it's really not. execution: object = None ip_simul: int = 30 # how many IPs to connect to at once domain_simul: int = 3 # how many domains per IP to request at once packets_per_second: int = 50 # rough limit on all outgoing DNS packets ip_wait: float = 0.05 domain_wait: float = 0.25 impatient: bool = False # reduce retries and times for timeouts early_stopping: bool = True # stop at the first invalid domain dry: bool = True # don't write anything to database progress: bool = False # periodically print progress to stderr blocking_file_io: bool = False # halt execution until inputs arrive @dataclass class Entry: from datetime import datetime date: datetime success: bool server: str kind: str domain: str exception: str addrs: list # list of strings reason: str execution: object Check = namedtuple("Check", ("kind", "domain", "failures"))