// IPv6Address will generate a random version 6 ip address
553808
func IPv6Address() string {
	num := 65536
	return fmt.Sprintf("2001:cafe:%x:%x:%x:%x:%x:%x", rand.Intn(num), rand.Intn(num), rand.Intn(num), rand.Intn(num), rand.Intn(num), rand.Intn(num))
}
1017244
func (cn *connection) ipv6() bool {
	ip := cn.remoteAddr.IP
	if ip.To4() != nil {
		return false
	}
	return len(ip) == net.IPv6len
}
448102
func (b IPv4) SourceAddress() tcpip.Address {
	return tcpip.Address(b[srcAddr : srcAddr+IPv4AddressSize])
}
645251
func (s *Instance) SetIpAddress(v string) *Instance {
	s.IpAddress = &v
	return s
}
379141
func (s *Server) CIDRIPAddress() string {
	ip, maskLen := s.IPAddress(), s.NetworkMaskLen()
	if ip != "" && maskLen > 0 {
		return fmt.Sprintf("%s/%d", ip, maskLen)
	}
	return ""
}
158433
func IPv6() string {
	size := 16
	ip := make([]byte, size)
	for i := 0; i < size; i++ {
		ip[i] = byte(r.Intn(256))
	}
	return net.IP(ip).To16().String()
}
333500
func (n *NFS) IPAddress() string {
	if len(n.Remark.Servers) < 1 {
		return ""
	}

	v, ok := n.Remark.Servers[0].(map[string]interface{})
	if !ok {
		return ""
	}

	if ip, ok := v["IPAddress"]; ok {
		return ip.(string)
	}
	return ""
}
900203
func (n *NIC) AddAddress(protocol tcpip.NetworkProtocolNumber, addr tcpip.Address) *tcpip.Error {
	return n.AddAddressWithOptions(protocol, addr, CanBePrimaryEndpoint)
}
551814
func (s *InstanceAccessDetails) SetIpAddress(v string) *InstanceAccessDetails {
	s.IpAddress = &v
	return s
}
964780
func (s *CreateMountTargetInput) SetIpAddress(v string) *CreateMountTargetInput {
	s.IpAddress = &v
	return s
}
665986
func (s *StaticIp) SetIpAddress(v string) *StaticIp {
	s.IpAddress = &v
	return s
}
1115377
func (s *NetworkInterface) SetIpv4Address(v string) *NetworkInterface {
	s.Ipv4Address = &v
	return s
}
4644
func (a *IPv6Addr) GetIPv6NetID() int64 {
	if a.IPv6Net != nil {
		return a.IPv6Net.ID
	}
	return 0
}
1348499
func (s *HealthCheckConfig) SetIPAddress(v string) *HealthCheckConfig {
	s.IPAddress = &v
	return s
}
918788
func (h *Host) IPv6Net() *net.IPNet {
	return &net.IPNet{IP: h.IPv6Addr, Mask: h.IPv6Mask}
}
1270559
func (s *DisassociateResolverEndpointIpAddressInput) SetIpAddress(v *IpAddressUpdate) *DisassociateResolverEndpointIpAddressInput {
	s.IpAddress = v
	return s
}
180340
func (s *Connector) SetIpAddress(v string) *Connector {
	s.IpAddress = &v
	return s
}