// LinodeIPList maps to the 'linode.ip.list' call.
//
// https://www.linode.com/api/linode/linode.ip.list
322227
func (c *Client) LinodeIPList(linodeID *int, ipID *int) ([]LinodeIP, error) {
	args := make(map[string]interface{})
	args["LinodeID"] = linodeID
	args["IPAddressID"] = ipID

	data, err := c.apiCall("linode.ip.list", args)
	if err != nil {
		return nil, err
	}

	var out []LinodeIP
	err = unmarshalMultiMap(data, &out)
	if err != nil {
		return nil, err
	}

	return out, nil
}
899122
func (pp *PP) ppList() []map[string]interface{} {
	pps := make([]map[string]interface{}, 0, len(pp.PostProcessors))
	for _, rawPP := range pp.PostProcessors {
		switch pp := rawPP.(type) {
		case string:
		case map[string]interface{}:
			pps = append(pps, pp)
		case []interface{}:
			for _, innerRawPP := range pp {
				if innerPP, ok := innerRawPP.(map[string]interface{}); ok {
					pps = append(pps, innerPP)
				}
			}
		}
	}
	return pps
}
922264
func (devices *DeviceSet) List() []string {
	devices.Lock()
	defer devices.Unlock()

	ids := make([]string, len(devices.Devices))
	i := 0
	for k := range devices.Devices {
		ids[i] = k
		i++
	}
	return ids
}
89779
func (mg *MailgunImpl) ListIPS(ctx context.Context, dedicated bool) ([]IPAddress, error) {
	r := newHTTPRequest(generatePublicApiUrl(mg, ipsEndpoint))
	r.setClient(mg.Client())
	if dedicated {
		r.addParameter("dedicated", "true")
	}
	r.setBasicAuth(basicAuthUser, mg.APIKey())

	var resp ipAddressListResponse
	if err := getResponseFromJSON(ctx, r, &resp); err != nil {
		return nil, err
	}
	var result []IPAddress
	for _, ip := range resp.Items {
		result = append(result, IPAddress{IP: ip})
	}
	return result, nil
}
1237926
func (c *Client) LinodeIPAddPrivate(linodeID int) (ipID int, ipAddr string, err error) {
	args := make(map[string]interface{})
	args["LinodeID"] = linodeID

	data, err := c.apiCall("linode.ip.addprivate", args)
	if err != nil {
		return 0, "", err
	}

	out := struct {
		IPAddrID int    `json:"IPAddressID"`
		IPAddr   string `json:"IPAddress"`
	}{}

	err = json.Unmarshal(data, &out)
	if err != nil {
		return 0, "", err
	}

	return out.IPAddrID, out.IPAddr, nil
}
1124195
func (r *AppPackageService) PublicList() *AppPackagePublicListCall {
	c := &AppPackagePublicListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}
291776
func (p *parserMixin) ResolvedIPList() (target *[]net.IP) {
	target = new([]net.IP)
	p.ResolvedIPListVar(target)
	return
}
741913
func (s IPPermissionSet) List() []*ec2.IpPermission {
	res := make([]*ec2.IpPermission, 0, len(s))
	for _, v := range s {
		res = append(res, v)
	}
	return res
}
1113261
func (p *parserMixin) IPList() (target *[]net.IP) {
	target = new([]net.IP)
	p.IPListVar(target)
	return
}
1294361
func (d *Domain) ListAllInterfaceAddresses(src DomainInterfaceAddressesSource) ([]DomainInterface, error) {
	if C.LIBVIR_VERSION_NUMBER < 1002014 {
		return []DomainInterface{}, makeNotImplementedError("virDomainInterfaceAddresses")
	}

	var cList *C.virDomainInterfacePtr
	var err C.virError
	numIfaces := int(C.virDomainInterfaceAddressesWrapper(d.ptr, (**C.virDomainInterfacePtr)(&cList), C.uint(src), 0, &err))
	if numIfaces == -1 {
		return nil, makeError(&err)
	}

	ifaces := make([]DomainInterface, numIfaces)

	for i := 0; i < numIfaces; i++ {
		var ciface *C.virDomainInterface
		ciface = *(**C.virDomainInterface)(unsafe.Pointer(uintptr(unsafe.Pointer(cList)) + (unsafe.Sizeof(ciface) * uintptr(i))))

		ifaces[i].Name = C.GoString(ciface.name)
		ifaces[i].Hwaddr = C.GoString(ciface.hwaddr)

		numAddr := int(ciface.naddrs)

		ifaces[i].Addrs = make([]DomainIPAddress, numAddr)

		for k := 0; k < numAddr; k++ {
			var caddr *C.virDomainIPAddress
			caddr = (*C.virDomainIPAddress)(unsafe.Pointer(uintptr(unsafe.Pointer(ciface.addrs)) + (unsafe.Sizeof(*caddr) * uintptr(k))))
			ifaces[i].Addrs[k] = DomainIPAddress{}
			ifaces[i].Addrs[k].Type = int(caddr._type)
			ifaces[i].Addrs[k].Addr = C.GoString(caddr.addr)
			ifaces[i].Addrs[k].Prefix = uint(caddr.prefix)

		}
		C.virDomainInterfaceFreeWrapper(ciface)
	}
	C.free(unsafe.Pointer(cList))
	return ifaces, nil
}
384606
func GetLocalAddrList() ([]string, error) {
	var addrList []string
	// get the link list
	intfList, err := net.Interfaces()
	if err != nil {
		return addrList, err
	}

	log.Debugf("Got address list(%d): %+v", len(intfList), intfList)

	// Loop thru each interface and add its ip addr to list
	for _, intf := range intfList {
		if strings.HasPrefix(intf.Name, "docker") || strings.HasPrefix(intf.Name, "veth") ||
			strings.HasPrefix(intf.Name, "vport") || strings.HasPrefix(intf.Name, "lo") {
			continue
		}

		addrs, err := intf.Addrs()
		if err != nil {
			return addrList, err
		}

		for _, addr := range addrs {
			addrList = append(addrList, addr.String())
		}
	}

	return addrList, err
}
111936
func (service *BaseService) IDList(topic string) []string {
	return service.getTopic(topic).idlist()
}
925246
func ListIPMembers(client *TwilioIPMessagingClient, serviceSid, channelSid string) (*IPMemberList, error) {
	var memberList *IPMemberList

	body, err := client.get(nil, "/Services/"+serviceSid+"/Channels/"+channelSid+"/Members.json")

	if err != nil {
		return memberList, err
	}

	memberList = new(IPMemberList)
	memberList.Client = client
	err = json.Unmarshal(body, memberList)

	return memberList, err
}
1055801
func InterfaceIPs(device string) (ips []net.IP, _ error) {
	var networks []net.Addr

	if iface, err := net.InterfaceByName(device); err != nil {
		return nil, err
	} else if networks, err = iface.Addrs(); err != nil {
		return nil, err
	}

	for _, network := range networks {
		if ipNet, castable := network.(*net.IPNet); castable {
			ips = append(ips, ipNet.IP)
		}
	}

	// Note that on non-IP interfaces it will be an empty slice
	// and no error indicator. Maybe that's not super-perfect.
	return ips, nil
}
1026217
func (self *Version) List(zoneId int64) ([]*VersionInfo, error) {
	var res []interface{}
	params := []interface{}{self.Key, zoneId}
	if err := self.Call("domain.zone.version.list", params, &res); err != nil {
		return nil, err
	}

	versions := make([]*VersionInfo, 0)
	for _, r := range res {
		version := ToVersionInfo(r.(map[string]interface{}))
		versions = append(versions, version)
	}
	return versions, nil
}
560528
func (ipl *IPList) lookup(ip net.IP) (Range, bool) {
	return lookup(func(i int) net.IP {
		return ipl.ranges[i].First
	}, func(i int) Range {
		return ipl.ranges[i]
	}, len(ipl.ranges), ip)
}
299316
func (c *Client) RouteList(appID string) ([]*router.Route, error) {
	var routes []*router.Route
	return routes, c.Get(fmt.Sprintf("/apps/%s/routes", appID), &routes)
}