コード例 #1
0
 def add_ipv4_address(self, ipv4_address):
     """
     Add the specified IPv4 address to the list of addresses to scan.
     :param ipv4_address: The IPv4 address to scan.
     :return: None
     """
     ValidationHelper.validate_ipv4_address(ipv4_address)
     self._ipv4_addresses.add(ipv4_address)
コード例 #2
0
 def add_ipv4_range(self, start=None, end=None):
     """
     Add the specified IPv4 address range to the list of addresses to scan.
     :param start: The start of the IPv4 address range.
     :param end: The end of the IPv4 address range.
     :return: None
     """
     ValidationHelper.validate_ipv4_address(start)
     ValidationHelper.validate_ipv4_address(end)
     start_addr = IPAddress(start)
     end_addr = IPAddress(end)
     if end_addr <= start_addr:
         raise ValueError(
             "NmapScanner.add_ipv4_range received an end value (%s) less than its start value (%s)."
             % (end, start))
     self._ipv4_ranges.add((start, end))