func Addrs(af int, name string) ([]Addr, error) {
	eps, err := newEndpoints(af)
	if len(eps) == 0 {
		return nil, err
	}
	defer func() {
		for _, ep := range eps {
			ep.close()
		}
	}()
	lls, err := links(eps, name)
	if len(lls) == 0 {
		return nil, err
	}
	var as []Addr
	for _, ll := range lls {
		var lifr lifreq
		for i := 0; i < len(ll.Name); i++ {
			lifr.Name[i] = int8(ll.Name[i])
		}
		for _, ep := range eps {
			ioc := int64(sysSIOCGLIFADDR)
			err := ioctl(ep.s, uintptr(ioc), unsafe.Pointer(&lifr))
			if err != nil {
				continue
			}
			sa := (*sockaddrStorage)(unsafe.Pointer(&lifr.Lifru[0]))
			l := int(littleEndian.Uint32(lifr.Lifru1[:4]))
			if l == 0 {
				continue
			}
			switch sa.Family {
			case sysAF_INET:
				a := &Inet4Addr{PrefixLen: l}
				copy(a.IP[:], lifr.Lifru[4:8])
				as = append(as, a)
			case sysAF_INET6:
				a := &Inet6Addr{PrefixLen: l, ZoneID: int(littleEndian.Uint32(lifr.Lifru[24:28]))}
				copy(a.IP[:], lifr.Lifru[8:24])
				as = append(as, a)
			}
		}
	}
	return as, nil
}
Addrs returns a list of interface addresses.

The provided af must be an address family and name must be a data
link name. The zero value of af or name means a wildcard.
package lif
import (
	"errors"
	"unsafe"
)
type Addr interface {
	Family() int
}
type Inet4Addr struct {
	IP        [4]byte  
	PrefixLen int      
}
func (a *Inet4Addr) Family() int { return sysAF_INET }
type Inet6Addr struct {
	IP        [16]byte  
	PrefixLen int       
	ZoneID    int       
}
func (a *Inet6Addr) Family() int { return sysAF_INET6 }