'Iterate over hosts.
For each host on the network we yield a tuple containing:
port,  # a DictModel instance representing the port.
alloc,  # a DictModel instance of the allocated ip and subnet.
# if alloc is None, it means there is no need to allocate
# an IPv6 address because of stateless DHCPv6 network.
host_name,  # Host name.
name,  # Canonical hostname in the format \'hostname[.domain]\'.
no_dhcp,  # A flag indicating that the address doesn\'t need a DHCP
# IP address.
no_opts,  # A flag indication that options shouldn\'t be written'

def _iter_hosts(self):

    v6_nets = dict(((subnet.id, subnet) for subnet in self._get_all_subnets(self.network) if (subnet.ip_version == 6)))
    for port in self.network.ports:
        fixed_ips = self._sort_fixed_ips_for_dnsmasq(port.fixed_ips, v6_nets)
        dns_assignment = getattr(port, 'dns_assignment', None)
        if dns_assignment:
            dns_ip_map = {d.ip_address: d for d in dns_assignment}
        for alloc in fixed_ips:
            no_dhcp = False
            no_opts = False
            if (alloc.subnet_id in v6_nets):
                addr_mode = v6_nets[alloc.subnet_id].ipv6_address_mode
                no_dhcp = (addr_mode in (constants.IPV6_SLAAC, constants.DHCPV6_STATELESS))
                no_opts = (addr_mode == constants.IPV6_SLAAC)
            if dns_assignment:
                hostname = dns_ip_map[alloc.ip_address].hostname
                fqdn = dns_ip_map[alloc.ip_address].fqdn
            else:
                hostname = ('host-%s' % alloc.ip_address.replace('.', '-').replace(':', '-'))
                fqdn = hostname
                if self.conf.dns_domain:
                    fqdn = ('%s.%s' % (fqdn, self.conf.dns_domain))
            (yield (port, alloc, hostname, fqdn, no_dhcp, no_opts))
