Return a list of mac addresses for this device.

        Computers don't tell you which network device is which.
15831
def mac_addresses(self):
        
        mac_addresses = [self.findtext("general/mac_address")]
        if self.findtext("general/alt_mac_address"):
            mac_addresses.append(self.findtext("general/alt_mac_address"))
            return mac_addresses
1244244
def list_devices(self):
        """"""
        if self.plm.devices:
            for addr in self.plm.devices:
                device = self.plm.devices[addr]
                if device.address.is_x10:
                    _LOGGING.info('Device: %s %s', device.address.human,
                                  device.description)
                else:
                    _LOGGING.info('Device: %s cat: 0x%02x subcat: 0x%02x '
                                  'desc: %s, model: %s',
                                  device.address.human, device.cat,
                                  device.subcat, device.description,
                                  device.model)
        else:
            _LOGGING.info('No devices found')
            if not self.plm.transport:
                _LOGGING.info('IM connection has not been made.')
                _LOGGING.info('Use `connect [device]` to open the connection')
359142
def get_devices(self) -> list:
        """"""

        if not self.enabled:
            return None

        self.in_process = True

        response, _ = helpers.call_api(
            '/cloud/v1/deviceManaged/devices',
            'post',
            headers=helpers.req_headers(self),
            json=helpers.req_body(self, 'devicelist')
        )

        if response and helpers.check_response(response, 'get_devices'):
            if 'result' in response and 'list' in response['result']:
                device_list = response['result']['list']
                outlets, switches, fans = self.process_devices(device_list)
            else:
                logger.error('Device list in response not found')
        else:
            logger.error('Error retrieving device list')

        self.in_process = False

        return (outlets, switches, fans)
296345
def trusted_devices(self):
        
        request = self.session.get(
            '%s/listDevices' % self._setup_endpoint,
            params=self.params
        )
        return request.json().get('devices')
342258
def _list_vlans_by_name(self, name):
        
        results = self.list_vlans(name=name, mask='id')
        return [result['id'] for result in results]
401090
def devices(self):
        
        devices = None
        with self.socket.Connect():
            devices = self._command("host:devices")

        return parse_device_list(devices)
1234605
def get_device_address(device):
    
    if device is None:
        return None
    command = ['ip', 'route', 'list', 'dev', device]
    ip_routes = subprocess.check_output(command).strip()
    for line in ip_routes.split('\n'):
        seen = ''
        for a in line.split():
            if seen == 'src':
                return a
            seen = a
    return None
771363
def get_macs_for_vlan(self, ip, vlan, display_progress=0, snmpobj=None, system_name=None, ifname_vbtbl=None):
        '''
        
        '''
        ret_macs = []

        if (snmpobj == None):
            snmpobj = natlas_snmp(ip)
            if (snmpobj.get_cred(self.config.snmp_creds) == 0):
                return None
        if (ifname_vbtbl == None):
            ifname_vbtbl = snmpobj.get_bulk(OID_IFNAME)
        if (system_name == None):
            system_name = util.shorten_host_name(snmpobj.get_val(OID_SYSNAME), self.config.host_domains)

        # change our SNMP credentials
        old_cred = snmpobj.v2_community
        snmpobj.v2_community = old_cred + '@' + str(vlan)

        if (display_progress == 1):
            sys.stdout.write(str(vlan)) # found VLAN
            sys.stdout.flush()

        # get CAM table for this VLAN
        cam_vbtbl       = snmpobj.get_bulk(OID_VLAN_CAM)
        portnum_vbtbl   = snmpobj.get_bulk(OID_BRIDGE_PORTNUMS)
        ifindex_vbtbl   = snmpobj.get_bulk(OID_IFINDEX)
        cam_match       = None

        if (cam_vbtbl == None):
            # error getting CAM for VLAN
            return None

        for cam_row in cam_vbtbl:
            for cam_n, cam_v in cam_row:
                cam_entry = natlas_mac.mac_format_ascii(cam_v, 0)

                # find the interface index
                p               = cam_n.getOid()
                portnum_oid     = '%s.%i.%i.%i.%i.%i.%i' % (OID_BRIDGE_PORTNUMS, p[11], p[12], p[13], p[14], p[15], p[16])
                bridge_portnum  = snmpobj.cache_lookup(portnum_vbtbl, portnum_oid)

                # get the interface index and description
                try:
                    ifidx       = snmpobj.cache_lookup(ifindex_vbtbl, OID_IFINDEX + '.' + bridge_portnum)
                    port        = snmpobj.cache_lookup(ifname_vbtbl, OID_IFNAME + '.' + ifidx)
                except TypeError:
                    port = 'None'

                mac_addr = natlas_mac.mac_format_ascii(cam_v, 1)
                
                if (display_progress == 1):
                    sys.stdout.write('.') # found CAM entry
                    sys.stdout.flush()

                entry = natlas_mac.mac_object(system_name, ip, vlan, mac_addr, port)
                ret_macs.append(entry)

        # restore SNMP credentials
        snmpobj.v2_community = old_cred
        return ret_macs
982506
def device_info(self):
        """"""
        return {
            'connections': {('mac', self.device['device_mac'])},
            'identifieres': self.device['device_id'],
            'manufacturer': 'Minut',
            'model': 'Point v{}'.format(self.device['hardware_version']),
            'name': self.device['description'],
            'sw_version': self.device['firmware']['installed'],
        }
460001
def get_ip_addr(self) -> str:
        ''''''
        output, _ = self._execute(
            '-s', self.device_sn, 'shell', 'ip', '-f', 'inet', 'addr', 'show', 'wlan0')
        ip_addr = re.findall(
            r"\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b", output)
        if not ip_addr:
            raise ConnectionError(
                'The device is not connected to WLAN or not connected via USB.')
        return ip_addr[0]
678599
def devices(self):
        
        data = self.query(MyPlexDevice.key)
        return [MyPlexDevice(self, elem) for elem in data]
19996
def _get_nics(dom):
    '''
    
    '''
    nics = {}
    doc = ElementTree.fromstring(dom.XMLDesc(0))
    for iface_node in doc.findall('devices/interface'):
        nic = {}
        nic['type'] = iface_node.get('type')
        for v_node in iface_node:
            if v_node.tag == 'mac':
                nic['mac'] = v_node.get('address')
            if v_node.tag == 'model':
                nic['model'] = v_node.get('type')
            if v_node.tag == 'target':
                nic['target'] = v_node.get('dev')
            # driver, source, and match can all have optional attributes
            if re.match('(driver|source|address)', v_node.tag):
                temp = {}
                for key, value in six.iteritems(v_node.attrib):
                    temp[key] = value
                nic[v_node.tag] = temp
            # virtualport needs to be handled separately, to pick up the
            # type attribute of the virtualport itself
            if v_node.tag == 'virtualport':
                temp = {}
                temp['type'] = v_node.get('type')
                for key, value in six.iteritems(v_node.attrib):
                    temp[key] = value
                nic['virtualport'] = temp
        if 'mac' not in nic:
            continue
        nics[nic['mac']] = nic
    return nics
423413
function getInterfaceMAC (device) {
  if (process.platform === 'darwin' || process.platform === 'linux') {
    let output
    try {
      output = cp.execSync(quote(['ifconfig', device]), { stdio: 'pipe' }).toString()
    } catch (err) {
      return null
    }

    const address = MAC_ADDRESS_RE.exec(output)
    return address && normalize(address[0])
  } else if (process.platform === 'win32') {
    console.error('No windows support for this method yet - PR welcome!')
  }
}
855842
def get_interface_addresses():
    

    addresses = []
    ifaces = netifaces.interfaces()
    for iface in ifaces:
        addrs = netifaces.ifaddresses(iface)
        families = addrs.keys()

        # put IPv4 to the end so it lists as the main iface address
        if netifaces.AF_INET in families:
            families.remove(netifaces.AF_INET)
            families.append(netifaces.AF_INET)

        for family in families:
            for addr in addrs[family]:
                address = {
                    'name': iface,
                    'family': family,
                    'ip': addr['addr'],
                }
                addresses.append(address)

    return addresses
877787
def addresses(self):
        
        if self._addresses is None:
            self._addresses = AddressList(self._version, account_sid=self._solution['sid'], )
        return self._addresses
1345685
def get_ip_addresses(self, machine, *, boot_only=False, discovered=False):
        
        boot_ips = [
            link.ip_address
            for link in machine.boot_interface.links
            if link.ip_address
        ]
        if boot_only:
            if boot_ips:
                return boot_ips
            elif discovered:
                return [
                    link.ip_address
                    for link in machine.boot_interface.discovered
                    if link.ip_address
                ]
            else:
                return []
        else:
            other_ips = [
                link.ip_address
                for interface in machine.interfaces
                for link in interface.links
                if (interface.id != machine.boot_interface.id and
                    link.ip_address)
            ]
            ips = boot_ips + other_ips
            if ips:
                return ips
            elif discovered:
                return [
                    link.ip_address
                    for link in machine.boot_interface.discovered
                    if link.ip_address
                ] + [
                    link.ip_address
                    for interface in machine.interfaces
                    for link in interface.discovered
                    if (interface.id != machine.boot_interface.id and
                        link.ip_address)
                ]
            else:
                return []
1260715
def list_():
    '''
    
    '''
    ret = {}
    for line in (__salt__['cmd.run_stdout']
                    (['mdadm', '--detail', '--scan'],
                     python_shell=False).splitlines()):
        if ' ' not in line:
            continue
        comps = line.split()
        device = comps[1]
        ret[device] = {"device": device}
        for comp in comps[2:]:
            key = comp.split('=')[0].lower()
            value = comp.split('=')[1]
            ret[device][key] = value
    return ret