code: func (h *Handle) AddrList(link Link, family int) ([]Addr, error) {
  	req := h.newNetlinkRequest(unix.RTM_GETADDR, unix.NLM_F_DUMP)
  	msg := nl.NewIfInfomsg(family)
  	req.AddData(msg)
  
  	msgs, err := req.Execute(unix.NETLINK_ROUTE, unix.RTM_NEWADDR)
  	if err != nil {
  		return nil, err
  	}
  
  	indexFilter := 0
  	if link != nil {
  		base := link.Attrs()
  		h.ensureIndex(base)
  		indexFilter = base.Index
  	}
  
  	var res []Addr
  	for _, m := range msgs {
  		addr, msgFamily, ifindex, err := parseAddr(m)
  		if err != nil {
  			return res, err
  		}
  
  		if link != nil && ifindex != indexFilter {
  			// Ignore messages from other interfaces
  			continue
  		}
  
  		if family != FAMILY_ALL && msgFamily != family {
  			continue
  		}
  
  		res = append(res, addr)
  	}
  
  	return res, nil
  }
docs: // AddrList gets a list of IP addresses in the system.
  // Equivalent to: `ip addr show`.
  // The list can be filtered by link and ip family.