// Host returns a copy of ipv6 with its mask set to /128 so that it can be
// used by DialPacketArgs(), DialStreamArgs(), ListenPacketArgs(), or
// ListenStreamArgs().
511998
func (ipv6 IPv6Addr) Host() IPAddr {
	// Nothing should listen on a broadcast address.
	return IPv6Addr{
		Address: ipv6.Address,
		Mask:    ipv6HostMask,
		Port:    ipv6.Port,
	}
}
292022
func (options) HostPort(hostPort string) Option {
	return func(o *options) {
		o.hostPort = hostPort
	}
}
768330
func (c *Client) Connect(host string, port uint) (err error) {
	return c.dial(`tcp`, fmt.Sprintf(`%s:%d`, host, port))
}
208703
func (c *Client) Hosts() ([]*Host, error) {
	insts, err := c.s.Instances()
	if err != nil {
		return nil, err
	}
	hosts := make([]*Host, len(insts))
	for i, inst := range insts {
		hosts[i] = NewHost(
			inst.Meta["id"],
			inst.Addr,
			c.h,
			HostTagsFromMeta(inst.Meta),
		)
	}
	return hosts, nil
}
43850
func (b BaseURL) HostURL() string {
	return strings.TrimSuffix(b.String(), b.Path())
}
619771
func (c *xContext) Host() string {
	host := c.Request().Host()
	if len(host) > 0 {
		delim := `:`
		if host[0] == '[' {
			host = strings.TrimPrefix(host, `[`)
			delim = `]:`
		}
		hostParts := strings.SplitN(host, delim, 2)
		if len(hostParts) > 0 {
			return hostParts[0]
		}
		return host
	}
	return `localhost`
}
3917
func WithIPv6Mask(mask net.IPMask) Option {
	return func(o *Options) {
		o.IPv6Mask = mask
	}
}
410095
func (c *Config) Host() string {
	switch c.Type {
	case "ssh":
		return c.SSHHost
	case "winrm":
		return c.WinRMHost
	default:
		return ""
	}
}
286114
func (a *Addr) HostPort(defaultPort int) string {
	port := a.Port
	if port == 0 {
		port = defaultPort
	}
	return net.JoinHostPort(a.Host, strconv.Itoa(port))
}
742739
func (a Address) VHost() string {
	if idx := strings.Index(a.Original, "://"); idx > -1 {
		return a.Original[idx+3:]
	}
	return a.Original
}
1278178
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
	cfg.Host = host
	return cfg
}
602723
func (api *API) Hosts(ctx context.Context) []*Node {
	span, _ := tracing.StartSpanFromContext(ctx, "API.Hosts")
	defer span.Finish()
	return api.cluster.Nodes()
}
738829
func (c *Client) AddHost(host host.Host) ([]byte, error) {
	response := []byte{}
	if err := c.call("AddHost", host, &response); err != nil {
		return []byte{}, err
	}
	return response, nil
}
120971
func (p *PerHost) AddHost(host string) {
	if strings.HasSuffix(host, ".") {
		host = host[:len(host)-1]
	}
	p.bypassHosts = append(p.bypassHosts, host)
}
423285
func (p *ProxyNet) LookupHost(host string) ([]string, error) {
	return LookupHost(host, p.SOCKS)
}
370707
func (s *Server) AddHost(host host.Host, hostReply *[]byte) error {
	privateKey, err := s.f.AddHost(s.context(), &host)
	if err != nil {
		return err
	}
	*hostReply = privateKey
	return nil
}
310303
func (ipv6 IPv6Addr) NetIPNet() *net.IPNet {
	ipv6net := &net.IPNet{}
	ipv6net.IP = make(net.IP, IPv6len)
	copy(ipv6net.IP, *ipv6.NetIP())
	ipv6net.Mask = *ipv6.NetIPMask()
	return ipv6net
}