// SelfIPs returns a list of self IP's.
975269
func (b *BigIP) SelfIPs() (*SelfIPs, error) {
	var self SelfIPs
	err, _ := b.getForEntity(&self, uriNet, uriSelf)
	if err != nil {
		return nil, err
	}

	return &self, nil
}
660241
func (o *Subnet) IPReservations(info *bambou.FetchingInfo) (IPReservationsList, *bambou.Error) {

	var list IPReservationsList
	err := bambou.CurrentSession().FetchChildren(o, IPReservationIdentity, &list, info)
	return list, err
}
618107
func (s *DirectoryDescription) SetDnsIpAddrs(v []*string) *DirectoryDescription {
	s.DnsIpAddrs = v
	return s
}
171062
func (s ipEntries) getIPs(now time.Time) []net.IP {
	ips := make([]net.IP, 0, len(s)) // worst case size
	for ip, entry := range s {
		if entry != nil && !entry.isExpiredBy(now) {
			ips = append(ips, net.ParseIP(ip))
		}
	}

	return ip.KeepUniqueIPs(ips) // sorts IPs
}
998552
func (r *PURuntime) SetIPAddresses(ipa ExtendedMap) {
	r.Lock()
	defer r.Unlock()

	r.ips = ipa.Copy()
}
343920
func getLocalIPs() (ips []string) {
	ips = make([]string, 0, 6)

	addrs, err := net.InterfaceAddrs()
	if err != nil {
		return
	}

	for _, addr := range addrs {
		ip, _, err := net.ParseCIDR(addr.String())
		if err != nil {
			continue
		}
		ips = append(ips, ip.String())
	}
	return
}
731898
func ListAvailableIPs(nwCfg *mastercfg.CfgNetworkState) string {
	return netutils.ListAvailableIPs(nwCfg.IPAllocMap, nwCfg.SubnetIP, nwCfg.SubnetLen)
}
848447
func GetIPv4Addresses() (ips []string, err error) {
	ips = []string{}

	addrs, err := net.InterfaceAddrs()
	if err != nil {
		return nil, fmt.Errorf("unable to use InterfaceAddrs to find local ipv4 addresses: %v", err)
	}

	for _, a := range addrs {
		if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() && nil != ipnet.IP.To4() {
			ips = append(ips, ipnet.IP.String())
		}
	}

	if len(ips) == 0 {
		return ips, fmt.Errorf("unable to identify local ip address")
	}

	return ips, nil
}
791065
func (s *UpdateConditionalForwarderInput) SetDnsIpAddrs(v []*string) *UpdateConditionalForwarderInput {
	s.DnsIpAddrs = v
	return s
}
701610
func (h *Hostlist) GetUniqueIPs() []net.IP {
	h.Sort()
	// A map doesn't preserve order so we're going to use the map to check
	// whether we've seen something and use the list to keep track of the
	// order.
	seen := make(map[string]bool)
	inOrder := []net.IP{}

	for _, hostname := range *h {
		key := (*hostname).IP.String()
		if !seen[key] {
			seen[key] = true
			inOrder = append(inOrder, (*hostname).IP)
		}
	}
	return inOrder
}
553956
func (api *API) ListServerIps(server_id string) ([]ServerIp, error) {
	result := []ServerIp{}
	url := createUrl(api, serverPathSegment, server_id, "ips")
	err := api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}
	for index, _ := range result {
		result[index].api = api
	}
	return result, nil
}
687255
func (b *Builder) expandIPs(name string, s *string) []*net.IPAddr {
	if s == nil || *s == "" {
		return nil
	}

	addrs := b.expandAddrs(name, s)
	var x []*net.IPAddr
	for _, addr := range addrs {
		switch a := addr.(type) {
		case *net.IPAddr:
			x = append(x, a)
		case *net.UnixAddr:
			b.err = multierror.Append(b.err, fmt.Errorf("%s cannot be a unix socket", name))
			return nil
		default:
			b.err = multierror.Append(b.err, fmt.Errorf("%s has invalid address type %T", name, a))
			return nil
		}
	}
	return x
}
759847
func (api *API) ListFirewallPolicyServerIps(fp_id string) ([]ServerIpInfo, error) {
	result := []ServerIpInfo{}
	url := createUrl(api, firewallPolicyPathSegment, fp_id, "server_ips")
	err := api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}
	return result, nil
}
1019208
func GetLocalEndpointIPs(endpointsMap EndpointsMap) map[types.NamespacedName]sets.String {
	localIPs := make(map[types.NamespacedName]sets.String)
	for svcPortName, epList := range endpointsMap {
		for _, ep := range epList {
			if ep.GetIsLocal() {
				nsn := svcPortName.NamespacedName
				if localIPs[nsn] == nil {
					localIPs[nsn] = sets.NewString()
				}
				localIPs[nsn].Insert(ep.IP())
			}
		}
	}
	return localIPs
}
405207
func ListAllocatedIPs(allocMap bitset.BitSet, ipPool string, subnetIP string, subnetLen uint) string {
	idx := uint(0)
	startIdx := idx
	list := []string{}
	inRange := false

	ClearReservedEntries(&allocMap, subnetLen)
	ClearBitsOutsideRange(&allocMap, ipPool, subnetLen)
	for {
		foundValue, found := allocMap.NextSet(idx)
		if !found {
			break
		}

		if !inRange { // begin of range
			startIdx = foundValue
			inRange = true
		} else if foundValue > idx { // end of range
			thisRange := getIPRange(subnetIP, subnetLen, startIdx, idx-1)
			list = append(list, thisRange)
			startIdx = foundValue
		}
		idx = foundValue + 1
	}

	// list end with allocated value
	if inRange {
		thisRange := getIPRange(subnetIP, subnetLen, startIdx, idx-1)
		list = append(list, thisRange)
	}

	return strings.Join(list, ", ")
}
314361
func getLocalIPS() []net.IP {
	addrs, err := net.InterfaceAddrs()
	if err != nil {
		return nil
	}
	var ips []net.IP
	for _, address := range addrs {
		// check the address type and if it is not a loopback the display it
		if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() && ipnet.IP.String() != "127.0.1.1" {
			if ipnet.IP.To4() != nil {
				ips = append(ips, ipnet.IP)
			}
		}
	}
	return ips
}
1313764
func (r *PURuntime) IPAddresses() ExtendedMap {
	r.Lock()
	defer r.Unlock()

	return r.ips.Copy()
}