From 87d772a7d708fec12f48cd8adc0dedff6e1025da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 26 Aug 2024 10:15:20 +0200 Subject: Adding upstream version 1.47.0. Signed-off-by: Daniel Baumann --- src/go/collectors/go.d.plugin/pkg/iprange/pool.go | 40 ----------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/go/collectors/go.d.plugin/pkg/iprange/pool.go (limited to 'src/go/collectors/go.d.plugin/pkg/iprange/pool.go') diff --git a/src/go/collectors/go.d.plugin/pkg/iprange/pool.go b/src/go/collectors/go.d.plugin/pkg/iprange/pool.go deleted file mode 100644 index 48ba5689b..000000000 --- a/src/go/collectors/go.d.plugin/pkg/iprange/pool.go +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package iprange - -import ( - "math/big" - "net" - "strings" -) - -// Pool is a collection of IP Ranges. -type Pool []Range - -// String returns the string form of the pool. -func (p Pool) String() string { - var b strings.Builder - for _, r := range p { - b.WriteString(r.String() + " ") - } - return strings.TrimSpace(b.String()) -} - -// Size reports the number of IP addresses in the pool. -func (p Pool) Size() *big.Int { - size := big.NewInt(0) - for _, r := range p { - size.Add(size, r.Size()) - } - return size -} - -// Contains reports whether the pool includes IP. -func (p Pool) Contains(ip net.IP) bool { - for _, r := range p { - if r.Contains(ip) { - return true - } - } - return false -} -- cgit v1.2.3