Sets the MAC address.

        :param mac_addr: a MAC address (hexadecimal format: hh:hh:hh:hh:hh:hh)
765498
def set_mac_addr(self, mac_addr):
        

        yield from self._hypervisor.send('{platform} set_mac_addr "{name}" {mac_addr}'.format(platform=self._platform,
                                                                                              name=self._name,
                                                                                              mac_addr=mac_addr))

        log.info('Router "{name}" [{id}]: MAC address updated from {old_mac} to {new_mac}'.format(name=self._name,
                                                                                                  id=self._id,
                                                                                                  old_mac=self._mac_addr,
                                                                                                  new_mac=mac_addr))
        self._mac_addr = mac_addr
1053899
def set_lan_port(self, port_id, mac=None):
        
        port_handler = _parse_physical_port_id(port_id)
        port = self._find_port(port_handler)
        if port:
            port_handler.set_lan_port(port, mac)
        else:
            self._add_port(port_handler, port_handler.create_lan_port(mac))
1313553
def _read_mac_addr(self):
        """"""
        _byte = self._read_fileng(6)
        _addr = '-'.join(textwrap.wrap(_byte.hex(), 2))
        return _addr
1144024
def hostaddr(dest='8.8.8.8'):
    '''
    
    '''
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

    # doesn't actually send any packets!
    sock.connect((dest, 80))
    addr, port = sock.getsockname()

    sock.close()

    return addr
492995
def in6_addrtomac(addr):
    
    mask = inet_pton(socket.AF_INET6, "::ffff:ffff:ffff:ffff")
    x = in6_and(mask, inet_pton(socket.AF_INET6, addr))
    ifaceid = inet_ntop(socket.AF_INET6, x)[2:]
    return in6_ifaceidtomac(ifaceid)
711171
def get_primary_mac_address():
    
    log = logging.getLogger(mod_logger + '.get_primary_mac_address')
    log.debug('Attempting to determine the MAC address for eth0...')
    try:
        mac_address = netifaces.ifaddresses('eth0')[netifaces.AF_LINK][0]['addr']
    except Exception:
        _, ex, trace = sys.exc_info()
        msg = '{n}: Unable to determine the eth0 mac address for this system:\n{e}'.format(
            n=ex.__class__.__name__, e=str(ex))
        raise AWSMetaDataError, msg, trace
    return mac_address
482521
def accept(self, addr):
        

        # Add the address to the set
        ip_addr = _parse_ip(addr)
        if ip_addr is None:
            LOG.warn("Cannot add address %r to proxy %s: "
                     "invalid address" % (addr, self.address))
        else:
            self.accepted.add(addr)
1320760
def mac_address(self, mac_address):
        

        if not mac_address:
            # use the node UUID to generate a random MAC address
            self._mac_address = "52:%s:%s:%s:%s:00" % (self.project.id[-4:-2], self.project.id[-2:], self.id[-4:-2], self.id[-2:])
        else:
            self._mac_address = mac_address

        log.info('QEMU VM "{name}" [{id}]: MAC address changed to {mac_addr}'.format(name=self._name,
                                                                                     id=self._id,
                                                                                     mac_addr=self._mac_address))
1281375
def set_static_ip_address(self, context, msg):
        
        args = jsonutils.loads(msg)
        macaddr = args.get('mac')
        ipaddr = args.get('ip')
        LOG.debug('set_static_ip_address received: %(mac)s %(ip)s', (
                  {'mac': macaddr, 'ip': ipaddr}))

        # Add the request into queue for processing.
        event_type = 'cli.static_ip.set'
        payload = {'mac': macaddr, 'ip': ipaddr}
        timestamp = time.ctime()
        data = (event_type, payload)
        pri = self.obj.PRI_LOW_START
        self.obj.pqueue.put((pri, timestamp, data))
        LOG.debug('Added request to add static ip into queue.')

        return 0
887603
def add_interrupt(self, interrupt):
		
		self.interrupts.append(interrupt)
		self.constants[interrupt.name] = interrupt.address
1218910
def set_remote_addr(self, dst_mac, dst_ip):
        
        self.dst_mac = dst_mac
        self.dst_ip = dst_ip

        if not (dst_mac == "FF:FF:FF:FF:FF:FF" or dst_ip == "255.255.255.255"):
            self._remote_addr_config = True

        LOG.info("[BFD][%s][REMOTE] Remote address configured: %s, %s.",
                 hex(self._local_discr), self.dst_ip, self.dst_mac)
1282802
def mac_address(self):
        
        if self._mac_address is None:
            self._mac_address = self._get_mac_address()

        return self._mac_address
478246
def mac(self):
        
        res = 'Port       Mac                VLAN\n'
        result = (yield from self._node._hypervisor.send('ethsw show_mac_addr_table {}'.format(self._node.name)))
        for line in result:
            mac, vlan, nio = line.replace('  ', ' ').split(' ')
            mac = mac.replace('.', '')
            mac = "{}:{}:{}:{}:{}:{}".format(
                mac[0:2],
                mac[2:4],
                mac[4:6],
                mac[6:8],
                mac[8:10],
                mac[10:12])
            for port_number, switch_nio in self._node.nios.items():
                if switch_nio.name == nio:
                    res += 'Ethernet' + str(port_number) + '  ' + mac + '  ' + vlan + '\n'
                    break
        return res
979802
def _set_address(self, address, force=None):
        
        force = force if force is not None else self.force
        if self.address != address or self._force_last != force:
            if force is True:
                ioctl(self.fd, I2C_SLAVE_FORCE, address)
            else:
                ioctl(self.fd, I2C_SLAVE, address)
            self.address = address
            self._force_last = force
549845
def set_x10_address(self, x10address):
        """"""
        set_cmd = self._create_set_property_msg('_x10_house_code', 0x04,
                                                x10address)
        self._send_method(set_cmd, self._property_set)
421288
func (s *AgentNetworkInfo) SetMacAddress(v string) *AgentNetworkInfo {
	s.MacAddress = &v
	return s
}
508290
def add_host(zone, name, ttl, ip, keyname, keyfile, nameserver, timeout,
             port=53, keyalgorithm='hmac-md5'):
    '''
    
    '''
    res = []
    if zone in name:
        name = name.replace(zone, '').rstrip('.')
    fqdn = '{0}.{1}'.format(name, zone)

    ret = create(zone, name, ttl, 'A', ip, keyname, keyfile, nameserver,
                 timeout, port, keyalgorithm)
    res.append(ret[fqdn])

    parts = ip.split('.')[::-1]
    i = len(parts)
    popped = []

    # Iterate over possible reverse zones
    while i > 1:
        p = parts.pop(0)
        i -= 1
        popped.append(p)

        zone = '{0}.{1}'.format('.'.join(parts), 'in-addr.arpa.')
        name = '.'.join(popped)
        rev_fqdn = '{0}.{1}'.format(name, zone)
        ret = create(zone, name, ttl, 'PTR', "{0}.".format(fqdn), keyname,
                     keyfile, nameserver, timeout, port, keyalgorithm)

        if "Created" in ret[rev_fqdn]:
            res.append(ret[rev_fqdn])
            return {fqdn: res}

    res.append(ret[rev_fqdn])

    return {fqdn: res}