def validateIP(self, host, ip):
try:
addrs = socket.gethostbyname_ex(host)
except BaseException as e:
self.sf.debug("Unable to resolve " + host + ": " + str(e))
return False
for addr in addrs:
if type(addr) == list:
for a in addr:
if str(a) == ip:
return True
else:
if str(addr) == ip:
return True
return False
# Handle events sent to this module
评论列表
文章目录