Return the network list for each interface
@return {object} network list
426612
function getNetworkInterfaces() {
    const ret = {};
    for (const macinfo of Object.values(macs)) {
        if (!macinfo.self) {
            continue;
        }
        ret[macinfo.net] = objCpy(macinfo);
    }
    return ret;
}
262224
public java.util.List<String> getNetworkInterfaceIds() {
        if (networkInterfaceIds == null) {
            networkInterfaceIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return networkInterfaceIds;
    }
1209336
function getAddress(loopback, opt_family) {
  var family = opt_family || 'IPv4';
  var addresses = [];

  var interfaces;
  if (loopback) {
    var lo = getLoInterface();
    interfaces = lo ? [lo] : null;
  }
  interfaces = interfaces || os.networkInterfaces();
  for (var key in interfaces) {
    interfaces[key].forEach(function(ipAddress) {
      if (ipAddress.family === family &&
          ipAddress.internal === loopback) {
        addresses.push(ipAddress.address);
      }
    });
  }
  return addresses[0];
}
294057
def network_interfaces_list_all(**kwargs):
    '''
    

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        nics = __utils__['azurearm.paged_object_to_list'](netconn.network_interfaces.list_all())

        for nic in nics:
            result[nic['name']] = nic
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
825548
function getNetwork(network) {
    // No network (null)
    if (network == null) {
        return null;
    }
    if (typeof (network) === 'number') {
        for (var name_1 in networks) {
            var n_1 = networks[name_1];
            if (n_1.chainId === network) {
                return {
                    name: n_1.name,
                    chainId: n_1.chainId,
                    ensAddress: (n_1.ensAddress || null),
                    _defaultProvider: (n_1._defaultProvider || null)
                };
            }
        }
        return {
            chainId: network,
            name: 'unknown'
        };
    }
    if (typeof (network) === 'string') {
        var n_2 = networks[network];
        if (n_2 == null) {
            return null;
        }
        return {
            name: n_2.name,
            chainId: n_2.chainId,
            ensAddress: n_2.ensAddress,
            _defaultProvider: (n_2._defaultProvider || null)
        };
    }
    var n = networks[network.name];
    // Not a standard network; check that it is a valid network in general
    if (!n) {
        if (typeof (network.chainId) !== 'number') {
            errors.throwError('invalid network chainId', errors.INVALID_ARGUMENT, { arg: 'network', value: network });
        }
        return network;
    }
    // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)
    if (network.chainId !== 0 && network.chainId !== n.chainId) {
        errors.throwError('network chainId mismatch', errors.INVALID_ARGUMENT, { arg: 'network', value: network });
    }
    // Standard Network (allow overriding the ENS address)
    return {
        name: network.name,
        chainId: n.chainId,
        ensAddress: (network.ensAddress || n.ensAddress || null),
        _defaultProvider: (network._defaultProvider || n._defaultProvider || null)
    };
}
1206996
def get_interfaces(zone, permanent=True):
    '''
    
    '''
    cmd = '--zone={0} --list-interfaces'.format(zone)

    if permanent:
        cmd += ' --permanent'

    return __firewall_cmd(cmd).split()
299625
def get_interfaces
      mac_keys = facts.keys.select { |f| f =~ /net\.interface\..*\.mac_address/ }
      names = mac_keys.map do |key|
        key.sub('net.interface.', '').sub('.mac_address', '') if facts[key] != 'none'
      end
      names.compact
    end
873888
function getOwnIpAddresses() {
    // enumerate interfaces
    var net = os.networkInterfaces();
    var addresses = Object.keys(net)
        // flatten the array structure
        .map(function (k) { return net[k]; })
        .reduce(function (prev, cur) { return prev.concat.apply(prev, cur); }, [])
        // only use external IPv4 ones
        .filter(function (add) { return !add.internal && add.family === "IPv4"; })
        // extract address as number array
        .map(function (k) { return k.address.split(".").map(function (num) { return +num; }); })
        // ignore unconnected ones
        .filter(function (add) { return add[0] !== 169; })
        // turn the address into a string again
        .map(function (a) { return a[0] + "." + a[1] + "." + a[2] + "." + a[3]; });
    return addresses;
}
311881
def _diff_interface_lists(old, new):
    '''
    
    '''
    diff = _diff_lists(old, new, _nics_equal)

    # Remove duplicated addresses mac addresses and let libvirt generate them for us
    macs = [nic.find('mac').get('address') for nic in diff['unchanged']]
    for nic in diff['new']:
        mac = nic.find('mac')
        if mac.get('address') in macs:
            nic.remove(mac)

    return diff
336527
def in6_getifaddr():
    

    # List all network interfaces
    if OPENBSD:
        try:
            f = os.popen("%s" % conf.prog.ifconfig)
        except OSError:
            log_interactive.warning("Failed to execute ifconfig.")
            return []

        # Get the list of network interfaces
        splitted_line = []
        for l in f:
            if "flags" in l:
                iface = l.split()[0].rstrip(':')
                splitted_line.append(iface)

    else:  # FreeBSD, NetBSD or Darwin
        try:
            f = os.popen("%s -l" % conf.prog.ifconfig)
        except OSError:
            log_interactive.warning("Failed to execute ifconfig.")
            return []

        # Get the list of network interfaces
        splitted_line = f.readline().rstrip().split()

    ret = []
    for i in splitted_line:
        ret += _in6_getifaddr(i)
    return ret
887867
def getSystemIps():
        
        IPs = []
        for interface in NetInfo.getSystemIfs():
            if not interface.startswith('lo'):
                ip = netinfo.get_ip(interface)
                IPs.append(ip)
        return IPs
866869
def EnumerateInterfacesFromClient(args):
  
  del args  # Unused.

  pythoncom.CoInitialize()
  for interface in (wmi.WMI().Win32_NetworkAdapterConfiguration() or []):
    addresses = []
    for ip_address in interface.IPAddress or []:
      addresses.append(
          rdf_client_network.NetworkAddress(human_readable_address=ip_address))

    response = rdf_client_network.Interface(ifname=interface.Description)
    if interface.MACAddress:
      response.mac_address = binascii.unhexlify(
          interface.MACAddress.replace(":", ""))
    if addresses:
      response.addresses = addresses

    yield response
1041403
def ipoib_interfaces():
    """"""
    interfaces = []

    for interface in network_interfaces():
        try:
            driver = re.search('^driver: (.+)$', subprocess.check_output([
                'ethtool', '-i',
                interface]), re.M).group(1)

            if driver in IPOIB_DRIVERS:
                interfaces.append(interface)
        except Exception:
            log("Skipping interface %s" % interface, level=INFO)
            continue

    return interfaces
728563
def interfaces(self):
        """"""
        
        ifaces = []
        for f in sorted(os.listdir(CTRL_IFACE_DIR)):
            sock_file = '/'.join([CTRL_IFACE_DIR, f])
            mode = os.stat(sock_file).st_mode
            if stat.S_ISSOCK(mode):
                iface = {}
                iface['name'] = f
                ifaces.append(iface)
                self._connect_to_wpa_s(f)

        return ifaces
267838
def get_networks_by_ids(self, network_ids: Iterable[int]) -> List[Network]:
        
        log.debug('getting networks by identifiers: %s', network_ids)
        return self.session.query(Network).filter(Network.id_in(network_ids)).all()
453955
@Pure
	public static Collection<InetAddress> getPrimaryAdapterAddresses() {
		final Enumeration<NetworkInterface> interfaces;
		try {
			interfaces = NetworkInterface.getNetworkInterfaces();
		} catch (SocketException exception) {
			return Collections.emptyList();
		}
		if (interfaces != null) {
			NetworkInterface inter;
			while (interfaces.hasMoreElements()) {
				inter = interfaces.nextElement();
				try {
					final byte[] addr = inter.getHardwareAddress();
					if (addr != null) {
						final Collection<InetAddress> inetList = new ArrayList<>();
						final Enumeration<InetAddress> inets = inter.getInetAddresses();
						while (inets.hasMoreElements()) {
							inetList.add(inets.nextElement());
						}
						return inetList;
					}
				} catch (SocketException exception) {
					// Continue to the next loop.
				}
			}
		}
		return Collections.emptyList();
	}
889811
function ip() {
    let network = os.networkInterfaces(),
        keys = Object.keys(network),
        ips = [];

    for (let key of keys) {
        network[key].forEach(ip => {
            ip.family === 'IPv4' && !ip.internal && ips.push(ip.address);
        });
    }

    return ips.length ? ips[0] : '127.0.0.1';
}