def __init__(self, interface):
self.interface = interface
self.hosts = {}
self.advanced_scan = False
try:
self.local_ip = netifaces.ifaddresses(interface)[netifaces.AF_INET][0]['addr']
except KeyError:
self.local_ip = raw_input("\n{R}ERROR: Unable to retrieve local IP address\n{N}Please enter manually: ".format(R=RED, N=NORMAL))
try:
self.gateway_ip = netifaces.gateways()["default"][netifaces.AF_INET][0]
except KeyError:
self.gateway_ip = raw_input("\n{R}ERROR: Unable to retrieve gateway IP address\n{N}Please enter manually: ".format(R=RED, N=NORMAL))
评论列表
文章目录