// SetLinkMacAddress sets link's MAC address.
// It is equivalent of running: ip link set dev ${interface name} address ${address}
771975
func (l *Link) SetLinkMacAddress(macaddr string) error {
	return netlink.NetworkSetMacAddress(l.NetInterface(), macaddr)
}
1070242
func (s *BrokerInstance) SetIpAddress(v string) *BrokerInstance {
	s.IpAddress = &v
	return s
}
437612
func (l *Link) SetLinkNsFd(nspath string) error {
	fd, err := syscall.Open(nspath, syscall.O_RDONLY, 0)
	if err != nil {
		return fmt.Errorf("Could not attach to Network namespace: %s", err)
	}

	return netlink.NetworkSetNsFd(l.NetInterface(), fd)
}
535623
func (s *AgentNetworkInfo) SetIpAddress(v string) *AgentNetworkInfo {
	s.IpAddress = &v
	return s
}
1100503
func (s *Instance) SetIpv6Address(v string) *Instance {
	s.Ipv6Address = &v
	return s
}
683979
func macAddress() []byte {
	address := [6]byte{}
	ifaces, err := net.Interfaces()
	// Try to get address from interfaces.
	if err == nil {
		set := false
		for _, iface := range ifaces {
			if len(iface.HardwareAddr.String()) != 0 {
				copy(address[:], []byte(iface.HardwareAddr))
				set = true
				break
			}
		}
		if set {
			// Had success.
			return address[:]
		}
	}
	// Need a random address.
	rand.Read(address[:])
	address[0] |= 0x01
	return address[:]
}
298258
func ParseMACAddress(s string) (LinkAddress, error) {
	parts := strings.FieldsFunc(s, func(c rune) bool {
		return c == ':' || c == '-'
	})
	if len(parts) != 6 {
		return "", fmt.Errorf("inconsistent parts: %s", s)
	}
	addr := make([]byte, 0, len(parts))
	for _, part := range parts {
		u, err := strconv.ParseUint(part, 16, 8)
		if err != nil {
			return "", fmt.Errorf("invalid hex digits: %s", s)
		}
		addr = append(addr, byte(u))
	}
	return LinkAddress(addr), nil
}
279534
func setMachineAddresses(tag names.MachineTag, m Machine) error {
	addrs, err := interfaceAddrs()
	if err != nil {
		return err
	}
	var hostAddresses []network.Address
	for _, addr := range addrs {
		var ip net.IP
		switch addr := addr.(type) {
		case *net.IPAddr:
			ip = addr.IP
		case *net.IPNet:
			ip = addr.IP
		default:
			continue
		}
		address := network.NewAddress(ip.String())
		// Filter out link-local addresses as we cannot reliably use them.
		if address.Scope == network.ScopeLinkLocal {
			continue
		}
		hostAddresses = append(hostAddresses, address)
	}
	if len(hostAddresses) == 0 {
		return nil
	}
	// Filter out any LXC or LXD bridge addresses.
	hostAddresses = network.FilterBridgeAddresses(hostAddresses)
	logger.Infof("setting addresses for %q to %v", tag, hostAddresses)
	return m.SetMachineAddresses(hostAddresses)
}
500178
func (_PublicResolver *PublicResolverSession) SetAddr(node [32]byte, addr common.Address) (*types.Transaction, error) {
	return _PublicResolver.Contract.SetAddr(&_PublicResolver.TransactOpts, node, addr)
}
356105
func MacAddress() string {
	blocks := []string{}
	for i := 0; i < 6; i++ {
		number := fmt.Sprintf("%02x", privateRand.Intn(255))
		blocks = append(blocks, number)
	}

	return strings.Join(blocks, ":")
}
291433
func (s *BGPPeer) SetAmazonAddress(v string) *BGPPeer {
	s.AmazonAddress = &v
	return s
}
976013
func (s *GetCustomVerificationEmailTemplateOutput) SetFromEmailAddress(v string) *GetCustomVerificationEmailTemplateOutput {
	s.FromEmailAddress = &v
	return s
}
12454
func (s *DescribeEndpointOutput) SetEndpointAddress(v string) *DescribeEndpointOutput {
	s.EndpointAddress = &v
	return s
}
74094
func (s *NewPrivateVirtualInterface) SetAmazonAddress(v string) *NewPrivateVirtualInterface {
	s.AmazonAddress = &v
	return s
}
302409
func (s *EndpointBatchItem) SetAddress(v string) *EndpointBatchItem {
	s.Address = &v
	return s
}
1364791
func (o *PostNodesMacaddressDhcpWhitelistParams) WithMacaddress(macaddress string) *PostNodesMacaddressDhcpWhitelistParams {
	o.Macaddress = macaddress
	return o
}
1324297
func (s *MountTargetDescription) SetIpAddress(v string) *MountTargetDescription {
	s.IpAddress = &v
	return s
}