9 func ParseCIDRListReader(r io.Reader) (ret []Range, err error) {
10 s := bufio.NewScanner(r)
12 err = func() (err error) {
13 _, in, err := net.ParseCIDR(s.Text())
17 ret = append(ret, Range{
30 // Returns the last, inclusive IP in a net.IPNet.
31 func IPNetLast(in *net.IPNet) (last net.IP) {
33 if n != len(in.Mask) {
36 last = make(net.IP, n)
37 for i := 0; i < n; i++ {
38 last[i] = in.IP[i] | ^in.Mask[i]