@flow.StateHandler()
  def EnumerateInterfaces(self, responses):
    """Enumerates the interfaces."""
    if responses.success and responses:
      net_fd = aff4.FACTORY.Create(self.client.urn.Add("network"), "Network",
                                   token=self.token)
      interface_list = net_fd.Schema.INTERFACES()
      mac_addresses = []
      ip_addresses = []
      for response in responses:
        interface_list.Append(response)

        # Add a hex encoded string for searching
        if (response.mac_address and
            response.mac_address != "\x00" * len(response.mac_address)):
          mac_addresses.append(response.mac_address.human_readable_address)

        for address in response.addresses:
          if address.human_readable_address not in self.FILTERED_IPS:
            ip_addresses.append(address.human_readable_address)

      self.client.Set(self.client.Schema.MAC_ADDRESS(
          "\n".join(mac_addresses)))
      self.client.Set(self.client.Schema.HOST_IPS(
          "\n".join(ip_addresses)))

      net_fd.Set(net_fd.Schema.INTERFACES(interface_list))
      net_fd.Close()
      self.client.Set(self.client.Schema.LAST_INTERFACES(interface_list))

    else:
      self.Log("Could not enumerate interfaces.")
dataset/ETHPy150Open google/grr/grr/lib/flows/general/discovery.py/Interrogate.EnumerateInterfaces/original