// DestinationAddress returns the "destination address" field of the ipv6
// header.
1193
func (b IPv6) DestinationAddress() tcpip.Address {
	return tcpip.Address(b[v6DstAddr : v6DstAddr+IPv6AddressSize])
}
1150516
func genAddress(ip string, port int) string {
	return strings.Join([]string{ip, strconv.Itoa(port)}, ":")
}
795830
func encodeAddress(hash160 []byte, netID byte) string {
	// Format is 1 byte for a network and address class (i.e. P2PKH vs
	// P2SH), 20 bytes for a RIPEMD160 hash, and 4 bytes of checksum.
	return base58.CheckEncode(hash160[:ripemd160.Size], netID)
}
306521
func PackTCPAddress(ip string, port uint16) ([]byte, error) {
	var result bytes.Buffer

	// Pack the port to 2 bytes
	portBuf := make([]byte, 2)
	endian.PutUint16(portBuf, port)
	result.Write(portBuf)

	// Pack the ip address to 4 bytes
	ipaddr := net.ParseIP(ip)
	if ipaddr == nil {
		return nil, ErrInvalidTCPAddress
	}
	ipbytes := ipaddr.To4()
	result.Write(ipbytes)

	return result.Bytes(), nil
}
533579
func Address(addr string) Option {
	return func(o *Options) {
		o.Server.Init(server.Address(addr))
	}
}
1145468
func (facade *Facade) PublicAddress(target string) (string, error) {
	addr, err := facade.addressCall("PublicAddress", target)
	return addr, errors.Trace(err)
}
388751
func (u Unit) Destination(root string) string {
	return path.Join(u.prefix(root), u.Name)
}
1172855
func (k *Kubernetes) ExternalAddress(state request.Request) []dns.RR {
	// This is probably wrong, because of all the fallback behavior of k.nsAddr, i.e. can get
	// an address that isn't reacheable from outside the cluster.
	rrs := []dns.RR{k.nsAddr()}
	return rrs
}
1100503
func (s *Instance) SetIpv6Address(v string) *Instance {
	s.Ipv6Address = &v
	return s
}
243372
func (e Endpoint) SocketAddress() string {
	return fmt.Sprintf("%s:%d", e.Host, e.Port)
}
1344823
func HostAddress(hostname string) (network.Address, error) {
	if ip := net.ParseIP(hostname); ip != nil {
		addr := network.Address{
			Value: ip.String(),
			Type:  network.DeriveAddressType(ip.String()),
			Scope: network.ScopePublic,
		}
		return addr, nil
	}
	// Only a resolvable hostname may be used as a public address.
	if _, err := netLookupHost(hostname); err != nil {
		return network.Address{}, err
	}
	addr := network.Address{
		Value: hostname,
		Type:  network.HostName,
		Scope: network.ScopePublic,
	}
	return addr, nil
}
182189
func (ipv6 IPv6Addr) AddressBinString() string {
	bi := big.Int(*ipv6.Address)
	return fmt.Sprintf("%0128s", bi.Text(2))
}
604773
func WithAddress(a string) source.Option {
	return func(o *source.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, addressKey{}, a)
	}
}
1140287
func BytesToAddress(b []byte) Address {
	var a Address
	a.SetBytes(b)
	return a
}
1093796
func (b IPv4) DestinationAddress() tcpip.Address {
	return tcpip.Address(b[dstAddr : dstAddr+IPv4AddressSize])
}
314953
func (s *ReindexService) DestinationIndex(index string) *ReindexService {
	if s.destination == nil {
		s.destination = NewReindexDestination()
	}
	s.destination = s.destination.Index(index)
	return s
}
900203
func (n *NIC) AddAddress(protocol tcpip.NetworkProtocolNumber, addr tcpip.Address) *tcpip.Error {
	return n.AddAddressWithOptions(protocol, addr, CanBePrimaryEndpoint)
}