def get_instance_nw_info(self, context, instance_id,
                             instance_type_id, host):
        # TODO(tr3buchet) should handle floating IPs as well?
        try:
            fixed_ips = self.db.fixed_ip_get_by_instance(context, instance_id)
        except exception.FixedIpNotFoundForInstance:
            LOG.warn(_('No fixed IPs for instance %s'), instance_id)
            fixed_ips = []

        vifs = self.db.virtual_interface_get_by_instance(context, instance_id)
        flavor = self.db.instance_type_get(context, instance_type_id)
        network_info = []
        # a vif has an address, instance_id, and network_id
        # it is also joined to the instance and network given by those IDs
        for vif in vifs:
            network = vif['network']

            if network is None:
                continue

            # determine which of the instance's IPs belong to this network
            network_IPs = [fixed_ip['address'] for fixed_ip in fixed_ips if
                           fixed_ip['network_id'] == network['id']]

            # TODO(tr3buchet) eventually "enabled" should be determined
            def ip_dict(ip):
                return {
                    'ip': ip,
                    'netmask': network['netmask'],
                    'enabled': '1'}

            def ip6_dict():
                return {
                    'ip': ipv6.to_global(network['cidr_v6'],
                                         vif['address'],
                                         network['project_id']),
                    'netmask': network['netmask_v6'],
                    'enabled': '1'}
            network_dict = {
                'bridge': network['bridge'],
                'id': network['id'],
                'cidr': network['cidr'],
                'cidr_v6': network['cidr_v6'],
                'injected': network['injected'],
                'vlan': network['vlan'],
                'bridge_interface': network['bridge_interface'],
                'multi_host': network['multi_host']}
            if network['multi_host']:
                dhcp_server = self._get_dhcp_ip(context, network, host)
            else:
                dhcp_server = self._get_dhcp_ip(context,
                                                network,
                                                network['host'])
            info = {
                'label': network['label'],
                'gateway': network['gateway'],
                'dhcp_server': dhcp_server,
                'broadcast': network['broadcast'],
                'mac': vif['address'],
                'vif_uuid': vif['uuid'],
                'rxtx_cap': flavor['rxtx_cap'],
                'dns': [],
                'ips': [ip_dict(ip) for ip in network_IPs],
                'should_create_bridge': self.SHOULD_CREATE_BRIDGE,
                'should_create_vlan': self.SHOULD_CREATE_VLAN}

            if network['cidr_v6']:
                info['ip6s'] = [ip6_dict()]
            # TODO(tr3buchet): handle ip6 routes here as well
            if network['gateway_v6']:
                info['gateway6'] = network['gateway_v6']
            if network['dns1']:
                info['dns'].append(network['dns1'])
            if network['dns2']:
                info['dns'].append(network['dns2'])

            network_info.append((network_dict, info))
        return network_info
Creates network info list for instance.
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/network/manager.py/NetworkManager.get_instance_nw_info